mirror of https://github.com/snes9xgit/snes9x.git
Change debugger's log folder to LOG_DIR. / Mac: Add frame advance, change the timing of .srm save.
This commit is contained in:
parent
7c6a0f58d1
commit
bd1c44b8e6
|
@ -600,6 +600,9 @@ void S9xAPUTimingSetSpeedup (int ticks)
|
||||||
|
|
||||||
void S9xAPUAllowTimeOverflow (bool allow)
|
void S9xAPUAllowTimeOverflow (bool allow)
|
||||||
{
|
{
|
||||||
|
if (allow)
|
||||||
|
printf("APU time overflow allowed\n");
|
||||||
|
|
||||||
spc_core->spc_allow_time_overflow(allow);
|
spc_core->spc_allow_time_overflow(allow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3509,7 +3509,7 @@ static void Op42 (void)
|
||||||
S9xMessage(S9X_DEBUG, S9X_DEBUG_OUTPUT, buf);
|
S9xMessage(S9X_DEBUG, S9X_DEBUG_OUTPUT, buf);
|
||||||
if (trace != NULL)
|
if (trace != NULL)
|
||||||
fclose(trace);
|
fclose(trace);
|
||||||
ENSURE_TRACE_OPEN(trace,"WDMtrace.log","ab")
|
ENSURE_TRACE_OPEN(trace, "WDMtrace.log", "ab")
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1532,7 +1532,7 @@ static void debug_process_command (char *Line)
|
||||||
if (SA1.Flags & TRACE_FLAG)
|
if (SA1.Flags & TRACE_FLAG)
|
||||||
{
|
{
|
||||||
printf("SA1 CPU instruction tracing enabled.\n");
|
printf("SA1 CPU instruction tracing enabled.\n");
|
||||||
ENSURE_TRACE_OPEN(trace2,"trace_sa1.log","wb")
|
ENSURE_TRACE_OPEN(trace2, "trace_sa1.log", "wb")
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1548,7 +1548,7 @@ static void debug_process_command (char *Line)
|
||||||
if (CPU.Flags & TRACE_FLAG)
|
if (CPU.Flags & TRACE_FLAG)
|
||||||
{
|
{
|
||||||
printf("CPU instruction tracing enabled.\n");
|
printf("CPU instruction tracing enabled.\n");
|
||||||
ENSURE_TRACE_OPEN(trace,"trace.log","wb")
|
ENSURE_TRACE_OPEN(trace, "trace.log", "wb")
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2578,7 +2578,7 @@ void S9xTrace (void)
|
||||||
{
|
{
|
||||||
char msg[512];
|
char msg[512];
|
||||||
|
|
||||||
ENSURE_TRACE_OPEN(trace,"trace.log","a")
|
ENSURE_TRACE_OPEN(trace, "trace.log", "a")
|
||||||
|
|
||||||
debug_cpu_op_print(msg, Registers.PB, Registers.PCw);
|
debug_cpu_op_print(msg, Registers.PB, Registers.PCw);
|
||||||
fprintf(trace, "%s\n", msg);
|
fprintf(trace, "%s\n", msg);
|
||||||
|
@ -2588,7 +2588,7 @@ void S9xSA1Trace (void)
|
||||||
{
|
{
|
||||||
char msg[512];
|
char msg[512];
|
||||||
|
|
||||||
ENSURE_TRACE_OPEN(trace2,"trace_sa1.log","a")
|
ENSURE_TRACE_OPEN(trace2, "trace_sa1.log", "a")
|
||||||
|
|
||||||
debug_sa1_op_print(msg, SA1Registers.PB, SA1Registers.PCw);
|
debug_sa1_op_print(msg, SA1Registers.PB, SA1Registers.PCw);
|
||||||
fprintf(trace2, "%s\n", msg);
|
fprintf(trace2, "%s\n", msg);
|
||||||
|
|
9
debug.h
9
debug.h
|
@ -189,8 +189,13 @@ struct SBreakPoint
|
||||||
uint16 Address;
|
uint16 Address;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define ENSURE_TRACE_OPEN(fp,file,mode) \
|
#define ENSURE_TRACE_OPEN(fp, file, mode) \
|
||||||
if(!fp) {std::string fn=S9xGetDirectory(DEFAULT_DIR);fn+=SLASH_STR file;fp=fopen(fn.c_str(),mode);}
|
if (!fp) \
|
||||||
|
{ \
|
||||||
|
std::string fn = S9xGetDirectory(LOG_DIR); \
|
||||||
|
fn += SLASH_STR file; \
|
||||||
|
fp = fopen(fn.c_str(), mode); \
|
||||||
|
}
|
||||||
|
|
||||||
extern struct SBreakPoint S9xBreakpoint[6];
|
extern struct SBreakPoint S9xBreakpoint[6];
|
||||||
|
|
||||||
|
|
|
@ -30,8 +30,10 @@
|
||||||
"NPConnecting" = "Connecting";
|
"NPConnecting" = "Connecting";
|
||||||
"NPServerName" = "Server";
|
"NPServerName" = "Server";
|
||||||
|
|
||||||
"AlertMes_03" = "The folders for saving files could not be created.";
|
"AlertMes_01" = "The folder for saving files is not found.";
|
||||||
"AlertMes_04" = "Some features will not work properly without these folders.";
|
"AlertMes_02" = "Application Support folder will be used instead.";
|
||||||
|
"AlertMes_03" = "The folder for saving files is not writable.";
|
||||||
|
"AlertMes_04" = "Application Support folder will be used instead.";
|
||||||
"AlertMes_05" = "This ROM image has bad checksum, so might not work properly.";
|
"AlertMes_05" = "This ROM image has bad checksum, so might not work properly.";
|
||||||
"AlertMes_06" = "Or failed to detect map / interleave.";
|
"AlertMes_06" = "Or failed to detect map / interleave.";
|
||||||
"AlertMes_07" = "No enough space in Cheat Entry.";
|
"AlertMes_07" = "No enough space in Cheat Entry.";
|
||||||
|
|
|
@ -1278,7 +1278,7 @@ static void CheatFinderHandleAddEntryButton (WindowData *cf)
|
||||||
PlayAlertSound();
|
PlayAlertSound();
|
||||||
else
|
else
|
||||||
if (Cheat.num_cheats + cfViewNumBytes > MAX_CHEATS)
|
if (Cheat.num_cheats + cfViewNumBytes > MAX_CHEATS)
|
||||||
AppearanceAlert(kAlertCautionAlert, kCFCantAddWarning, kCFCantAddHint);
|
AppearanceAlert(kAlertCautionAlert, kS9xMacAlertCFCantAddEntry, kS9xMacAlertCFCantAddEntryHint);
|
||||||
else
|
else
|
||||||
CheatFinderBeginAddEntrySheet(cf);
|
CheatFinderBeginAddEntrySheet(cf);
|
||||||
}
|
}
|
||||||
|
|
|
@ -922,11 +922,10 @@ static bool8 NPClientBeginOpenROMImage (WindowRef window)
|
||||||
|
|
||||||
static bool8 NPClientEndOpenROMImage (void)
|
static bool8 NPClientEndOpenROMImage (void)
|
||||||
{
|
{
|
||||||
OSStatus err;
|
OSStatus err;
|
||||||
FSCatalogInfo info;
|
FSRef cartRef;
|
||||||
FSRef cartRef;
|
char filename[PATH_MAX + 1];
|
||||||
char filename[PATH_MAX + 1];
|
bool8 r;
|
||||||
bool8 r;
|
|
||||||
|
|
||||||
r = NavEndOpenROMImageSheet(&cartRef);
|
r = NavEndOpenROMImageSheet(&cartRef);
|
||||||
if (!r)
|
if (!r)
|
||||||
|
@ -935,8 +934,7 @@ static bool8 NPClientEndOpenROMImage (void)
|
||||||
return (false);
|
return (false);
|
||||||
}
|
}
|
||||||
|
|
||||||
err = FSGetCatalogInfo(&cartRef, kFSCatInfoVolume, &info, NULL, NULL, NULL);
|
CheckSaveFolder(&cartRef);
|
||||||
lockedROMMedia = IsLockedMedia(info.volume);
|
|
||||||
|
|
||||||
Settings.ForceLoROM = (romDetect == kLoROMForce );
|
Settings.ForceLoROM = (romDetect == kLoROMForce );
|
||||||
Settings.ForceHiROM = (romDetect == kHiROMForce );
|
Settings.ForceHiROM = (romDetect == kHiROMForce );
|
||||||
|
|
|
@ -193,14 +193,16 @@
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
kFolderFail = 3,
|
kS9xMacAlertFolderNotFound = 1,
|
||||||
kFolderHint,
|
kS9xMacAlertFolderNotFoundHint,
|
||||||
kBadRomWarning,
|
kS9xMacAlertFolderFailToCreate,
|
||||||
kBadRomHint,
|
kS9xMacAlertFolderFailToCreateHint,
|
||||||
kCFCantAddWarning,
|
kS9xMacAlertkBadRom,
|
||||||
kCFCantAddHint,
|
kS9xMacAlertkBadRomHint,
|
||||||
kRequiredSystemWarning,
|
kS9xMacAlertCFCantAddEntry,
|
||||||
kRequiredSystemHint
|
kS9xMacAlertCFCantAddEntryHint,
|
||||||
|
kS9xMacAlertRequiredSystem,
|
||||||
|
kS9xMacAlertRequiredSystemHint
|
||||||
};
|
};
|
||||||
|
|
||||||
extern int autofireLastTabIndex;
|
extern int autofireLastTabIndex;
|
||||||
|
|
|
@ -207,6 +207,78 @@ static OSStatus FindApplicationSupportFolder (FSRef *, char *, const char *);
|
||||||
static OSStatus FindCustomFolder (FSRef *, char *, const char *);
|
static OSStatus FindCustomFolder (FSRef *, char *, const char *);
|
||||||
|
|
||||||
|
|
||||||
|
void CheckSaveFolder (FSRef *cartRef)
|
||||||
|
{
|
||||||
|
OSStatus err;
|
||||||
|
Boolean r;
|
||||||
|
FSCatalogInfo finfo;
|
||||||
|
FSVolumeInfo vinfo;
|
||||||
|
FSRef ref;
|
||||||
|
CFURLRef burl, purl;
|
||||||
|
char s[PATH_MAX + 1];
|
||||||
|
|
||||||
|
switch (saveInROMFolder)
|
||||||
|
{
|
||||||
|
case 0: // Snes9x folder
|
||||||
|
burl = CFBundleCopyBundleURL(CFBundleGetMainBundle());
|
||||||
|
purl = CFURLCreateCopyDeletingLastPathComponent(kCFAllocatorDefault, burl);
|
||||||
|
r = CFURLGetFSRef(purl, &ref);
|
||||||
|
CFRelease(purl);
|
||||||
|
CFRelease(burl);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 1: // ROM folder
|
||||||
|
err = FSGetCatalogInfo(cartRef, kFSCatInfoNone, NULL, NULL, NULL, &ref);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 2: // Application Support folder
|
||||||
|
return;
|
||||||
|
|
||||||
|
case 4: // Custom folder
|
||||||
|
if (saveFolderPath == NULL)
|
||||||
|
{
|
||||||
|
saveInROMFolder = 2;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
r = CFStringGetCString(saveFolderPath, s, PATH_MAX, kCFStringEncodingUTF8);
|
||||||
|
err = FSPathMakeRef((unsigned char *) s, &ref, NULL);
|
||||||
|
if (err)
|
||||||
|
{
|
||||||
|
AppearanceAlert(kAlertCautionAlert, kS9xMacAlertFolderNotFound, kS9xMacAlertFolderNotFoundHint);
|
||||||
|
saveInROMFolder = 2;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
err = FSGetCatalogInfo(&ref, kFSCatInfoUserPrivs | kFSCatInfoVolume, &finfo, NULL, NULL, NULL);
|
||||||
|
if (err == noErr)
|
||||||
|
{
|
||||||
|
if (finfo.userPrivileges & kioACUserNoMakeChangesMask)
|
||||||
|
{
|
||||||
|
AppearanceAlert(kAlertCautionAlert, kS9xMacAlertFolderFailToCreate, kS9xMacAlertFolderFailToCreateHint);
|
||||||
|
saveInROMFolder = 2;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
err = FSGetVolumeInfo(finfo.volume, 0, NULL, kFSVolInfoFlags, &vinfo, NULL, NULL);
|
||||||
|
if (err == noErr)
|
||||||
|
{
|
||||||
|
if ((vinfo.flags & kFSVolFlagHardwareLockedMask) || (vinfo.flags & kFSVolFlagSoftwareLockedMask))
|
||||||
|
{
|
||||||
|
AppearanceAlert(kAlertCautionAlert, kS9xMacAlertFolderFailToCreate, kS9xMacAlertFolderFailToCreateHint);
|
||||||
|
saveInROMFolder = 2;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (err)
|
||||||
|
saveInROMFolder = 2;
|
||||||
|
}
|
||||||
|
|
||||||
static OSStatus FindSNESFolder (FSRef *folderRef, char *folderPath, const char *folderName)
|
static OSStatus FindSNESFolder (FSRef *folderRef, char *folderPath, const char *folderName)
|
||||||
{
|
{
|
||||||
OSStatus err;
|
OSStatus err;
|
||||||
|
@ -231,15 +303,7 @@ static OSStatus FindSNESFolder (FSRef *folderRef, char *folderPath, const char *
|
||||||
AddFolderIcon(folderRef, folderName);
|
AddFolderIcon(folderRef, folderName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err)
|
if (err == noErr)
|
||||||
{
|
|
||||||
if (!folderWarning)
|
|
||||||
{
|
|
||||||
AppearanceAlert(kAlertCautionAlert, kFolderFail, kFolderHint);
|
|
||||||
folderWarning = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
err = FSRefMakePath(folderRef, (unsigned char *) folderPath, PATH_MAX);
|
err = FSRefMakePath(folderRef, (unsigned char *) folderPath, PATH_MAX);
|
||||||
|
|
||||||
CFRelease(purl);
|
CFRelease(purl);
|
||||||
|
@ -284,15 +348,7 @@ static OSStatus FindApplicationSupportFolder (FSRef *folderRef, char *folderPath
|
||||||
AddFolderIcon(folderRef, folderName);
|
AddFolderIcon(folderRef, folderName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err)
|
if (err == noErr)
|
||||||
{
|
|
||||||
if (!folderWarning)
|
|
||||||
{
|
|
||||||
AppearanceAlert(kAlertCautionAlert, kFolderFail, kFolderHint);
|
|
||||||
folderWarning = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
err = FSRefMakePath(folderRef, (unsigned char *) folderPath, PATH_MAX);
|
err = FSRefMakePath(folderRef, (unsigned char *) folderPath, PATH_MAX);
|
||||||
|
|
||||||
CFRelease(fstr);
|
CFRelease(fstr);
|
||||||
|
@ -308,6 +364,9 @@ static OSStatus FindCustomFolder (FSRef *folderRef, char *folderPath, const char
|
||||||
UniChar buffer[PATH_MAX + 1];
|
UniChar buffer[PATH_MAX + 1];
|
||||||
char s[PATH_MAX + 1];
|
char s[PATH_MAX + 1];
|
||||||
|
|
||||||
|
if (saveFolderPath == NULL)
|
||||||
|
return (-1);
|
||||||
|
|
||||||
err = CFStringGetCString(saveFolderPath, s, PATH_MAX, kCFStringEncodingUTF8) ? noErr : -1;
|
err = CFStringGetCString(saveFolderPath, s, PATH_MAX, kCFStringEncodingUTF8) ? noErr : -1;
|
||||||
if (err == noErr)
|
if (err == noErr)
|
||||||
err = FSPathMakeRef((unsigned char *) s, &pref, NULL);
|
err = FSPathMakeRef((unsigned char *) s, &pref, NULL);
|
||||||
|
@ -326,15 +385,7 @@ static OSStatus FindCustomFolder (FSRef *folderRef, char *folderPath, const char
|
||||||
AddFolderIcon(folderRef, folderName);
|
AddFolderIcon(folderRef, folderName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err)
|
if (err == noErr)
|
||||||
{
|
|
||||||
if (!folderWarning)
|
|
||||||
{
|
|
||||||
AppearanceAlert(kAlertCautionAlert, kFolderFail, kFolderHint);
|
|
||||||
folderWarning = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
err = FSRefMakePath(folderRef, (unsigned char *) folderPath, PATH_MAX);
|
err = FSRefMakePath(folderRef, (unsigned char *) folderPath, PATH_MAX);
|
||||||
|
|
||||||
CFRelease(fstr);
|
CFRelease(fstr);
|
||||||
|
@ -437,21 +488,6 @@ static void AddFolderIcon (FSRef *fref, const char *folderName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Boolean IsLockedMedia (FSVolumeRefNum volume)
|
|
||||||
{
|
|
||||||
OSStatus err;
|
|
||||||
FSVolumeInfo info;
|
|
||||||
|
|
||||||
err = FSGetVolumeInfo(volume, 0, NULL, kFSVolInfoFlags, &info, NULL, NULL);
|
|
||||||
if (err == noErr)
|
|
||||||
{
|
|
||||||
if ((info.flags & kFSVolFlagHardwareLockedMask) || (info.flags & kFSVolFlagSoftwareLockedMask))
|
|
||||||
return (true);
|
|
||||||
}
|
|
||||||
|
|
||||||
return (false);
|
|
||||||
}
|
|
||||||
|
|
||||||
const char * S9xGetFilename (const char *inExt, enum s9x_getdirtype dirtype)
|
const char * S9xGetFilename (const char *inExt, enum s9x_getdirtype dirtype)
|
||||||
{
|
{
|
||||||
static int index = 0;
|
static int index = 0;
|
||||||
|
@ -506,6 +542,7 @@ const char * S9xGetFilename (const char *inExt, enum s9x_getdirtype dirtype)
|
||||||
|
|
||||||
case '.dat':
|
case '.dat':
|
||||||
case '.out':
|
case '.out':
|
||||||
|
case '.log':
|
||||||
strcpy(folderName, "Logs");
|
strcpy(folderName, "Logs");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -514,18 +551,29 @@ const char * S9xGetFilename (const char *inExt, enum s9x_getdirtype dirtype)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (folderName[0] && ((saveInROMFolder != 1) || lockedROMMedia))
|
if (folderName[0] && (saveInROMFolder != 1))
|
||||||
{
|
{
|
||||||
char s[PATH_MAX + 1];
|
char s[PATH_MAX + 1];
|
||||||
|
|
||||||
s[0] = 0;
|
s[0] = 0;
|
||||||
|
err = -1;
|
||||||
|
|
||||||
if (saveInROMFolder == 0)
|
if (saveInROMFolder == 0)
|
||||||
|
{
|
||||||
err = FindSNESFolder(&ref, s, folderName);
|
err = FindSNESFolder(&ref, s, folderName);
|
||||||
else
|
if (err)
|
||||||
if (saveFolderPath && (saveInROMFolder == 4))
|
saveInROMFolder = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (saveInROMFolder == 4)
|
||||||
|
{
|
||||||
err = FindCustomFolder(&ref, s, folderName);
|
err = FindCustomFolder(&ref, s, folderName);
|
||||||
else
|
if (err)
|
||||||
|
saveInROMFolder = 2;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (saveInROMFolder == 2)
|
||||||
err = FindApplicationSupportFolder(&ref, s, folderName);
|
err = FindApplicationSupportFolder(&ref, s, folderName);
|
||||||
|
|
||||||
if (err == noErr)
|
if (err == noErr)
|
||||||
|
@ -675,6 +723,7 @@ const char * S9xGetDirectory (enum s9x_getdirtype dirtype)
|
||||||
case SPC_DIR: strcpy(inExt, ".spc"); break;
|
case SPC_DIR: strcpy(inExt, ".spc"); break;
|
||||||
case CHEAT_DIR: strcpy(inExt, ".cht"); break;
|
case CHEAT_DIR: strcpy(inExt, ".cht"); break;
|
||||||
case BIOS_DIR: strcpy(inExt, ".bio"); break;
|
case BIOS_DIR: strcpy(inExt, ".bio"); break;
|
||||||
|
case LOG_DIR: strcpy(inExt, ".log"); break;
|
||||||
default: strcpy(inExt, ".xxx"); break;
|
default: strcpy(inExt, ".xxx"); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -191,8 +191,8 @@
|
||||||
#ifndef _mac_file_h_
|
#ifndef _mac_file_h_
|
||||||
#define _mac_file_h_
|
#define _mac_file_h_
|
||||||
|
|
||||||
|
void CheckSaveFolder (FSRef *);
|
||||||
void ChangeTypeAndCreator (const char *, OSType, OSType);
|
void ChangeTypeAndCreator (const char *, OSType, OSType);
|
||||||
Boolean IsLockedMedia (FSVolumeRefNum);
|
|
||||||
const char * S9xGetSPCFilename (void);
|
const char * S9xGetSPCFilename (void);
|
||||||
const char * S9xGetPNGFilename (void);
|
const char * S9xGetPNGFilename (void);
|
||||||
const char * S9xGetFreezeFilename (int);
|
const char * S9xGetFreezeFilename (int);
|
||||||
|
|
|
@ -296,7 +296,7 @@ extern int64 lastFrame;
|
||||||
extern unsigned long spcFileCount, pngFileCount;
|
extern unsigned long spcFileCount, pngFileCount;
|
||||||
extern SInt32 systemVersion;
|
extern SInt32 systemVersion;
|
||||||
extern bool8 finished, cartOpen,
|
extern bool8 finished, cartOpen,
|
||||||
autofire, hidExist, folderWarning, lockedROMMedia, directDisplay;
|
autofire, hidExist, directDisplay;
|
||||||
extern bool8 fullscreen, autoRes,
|
extern bool8 fullscreen, autoRes,
|
||||||
glstretch, gl32bit, vsync, drawoverscan, lastoverscan, screencurvature,
|
glstretch, gl32bit, vsync, drawoverscan, lastoverscan, screencurvature,
|
||||||
multiprocessor, ciFilterEnable;
|
multiprocessor, ciFilterEnable;
|
||||||
|
|
|
@ -195,6 +195,7 @@
|
||||||
#import "crosshairs.h"
|
#import "crosshairs.h"
|
||||||
#import "cheats.h"
|
#import "cheats.h"
|
||||||
#import "movie.h"
|
#import "movie.h"
|
||||||
|
#import "snapshot.h"
|
||||||
#import "display.h"
|
#import "display.h"
|
||||||
#import "blit.h"
|
#import "blit.h"
|
||||||
|
|
||||||
|
@ -280,8 +281,6 @@ bool8 finished = false,
|
||||||
cartOpen = false,
|
cartOpen = false,
|
||||||
autofire = false,
|
autofire = false,
|
||||||
hidExist = true,
|
hidExist = true,
|
||||||
folderWarning = false,
|
|
||||||
lockedROMMedia = false,
|
|
||||||
directDisplay = false;
|
directDisplay = false;
|
||||||
|
|
||||||
bool8 fullscreen = false,
|
bool8 fullscreen = false,
|
||||||
|
@ -433,7 +432,9 @@ enum
|
||||||
kmCtrKey = 0x3B,
|
kmCtrKey = 0x3B,
|
||||||
kmMinusKey = 0x1B,
|
kmMinusKey = 0x1B,
|
||||||
kmQKey = 0x0C,
|
kmQKey = 0x0C,
|
||||||
kmWKey = 0x0D
|
kmWKey = 0x0D,
|
||||||
|
kmOKey = 0x1F,
|
||||||
|
kmPKey = 0x23
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ButtonCommand
|
struct ButtonCommand
|
||||||
|
@ -453,6 +454,9 @@ struct GameViewInfo
|
||||||
|
|
||||||
static volatile bool8 rejectinput = false;
|
static volatile bool8 rejectinput = false;
|
||||||
|
|
||||||
|
static bool8 pauseEmulation = false,
|
||||||
|
frameAdvance = false;
|
||||||
|
|
||||||
static pthread_t s9xthread;
|
static pthread_t s9xthread;
|
||||||
|
|
||||||
static MenuRef recentMenu;
|
static MenuRef recentMenu;
|
||||||
|
@ -493,7 +497,9 @@ static ButtonCommand btncmd[] =
|
||||||
{ "_mac1", km0Key, false },
|
{ "_mac1", km0Key, false },
|
||||||
{ "_mac2", kmMinusKey, false },
|
{ "_mac2", kmMinusKey, false },
|
||||||
{ "_mac3", kmQKey, false },
|
{ "_mac3", kmQKey, false },
|
||||||
{ "_mac4", kmWKey, false }
|
{ "_mac4", kmWKey, false },
|
||||||
|
{ "_mac5", kmOKey, false },
|
||||||
|
{ "_mac6", kmPKey, false }
|
||||||
};
|
};
|
||||||
|
|
||||||
#define kCommandListSize (sizeof(btncmd) / sizeof(btncmd[0]))
|
#define kCommandListSize (sizeof(btncmd) / sizeof(btncmd[0]))
|
||||||
|
@ -598,6 +604,13 @@ int main (int argc, char **argv)
|
||||||
|
|
||||||
pthread_join(s9xthread, NULL);
|
pthread_join(s9xthread, NULL);
|
||||||
|
|
||||||
|
if (!Settings.NetPlay || Settings.NetPlayServer)
|
||||||
|
{
|
||||||
|
SNES9X_SaveSRAM();
|
||||||
|
S9xResetSaveTimer(false);
|
||||||
|
S9xSaveCheatFile(S9xGetFilename(".cht", CHEAT_DIR));
|
||||||
|
}
|
||||||
|
|
||||||
S9xDeinitDisplay();
|
S9xDeinitDisplay();
|
||||||
|
|
||||||
if (Settings.NetPlay)
|
if (Settings.NetPlay)
|
||||||
|
@ -657,6 +670,10 @@ static void * MacSnes9xThread (void *)
|
||||||
static inline void EmulationLoop (void)
|
static inline void EmulationLoop (void)
|
||||||
{
|
{
|
||||||
bool8 olddisplayframerate = false;
|
bool8 olddisplayframerate = false;
|
||||||
|
int storedMacFrameSkip = macFrameSkip;
|
||||||
|
|
||||||
|
pauseEmulation = false;
|
||||||
|
frameAdvance = false;
|
||||||
|
|
||||||
if (macQTRecord)
|
if (macQTRecord)
|
||||||
{
|
{
|
||||||
|
@ -704,7 +721,22 @@ static inline void EmulationLoop (void)
|
||||||
while (running)
|
while (running)
|
||||||
{
|
{
|
||||||
ProcessInput();
|
ProcessInput();
|
||||||
S9xMainLoop();
|
|
||||||
|
if (!pauseEmulation)
|
||||||
|
S9xMainLoop();
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (frameAdvance)
|
||||||
|
{
|
||||||
|
macFrameSkip = 1;
|
||||||
|
skipFrames = 1;
|
||||||
|
frameAdvance = false;
|
||||||
|
S9xMainLoop();
|
||||||
|
macFrameSkip = storedMacFrameSkip;
|
||||||
|
}
|
||||||
|
|
||||||
|
usleep(Settings.FrameTime);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2767,6 +2799,14 @@ static void ProcessInput (void)
|
||||||
sprintf(msg, "Emulation Speed: 100/%d", macFrameAdvanceRate / 10000);
|
sprintf(msg, "Emulation Speed: 100/%d", macFrameAdvanceRate / 10000);
|
||||||
S9xSetInfoString(msg);
|
S9xSetInfoString(msg);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 5:
|
||||||
|
pauseEmulation = !pauseEmulation;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 6:
|
||||||
|
frameAdvance = true;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -3123,7 +3163,7 @@ static void Initialize (void)
|
||||||
|
|
||||||
if ((systemVersion < 0x1039) || (qtVersion < 0x07008000))
|
if ((systemVersion < 0x1039) || (qtVersion < 0x07008000))
|
||||||
{
|
{
|
||||||
AppearanceAlert(kAlertStopAlert, kRequiredSystemWarning, kRequiredSystemHint);
|
AppearanceAlert(kAlertStopAlert, kS9xMacAlertRequiredSystem, kS9xMacAlertRequiredSystemHint);
|
||||||
QuitWithFatalError(0, "os 09");
|
QuitWithFatalError(0, "os 09");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3427,7 +3467,7 @@ void S9xMessage (int type, int number, const char *message)
|
||||||
|
|
||||||
if ((type == S9X_INFO) && (number == S9X_ROM_INFO))
|
if ((type == S9X_INFO) && (number == S9X_ROM_INFO))
|
||||||
if (strstr(message, "checksum ok") == NULL)
|
if (strstr(message, "checksum ok") == NULL)
|
||||||
AppearanceAlert(kAlertCautionAlert, kBadRomWarning, kBadRomHint);
|
AppearanceAlert(kAlertCautionAlert, kS9xMacAlertkBadRom, kS9xMacAlertkBadRomHint);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -189,8 +189,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include "snes9x.h"
|
#include "snes9x.h"
|
||||||
#include "apu.h"
|
#include "memmap.h"
|
||||||
#include "gfx.h"
|
|
||||||
#include "blit.h"
|
#include "blit.h"
|
||||||
|
|
||||||
#include <OpenGL/OpenGL.h>
|
#include <OpenGL/OpenGL.h>
|
||||||
|
@ -202,6 +201,7 @@
|
||||||
#include "mac-cart.h"
|
#include "mac-cart.h"
|
||||||
#include "mac-coreimage.h"
|
#include "mac-coreimage.h"
|
||||||
#include "mac-dialog.h"
|
#include "mac-dialog.h"
|
||||||
|
#include "mac-file.h"
|
||||||
#include "mac-keyboard.h"
|
#include "mac-keyboard.h"
|
||||||
#include "mac-os.h"
|
#include "mac-os.h"
|
||||||
#include "mac-render.h"
|
#include "mac-render.h"
|
||||||
|
@ -1280,6 +1280,15 @@ void ConfigurePreferences (void)
|
||||||
InitGameWindow();
|
InitGameWindow();
|
||||||
ShowWindow(gWindow);
|
ShowWindow(gWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cartOpen)
|
||||||
|
{
|
||||||
|
FSRef ref;
|
||||||
|
|
||||||
|
err = FSPathMakeRef((unsigned char *) Memory.ROMFilename, &ref, NULL);
|
||||||
|
if (err == noErr)
|
||||||
|
CheckSaveFolder(&ref);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -222,10 +222,9 @@ void SNES9X_Go (void)
|
||||||
|
|
||||||
bool8 SNES9X_OpenCart (FSRef *inRef)
|
bool8 SNES9X_OpenCart (FSRef *inRef)
|
||||||
{
|
{
|
||||||
OSStatus err;
|
OSStatus err;
|
||||||
FSCatalogInfo info;
|
FSRef cartRef;
|
||||||
FSRef cartRef;
|
char filename[PATH_MAX + 1];
|
||||||
char filename[PATH_MAX + 1];
|
|
||||||
|
|
||||||
DeinitGameWindow();
|
DeinitGameWindow();
|
||||||
|
|
||||||
|
@ -251,8 +250,7 @@ bool8 SNES9X_OpenCart (FSRef *inRef)
|
||||||
|
|
||||||
spcFileCount = pngFileCount = 0;
|
spcFileCount = pngFileCount = 0;
|
||||||
|
|
||||||
err = FSGetCatalogInfo(&cartRef, kFSCatInfoVolume, &info, NULL, NULL, NULL);
|
CheckSaveFolder(&cartRef);
|
||||||
lockedROMMedia = IsLockedMedia(info.volume);
|
|
||||||
|
|
||||||
Settings.ForceLoROM = (romDetect == kLoROMForce );
|
Settings.ForceLoROM = (romDetect == kLoROMForce );
|
||||||
Settings.ForceHiROM = (romDetect == kHiROMForce );
|
Settings.ForceHiROM = (romDetect == kHiROMForce );
|
||||||
|
@ -623,6 +621,7 @@ void SNES9X_Quit (void)
|
||||||
if (cartOpen)
|
if (cartOpen)
|
||||||
{
|
{
|
||||||
SNES9X_SaveSRAM();
|
SNES9X_SaveSRAM();
|
||||||
|
S9xResetSaveTimer(false);
|
||||||
S9xSaveCheatFile(S9xGetFilename(".cht", CHEAT_DIR));
|
S9xSaveCheatFile(S9xGetFilename(".cht", CHEAT_DIR));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue