Moved fastFetchExecute to CommonSettings, and set the default value to false.

This commit is contained in:
gocha 2009-09-08 22:53:43 +00:00
parent c0ea64bed8
commit 23087b4c0c
3 changed files with 11 additions and 11 deletions

View File

@ -431,6 +431,7 @@ extern struct TCommonSettings {
, spuAdpcmCache(false) , spuAdpcmCache(false)
, gfx3d_flushMode(0) , gfx3d_flushMode(0)
, manualBackupType(0) , manualBackupType(0)
, armFastFetchExecute(false)
{ {
strcpy(ARM9BIOS, "biosnds9.bin"); strcpy(ARM9BIOS, "biosnds9.bin");
strcpy(ARM7BIOS, "biosnds7.bin"); strcpy(ARM7BIOS, "biosnds7.bin");
@ -471,6 +472,8 @@ extern struct TCommonSettings {
//this is the user's choice of manual backup type, for cases when the autodetection can't be trusted //this is the user's choice of manual backup type, for cases when the autodetection can't be trusted
int manualBackupType; int manualBackupType;
bool armFastFetchExecute;
bool spu_muteChannels[16]; bool spu_muteChannels[16];
struct _ShowGpu { struct _ShowGpu {

View File

@ -30,7 +30,7 @@
#include "bios.h" #include "bios.h"
#include "debug.h" #include "debug.h"
#include "Disassembler.h" #include "Disassembler.h"
#include "NDSSystem.h"
template<u32> static u32 armcpu_prefetch(); template<u32> static u32 armcpu_prefetch();
@ -495,7 +495,6 @@ armcpu_flagIrq( armcpu_t *armcpu) {
} }
bool fastFetchExecute = true;
template<int PROCNUM> template<int PROCNUM>
u32 armcpu_exec() u32 armcpu_exec()
{ {
@ -522,7 +521,7 @@ u32 armcpu_exec()
cFetch = armcpu_prefetch(&ARMPROC); cFetch = armcpu_prefetch(&ARMPROC);
if (ARMPROC.stalled) { if (ARMPROC.stalled) {
return fastFetchExecute ? std::max(cFetch, cExecute) : (cFetch + cExecute); return CommonSettings.armFastFetchExecute ? std::max(cFetch, cExecute) : (cFetch + cExecute);
} }
#endif #endif
@ -554,7 +553,7 @@ u32 armcpu_exec()
#else #else
cFetch = armcpu_prefetch<PROCNUM>(); cFetch = armcpu_prefetch<PROCNUM>();
#endif #endif
return fastFetchExecute ? std::max(cFetch, cExecute) : (cFetch + cExecute); return CommonSettings.armFastFetchExecute ? std::max(cFetch, cExecute) : (cFetch + cExecute);
} }
if(PROCNUM==0) if(PROCNUM==0)
@ -570,7 +569,7 @@ u32 armcpu_exec()
#else #else
cFetch = armcpu_prefetch<PROCNUM>(); cFetch = armcpu_prefetch<PROCNUM>();
#endif #endif
return fastFetchExecute ? std::max(cFetch, cExecute) : (cFetch + cExecute); return CommonSettings.armFastFetchExecute ? std::max(cFetch, cExecute) : (cFetch + cExecute);
} }
//these templates needed to be instantiated manually //these templates needed to be instantiated manually

View File

@ -219,8 +219,6 @@ static bool lostFocusPause = true;
static bool lastPauseFromLostFocus = false; static bool lastPauseFromLostFocus = false;
static bool FrameLimit = true; static bool FrameLimit = true;
extern bool fastFetchExecute; // from armcpu.cpp
std::vector<HWND> LuaScriptHWnds; std::vector<HWND> LuaScriptHWnds;
LRESULT CALLBACK LuaScriptProc(HWND, UINT, WPARAM, LPARAM); LRESULT CALLBACK LuaScriptProc(HWND, UINT, WPARAM, LPARAM);
@ -1939,7 +1937,7 @@ int _main()
CommonSettings.showGpu.main = GetPrivateProfileInt("Display", "MainGpu", 1, IniName) != 0; CommonSettings.showGpu.main = GetPrivateProfileInt("Display", "MainGpu", 1, IniName) != 0;
CommonSettings.showGpu.sub = GetPrivateProfileInt("Display", "SubGpu", 1, IniName) != 0; CommonSettings.showGpu.sub = GetPrivateProfileInt("Display", "SubGpu", 1, IniName) != 0;
lostFocusPause = GetPrivateProfileBool("Focus", "BackgroundPause", false, IniName); lostFocusPause = GetPrivateProfileBool("Focus", "BackgroundPause", false, IniName);
fastFetchExecute = GetPrivateProfileBool("Emulation", "FetchExecute", false, IniName); CommonSettings.armFastFetchExecute = GetPrivateProfileBool("Emulation", "FetchExecute", false, IniName);
//Get Ram-Watch values //Get Ram-Watch values
RWSaveWindowPos = GetPrivateProfileBool("RamWatch", "SaveWindowPos", false, IniName); RWSaveWindowPos = GetPrivateProfileBool("RamWatch", "SaveWindowPos", false, IniName);
@ -3126,7 +3124,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
MainWindow->checkMenu(IDC_STATEREWINDING, staterewindingenabled == 1 ); MainWindow->checkMenu(IDC_STATEREWINDING, staterewindingenabled == 1 );
MainWindow->checkMenu(IDC_BACKGROUNDPAUSE, lostFocusPause); MainWindow->checkMenu(IDC_BACKGROUNDPAUSE, lostFocusPause);
MainWindow->checkMenu(IDC_FASTFETCHEXECUTE, fastFetchExecute); MainWindow->checkMenu(IDC_FASTFETCHEXECUTE, CommonSettings.armFastFetchExecute);
//Save type //Save type
const int savelist[] = {IDC_SAVETYPE1,IDC_SAVETYPE2,IDC_SAVETYPE3,IDC_SAVETYPE4,IDC_SAVETYPE5,IDC_SAVETYPE6,IDC_SAVETYPE7}; const int savelist[] = {IDC_SAVETYPE1,IDC_SAVETYPE2,IDC_SAVETYPE3,IDC_SAVETYPE4,IDC_SAVETYPE5,IDC_SAVETYPE6,IDC_SAVETYPE7};
@ -4101,8 +4099,8 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
return 0; return 0;
case IDC_FASTFETCHEXECUTE: case IDC_FASTFETCHEXECUTE:
fastFetchExecute = !fastFetchExecute; CommonSettings.armFastFetchExecute = !CommonSettings.armFastFetchExecute;
WritePrivateProfileInt("Emulation", "FetchExecute", (int)fastFetchExecute, IniName); WritePrivateProfileInt("Emulation", "FetchExecute", (int)CommonSettings.armFastFetchExecute, IniName);
return 0; return 0;
case IDC_SAVETYPE1: backup_setManualBackupType(0); return 0; case IDC_SAVETYPE1: backup_setManualBackupType(0); return 0;