diff options
| author | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2009-11-04 09:20:55 +0000 |
|---|---|---|
| committer | SND\weimingzhi_cp <SND\weimingzhi_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2009-11-04 09:20:55 +0000 |
| commit | 51e9552e84921787933266157e3eeac6a4bd99ed (patch) | |
| tree | 1bc54a5d5dbb31f134f172043f4ba63840ad1614 | |
| parent | b3f057b0193080489af70c2c39f867177280c7bf (diff) | |
| download | pcsxr-51e9552e84921787933266157e3eeac6a4bd99ed.tar.gz | |
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@35429 e17a0e51-4ae3-4d35-97c3-1a29b211df97
| -rw-r--r-- | ChangeLog | 1 | ||||
| -rw-r--r-- | macosx/Pcsx.xcodeproj/project.pbxproj | 2 | ||||
| -rw-r--r-- | macosx/PcsxController.m | 8 | ||||
| -rw-r--r-- | macosx/main.m | 51 |
4 files changed, 28 insertions, 34 deletions
@@ -9,6 +9,7 @@ November 4, 2009 Wei Mingzhi <weimingzhi@gmail.com> * macosx/English.lproj/PCSX.nib/objects.nib: Likewise. * macosx/English.lproj/PCSX.nib/info.nib: Likewise. * macosx/English.lproj/PCSX.nib/classes.nib: Likewise. + * macosx/main.m: Reload plugins at each time emulation starts. November 3, 2009 Wei Mingzhi <weimingzhi@gmail.com> diff --git a/macosx/Pcsx.xcodeproj/project.pbxproj b/macosx/Pcsx.xcodeproj/project.pbxproj index 5d282123..71dd2a2a 100644 --- a/macosx/Pcsx.xcodeproj/project.pbxproj +++ b/macosx/Pcsx.xcodeproj/project.pbxproj @@ -139,7 +139,7 @@ 2BA44360052DB2EA00E21DDD /* PcsxPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PcsxPlugin.h; sourceTree = "<group>"; }; 2BA44361052DB2EA00E21DDD /* PcsxPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = PcsxPlugin.m; sourceTree = "<group>"; tabWidth = 4; usesTabs = 0; }; 2BB3D6CF05427FE200831ACB /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Info.plist; sourceTree = "<group>"; }; - 2BB3D6D105427FE200831ACB /* PCSX.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PCSX.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 2BB3D6D105427FE200831ACB /* PCSX.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = PCSX.app; sourceTree = BUILT_PRODUCTS_DIR; }; 2BBB1126051DC00500B84448 /* PluginList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginList.h; sourceTree = "<group>"; }; 2BBB1127051DC00500B84448 /* PluginList.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PluginList.m; sourceTree = "<group>"; }; 2BBB1787051E0D9700B84448 /* English */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = English; path = Credits.rtf; sourceTree = "<group>"; }; diff --git a/macosx/PcsxController.m b/macosx/PcsxController.m index a7e5f313..f6dbc124 100644 --- a/macosx/PcsxController.m +++ b/macosx/PcsxController.m @@ -154,11 +154,11 @@ NSString *saveStatePath; [menuItem setState:([EmuThread isPaused] ? NSOnState : NSOffState)]; } - if ([menuItem action] == @selector(pause:) || [menuItem action] == @selector(freeze:) || - [menuItem action] == @selector(fullscreen:)) + if ([menuItem action] == @selector(pause:) || [menuItem action] == @selector(fullscreen:)) return [EmuThread active]; - if ([menuItem action] == @selector(reset:) || [menuItem action] == @selector(ejectCD:)) + if ([menuItem action] == @selector(reset:) || [menuItem action] == @selector(ejectCD:) || + [menuItem action] == @selector(freeze:)) return [EmuThread active] && ![EmuThread isRunBios]; if ([menuItem action] == @selector(runCD:) || [menuItem action] == @selector(runIso:) || @@ -174,7 +174,7 @@ NSString *saveStatePath; } if ([menuItem action] == @selector(defrost:)) { - if (![EmuThread active]) + if (![EmuThread active] || [EmuThread isRunBios]) return NO; NSString *path = [NSString stringWithFormat:@"%@/%s-%3.3d.pcsxstate", saveStatePath, CdromId, [menuItem tag]]; diff --git a/macosx/main.m b/macosx/main.m index fd3a9959..d6d8267c 100644 --- a/macosx/main.m +++ b/macosx/main.m @@ -14,8 +14,7 @@ #include "psxcommon.h" #include "sio.h" -int sysInited = 0; - +static BOOL sysInited = NO; //#define EMU_LOG int main(int argc, const char *argv[]) @@ -50,40 +49,35 @@ int main(int argc, const char *argv[]) } -int SysInit() -{ - if (sysInited) - return 0; - +int SysInit() { + if (!sysInited) { #ifdef GTE_DUMP - gteLog = fopen("gteLog.txt","wb"); - setvbuf(gteLog, NULL, _IONBF, 0); + gteLog = fopen("gteLog.txt","wb"); + setvbuf(gteLog, NULL, _IONBF, 0); #endif #ifdef EMU_LOG #ifndef LOG_STDOUT - emuLog = fopen("emuLog.txt","wb"); + emuLog = fopen("emuLog.txt","wb"); #else - emuLog = stdout; + emuLog = stdout; #endif - setvbuf(emuLog, NULL, _IONBF, 0); + setvbuf(emuLog, NULL, _IONBF, 0); #endif - if (psxInit() != 0) - return -1; - - while (LoadPlugins() == -1) { + if (psxInit() != 0) return -1; - //CancelQuit = 1; - //ConfigurePlugins(); - //CancelQuit = 0; - } - LoadMcds(Config.Mcd1, Config.Mcd2); - - sysInited = 1; - - return 0; + sysInited = YES; + } + + if (LoadPlugins() == -1) { + return -1; + } + + LoadMcds(Config.Mcd1, Config.Mcd2); + + return 0; } void SysReset() { @@ -91,8 +85,7 @@ void SysReset() { //psxReset(); } -void SysPrintf(char *fmt, ...) -{ +void SysPrintf(char *fmt, ...) { va_list list; char msg[512]; @@ -238,8 +231,8 @@ void SysClose() // Close mem and plugins ReleasePlugins(); if (emuLog != NULL) fclose(emuLog); - - sysInited = false; + + sysInited = NO; } void OnFile_Exit() |
