found some more protector code to remove, and added back in pause when inactive toggle/function.

git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@863 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
squall-leonhart 2009-03-23 15:19:42 +00:00
parent b0682b232e
commit f84cb6009d
6 changed files with 15 additions and 15 deletions

View File

@ -155,6 +155,8 @@ BEGIN_MESSAGE_MAP(MainWnd, CWnd)
ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_DISABLESTATUSMESSAGES, OnUpdateOptionsEmulatorDisablestatusmessages) ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_DISABLESTATUSMESSAGES, OnUpdateOptionsEmulatorDisablestatusmessages)
ON_COMMAND(ID_OPTIONS_EMULATOR_SYNCHRONIZE, OnOptionsEmulatorSynchronize) ON_COMMAND(ID_OPTIONS_EMULATOR_SYNCHRONIZE, OnOptionsEmulatorSynchronize)
ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_SYNCHRONIZE, OnUpdateOptionsEmulatorSynchronize) ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_SYNCHRONIZE, OnUpdateOptionsEmulatorSynchronize)
ON_COMMAND(ID_OPTIONS_EMULATOR_PAUSEWHENINACTIVE, OnOptionsEmulatorPausewheninactive)
ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_PAUSEWHENINACTIVE, OnUpdateOptionsEmulatorPausewheninactive)
ON_COMMAND(ID_OPTIONS_EMULATOR_SPEEDUPTOGGLE, OnOptionsEmulatorSpeeduptoggle) ON_COMMAND(ID_OPTIONS_EMULATOR_SPEEDUPTOGGLE, OnOptionsEmulatorSpeeduptoggle)
ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_SPEEDUPTOGGLE, OnUpdateOptionsEmulatorSpeeduptoggle) ON_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_SPEEDUPTOGGLE, OnUpdateOptionsEmulatorSpeeduptoggle)
ON_COMMAND(ID_OPTIONS_EMULATOR_AUTOMATICALLYAPPLYPATCHFILES, OnOptionsEmulatorAutomaticallyApplyPatchFiles) ON_COMMAND(ID_OPTIONS_EMULATOR_AUTOMATICALLYAPPLYPATCHFILES, OnOptionsEmulatorAutomaticallyApplyPatchFiles)
@ -1154,10 +1156,13 @@ void MainWnd::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized)
} }
} else { } else {
theApp.wasPaused = true; theApp.wasPaused = true;
if(theApp.pauseWhenInactive) {
if(emulating) { if(emulating) {
soundPause(); soundPause();
} }
theApp.active = a; theApp.active = a;
}
theApp.active = a;
memset(theApp.delta,255,sizeof(theApp.delta)); memset(theApp.delta,255,sizeof(theApp.delta));
} }

View File

@ -158,6 +158,8 @@ protected:
afx_msg void OnUpdateOptionsEmulatorDisablestatusmessages(CCmdUI* pCmdUI); afx_msg void OnUpdateOptionsEmulatorDisablestatusmessages(CCmdUI* pCmdUI);
afx_msg void OnOptionsEmulatorSynchronize(); afx_msg void OnOptionsEmulatorSynchronize();
afx_msg void OnUpdateOptionsEmulatorSynchronize(CCmdUI* pCmdUI); afx_msg void OnUpdateOptionsEmulatorSynchronize(CCmdUI* pCmdUI);
afx_msg void OnOptionsEmulatorPausewheninactive();
afx_msg void OnUpdateOptionsEmulatorPausewheninactive(CCmdUI* pCmdUI);
afx_msg void OnOptionsEmulatorSpeeduptoggle(); afx_msg void OnOptionsEmulatorSpeeduptoggle();
afx_msg void OnUpdateOptionsEmulatorSpeeduptoggle(CCmdUI* pCmdUI); afx_msg void OnUpdateOptionsEmulatorSpeeduptoggle(CCmdUI* pCmdUI);
afx_msg void OnOptionsEmulatorAutomaticallyApplyPatchFiles(); afx_msg void OnOptionsEmulatorAutomaticallyApplyPatchFiles();

View File

@ -275,6 +275,7 @@ VBA::VBA()
iconic = false; iconic = false;
glFilter = 0; glFilter = 0;
regEnabled = false; regEnabled = false;
pauseWhenInactive = true;
speedupToggle = false; speedupToggle = false;
winGbPrinterEnabled = false; winGbPrinterEnabled = false;
threadPriority = 2; threadPriority = 2;
@ -2046,7 +2047,7 @@ bool VBA::updateRenderMethod(bool force)
Sm60FPS_Init(); Sm60FPS_Init();
if( !(this->*secondaryTrapPointer)( force ) ) { if( !updateRenderMethod0( force ) ) {
// fall back to safe configuration // fall back to safe configuration
renderMethod = DIRECT_3D; renderMethod = DIRECT_3D;
fsAdapter = 0; fsAdapter = 0;

View File

@ -58,9 +58,6 @@ enum AUDIO_API {
class AVIWrite; class AVIWrite;
class WavWriter; class WavWriter;
typedef DWORD (WINAPI* lpGetModuleFileNameA)(HINSTANCE, LPSTR, DWORD);
typedef VOID (WINAPI* lpExitProcess)(UINT);
class VBA : public CWinApp class VBA : public CWinApp
{ {
public: public:
@ -152,6 +149,7 @@ class VBA : public CWinApp
bool iconic; bool iconic;
int glFilter; int glFilter;
bool dinputKeyFocus; bool dinputKeyFocus;
bool pauseWhenInactive;
bool speedupToggle; bool speedupToggle;
bool winGbPrinterEnabled; bool winGbPrinterEnabled;
int threadPriority; int threadPriority;
@ -209,12 +207,6 @@ class VBA : public CWinApp
CString wndClass; CString wndClass;
lpGetModuleFileNameA pGetModuleFileNameA;
lpExitProcess pExitProcess;
int securityCheck;
int securityCheck2;
public: public:
VBA(); VBA();
~VBA(); ~VBA();
@ -260,8 +252,6 @@ class VBA : public CWinApp
void loadSettings(); void loadSettings();
void addRecentFile(CString file); void addRecentFile(CString file);
bool trap(bool);
private: private:
unsigned int detectCpuCores(); unsigned int detectCpuCores();
}; };

View File

@ -1860,6 +1860,7 @@ BEGIN
END END
MENUITEM "&Remove intros (GBA)", ID_OPTIONS_EMULATOR_REMOVEINTROSGBA MENUITEM "&Remove intros (GBA)", ID_OPTIONS_EMULATOR_REMOVEINTROSGBA
MENUITEM "Auto-apply IPS/UPS/PPF", ID_OPTIONS_EMULATOR_AUTOMATICALLYAPPLYPATCHFILES MENUITEM "Auto-apply IPS/UPS/PPF", ID_OPTIONS_EMULATOR_AUTOMATICALLYAPPLYPATCHFILES
MENUITEM "Pause when inactive", ID_OPTIONS_EMULATOR_PAUSEWHENINACTIVE
MENUITEM "AGB Print", ID_OPTIONS_EMULATOR_AGBPRINT MENUITEM "AGB Print", ID_OPTIONS_EMULATOR_AGBPRINT
MENUITEM "Real Time Clock", ID_OPTIONS_EMULATOR_REALTIMECLOCK MENUITEM "Real Time Clock", ID_OPTIONS_EMULATOR_REALTIMECLOCK
MENUITEM "&Game Overrides...", ID_OPTIONS_EMULATOR_GAMEOVERRIDES MENUITEM "&Game Overrides...", ID_OPTIONS_EMULATOR_GAMEOVERRIDES

View File

@ -674,6 +674,7 @@
#define ID_FILE_EXPORT_BATTERYFILE 40118 #define ID_FILE_EXPORT_BATTERYFILE 40118
#define ID_OPTIONS_FILTER16BIT_PIXELATEEXPERIMENTAL 40121 #define ID_OPTIONS_FILTER16BIT_PIXELATEEXPERIMENTAL 40121
#define ID_OPTIONS_FILTER16BIT_MOTIONBLUREXPERIMENTAL 40122 #define ID_OPTIONS_FILTER16BIT_MOTIONBLUREXPERIMENTAL 40122
#define ID_OPTIONS_EMULATOR_PAUSEWHENINACTIVE 40124
#define ID_OPTIONS_SOUND_STARTRECORDING 40125 #define ID_OPTIONS_SOUND_STARTRECORDING 40125
#define ID_OPTIONS_SOUND_STOPRECORDING 40126 #define ID_OPTIONS_SOUND_STOPRECORDING 40126
#define ID_OPTIONS_VIDEO_LAYERS_BG0 40127 #define ID_OPTIONS_VIDEO_LAYERS_BG0 40127