- fix load a settings of GuitarGrip;
- add saving a status of cheats (disabled/enabled);
This commit is contained in:
mtabachenko 2009-12-26 10:10:55 +00:00
parent 52b8847c04
commit 1d7d7df7e9
5 changed files with 14 additions and 18 deletions

View File

@ -460,6 +460,7 @@ extern struct TCommonSettings {
, micMode(InternalNoise)
, spuInterpolationMode(SPUInterpolation_Linear)
, manualBackupType(0)
, cheatsDisable(false)
{
strcpy(ARM9BIOS, "biosnds9.bin");
strcpy(ARM7BIOS, "biosnds7.bin");
@ -487,6 +488,8 @@ extern struct TCommonSettings {
bool DebugConsole;
bool EnsataEmulation;
bool cheatsDisable;
int num_cores;
bool single_core() { return num_cores==1; }

View File

@ -717,7 +717,7 @@ void CHEATS::stackClear()
void CHEATS::process()
{
if (disabled) return;
if (CommonSettings.cheatsDisable) return;
if (!num) return;
for (int i = 0; i < num; i++)
{
@ -764,11 +764,6 @@ void CHEATS::getXXcodeString(CHEATS_LIST list, char *res_buf)
}
}
void CHEATS::disable(bool disable)
{
disabled = disable;
}
// ========================================== search
BOOL CHEATSEARCH::start(u8 type, u8 size, u8 sign)
{

View File

@ -52,7 +52,6 @@ private:
u8 *stack;
u16 numStack;
bool disabled;
void clear();
void ARparser(CHEATS_LIST cheat);
@ -61,7 +60,7 @@ private:
public:
CHEATS():
num(0), currentGet(0), stack(0), numStack(0), disabled(0)
num(0), currentGet(0), stack(0), numStack(0)
{
memset(list, 0, sizeof(list));
memset(filename, 0, sizeof(filename));
@ -87,7 +86,6 @@ public:
void stackClear();
void process();
void getXXcodeString(CHEATS_LIST cheat, char *res_buf);
void disable(bool disable);
};
class CHEATSEARCH

View File

@ -394,7 +394,7 @@ static void LoadGuitarConfig()
memcpy(&Guitar,&DefaultGuitar,sizeof(Guitar));
//Guitar.Enabled = true;
#define DO(X) ReadControl(#X,Guitar.X);
#define DO(X) ReadGuitarControl(#X,Guitar.X);
DO(GREEN);
DO(RED);
DO(YELLOW);

View File

@ -176,8 +176,6 @@ static BOOL OpenCore(const char* filename);
BOOL Mic_DeInit_Physical();
BOOL Mic_Init_Physical();
static bool _cheatsDisabled = false;
void UpdateHotkeyAssignments(); //Appends hotkey mappings to corresponding menu items
HMENU mainMenu = NULL; //Holds handle to the main DeSmuME menu
@ -2298,12 +2296,12 @@ int _main()
GetSystemInfo(&systemInfo);
CommonSettings.num_cores = systemInfo.dwNumberOfProcessors;
_cheatsDisabled = false;
char text[80];
GetINIPath();
CommonSettings.cheatsDisable = GetPrivateProfileInt("General", "cheatsDisable", false, IniName);
addon_type = GetPrivateProfileInt("GBAslot", "type", NDS_ADDON_NONE, IniName);
win32_CFlash_cfgMode = GetPrivateProfileInt("GBAslot.CFlash", "fileMode", 2, IniName);
win32_CFlash_cfgDirectory = GetPrivateProfileStdString("GBAslot.CFlash", "path", "");
@ -2362,7 +2360,7 @@ int _main()
CommonSettings.showGpu.main = GetPrivateProfileInt("Display", "MainGpu", 1, IniName) != 0;
CommonSettings.showGpu.sub = GetPrivateProfileInt("Display", "SubGpu", 1, IniName) != 0;
lostFocusPause = GetPrivateProfileBool("Focus", "BackgroundPause", false, IniName);
//Get Ram-Watch values
RWSaveWindowPos = GetPrivateProfileBool("RamWatch", "SaveWindowPos", false, IniName);
ramw_x = GetPrivateProfileInt("RamWatch", "RWWindowPosX", 0, IniName);
@ -3695,6 +3693,8 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
MainWindow->checkMenu(IDM_EJECTCARD, nds.cardEjected != FALSE);
MainWindow->checkMenu(IDM_CHEATS_DISABLE, CommonSettings.cheatsDisable == true);
//Save type
const int savelist[] = {IDC_SAVETYPE1,IDC_SAVETYPE2,IDC_SAVETYPE3,IDC_SAVETYPE4,IDC_SAVETYPE5,IDC_SAVETYPE6,IDC_SAVETYPE7,IDC_SAVETYPE8};
for(int i=0;i<8;i++)
@ -4846,9 +4846,9 @@ DOKEYDOWN:
return 0;
case IDM_CHEATS_DISABLE:
_cheatsDisabled = !_cheatsDisabled;
cheats->disable(_cheatsDisabled);
MainWindow->checkMenu(IDM_CHEATS_DISABLE, _cheatsDisabled );
CommonSettings.cheatsDisable = !CommonSettings.cheatsDisable;
WritePrivateProfileBool("General", "cheatsDisable", CommonSettings.cheatsDisable, IniName);
MainWindow->checkMenu(IDM_CHEATS_DISABLE, CommonSettings.cheatsDisable );
return 0;
case IDM_RECORD_MOVIE: