mirror of
https://github.com/dborth/snes9xgx.git
synced 2024-12-27 03:31:50 +01:00
09cb10dfb6
-libfat cleanup, add sd gecko support -tweak to mouse code
50 lines
1.2 KiB
C++
50 lines
1.2 KiB
C++
/****************************************************************************
|
|
* Snes9x 1.51
|
|
*
|
|
* Nintendo Wii/Gamecube Port
|
|
* Tantric August 2008
|
|
*
|
|
* cheatmgr.cpp
|
|
*
|
|
* Cheat handling
|
|
****************************************************************************/
|
|
|
|
#include "snes9xGx.h"
|
|
#include "memmap.h"
|
|
#include "fileop.h"
|
|
#include "cheats.h"
|
|
|
|
extern SCheatData Cheat;
|
|
|
|
/****************************************************************************
|
|
* SetupCheats
|
|
*
|
|
* Erases any prexisting cheats, loads cheats from a cheat file
|
|
* Called when a ROM is first loaded
|
|
****************************************************************************/
|
|
void
|
|
SetupCheats()
|
|
{
|
|
S9xInitCheatData ();
|
|
S9xDeleteCheats ();
|
|
|
|
char cheatFile[150] = { '\0' };
|
|
|
|
if(GCSettings.SaveMethod == METHOD_SD || GCSettings.SaveMethod == METHOD_USB)
|
|
{
|
|
changeFATInterface(GCSettings.SaveMethod);
|
|
sprintf (cheatFile, "%s/snes9x/cheats/%s.cht", ROOTFATDIR, Memory.ROMFilename);
|
|
}
|
|
|
|
// load cheat file if present
|
|
if(strlen(cheatFile) > 0)
|
|
{
|
|
if(S9xLoadCheatFile (cheatFile))
|
|
{
|
|
// disable all cheats loaded from the file
|
|
for (uint16 i = 0; i < Cheat.num_cheats; i++)
|
|
S9xDisableCheat(i);
|
|
}
|
|
}
|
|
}
|