From 276735a6067f6223599ececa6ad9f6452d85d14d Mon Sep 17 00:00:00 2001 From: gocha Date: Tue, 8 Sep 2009 23:35:35 +0000 Subject: [PATCH] 0.9.4+: separated two lag reduction options and changed the category name in INI 0.9.4+: disabled frameskip during avi recording --- src/NDSSystem.cpp | 7 ++++++- src/NDSSystem.h | 5 +++++ src/armcpu.cpp | 12 +++++------- src/windows/main.cpp | 24 +++++++++++++++--------- src/windows/resource.h | 3 ++- src/windows/resources.rc | Bin 688940 -> 689556 bytes 6 files changed, 33 insertions(+), 18 deletions(-) diff --git a/src/NDSSystem.cpp b/src/NDSSystem.cpp index c9e994274..993889f31 100644 --- a/src/NDSSystem.cpp +++ b/src/NDSSystem.cpp @@ -1675,7 +1675,12 @@ void NDS_Sleep() { nds.sleeping = TRUE; } bool SkipCur2DFrame = false, SkipNext2DFrame = false; bool SkipCur3DFrame = false; -void NDS_SkipNextFrame() { SkipNext2DFrame = true; SkipCur3DFrame = true; } +void NDS_SkipNextFrame() { + if (!driver->AVI_IsRecording()) { + SkipNext2DFrame = true; + SkipCur3DFrame = true; + } +} #define INDEX(i) ((((i)>>16)&0xFF0)|(((i)>>4)&0xF)) diff --git a/src/NDSSystem.h b/src/NDSSystem.h index 857312025..d71cffbb1 100644 --- a/src/NDSSystem.h +++ b/src/NDSSystem.h @@ -383,6 +383,8 @@ extern struct TCommonSettings { , spuAdpcmCache(false) , gfx3d_flushMode(0) , manualBackupType(0) + , armFixCycleCount(false) + , armFastFetchExecute(false) { strcpy(ARM9BIOS, "biosnds9.bin"); strcpy(ARM7BIOS, "biosnds7.bin"); @@ -414,6 +416,9 @@ extern struct TCommonSettings { //this is the user's choice of manual backup type, for cases when the autodetection can't be trusted int manualBackupType; + bool armFixCycleCount; + bool armFastFetchExecute; + bool spu_muteChannels[16]; struct _ShowGpu { diff --git a/src/armcpu.cpp b/src/armcpu.cpp index 674f450ec..262ad2cca 100644 --- a/src/armcpu.cpp +++ b/src/armcpu.cpp @@ -29,7 +29,7 @@ #include "bios.h" #include "debug.h" #include "Disassembler.h" - +#include "NDSSystem.h" template static u32 armcpu_prefetch(); @@ -494,12 +494,10 @@ armcpu_flagIrq( armcpu_t *armcpu) { return TRUE; } -bool fixCycleCount = false; - template u32 armcpu_exec() { - u32 cFetch = fixCycleCount ? 0 : 1; + u32 cFetch = CommonSettings.armFixCycleCount ? 0 : 1; u32 cExecute = 0; //this assert is annoying. but sometimes it is handy. @@ -536,7 +534,7 @@ u32 armcpu_exec() else cExecute += arm_instructions_set_1[INSTRUCTION_INDEX(ARMPROC.instruction)](); } - else if (fixCycleCount) + else if (CommonSettings.armFixCycleCount) cExecute++; // If condition=false: 1S cycle #ifdef GDB_STUB if ( ARMPROC.post_ex_fn != NULL) { @@ -546,7 +544,7 @@ u32 armcpu_exec() #else cFetch += armcpu_prefetch(); #endif - return fixCycleCount ? std::max(cFetch, cExecute) : (cFetch + cExecute); + return CommonSettings.armFastFetchExecute ? std::max(cFetch, cExecute) : (cFetch + cExecute); } if(PROCNUM==0) @@ -562,7 +560,7 @@ u32 armcpu_exec() #else cFetch += armcpu_prefetch(); #endif - return fixCycleCount ? std::max(cFetch, cExecute) : (cFetch + cExecute); + return CommonSettings.armFastFetchExecute ? std::max(cFetch, cExecute) : (cFetch + cExecute); } //these templates needed to be instantiated manually diff --git a/src/windows/main.cpp b/src/windows/main.cpp index dd4a75250..6470f3f0e 100644 --- a/src/windows/main.cpp +++ b/src/windows/main.cpp @@ -140,8 +140,6 @@ void wxTest() { #endif -extern bool fixCycleCount; - const int kGapNone = 0; const int kGapBorder = 5; const int kGapNDS = 64; // extremely tilted (but some games seem to use this value) @@ -1511,7 +1509,8 @@ int _main() GetPrivateProfileString("Watches", str, "", &rw_recent_files[i][0], 1024, IniName); } - fixCycleCount = (bool)GetPrivateProfileInt("Timings", "LagReduction", 0, IniName) != 0; + CommonSettings.armFixCycleCount = (bool)GetPrivateProfileInt("0.9.4+", "armFixCycleCount", 0, IniName) != 0; + CommonSettings.armFastFetchExecute = (bool)GetPrivateProfileInt("0.9.4+", "armFastFetchExecute", 0, IniName) != 0; //i think we should override the ini file with anything from the commandline CommandLine cmdline; @@ -2561,7 +2560,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM //Gray the recent ROM menu item if there are no recent ROMs DesEnableMenuItem(mainMenu, ID_FILE_RECENTROM, RecentRoms.size()>0); - DesEnableMenuItem(mainMenu, IDC_LAGREDUCTION, (movieMode == MOVIEMODE_INACTIVE)); + DesEnableMenuItem(mainMenu, IDC_ARMFIXCYCLECOUNT, (movieMode == MOVIEMODE_INACTIVE)); //Updated Checked menu items @@ -2630,7 +2629,8 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM MainWindow->checkMenu(IDC_STATEREWINDING, staterewindingenabled == 1 ); MainWindow->checkMenu(IDC_BACKGROUNDPAUSE, lostFocusPause); - MainWindow->checkMenu(IDC_LAGREDUCTION, fixCycleCount); + MainWindow->checkMenu(IDC_ARMFIXCYCLECOUNT, CommonSettings.armFixCycleCount); + MainWindow->checkMenu(IDC_ARMFASTFETCHEXECUTE, CommonSettings.armFastFetchExecute); //Save type const int savelist[] = {IDC_SAVETYPE1,IDC_SAVETYPE2,IDC_SAVETYPE3,IDC_SAVETYPE4,IDC_SAVETYPE5,IDC_SAVETYPE6,IDC_SAVETYPE7}; @@ -2692,7 +2692,8 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM WritePrivateProfileString("Watches", str, &rw_recent_files[i][0], IniName); } - WritePrivateProfileInt("Timings", "LagReduction", (int)fixCycleCount, IniName); + WritePrivateProfileInt("0.9.4+", "armFixCycleCount", (int)CommonSettings.armFixCycleCount, IniName); + WritePrivateProfileInt("0.9.4+", "armFastFetchExecute", (int)CommonSettings.armFastFetchExecute, IniName); ExitRunLoop(); } @@ -3536,9 +3537,14 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM WritePrivateProfileInt("Focus", "BackgroundPause", (int)lostFocusPause, IniName); return 0; - case IDC_LAGREDUCTION: - fixCycleCount = !fixCycleCount; - WritePrivateProfileInt("Timings", "LagReduction", (int)fixCycleCount, IniName); + case IDC_ARMFIXCYCLECOUNT: + CommonSettings.armFixCycleCount = !CommonSettings.armFixCycleCount; + WritePrivateProfileInt("0.9.4+", "armFixCycleCount", (int)CommonSettings.armFixCycleCount, IniName); + return 0; + + case IDC_ARMFASTFETCHEXECUTE: + CommonSettings.armFastFetchExecute = !CommonSettings.armFastFetchExecute; + WritePrivateProfileInt("0.9.4+", "armFastFetchExecute", (int)CommonSettings.armFastFetchExecute, IniName); return 0; case IDC_SAVETYPE1: backup_setManualBackupType(0); return 0; diff --git a/src/windows/resource.h b/src/windows/resource.h index 392c35024..94154efd1 100644 --- a/src/windows/resource.h +++ b/src/windows/resource.h @@ -794,7 +794,8 @@ #define IDC_HKCOMBO 60077 #define IDD_KEYCUSTOM 60078 #define IDM_HOTKEY_CONFIG 60079 -#define IDC_LAGREDUCTION 65432 +#define IDC_ARMFIXCYCLECOUNT 65432 +#define IDC_ARMFASTFETCHEXECUTE 65433 // Next default values for new objects // diff --git a/src/windows/resources.rc b/src/windows/resources.rc index cfd99e0eed917642864f2036f461a389bff47e11..b93e3bea50e5b4fc602c81a4792faaa06d3b641f 100644 GIT binary patch delta 696 zcmZ3}rZuHoYeRyMq8mddLj{8ZgCj!_gD;SFW~gLHX2@Yk1+()RN~arIu}V)**uugk z4N~F8;K>jHR22!tJ`Aov(w`xe!EgFRF&1rkH-YQ0BgV@pS2YooVAN1kMHUj{M C+K_bs delta 311 zcmbQzt+l32YeRyMqz^+PLpp;3Ll8qMLkdGFLo!1NLncE$L*Dd@VyxQJ7kG2B@Vf(L zT^U>$LK&PHLKr-!U!2A%JUKv3uDQv#y~&pmh?%xG`7-ahOSWm#A4sq$Y){f*arr}; j8SSSuS%H`hh}nUdWBVyh&MXxQ&5ZEp+#cc2Wn%^aBOX#7