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

This commit is contained in:
squall-leonhart 2009-03-23 15:19:42 +00:00
parent 3a4bc53645
commit c60b3f4e44
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_COMMAND(ID_OPTIONS_EMULATOR_SYNCHRONIZE, OnOptionsEmulatorSynchronize)
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_UPDATE_COMMAND_UI(ID_OPTIONS_EMULATOR_SPEEDUPTOGGLE, OnUpdateOptionsEmulatorSpeeduptoggle)
ON_COMMAND(ID_OPTIONS_EMULATOR_AUTOMATICALLYAPPLYPATCHFILES, OnOptionsEmulatorAutomaticallyApplyPatchFiles)
@ -1154,10 +1156,13 @@ void MainWnd::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized)
}
} else {
theApp.wasPaused = true;
if(theApp.pauseWhenInactive) {
if(emulating) {
soundPause();
}
theApp.active = a;
}
theApp.active = a;
memset(theApp.delta,255,sizeof(theApp.delta));
}

View File

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

View File

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

View File

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

View File

@ -1860,6 +1860,7 @@ BEGIN
END
MENUITEM "&Remove intros (GBA)", ID_OPTIONS_EMULATOR_REMOVEINTROSGBA
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 "Real Time Clock", ID_OPTIONS_EMULATOR_REALTIMECLOCK
MENUITEM "&Game Overrides...", ID_OPTIONS_EMULATOR_GAMEOVERRIDES

View File

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