Difference between revisions of "User:Seb76"

From UFOpaedia
Jump to navigation Jump to search
m (fixed spelling)
Line 11: Line 11:
  
 
:Of course, that's probably the hardest part :) It helps that both SOUND.COM and MCD.COM are less than 4K each, but my experience with assembler is very slim and many years out of date. You suggested using [http://en.wikipedia.org/wiki/Interactive_Disassembler IDA] in the Grenade discussion, so I'll be giving that a look. Any other suggestions or advice to get me started? [[User:Phasma Felis|Phasma Felis]] 20:46, 6 June 2008 (PDT)
 
:Of course, that's probably the hardest part :) It helps that both SOUND.COM and MCD.COM are less than 4K each, but my experience with assembler is very slim and many years out of date. You suggested using [http://en.wikipedia.org/wiki/Interactive_Disassembler IDA] in the Grenade discussion, so I'll be giving that a look. Any other suggestions or advice to get me started? [[User:Phasma Felis|Phasma Felis]] 20:46, 6 June 2008 (PDT)
 +
 +
::The way it works in the CE version is still influenced by this. Only the mouse, video and sound code was wrapped with windows calls; the rest was left as-is. All the sound related operations are centralized in one procedure taking 3 arguments. The first that I dubbed 'opcode', and 2 other that are not used (but may be of use in the DOS version). I suspect that in DOS version these arguments are passed to the TSR by some way to trigger sound actions. Here are the details I know from the CE edition:
 +
 +
::* if the opcode is >0x7f (i.e. the most significant bit is set), then it is a music change request (translated into a 'play midi' sequence in the CE edition), else it is a digitized sound that will be played
 +
 +
::* the music sample number is extracted by removing the high bit (opcode-0x80)
 +
 +
::* cases 1,5 and 14-17 stop the music but don't start a new sequence
 +
 +
::* for other cases, it starts playing a midi file (and stops the current playing if any):
 +
::{|
 +
! Sample idx || Sound file
 +
|-
 +
|    0 || sound/gmgeo1.mid
 +
|-
 +
|    2 || sound/gminter.mid
 +
|-
 +
|  3,4 || sound/gmdefend.mid
 +
|-
 +
|  6,7 || sound/gmenbase.mid
 +
|-
 +
|    8 || sound/gmmars.mid
 +
|-
 +
| 9,12 || sound/gmstory.mid
 +
|-
 +
|  10 || sound/gmlose.mid
 +
|-
 +
|  11 || sound/gmwin.mid
 +
|-
 +
|  13 || sound/gmtactic.mid
 +
|-
 +
|  18 || sound/gmgeo2.mid
 +
|}
 +
::You need to get this sample idx and remap it to the PSX track you want to play. I don't know if you can map all PSX tracks.
 +
::PS: What is the 'official' way of moving this to the talk page... Cut/Paste? [[User:Seb76|Seb76]] 04:11, 7 June 2008 (PDT)

Revision as of 11:11, 7 June 2008

Hi guys, I've been posting here for quite some time now so I guess it's time to make this page. For now it's just a stub, I'll try to update it when time is available.

I was a teenager when the game came out. I had no computer back then but I remember playing it on the computer of a friend's father, it was simply awesome. Years passed, and 3D completely changed the face of videogames. The main focus was turned to polygon counts and frames per second. Duke Nukem, Quake, Unreal, -you name any FPS-; I totally forgot about the "old-era" games. Later my interest in emulation brought me to the dosbox project; a real wayback machine... After all this 3D orgy, I decided to give it a shot and restarted the old X-COM just for fun. But then all memories came back at once; the music, the huge pixels, the tension of the first terror mission... The feeling was still the same after all the years. Still unmatched. IMHO the "best game ever" award it got is really deserved. I since tried the "UFO after-xxx" spinoffs, but I think their pseudo-realtime aspect removes what make X-COM unique to me, this feeling you get when you press the end of turn button. Everything can happen then...

Nowaday, most of my occupation with XCom is analysis of its code, and trying to explain the odd behaviors and see how the game can be exploited (with the help of a few patches). I'll try to gather here the most interesting pieces that I can find (most of my findings are scattered across the talk pages for the moment). Feel free to use the talk page if you have questions/suggestions. Seb76 13:25, 4 June 2008 (PDT)

Thanks for the userpage, Seb! :) I have a (probably very silly) project I could use some advice with.
I want to give the DOS version of X-COM the ability to play the excellent CD music from the PlayStation version. X-COM DOS plays its music through a TSR called MUSIC.COM in the SOUND subdirectory, which is loaded into memory when X-COM is started and then receives commands from it somehow. I've found a TSR CD player, Mercury Soft CD Player, that works in DOSBox and runs fine with X-COM, and if copied over SOUND.COM, X-COM will automatically start it and it responds to its hotkeys properly. I figure all that's left to do is disassemble SOUND.COM, figure out how it receives its signals, then disassemble MCD and modify it to respond to those same signals.
Of course, that's probably the hardest part :) It helps that both SOUND.COM and MCD.COM are less than 4K each, but my experience with assembler is very slim and many years out of date. You suggested using IDA in the Grenade discussion, so I'll be giving that a look. Any other suggestions or advice to get me started? Phasma Felis 20:46, 6 June 2008 (PDT)
The way it works in the CE version is still influenced by this. Only the mouse, video and sound code was wrapped with windows calls; the rest was left as-is. All the sound related operations are centralized in one procedure taking 3 arguments. The first that I dubbed 'opcode', and 2 other that are not used (but may be of use in the DOS version). I suspect that in DOS version these arguments are passed to the TSR by some way to trigger sound actions. Here are the details I know from the CE edition:
  • if the opcode is >0x7f (i.e. the most significant bit is set), then it is a music change request (translated into a 'play midi' sequence in the CE edition), else it is a digitized sound that will be played
  • the music sample number is extracted by removing the high bit (opcode-0x80)
  • cases 1,5 and 14-17 stop the music but don't start a new sequence
  • for other cases, it starts playing a midi file (and stops the current playing if any):
Sample idx Sound file
0 sound/gmgeo1.mid
2 sound/gminter.mid
3,4 sound/gmdefend.mid
6,7 sound/gmenbase.mid
8 sound/gmmars.mid
9,12 sound/gmstory.mid
10 sound/gmlose.mid
11 sound/gmwin.mid
13 sound/gmtactic.mid
18 sound/gmgeo2.mid
You need to get this sample idx and remap it to the PSX track you want to play. I don't know if you can map all PSX tracks.
PS: What is the 'official' way of moving this to the talk page... Cut/Paste? Seb76 04:11, 7 June 2008 (PDT)