win32: add separate framelimiter so that you can use frameskip 0 + limit (the old pre-0.9.1 style before I broke it)

This commit is contained in:
zeromus 2009-03-17 05:45:51 +00:00
parent 962d1e5e2d
commit c3c3e48da7
3 changed files with 16 additions and 1 deletions

View File

@ -152,6 +152,8 @@ int WndY = 0;
int ScreenGap = 0;
static int FrameLimit = 0;
//=========================== view tools
TOOLSCLASS *ViewDisasm_ARM7 = NULL;
TOOLSCLASS *ViewDisasm_ARM9 = NULL;
@ -938,7 +940,7 @@ DWORD WINAPI run()
NDS_SkipFrame(true);
}
if(frameskiprate != 0 || autoframeskipenab)
if(autoframeskipenab || FrameLimit)
while(SpeedThrottle())
{
}
@ -1086,6 +1088,8 @@ int MenuInit()
MainWindow->checkMenu(IDM_SCREENSEP_BORDER, MF_BYCOMMAND | ((ScreenGap==5)?MF_CHECKED:MF_UNCHECKED));
MainWindow->checkMenu(IDM_SCREENSEP_NDSGAP, MF_BYCOMMAND | ((ScreenGap==64)?MF_CHECKED:MF_UNCHECKED));
MainWindow->checkMenu(IDC_FRAMELIMIT, MF_BYCOMMAND | FrameLimit?MF_CHECKED:MF_UNCHECKED);
recentromsmenu = LoadMenu(hAppInst, "RECENTROMS");
GetRecentRoms();
@ -1271,6 +1275,7 @@ int WINAPI WinMain (HINSTANCE hThisInstance,
WndY = GetPrivateProfileInt("Video","WindowPosY", CW_USEDEFAULT, IniName);
frameCounterDisplay = GetPrivateProfileInt("Display","FrameCounter", 0, IniName);
ScreenGap = GetPrivateProfileInt("Display", "ScreenGap", 0, IniName);
FrameLimit = GetPrivateProfileInt("FrameLimit", "FrameLimit", 1, IniName);
//sprintf(text, "%s", DESMUME_NAME_AND_VERSION);
MainWindow = new WINCLASS(CLASSNAME, hThisInstance);
DWORD dwStyle = WS_CAPTION| WS_SYSMENU | WS_SIZEBOX | WS_MINIMIZEBOX | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
@ -2745,6 +2750,12 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
ChangeLanguage(2);
CheckLanguage(LOWORD(wParam));
return 0;
case IDC_FRAMELIMIT:
{
FrameLimit ^= 1;
MainWindow->checkMenu(IDC_FRAMELIMIT, FrameLimit ? MF_CHECKED : MF_UNCHECKED);
WritePrivateProfileInt("FrameLimit", "FrameLimit", FrameLimit, IniName);
}
case IDM_SCREENSEP_NONE:
{
SetScreenGap(0);

View File

@ -389,6 +389,7 @@
#define IDM_SCREENSEP_NDSGAP 40002
#define IDM_ABOUT 40003
#define IDM_EMULATIONSETTINGS 40004
#define IDC_FRAMELIMIT 40005
#define ID_VIEW_FRAMECOUNTER 40009
#define ID_VIEW_DISPLAYFPS 40010
#define IDM_FILE_RECORDAVI 40015

View File

@ -131,6 +131,7 @@ BEGIN
MENUITEM "Firmware Indstillinger", IDM_FIRMSETTINGS
POPUP "&Frame Skip"
BEGIN
MENUITEM "Limit to 60", IDC_FRAMELIMIT
MENUITEM "Auto", IDC_FRAMESKIPAUTO
MENUITEM "0", IDC_FRAMESKIP0
MENUITEM "1", IDC_FRAMESKIP1
@ -294,6 +295,7 @@ BEGIN
MENUITEM "Emulation Settings", IDM_EMULATIONSETTINGS
POPUP "&Frame Skip"
BEGIN
MENUITEM "Limit to 60", IDC_FRAMELIMIT
MENUITEM "Auto", IDC_FRAMESKIPAUTO
MENUITEM "0", IDC_FRAMESKIP0
MENUITEM "1", IDC_FRAMESKIP1
@ -455,6 +457,7 @@ BEGIN
MENUITEM "Config. du firmware", IDM_FIRMSETTINGS
POPUP "&Frame Skip"
BEGIN
MENUITEM "Limit to 60", IDC_FRAMELIMIT
MENUITEM "Auto", IDC_FRAMESKIPAUTO
MENUITEM "0", IDC_FRAMESKIP0
MENUITEM "1", IDC_FRAMESKIP1