// Filename : CHEATS.C // Coded by : Scott Evans // Created/Modified : 17/8/98 // Description : B2 game cheat modes #include "cheats.h" extern GAME_DATA gd; extern PROGRAM_DATA pd; extern SOUND_DATA *sounds; extern VOLUME menu_volume; word cheat_codes[]={ #include "cheats.dat" }; GAME_CHEATS gc; // Function : InitCheatCodes() // Coded by : Scott Evans // Created/Modified : 17/8/98 // Description : Initialise game cheats // Parameters : None // Returns : None // Notes : None void InitCheatCodes(void) { // Clear out structure bzero((u_byte *)&gc,sizeof(GAME_CHEATS)); // Set pointer to codes gc.codes=&cheat_codes[0]; // Disable all cheats gd.cheats_on=CC_NONE; #ifdef DEBUG_INFO PrintFM("Completed\n"); #endif } // Function : CheckForCheats() // Coded by : Scott Evans // Created/Modified : 17/8/98 // Description : Check for cheat codes // Parameters : gd - pointer to game data // pd - pointer to program data // Returns : None // Notes : None void CheckForCheats(void) { static u_word button_pressed=0; static u_long timer=0; u_byte i; word code; if(pd.pad && !pd.buttons_down) { timer=0; button_pressed=pd.pad; if(!gc.started) { // Test first character of each code for(i=0;i