User:Araxestroy/DOS version decompilation notes
From sc2k-reverse
Jump to navigationJump to search
We're not doing a full patch or anything on the DOS version but I've got an IDA database going for it to compare a few things against. If anyone asks me for a DOS patch I will put them in The Little Box Of Screams along with the Amiga fanboys.
Possible thiscall format
A lot seems to use __usercall with int a1@<edx> at the start. I'm wondering if this is a __thiscall variant specific to some DOS compiler, where that should actually be int this@<edx> more or less across the board. Watcom perhaps? I don't have enough experience with DOS C++ compilers to know whether or not that's accurate.
Some functions
- cseg01:00038BA7: char __usercall SimulationProposeMilitaryBase@<al>(int a1@<edx>, __int16 a2@<di>)
- Cities with coastlines seem to have a 50/50 chance of getting a naval base versus getting something else! This is good to know for reimplementation in the Win95 version.
- cseg01:00049F2A: char __usercall MessageBoxYesNo@<al>(int a1@<edx>, int a2)
- Message format is an array of 32-bit near pointers to strings followed by a null pointer for termination.
Some variables
Booleans all seem to be the C++ bool type, so sizeof(bool) == 1.
- dseg03:000C82E5: char bMilitaryBaseType
- Same format as Win95 version
- dseg03:000C82E6: bool bCityHasOcean
Map data
- dseg03:000D64C4 dwMapXUND
- dseg03:000D66C4 dwMapXZON
- dseg03:000D68C4 dwMapXTER
- dseg03:000D6AC4 dwMapALTM
- dseg03:000D6CC4 dwMapXBLD
- dseg03:000D7154 dwMapXBIT