Win32 - Frame Advance implemented (with hotkey "N"). Frame Counter Display enabled. TODO: frameCounter must be added to savestate info. frameCounter must be displayed on screen instead of the console window.
This commit is contained in:
parent
f059cc7ae1
commit
8f7c2a548c
|
@ -133,6 +133,9 @@ int frameskiprate=0;
|
||||||
int emu_paused = 0;
|
int emu_paused = 0;
|
||||||
static int backupmemorytype=MC_TYPE_AUTODETECT;
|
static int backupmemorytype=MC_TYPE_AUTODETECT;
|
||||||
static u32 backupmemorysize=1;
|
static u32 backupmemorysize=1;
|
||||||
|
unsigned int frameCounter=0;
|
||||||
|
bool frameAdvance = false;
|
||||||
|
bool frameCounterDisplay = false;
|
||||||
|
|
||||||
/* the firmware settings */
|
/* the firmware settings */
|
||||||
struct NDS_fw_config_data win_fw_config;
|
struct NDS_fw_config_data win_fw_config;
|
||||||
|
@ -600,6 +603,14 @@ DWORD WINAPI run( LPVOID lpParameter)
|
||||||
if (framestoskip < 1)
|
if (framestoskip < 1)
|
||||||
framestoskip += frameskiprate;
|
framestoskip += frameskiprate;
|
||||||
}
|
}
|
||||||
|
if (frameAdvance)
|
||||||
|
{
|
||||||
|
frameAdvance = false;
|
||||||
|
execute = FALSE;
|
||||||
|
SPU_Pause(1);
|
||||||
|
}
|
||||||
|
frameCounter++;
|
||||||
|
if (frameCounterDisplay) printlog("%d\n",frameCounter); //Will be replaced by a function that draws is directly on the screen
|
||||||
}
|
}
|
||||||
paused = TRUE;
|
paused = TRUE;
|
||||||
Sleep(500);
|
Sleep(500);
|
||||||
|
@ -1588,19 +1599,25 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
||||||
CheckMenuItem(menu, IDM_SBG3, MF_BYCOMMAND | MF_CHECKED);
|
CheckMenuItem(menu, IDM_SBG3, MF_BYCOMMAND | MF_CHECKED);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
//case IDM_EXEC:
|
|
||||||
// EnableMenuItem(menu, IDM_EXEC, MF_GRAYED);
|
|
||||||
// EnableMenuItem(menu, IDM_PAUSE, MF_ENABLED);
|
|
||||||
// NDS_UnPause();
|
|
||||||
// return 0;
|
|
||||||
case ACCEL_SPACEBAR:
|
case ACCEL_SPACEBAR:
|
||||||
case IDM_PAUSE:
|
case IDM_PAUSE:
|
||||||
if (emu_paused) NDS_UnPause();
|
if (emu_paused) NDS_UnPause();
|
||||||
else NDS_Pause();
|
else NDS_Pause();
|
||||||
emu_paused ^= 1;
|
emu_paused ^= 1;
|
||||||
CheckMenuItem(menu, IDM_PAUSE, emu_paused ? MF_CHECKED : MF_UNCHECKED);
|
CheckMenuItem(menu, IDM_PAUSE, emu_paused ? MF_CHECKED : MF_UNCHECKED);
|
||||||
// EnableMenuItem(menu, IDM_EXEC, MF_ENABLED);
|
return 0;
|
||||||
// EnableMenuItem(menu, IDM_PAUSE, MF_GRAYED);
|
|
||||||
|
case ACCEL_N: //Frame Advance
|
||||||
|
frameAdvance = true;
|
||||||
|
execute = TRUE;
|
||||||
|
emu_paused = 1;
|
||||||
|
CheckMenuItem(menu, IDM_PAUSE, emu_paused ? MF_CHECKED : MF_UNCHECKED);
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
case ID_VIEW_FRAMECOUNTER:
|
||||||
|
frameCounterDisplay ^= 1;
|
||||||
|
CheckMenuItem(menu, ID_VIEW_FRAMECOUNTER, frameCounterDisplay ? MF_CHECKED : MF_UNCHECKED);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#define saver(one,two,three,four,five, six) \
|
#define saver(one,two,three,four,five, six) \
|
||||||
|
@ -1638,6 +1655,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
|
||||||
|
|
||||||
case IDM_RESET:
|
case IDM_RESET:
|
||||||
NDS_Reset();
|
NDS_Reset();
|
||||||
|
frameCounter=0;
|
||||||
return 0;
|
return 0;
|
||||||
case IDM_CONFIG:
|
case IDM_CONFIG:
|
||||||
{
|
{
|
||||||
|
|
|
@ -285,14 +285,16 @@
|
||||||
#define IDM_ABOUT 40003
|
#define IDM_ABOUT 40003
|
||||||
#define ACCEL_P 40004
|
#define ACCEL_P 40004
|
||||||
#define ACCEL_SPACEBAR 40005
|
#define ACCEL_SPACEBAR 40005
|
||||||
|
#define ID_VIEW_DISPLAYFRAMECOUNTER 40006
|
||||||
#define ACCEL_N 40007
|
#define ACCEL_N 40007
|
||||||
|
#define ID_VIEW_FRAMECOUNTER 40009
|
||||||
|
|
||||||
// Next default values for new objects
|
// Next default values for new objects
|
||||||
//
|
//
|
||||||
#ifdef APSTUDIO_INVOKED
|
#ifdef APSTUDIO_INVOKED
|
||||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||||
#define _APS_NEXT_COMMAND_VALUE 40006
|
#define _APS_NEXT_COMMAND_VALUE 40008
|
||||||
#define _APS_NEXT_CONTROL_VALUE 1000
|
#define _APS_NEXT_CONTROL_VALUE 1000
|
||||||
#define _APS_NEXT_SYMED_VALUE 101
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -666,6 +666,8 @@ BEGIN
|
||||||
MENUITEM "4x", IDC_WINDOW4X
|
MENUITEM "4x", IDC_WINDOW4X
|
||||||
END
|
END
|
||||||
MENUITEM "&Force Maintain Ratio", IDC_FORCERATIO
|
MENUITEM "&Force Maintain Ratio", IDC_FORCERATIO
|
||||||
|
MENUITEM SEPARATOR
|
||||||
|
MENUITEM "Display Frame Counter", ID_VIEW_FRAMECOUNTER
|
||||||
END
|
END
|
||||||
POPUP "&Config"
|
POPUP "&Config"
|
||||||
BEGIN
|
BEGIN
|
||||||
|
|
Loading…
Reference in New Issue