Mortal Kombat 1 (DOS)
Info for anyone to examine/expand/fix/copy the cheats i've done
by AQRIT

 0x80C90 // "DOUBLE ICE BACKFIRE" file offset in mk.exe


Data Offsets
--------------
relative offsets from the text "DOUBLE ICE BACKFIRE" (in decimal)
 
 (-1618190) // ??? 0 ???, 1 when fighting, 2 can't move, 3/4 victory, 5 defeat

 57148 // reptile hint counter 0-20 starts at 17 (20 = hint)
 57260 // Graphics Settings (0)Low (1)Medium (2)High
 57336 // (WORD?) DIP switches 0-8 bit array
 57490 // cmos/config file checksum
 57815 // (WORD?) temp dip switches used for "save & exit" or "cancel"
 57997 // number of tries for "enter word from page..." copy-protection

 126220 // pointer related to reptile's color?
 126488 // remembers winnner during fatality
 126492 // p1 or p2???? 
 126504 // timer: ones
 126508 // timer: tens
 126615 // p1 last key pressed 1=u 2=d 3=l 4=r 5=hp 6=lp 7=block 8=hk 9=lk 10=start
 126616 // p1 (0)AI controled (1)human controled (2)continue screen (3)pressed start
 126632 // p1 fighter
 126648 // p1 health
 126652 // p1 damage not yet decremented from health
 126715 // p2 last key pressed 1=u 2=d 3=l 4=r 5=hp 6=lp 7=block 8=hk 9=lk 10=start
 126716 // p2 (0)AI controled (1)human controled (2)continue screen (3)pressed start
 126732 // p2 fighter
 126748 // p2 health
 126752 // p2 damage not yet decremented from health
 126816 // p1 flawless victorys
 126817 // p1 rounds won? == used for minor difficulty adjustment???
 126818 // p2 flawless victorys
 126819 // p2 rounds won? == used for minor difficulty adjustment???
 126860 // AI Difficulty
 126864 // Round Number 
 126868 // fighter line up selector  
 126872 // Match
 126876 // Total 'Battles' Played? 
 126880 // p1 win streak
 126884 // p2 win streak
 126888 // Wins Less Losses, Used for difficulty adjustments?

 255805 // p1 break material
 255806 // p2 break material
 255807 // two player test ur might counter, decreasing from 5 every match (0 = test your might)
 255808 // Map
 255809 // Mode (see note: Mode)
 255810 // end round modes (0)default (3)finishing period (1/2)winning player number
 255811 // second endurance character (FF == NULL)
 255812 // ??? counter 1-3, don't know what for
 255813 // round time: tens, used for drawing and time bonus score
 255814 // round time: ones, used for drawing and time bonus score
 255815 // THE PIT Silhouettes Count decreasing from 11 every match  (0 = silhouettes)
 255816 // AI Fatality Counter decreasing every match from 5 (0 = AI does fatality)
 255817 // erase background flag???
 255818 // Disable Sound Effects Flag
 255819 // Disable Finishing Move Period Flag, as per goro
 255820 // Finishing Period Over flag
 255821 // Round Over flag
 255822 // Draw HUD flag
 255823 // (0) fall over at end round, (1) Fatality Occurring, (2) Fatality move over
 255824 // movement allowed flag  // set to 9 between matches?
 255825 // has player pressed start maybe?
 255826 // Disable Fatalities Flag
 255827 // Disable Blood Flag
 255828 // Fatality occured Flag, Used when scoring?
 255829 // Scorpion-to-Reptile for AI Players flag
 255830 // Block Key Pressed; Used for Reptile Fight
 255831 // ??? reset to 0 every round saw it change to 2 once, no idea why
 255832 // draw "PRESS START" flag
 255833 // 'move in place' flag? 
 255834 // disables drawing to screen?
 255835 // Credits (lives) 

Note Mode:
(14) player x has entered the tourny (13)occurs right after fighter select...?  
(12)??? (11)game over (10)??? (9)breaking (8)??? (7)ladder screen/ or 2 player face off screen 
(6)start match (5)can't move during round (4)continued/fighter select (3)continue screen (2)fighting round (1)main menu (0)???   




*************************************************
*************************************************
Code Offsets
*************************************************
*************************************************

/* CHEAT struct contains patch info
DWORD offset:   relative offset from the text "DOUBLE ICE BACKFIRE" (in hex)
char * enable:  pointer to: bytes written to process memory to enabling a cheat
char * disable: pointer to: the bytes written to disabled a cheat
				this can be NULL, like when writting data not code
const CHEAT * next: the next struct containing patch info
                    use when multipul places must be patched to enable a cheat
                    set *next = NULL on the last CHEAT in a group
*/
struct CHEAT{
	DWORD offset;
	char * enable;
//	char * disable;
	char length;
	const CHEAT * next;
};
// note: be carefull with the const keyword...



const CHEAT FighterSetP1 = { 0x0001EEA8, new char[1], NULL, 0x01, NULL };
const CHEAT FighterSetP2 = { 0x0001EF0C, new char[1], NULL, 0x01, NULL };


// incomplete
// problem: if Fighter is poked at the wrong time it could cause problems...
//const CHEAT FighterSetP2 = { 0x0001EF0C, &szFighterP2[3], NULL, 0x01, NULL };
char szAIFighter[] = "\x33\xc0\xb0\x00\x90";
//const CHEAT FighterFreezeEnduranceP2 = { 0xFFFD0367, "\x90\x90\x90\x90\x90\x90",
//	"\x89\x15\x88\x63\x1B\x00", 0x06, NULL };
const CHEAT AIFighterFreezeSelection = { 0x00000000, &szAIFighter[3], NULL, 0x00, NULL };
const CHEAT AIFighterFreeze = { 0xFFFD185B, szAIFighter,
	 "\xE8\x45\x00\x00\x00", 0x05, NULL };
// 0170:168CD7  E845000000          call 0016:8D21 ($+45)
// 33C0				xor  eax,eax
// B0__				mov al,__
// 90               nop
//
// sm 0170:168CD7 33 c0 b0 01 90

/*
0170:1722E3  A324631B00          mov  [001B6324],eax
0170:1722E8  A388631B00          mov  [001B6388],eax
*/


// -21

// Cheat: Invinciblity for player 1
// problem: currently a GodMode enabled player, is killed if their health is
//			less than the total damage of a single hit
// quick-fix: set player's health to full
const CHEAT HealthSetFullP1 = { 0x0001EEB8, "\x80", NULL, 0x01, NULL };
const CHEAT GodModeP1 = { 0xFFFD9D08, "\xEB\x04",
	"\xFF\x0D", 0x02, &HealthSetFullP1 };


// Cheat: Invinciblity for player 2
// problem: currently a GodMode enabled player, is killed if their health is
//			less than the total damage of a single hit
// quick-fix: set player's health to full
const CHEAT HealthSetFullP2 = { 0x0001EF1C, "\x80", NULL, 0x01, NULL };
const CHEAT GodModeP2 = { 0xFFFD9D24, "\xEB\x04",
	"\xFF\x0D", 0x02, &HealthSetFullP2 };


// Cheat: Match selection and change prevention
// problem: gets stuck if set too high before the 'battle plan' scroll
const CHEAT MatchSet = { 0x0001EF98, new char[1], NULL, 0x01, NULL };
const CHEAT MatchFreezeReset = { 0xFFFD1D1A, "\xEB\x04",
	"\x89\x15", 0x02, NULL };
const CHEAT MatchFreezeBreak = { 0xFFFD186C,"\xEB\x04",
	"\xFF\x05", 0x02, &MatchFreezeReset };
const CHEAT MatchFreeze = { 0xFFFD17CC, "\xEB\x04",
	"\xFF\x05", 0x02, &MatchFreezeBreak };


// Cheat: disable the drawing of player health bars and the round timer
const CHEAT DrawHUDSet = {0x0003E74E, "\x00", "\x01", 0x01, NULL };
const CHEAT DrawHUD = {0xFFFCF8C0, "\x00", "\x01", 0x01, &DrawHUDSet };


// Cheat: Set Multi-Player Battle 'Test Your Might' Frequency
char szBreakElapse[] = "\x05";
const CHEAT BreakElapseReset = { 0xFFFD1884, szBreakElapse, NULL, 0x01, NULL };
const CHEAT BreakElapse = { 0x0003E73F, szBreakElapse, NULL, 0x01, &BreakElapseReset };


// Cheat: Set Test Your Might Break Material to Selection
const CHEAT BlockSetP1 = { 0x0003E73D, new char[1], NULL, 0x01, NULL };
const CHEAT BlockSetP2 = { 0x0003E73E, new char[1], NULL, 0x01, NULL };

// Cheat: Disable the Round Timer
const CHEAT RoundTimer = { 0xFFFCFA50, "\xEB\x04",
	"\xFF\x0D", 0x02, NULL };

// Cheat: Disable the Finishing Period Timer
// Problem: knock someone into the pit during the grace period...
//  then you must re-enable the fatality timer
const CHEAT FatalityTimer = { 0xFFFCFDBF,"\xEB\xDA",
	"\xFF\x0D", 0x02, NULL };

// Cheat: use built-in cheat menu options aka DIP switches
// dip switches are a bit array/field
// Checksum: checksum test always passes so settings don't get reset.
// this cheat never gets disabled
short int wDIP;
const CHEAT Checksum = { 0xFFFC8EB3, "\xEB", "\x74", 0x01, NULL };
const CHEAT DIP = { 0x0000DFF8, (char *)&wDIP, NULL, 0x02, &Checksum };

// Cheat: Reptile Hint frequency
const CHEAT ReptileHints = { 0xFFFCFDEB, new char[1], NULL, 0x01, NULL };


// Cheat: Remove Reptile Fight Requirments
// nop jumps from Reptile test
// ReptileDoubleFlawless: jumps over the p1 and p2 double flawless victory tests
const CHEAT ReptileMap = { 0xFFFD176C, "\x75\x35", "\x90\x90", 0x02, NULL };
const CHEAT ReptileSilhouettes = { 0xFFFD1775, "\x75\x2C", "\x90\x90", 0x02, NULL };
const CHEAT ReptileDoubleFlawless = { 0xFFFD1780, "\xB8\xDC", "\xEB\x16", 0x02, NULL };
const CHEAT ReptileBlock = { 0xFFFD177E, "\x75\x23", "\x90\x90", 0x02, NULL };
const CHEAT ReptileFatality = { 0xFFFD179F, "\x74\x02", "\x90\x90", 0x02, NULL };


// Cheat: Always show THE PIT Moon Silhouettes
// Moon Silhouettes on map THE PIT signals when its possible to fight Reptile
// Silhouettes: Show moon silhouettes when on THE PIT, reguardless of counter
// SilhouettesCounter: jump over the code that changes the silhouette counter
// SilhouetteSet: set counter to 0x0A so it always passes the reptile test
const CHEAT SilhouettesCounterSet = { 0x0003E747, "\x0A", NULL, 0x01, NULL };
const CHEAT SilhouettesCounter = { 0xFFFD1648,"\xEB\x19","\xA0\xC3", 0x02, &SilhouettesCounterSet };
const CHEAT Silhouettes = { 0xFFFC82EF, "\x90\x90", "\x75\x0F", 0x02, &SilhouettesCounter };


// Cheat: Map selection and change prevention
// problem (sort of): tsung death causes the screen to black out on 'the pit bottom'
// problem: knock endurance 3 fighter into the pit then goro will jump-in
//  at the bottom of the pit :p
//
// MapFreezePreviews: the demo fights shown while on the main screen
// ReptileMapTest: since the map is froze we must test for map 3 instead of
//	map 4 to get to the reptile fight
const CHEAT MapSet = { 0x0003E740, new char[1], NULL, 0x01, NULL };
const CHEAT MapFreezeEndurance3 = { 0xFFFCF8CB, "\xEB", "\xC6", 0x01, NULL };
const CHEAT MapFreezeTsung = { 0xFFFD14F5, "\xEB\x05", "\xB0\x06", 0x02, &MapFreezeEndurance3 };
const CHEAT MapFreezeIni = { 0xFFFD12BE, "\x25", "\xA2", 0x01, &MapFreezeTsung };
const CHEAT MapFreezeReptile = { 0xFFFD1E1A, "\x33\xC0\xB0\x09\xEB\x04",
	"\xB8\x09\x00\x00\x00\xA2", 0x06, &MapFreezeIni };
const CHEAT MapFreezePreviews = { 0xFFFD18EB, "\xEB\x09\x90\x90\x90",
	"\xE8\x68\x92\x01\x00", 0x05, &MapFreezeReptile };
const CHEAT ReptileMapTest = { 0xFFFD176B, "\x03", "\x04", 0x01, &MapFreezePreviews};
const CHEAT MapFreeze = {0xFFFD1617, "\xEB\x14", "\xFE\x05", 0x02, &ReptileMapTest };


// set starting health values
// StartingHealthP(1,2): set it for the second endurance fighter
// StartingHealthP(1,2)_B: 2nd endurance fighter's health during the jump in
// StartingHealth: sets it for all others fighters
// this cheat never gets disabled but it can be set to the normal full health
char szStartingHealth[] = "\x66\x05\x80\x80\x88\x25";
const CHEAT StartingHealth2 = { 0xFFFD153D, "\xA2", NULL, 0x01, NULL };
const CHEAT StartingHealth = { 0xFFFD1533, szStartingHealth, NULL, 0x06, &StartingHealth2 };
const CHEAT StartingHealthP1_B = { 0xFFFD03A4, &szStartingHealth[3], NULL, 0x01, &StartingHealth };
const CHEAT StartingHealthP2_B = { 0xFFFD035D, &szStartingHealth[2], NULL, 0x01, &StartingHealth };
const CHEAT StartingHealthP1 = { 0xFFFCB58A, &szStartingHealth[3], NULL, 0x01, &StartingHealthP1_B };
const CHEAT StartingHealthP2 = { 0xFFFCB5D2, &szStartingHealth[2], NULL, 0x01, &StartingHealthP2_B };

// Cheat: Prevent Difficulty from being increased by the game
// problem: game still gets a little harder as the AI "learns"
const CHEAT DifficultySet = { 0x0001EF8C, new char[1], NULL, 0x01, NULL };
const CHEAT DifficultyFightPreviews = { 0xFFFD1916,"\xEB\x08", "\xC7\x05", 0x02, NULL };
const CHEAT DifficultyIni = { 0xFFFD1D35, "\xEB\x04", "\x89\x15", 0x02, &DifficultyFightPreviews };
const CHEAT DifficultyReptile = { 0xFFFD1E24, "\x25", "\xA3", 0x01, &DifficultyIni };
const CHEAT DifficultyAfterReptile = { 0xFFFD1208, "\xEB\x08", "\xC7\x05", 0x02, &DifficultyReptile };
const CHEAT DifficultyGoro = { 0xFFFD1391, "\xEB\x04", "\x89\x0D", 0x02, &DifficultyAfterReptile };
const CHEAT DifficultySkill = { 0xFFFD15BF, "\xEB", "\x77", 0x01, &DifficultyGoro };
const CHEAT DifficultyFreeze = { 0xFFFD1CD6, "\xC3","\x76", 0x01, &DifficultySkill };


// Cheat: One Round Matches
// No best 2 out of 3 rounds, winner of first round wins match
// both p1 and p2 have a flawless victory on match start
// ThirdRound: show round as "ROUND 3" pokes the text "3" onto "ROUND %d"
// xxxxxxxxxxSetsPx: poke data values for when its enabled mid-round
//
// EndMatchTest: to always end match after round 1 is no longer needed
// because after round 1 someone will always have 2 victorys (or a draw occurs)
// const CHEAT EndMatchTest = { 0xFFFCFB7B, "\x90\x90\x90\x90\x90\x90",
//	 "\x0F\x85\xBB\x01\x00\x00", 0x06, NULL };
//
/*** Goro One Round Matches ***
orginal code:

0000:1876B0  B820000000           mov  eax,00000020
0000:1876B5  E85E100100           call 00198718 ($+1105e)
0000:1876BA  C705F8631D0000000000 mov  dword [001D63F8],000000
0000:1876C4  C605CC5B1F0001       mov  byte [001F5BCC],01 // movement allowed flag
0000:1876CB  33C0                 xor  eax,eax
0000:1876CD  A2C85B1F00           mov  [001F5BC8],al // Finishing Period Over flag
0000:1876D2  A2DD631D00           mov  [001D63DD],al // p1 rounds won
0000:1876D7  A2DF631D00           mov  [001D63DF],al // p2 rounds won

changed to:

0000:1876B0  33C0                xor  eax,eax
0000:1876B2  B020                mov  al,20
0000:1876B4  E85F100100          call 00198718 ($+1105f)
0000:1876B9  33C0                xor  eax,eax
0000:1876BB  A3F8631D00          mov  [001D63F8],eax
0000:1876C0  40                  inc  eax
0000:1876C1  90                  nop
0000:1876C2  90                  nop
0000:1876C3  90                  nop
0000:1876C4  C605CC5B1F0001      mov  byte [001F5BCC],01
0000:1876CB  90                  nop
0000:1876CC  8825C85B1F00        mov  [001F5BC8],ah
0000:1876D2  A2DD631D00          mov  [001D63DD],al
0000:1876D7  A2DF631D00          mov  [001D63DF],al
********************/
const CHEAT RoundsWonSetP1 = { 0x0001EF61, "\x01", NULL, 0x01, NULL };
const CHEAT RoundsWonSetP2 = { 0x0001EF63, "\x01", NULL, 0x01, &RoundsWonSetP1 };
const CHEAT FlawlessSetP1 = { 0x0001EF60, "\x01", NULL, 0x01, &RoundsWonSetP2 };
const CHEAT FlawlessSetP2 = { 0x0001EF62, "\x01", NULL, 0x01, &FlawlessSetP1 };
const CHEAT ThirdRound = { 0xFFFF83EA, "3\0", "%d", 0x02, &FlawlessSetP2 };
const CHEAT OneRoundMatchesB = { 0xFFFD12D0, "\xB0\x01", "\x33\xC0", 0x02, &ThirdRound };
const CHEAT OneRoundMatchesGoro3 = { 0xFFFD0249, "\x33\xC0\xB0\x20\xE8\x5F\x10\x01\x00\x33\xC0\xA3",
	"\xB8\x20\x00\x00\x00\xE8\x5E\x10\x01\x00\xC7\x05", 0x0C, &OneRoundMatchesB };
const CHEAT OneRoundMatchesGoro2 = { 0xFFFD0259, "\x40\x90\x90\x90", "\x00\x00\x00\x00", 0x04, &OneRoundMatchesGoro3 };
const CHEAT OneRoundMatchesGoro1 = { 0xFFFD0264, "\x90\x88\x25", "\x33\xC0\xA2", 0x03, &OneRoundMatchesGoro2 };
const CHEAT OneRoundMatchesReptile = { 0xFFFD1E04, "\xB0\x01", "\x33\xC0", 0x02, &OneRoundMatchesGoro1 };
const CHEAT OneRoundMatches = { 0xFFFD16A7, "\xB0\x01", "\x33\xC0", 0x02, &OneRoundMatchesReptile };



// Cheat: an upper-cut while on the map "the pit" always knocks
// the victim into the pit regardless of health or rounds won.
// aka an instant victory to whoever lands the first upper-cut  
// 
// Problem: ignores godmode
const CHEAT PitFall4 = { 0xFFFDD610,
"\x3B\x7B\xE4\x74\x03\x83\xC3\x64\x8B\x03\x2B\x43\x04\x79\x02\x31\xC0\xC3",
"\x3B\x7B\xE4\x74\x03\x83\xC3\x64\x8B\x03\x2B\x43\x04\x79\x02\x31\xC0\xC3",
0x12, NULL };
const CHEAT PitFall3 = { 0xFFFDD60B, "\xBB", "\xBB", 0x01, &PitFall4 };
const CHEAT PitFall2 = { 0xFFFE2D7F,
	"\xF6\x00\xFF\x75\x18\x80\x78\xEE\x03\x75\x12\x81\x48\xF9\x01\x01\x01\x00\xE8\x75\xA8\xFF\xFF\xC6\x03\x00\x90\xEB\x51",
	"\xF6\x00\xFF\x75\x18\x80\x78\xEE\x03\x75\x12\x90\xE8\x7B\xA8\xFF\xFF\x75\x0A\xE8\xF1\xA8\xFF\xFF\x83\xF8\x02\x74\x51",
	0x1D, &PitFall3 };
const CHEAT PitFall = { 0xFFFE2D79, "\x90\xB8", "\x90\xB8", 0x02, &PitFall2 };


/* PitFall


// pitfall3 and 4
// moodify a func so it returns as a side effect a pointer to
// the victim's health in ebx

// orginal
// edi is the victimId
0170:194A87  A134631D00          mov  eax,[001D6334] ; health P1
0170:194A8C  8B1D38631D00        mov  ebx,[001D6338] ; damage not yet dec from health P1
0170:194A92  3B3D18631D00        cmp  edi,[001D6318] ; player1 ID
0170:194A98  740B                je   00194AA5 ($+b)         
0170:194A9A  A198631D00          mov  eax,[001D6398] ; p2 health
0170:194A9F  8B1D9C631D00        mov  ebx,[001D639C] ; p2 damage
0170:194AA5  2BC3                sub  eax,ebx        ; subtract dmg from hp
0170:194AA7  7902                jns  00194AAB ($+2)         
0170:194AA9  33C0                xor  eax,eax        ; dead
0170:194AAB  C3                  ret                 ; return hp remaining & jump flags set if dead

// changed so ebx points to the victims health upon return...
enabled and disabled:
BB 34631D00   MOV EBX,001D6334
3B7B E4       CMP EDI,DWORD PTR DS:[EBX-1C]
74 03         JE $+3
83C3 64       ADD EBX,64
8B03          MOV EAX,DWORD PTR DS:[EBX]
2B43 04       SUB EAX,DWORD PTR DS:[EBX+4]
79 02         JNS $+2
31C0          XOR EAX,EAX
C3            RETN

// pit fall test
orginal:
0170:17A1F5 F605CE5B1D00FF test byte [001D5BCE],FF // check if fatalities disabled?
0170:17A1FC 751A           jne  0017A218 ($+1a)    // jump out if disabled
0170:17A1FE 803D BC5B1D00 03 cmp  byte [001D5BBC],03 // check if map == 'the pit'
0170:17A205 7511           jne  0017A218 ($+11)    // jump out if not 'the pit'
0170:17A207 E87BA8FFFF     call 00174A87 ($-5785)  // set jump flag if the victim is dead
0170:17A20C 750A           jne  0017A218 ($+a)     // jump out if victim is not dead  
0170:17A20E E8F1A8FFFF     call 00174B04 ($-570f)  // returns the winning player's number of rounds won... 
0170:17A213 83F802         cmp  eax,0002           // check if rounds won == 2
0170:17A216 7451           je   0017A269 ($+51)    // jump if someone is going to be knocked into the pit-

enabled:
0170:17A1F5 90               nop
0170:17A1F6 B8 xxxxxxxx      MOV EAX, xxxxxxxx  
0170:17A1FB F600 FF          TEST BYTE PTR DS:[EAX],FF        // check if fatalities disabled
0170:17A1FE 7518             jne  0017A218 ($+18)             // jump out if disabled
0170:17A200 8078 EE 03       CMP BYTE PTR DS:[EAX-12],3       // check for map "the pit"
0170:17A204 7512             jne  0017A218 ($+12) 			  // jump out if map is not "the pit"
0170:17A206 8148 F9 01010100 OR DWORD PTR DS:[EAX-7],00010101 // set no finishing period, finishing period over, and round over flags
0170:17A20D E8 75A8FFFF      call 00174A87                    // returns pointer to victim health in ebx  
0170:17A212 C60300           MOV BYTE PTR DS:[EBX],0          // kill the victim
0170:17A215 90               NOP
0170:17A216 eb51		     jmp  ($+51)                      // jump if someone is going to be knocked into the pit-

disabled:
0170:17A1F5 90             nop
0170:17A1F6 B8 xxxxxxxx    MOV EAX, xxxxxxxx  
0170:17A1FB F600 FF        TEST BYTE PTR DS:[EAX],FF  // check if fatalities disabled
0170:17A1FE 7518           jne  0017A218 ($+18)       // jump out if disabled
0170:17A200 8078 EE 03     CMP BYTE PTR DS:[EAX-12],3 // check for map "the pit"
0170:17A204 7512           jne  0017A218 ($+12) 	  // jump out if map is not "the pit"
0170:17A206 90             NOP
0170:17A207 E87BA8FFFF     call 00174A87 ($-5785)  // set jump flag if the victim is dead
0170:17A20C 750A           jne  0017A218 ($+a)     // jump out if victim is not dead  
0170:17A20E E8F1A8FFFF     call 00174B04 ($-570f)  // returns the winning player's number of rounds won... 
0170:17A213 83F802         cmp  eax,0002           // check if rounds won == 2
0170:17A216 7451           je   0017A269 ($+51)    // jump if someone is going to be knocked into the pit-
*/


//=============================================================
// needs fixin' below this line


// Cheat: Blitz: no 'freeze time' before fighting begins at round start
// problem (sort of): player won't die until the offical start of the round :)
// BlitzMoveEndurance: Don't freeze movement while 2nd endurance fighter jumps-in
// blitz2: writes over a redundant instruction:  p2 damage = 0
// Blitz: allow movement at round start
//
// todo: nop set health on endurance fighter jump in
// sets the endurance fighter health twice during the jump in
// which since blitz doesn't freeze during the jump in... 
// (a split second the user will probably never know...) 
// see StartingHealthPxx ?? 
//
// todo: set 0178:001F5BBD (mode) to 2 at round start
/// if mode is set during Round Init like the "move allowed" flag-> its too early
/// and if a key is pressed then crash l-(
/// ? set mode around when it displays the "ROUND %d" ?
///
const CHEAT BlitzMoveEndurance = { 0xFFFD0454,  "\x25", "\xA2", 0x01, NULL };
const CHEAT Blitz3 = { 0xFFFD14B8, "\x89\x50\x24\xC6\x03\x01\x90", "\xC7\x40\x24\x00\x00\x00\x00", 0x07, &BlitzMoveEndurance };
const CHEAT Blitz2 = { 0xFFFD1440, "\x89\xc2\x90\x90\x90", "\x90\x90\x90\x90\x90", 0x05, &Blitz3};
const CHEAT Blitz = { 0xFFFD144F, "\xBB", "\xA2", 0x01, &Blitz2 };


// BP 0170:186D8A // mov "ROUND %d" address into register



// Cheat: Change Scorpion to Reptile
// basically just turns scorpion the color green ....
// problem: no idea how to switch from scorpion to sub-zero during a match :(
// side effect: main menu preview fights will always feature reptile instead of scorpion
// side effect: fighter selection sometimes features reptile instead of scorpion
/*** Scorpion2Reptile ***
orginal code:
0170:164EA9  cmp  byte [001D5BD1],01
0170:164EB0  jne  00164EDA ($+28)
0170:164EB2  mov  eax,001B6314
0170:164EB7  cmp  dword [esi+0004],0205001
0170:164EBC  je   00164EC3 ($+5)
0170:164EBE  mov  eax,001B6378
0170:164EC3  cmp  byte [eax],01
0170:164EC6  je   00164EDA ($+12)
0170:164EC8  mov  eax,00000004

changed to:
0170:164EA9 B814631B00		mov eax,001B6314		// [001B6314]: p1 is AI or Human controled
0170:164EAE 66837E0401		cmp dword [esi+0004],01	// check player # func was called for
0170:164EB3 7412 or 7402	je +12 or je +2			// jump when hacked or jump to 2nd test
0170:164EB5 7510 or 0464	jne +10 or add eax,64	// jump when hacked or eax = p2 AI/Human
0170:164EB7 803801			cmp byte [eax],01		// check if player is human controled
0170:164EBA 741E			je 00164EDA				// don't make reptile
0170:164EBC 803DD15B1D0000	cmp byte [001D5BD1],00	// check reptile flag
0170:164EC3 90				nop
0170:164EC4 90				nop
0170:164EC5 90				nop
********************/

//const CHEAT Scorpion2ReptileSet2 = { 0x0003E755, "\x01", "\x00", 0x01, NULL };
//const CHEAT Scorpion2ReptileSet = { 0xFFFCF8B4, "\x01", "\x00", 0x01, &Scorpion2ReptileSet };
char szScorpion2Reptile[] = "\xB8\x14\x63\x1B\x00\x66\x83\x7E\x04\x01\x74\x02"
			"\x04\x64\x80\x38\x01\x74\x1E\x80\x3D\xD1\x5B\x1D\x00\x00\x90\x90\x90";
const CHEAT Scorpion2Reptile2 = { 0xFFFDCF14, "\x90\x90", NULL, 0x02, NULL };
const CHEAT Scorpion2Reptile = { 0xFFFCDA2D, szScorpion2Reptile, NULL, 0x1D, &Scorpion2Reptile2 };
// basically change the code to something that functions properly and
// is hackable... then hack my own hack ...
// to enable/disable hack alter the string in the following ways:
// Player1--> szScorpion2Reptile[10]  enable:"\x74\x13" Disable:"\x74\x02"
// Player2--> szScorpion2Reptile[12]  enable:"\x75\x11" Disable:"\x04\x64"




ideas:
--------------------------------
allow fatalities at any time
shadows only, fighters invisble :)
freeze opponent (via subzero's ability) ( must have a player state var? )
freeze and levitate
reptile speed
figure out the *GRA files 
show player's CAMEOS
play as dark colored model always
hotkey to perform special moves/fatality
move fighter during selection
randomize fighter
have endurance fighters on your side
every match is endurance 
change background color
more blood


play as goro/tsung
------------------------
Let the round start with the AI in control of goro/tsung
then set the 'AI controled' var to 'human controled'
you can not expect to really fight with them though...

Goro:
forward = forward
down = block
up = crash!!!!
back = back but no animation
low punch = fireball sort of? 

Tsung:
forward = forward
back = back
block = crash!!!


garbage
----------
CS:00181FD4  // randomizer function?
CS:00167C5D // finish 'HIM' or finish 'HER' test

the same function is always called to get dip switches. 
what (if any) tests DIP switchs 6,7,8???