Skip to content

Commit 6b1495d

Browse files
authored
Merge pull request #8 from ShutOstrich/master
Update to Snes9x 1.62.3
2 parents d2dc097 + c0e0b55 commit 6b1495d

38 files changed

+1338
-1834
lines changed

Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>1.61</string>
22+
<string>1.62.3</string>
2323
<key>NSPrincipalClass</key>
2424
<string>OEGameCoreController</string>
2525
<key>OEGameCoreClass</key>

SNES9x.xcodeproj/project.pbxproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
87709EEE294EDD590084AEE0 /* tileimpl-n2x1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 87709EEB294EDD580084AEE0 /* tileimpl-n2x1.cpp */; };
3838
8D5B49B0048680CD000E48DA /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C167DFE841241C02AAC07 /* InfoPlist.strings */; };
3939
8D5B49B4048680CD000E48DA /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */; };
40+
8F6CC7A029FD51E2006C7D59 /* fscompat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8F6CC79E29FD51E2006C7D59 /* fscompat.cpp */; };
4041
94790D7A14C0C46900B30798 /* apu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94790CDC14C0C46900B30798 /* apu.cpp */; };
4142
94790D8114C0C46900B30798 /* bsx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94790CF014C0C46900B30798 /* bsx.cpp */; };
4243
94790D8214C0C46900B30798 /* c4.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94790CF214C0C46900B30798 /* c4.cpp */; };
@@ -158,6 +159,8 @@
158159
87709EEB294EDD580084AEE0 /* tileimpl-n2x1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "tileimpl-n2x1.cpp"; path = "src/tileimpl-n2x1.cpp"; sourceTree = "<group>"; };
159160
8D5B49B6048680CD000E48DA /* SNES9x.oecoreplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SNES9x.oecoreplugin; sourceTree = BUILT_PRODUCTS_DIR; };
160161
8D5B49B7048680CD000E48DA /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
162+
8F6CC79E29FD51E2006C7D59 /* fscompat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = fscompat.cpp; path = src/fscompat.cpp; sourceTree = "<group>"; };
163+
8F6CC79F29FD51E2006C7D59 /* fscompat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = fscompat.h; path = src/fscompat.h; sourceTree = "<group>"; };
161164
94790CDA14C0C46900B30798 /* 65c816.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 65c816.h; path = src/65c816.h; sourceTree = "<group>"; };
162165
94790CDC14C0C46900B30798 /* apu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = apu.cpp; sourceTree = "<group>"; };
163166
94790CDD14C0C46900B30798 /* apu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = apu.h; sourceTree = "<group>"; };
@@ -394,6 +397,8 @@
394397
94790D0F14C0C46900B30798 /* dsp3.cpp */,
395398
94790D1014C0C46900B30798 /* dsp4.cpp */,
396399
94790D1114C0C46900B30798 /* font.h */,
400+
8F6CC79E29FD51E2006C7D59 /* fscompat.cpp */,
401+
8F6CC79F29FD51E2006C7D59 /* fscompat.h */,
397402
94790D1214C0C46900B30798 /* fxdbg.cpp */,
398403
94790D1314C0C46900B30798 /* fxemu.cpp */,
399404
94790D1414C0C46900B30798 /* fxemu.h */,
@@ -668,6 +673,7 @@
668673
94790DA714C0C46900B30798 /* netplay.cpp in Sources */,
669674
94790DA814C0C46900B30798 /* obc1.cpp in Sources */,
670675
94790DA914C0C46900B30798 /* ppu.cpp in Sources */,
676+
8F6CC7A029FD51E2006C7D59 /* fscompat.cpp in Sources */,
671677
87431C061B02F20700F82158 /* stream.cpp in Sources */,
672678
94790DAB14C0C46900B30798 /* sa1.cpp in Sources */,
673679
94790DAC14C0C46900B30798 /* sa1cpu.cpp in Sources */,
@@ -716,6 +722,7 @@
716722
isa = XCBuildConfiguration;
717723
buildSettings = {
718724
ALWAYS_SEARCH_USER_PATHS = NO;
725+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
719726
CLANG_ENABLE_OBJC_ARC = YES;
720727
COMBINE_HIDPI_IMAGES = YES;
721728
HEADER_SEARCH_PATHS = (
@@ -745,6 +752,7 @@
745752
isa = XCBuildConfiguration;
746753
buildSettings = {
747754
ALWAYS_SEARCH_USER_PATHS = NO;
755+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
748756
CLANG_ENABLE_OBJC_ARC = YES;
749757
COMBINE_HIDPI_IMAGES = YES;
750758
GCC_STRICT_ALIASING = YES;

SNESGameCore.mm

Lines changed: 6 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,8 @@ - (BOOL)loadFileAtPath:(NSString *)path error:(NSError **)error
101101
Settings.SoundInputRate = 32040;
102102
Settings.DynamicRateControl = false;
103103
Settings.DynamicRateLimit = 5;
104-
Settings.SupportHiRes = true;
105104
Settings.Transparency = true;
106-
GFX.InfoString = NULL;
105+
GFX.InfoString.clear();
107106
GFX.InfoStringTimeout = 0;
108107
Settings.DontSaveOopsSnapshot = true;
109108
Settings.NoPatch = true;
@@ -123,7 +122,6 @@ - (BOOL)loadFileAtPath:(NSString *)path error:(NSError **)error
123122

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

126-
GFX.Pitch = 512 * 2;
127125
GFX.Screen = _indirectVideoBuffer;
128126

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

909907
S9xAddCheatGroup("OpenEmu", cheatCode);
910-
S9xEnableCheatGroup(Cheat.g.size () - 1);
908+
S9xEnableCheatGroup(Cheat.group.size() - 1);
911909
}
912910
}
913911
}
@@ -935,42 +933,7 @@ void S9xMessage(int type, int number, const char *message)
935933
NSLog(@"[Snes9x] %s", message);
936934
}
937935

938-
void _splitpath(const char *path, char *drive, char *dir, char *fname, char *ext)
939-
{
940-
// This function is mostly used for various Snes9x generated snapshots (functionality that belongs in the frontend instead), but defined anyway
941-
NSString *nsPath = @(path);
942-
943-
drive[0] = '\0';
944-
945-
NSString *extension = nsPath.pathExtension;
946-
NSArray *components = nsPath.pathComponents;
947-
NSArray *dirComponents = [nsPath.pathComponents subarrayWithRange:NSMakeRange(0, components.count - 1)];
948-
NSString *fileName = [nsPath.lastPathComponent stringByDeletingPathExtension];
949-
NSString *directory = [NSString pathWithComponents:dirComponents];
950-
951-
strcpy(dir, directory.UTF8String);
952-
strcpy(fname, fileName.UTF8String);
953-
strcpy(ext, extension.UTF8String);
954-
}
955-
956-
void _makepath(char *path, const char *drive, const char *dir, const char *fname, const char *ext)
957-
{
958-
// This function is mostly used for Snes9x internal soft patching, but defined anyway
959-
#pragma unused (drive)
960-
961-
NSString *directory = @(dir);
962-
NSString *fileName = @(fname);
963-
NSString *extension = @(ext);
964-
965-
fileName = [fileName stringByAppendingPathExtension:extension];
966-
967-
NSString *fullPath = [directory stringByAppendingPathComponent:fileName];
968-
NSURL *fullURL = [NSURL fileURLWithPath:fullPath];
969-
970-
strcpy(path, fullURL.fileSystemRepresentation);
971-
}
972-
973-
const char *S9xGetDirectory(enum s9x_getdirtype dirtype)
936+
std::string S9xGetDirectory(enum s9x_getdirtype dirtype)
974937
{
975938
// We don't seem to use this function, but defined anyway
976939
NSURL *batterySavesDirectory = [NSURL fileURLWithPath:_current.batterySavesDirectoryPath];
@@ -982,7 +945,7 @@ void _makepath(char *path, const char *drive, const char *dir, const char *fname
982945
case SRAM_DIR: return batterySavesDirectory.fileSystemRepresentation; break;
983946
case BIOS_DIR: return biosDirectoryURL.fileSystemRepresentation; break;
984947
case SAT_DIR: return biosDirectoryURL.fileSystemRepresentation; break;
985-
default: return NULL; break;
948+
default: return ""; break;
986949
}
987950
}
988951

@@ -1019,27 +982,16 @@ unsigned char S9xContinueUpdate(int width, int height)
1019982
return true;
1020983
}
1021984

1022-
const char *S9xBasename(const char *filename)
1023-
{
1024-
// Called by S9xFreezeGame/S9xUnfreezeGame -- useless for us
1025-
return NULL;
1026-
}
1027-
1028985
const char *S9xStringInput(const char *message)
1029986
{
1030987
return NULL;
1031988
}
1032989

1033-
const char *S9xGetFilename(const char *extension, enum s9x_getdirtype dirtype)
990+
std::string S9xGetFilenameInc(std::string, enum s9x_getdirtype)
1034991
{
1035992
return "";
1036993
}
1037994

1038-
const char *S9xGetFilenameInc(const char *, enum s9x_getdirtype)
1039-
{
1040-
return NULL;
1041-
}
1042-
1043995
bool S9xPollButton(uint32 id, bool *pressed)
1044996
{
1045997
return true;

src/LICENSE

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
(c) Copyright 2006 - 2007 nitsuja
2323

24-
(c) Copyright 2009 - 2022 BearOso,
24+
(c) Copyright 2009 - 2023 BearOso,
2525
OV2
2626

2727
(c) Copyright 2017 qwertymodo
@@ -139,21 +139,21 @@
139139
(c) Copyright 2006 - 2007 Shay Green
140140

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

144144
Win32 GUI code
145145
(c) Copyright 2003 - 2006 blip,
146146
funkyass,
147147
Matthew Kendora,
148148
Nach,
149149
nitsuja
150-
(c) Copyright 2009 - 2022 OV2
150+
(c) Copyright 2009 - 2023 OV2
151151

152152
Original Mac OS GUI code
153153
(c) Copyright 1998 - 2001 John Stiles
154154
(c) Copyright 2001 - 2011 zones
155155
New MacOS GUI code
156-
(c) Copyright 2022 Michael Donald Buckley
156+
(c) Copyright 2022 - 2023 Michael Donald Buckley
157157

158158
Libretro port
159159
(c) Copyright 2011 - 2017 Hans-Kristian Arntzen,

0 commit comments

Comments
 (0)