Skip to content

Commit

Permalink
Merge pull request #8 from ShutOstrich/master
Browse files Browse the repository at this point in the history
Update to Snes9x 1.62.3
  • Loading branch information
clobber authored Apr 30, 2023
2 parents d2dc097 + c0e0b55 commit 6b1495d
Show file tree
Hide file tree
Showing 38 changed files with 1,338 additions and 1,834 deletions.
2 changes: 1 addition & 1 deletion Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.61</string>
<string>1.62.3</string>
<key>NSPrincipalClass</key>
<string>OEGameCoreController</string>
<key>OEGameCoreClass</key>
Expand Down
8 changes: 8 additions & 0 deletions SNES9x.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
87709EEE294EDD590084AEE0 /* tileimpl-n2x1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 87709EEB294EDD580084AEE0 /* tileimpl-n2x1.cpp */; };
8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; };
8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; };
8F6CC7A029FD51E2006C7D59 /* fscompat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8F6CC79E29FD51E2006C7D59 /* fscompat.cpp */; };
94790D7A14C0C46900B30798 /* apu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94790CDC14C0C46900B30798 /* apu.cpp */; };
94790D8114C0C46900B30798 /* bsx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94790CF014C0C46900B30798 /* bsx.cpp */; };
94790D8214C0C46900B30798 /* c4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94790CF214C0C46900B30798 /* c4.cpp */; };
Expand Down Expand Up @@ -158,6 +159,8 @@
87709EEB294EDD580084AEE0 /* tileimpl-n2x1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "tileimpl-n2x1.cpp"; path = "src/tileimpl-n2x1.cpp"; sourceTree = "<group>"; };
8D5B49B6048680CD000E48DA /* SNES9x.oecoreplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SNES9x.oecoreplugin; sourceTree = BUILT_PRODUCTS_DIR; };
8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8F6CC79E29FD51E2006C7D59 /* fscompat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = fscompat.cpp; path = src/fscompat.cpp; sourceTree = "<group>"; };
8F6CC79F29FD51E2006C7D59 /* fscompat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fscompat.h; path = src/fscompat.h; sourceTree = "<group>"; };
94790CDA14C0C46900B30798 /* 65c816.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 65c816.h; path = src/65c816.h; sourceTree = "<group>"; };
94790CDC14C0C46900B30798 /* apu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = apu.cpp; sourceTree = "<group>"; };
94790CDD14C0C46900B30798 /* apu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = apu.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -394,6 +397,8 @@
94790D0F14C0C46900B30798 /* dsp3.cpp */,
94790D1014C0C46900B30798 /* dsp4.cpp */,
94790D1114C0C46900B30798 /* font.h */,
8F6CC79E29FD51E2006C7D59 /* fscompat.cpp */,
8F6CC79F29FD51E2006C7D59 /* fscompat.h */,
94790D1214C0C46900B30798 /* fxdbg.cpp */,
94790D1314C0C46900B30798 /* fxemu.cpp */,
94790D1414C0C46900B30798 /* fxemu.h */,
Expand Down Expand Up @@ -668,6 +673,7 @@
94790DA714C0C46900B30798 /* netplay.cpp in Sources */,
94790DA814C0C46900B30798 /* obc1.cpp in Sources */,
94790DA914C0C46900B30798 /* ppu.cpp in Sources */,
8F6CC7A029FD51E2006C7D59 /* fscompat.cpp in Sources */,
87431C061B02F20700F82158 /* stream.cpp in Sources */,
94790DAB14C0C46900B30798 /* sa1.cpp in Sources */,
94790DAC14C0C46900B30798 /* sa1cpu.cpp in Sources */,
Expand Down Expand Up @@ -716,6 +722,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_ENABLE_OBJC_ARC = YES;
COMBINE_HIDPI_IMAGES = YES;
HEADER_SEARCH_PATHS = (
Expand Down Expand Up @@ -745,6 +752,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_ENABLE_OBJC_ARC = YES;
COMBINE_HIDPI_IMAGES = YES;
GCC_STRICT_ALIASING = YES;
Expand Down
60 changes: 6 additions & 54 deletions SNESGameCore.mm
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,8 @@ - (BOOL)loadFileAtPath:(NSString *)path error:(NSError **)error
Settings.SoundInputRate = 32040;
Settings.DynamicRateControl = false;
Settings.DynamicRateLimit = 5;
Settings.SupportHiRes = true;
Settings.Transparency = true;
GFX.InfoString = NULL;
GFX.InfoString.clear();
GFX.InfoStringTimeout = 0;
Settings.DontSaveOopsSnapshot = true;
Settings.NoPatch = true;
Expand All @@ -123,7 +122,6 @@ - (BOOL)loadFileAtPath:(NSString *)path error:(NSError **)error

_indirectVideoBuffer = (uint16_t *)malloc(MAX_SNES_WIDTH * MAX_SNES_HEIGHT * sizeof(uint16_t));

GFX.Pitch = 512 * 2;
GFX.Screen = _indirectVideoBuffer;

S9xUnmapAllControls();
Expand Down Expand Up @@ -666,7 +664,7 @@ - (void)resetEmulation
- (void)stopEmulation
{
// Save SRAM
NSURL *url = [NSURL fileURLWithPath:@(Memory.ROMFilename)];
NSURL *url = [NSURL fileURLWithPath:@(Memory.ROMFilename.c_str())];
NSString *extensionlessFilename = url.lastPathComponent.stringByDeletingPathExtension;
NSURL *batterySavesDirectory = [NSURL fileURLWithPath:self.batterySavesDirectoryPath];
NSURL *saveFileURL = [batterySavesDirectory URLByAppendingPathComponent:[extensionlessFilename stringByAppendingPathExtension:@"sav"]];
Expand Down Expand Up @@ -907,7 +905,7 @@ - (void)setCheat:(NSString *)code setType:(NSString *)type setEnabled:(BOOL)enab
const char *cheatCode = [singleCode stringByReplacingOccurrencesOfString:@":" withString:@""].UTF8String;

S9xAddCheatGroup("OpenEmu", cheatCode);
S9xEnableCheatGroup(Cheat.g.size () - 1);
S9xEnableCheatGroup(Cheat.group.size() - 1);
}
}
}
Expand Down Expand Up @@ -935,42 +933,7 @@ void S9xMessage(int type, int number, const char *message)
NSLog(@"[Snes9x] %s", message);
}

void _splitpath(const char *path, char *drive, char *dir, char *fname, char *ext)
{
// This function is mostly used for various Snes9x generated snapshots (functionality that belongs in the frontend instead), but defined anyway
NSString *nsPath = @(path);

drive[0] = '\0';

NSString *extension = nsPath.pathExtension;
NSArray *components = nsPath.pathComponents;
NSArray *dirComponents = [nsPath.pathComponents subarrayWithRange:NSMakeRange(0, components.count - 1)];
NSString *fileName = [nsPath.lastPathComponent stringByDeletingPathExtension];
NSString *directory = [NSString pathWithComponents:dirComponents];

strcpy(dir, directory.UTF8String);
strcpy(fname, fileName.UTF8String);
strcpy(ext, extension.UTF8String);
}

void _makepath(char *path, const char *drive, const char *dir, const char *fname, const char *ext)
{
// This function is mostly used for Snes9x internal soft patching, but defined anyway
#pragma unused (drive)

NSString *directory = @(dir);
NSString *fileName = @(fname);
NSString *extension = @(ext);

fileName = [fileName stringByAppendingPathExtension:extension];

NSString *fullPath = [directory stringByAppendingPathComponent:fileName];
NSURL *fullURL = [NSURL fileURLWithPath:fullPath];

strcpy(path, fullURL.fileSystemRepresentation);
}

const char *S9xGetDirectory(enum s9x_getdirtype dirtype)
std::string S9xGetDirectory(enum s9x_getdirtype dirtype)
{
// We don't seem to use this function, but defined anyway
NSURL *batterySavesDirectory = [NSURL fileURLWithPath:_current.batterySavesDirectoryPath];
Expand All @@ -982,7 +945,7 @@ void _makepath(char *path, const char *drive, const char *dir, const char *fname
case SRAM_DIR: return batterySavesDirectory.fileSystemRepresentation; break;
case BIOS_DIR: return biosDirectoryURL.fileSystemRepresentation; break;
case SAT_DIR: return biosDirectoryURL.fileSystemRepresentation; break;
default: return NULL; break;
default: return ""; break;
}
}

Expand Down Expand Up @@ -1019,27 +982,16 @@ unsigned char S9xContinueUpdate(int width, int height)
return true;
}

const char *S9xBasename(const char *filename)
{
// Called by S9xFreezeGame/S9xUnfreezeGame -- useless for us
return NULL;
}

const char *S9xStringInput(const char *message)
{
return NULL;
}

const char *S9xGetFilename(const char *extension, enum s9x_getdirtype dirtype)
std::string S9xGetFilenameInc(std::string, enum s9x_getdirtype)
{
return "";
}

const char *S9xGetFilenameInc(const char *, enum s9x_getdirtype)
{
return NULL;
}

bool S9xPollButton(uint32 id, bool *pressed)
{
return true;
Expand Down
8 changes: 4 additions & 4 deletions src/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

(c) Copyright 2006 - 2007 nitsuja

(c) Copyright 2009 - 2022 BearOso,
(c) Copyright 2009 - 2023 BearOso,
OV2

(c) Copyright 2017 qwertymodo
Expand Down Expand Up @@ -139,21 +139,21 @@
(c) Copyright 2006 - 2007 Shay Green

GTK+ GUI code
(c) Copyright 2004 - 2022 BearOso
(c) Copyright 2004 - 2023 BearOso

Win32 GUI code
(c) Copyright 2003 - 2006 blip,
funkyass,
Matthew Kendora,
Nach,
nitsuja
(c) Copyright 2009 - 2022 OV2
(c) Copyright 2009 - 2023 OV2

Original Mac OS GUI code
(c) Copyright 1998 - 2001 John Stiles
(c) Copyright 2001 - 2011 zones
New MacOS GUI code
(c) Copyright 2022 Michael Donald Buckley
(c) Copyright 2022 - 2023 Michael Donald Buckley

Libretro port
(c) Copyright 2011 - 2017 Hans-Kristian Arntzen,
Expand Down
Loading

0 comments on commit 6b1495d

Please sign in to comment.