@@ -101,9 +101,8 @@ - (BOOL)loadFileAtPath:(NSString *)path error:(NSError **)error
101
101
Settings.SoundInputRate = 32040 ;
102
102
Settings.DynamicRateControl = false ;
103
103
Settings.DynamicRateLimit = 5 ;
104
- Settings.SupportHiRes = true ;
105
104
Settings.Transparency = true ;
106
- GFX.InfoString = NULL ;
105
+ GFX.InfoString . clear () ;
107
106
GFX.InfoStringTimeout = 0 ;
108
107
Settings.DontSaveOopsSnapshot = true ;
109
108
Settings.NoPatch = true ;
@@ -123,7 +122,6 @@ - (BOOL)loadFileAtPath:(NSString *)path error:(NSError **)error
123
122
124
123
_indirectVideoBuffer = (uint16_t *)malloc (MAX_SNES_WIDTH * MAX_SNES_HEIGHT * sizeof (uint16_t ));
125
124
126
- GFX.Pitch = 512 * 2 ;
127
125
GFX.Screen = _indirectVideoBuffer;
128
126
129
127
S9xUnmapAllControls ();
@@ -666,7 +664,7 @@ - (void)resetEmulation
666
664
- (void )stopEmulation
667
665
{
668
666
// Save SRAM
669
- NSURL *url = [NSURL fileURLWithPath: @(Memory.ROMFilename)];
667
+ NSURL *url = [NSURL fileURLWithPath: @(Memory.ROMFilename. c_str () )];
670
668
NSString *extensionlessFilename = url.lastPathComponent .stringByDeletingPathExtension ;
671
669
NSURL *batterySavesDirectory = [NSURL fileURLWithPath: self .batterySavesDirectoryPath];
672
670
NSURL *saveFileURL = [batterySavesDirectory URLByAppendingPathComponent: [extensionlessFilename stringByAppendingPathExtension: @" sav" ]];
@@ -907,7 +905,7 @@ - (void)setCheat:(NSString *)code setType:(NSString *)type setEnabled:(BOOL)enab
907
905
const char *cheatCode = [singleCode stringByReplacingOccurrencesOfString: @" :" withString: @" " ].UTF8String ;
908
906
909
907
S9xAddCheatGroup (" OpenEmu" , cheatCode);
910
- S9xEnableCheatGroup (Cheat.g .size () - 1 );
908
+ S9xEnableCheatGroup (Cheat.group .size () - 1 );
911
909
}
912
910
}
913
911
}
@@ -935,42 +933,7 @@ void S9xMessage(int type, int number, const char *message)
935
933
NSLog (@" [Snes9x] %s " , message);
936
934
}
937
935
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)
974
937
{
975
938
// We don't seem to use this function, but defined anyway
976
939
NSURL *batterySavesDirectory = [NSURL fileURLWithPath: _current.batterySavesDirectoryPath];
@@ -982,7 +945,7 @@ void _makepath(char *path, const char *drive, const char *dir, const char *fname
982
945
case SRAM_DIR: return batterySavesDirectory.fileSystemRepresentation ; break ;
983
946
case BIOS_DIR: return biosDirectoryURL.fileSystemRepresentation ; break ;
984
947
case SAT_DIR: return biosDirectoryURL.fileSystemRepresentation ; break ;
985
- default : return NULL ; break ;
948
+ default : return " " ; break ;
986
949
}
987
950
}
988
951
@@ -1019,27 +982,16 @@ unsigned char S9xContinueUpdate(int width, int height)
1019
982
return true ;
1020
983
}
1021
984
1022
- const char *S9xBasename (const char *filename)
1023
- {
1024
- // Called by S9xFreezeGame/S9xUnfreezeGame -- useless for us
1025
- return NULL ;
1026
- }
1027
-
1028
985
const char *S9xStringInput (const char *message)
1029
986
{
1030
987
return NULL ;
1031
988
}
1032
989
1033
- const char * S9xGetFilename ( const char *extension , enum s9x_getdirtype dirtype )
990
+ std::string S9xGetFilenameInc (std::string , enum s9x_getdirtype)
1034
991
{
1035
992
return " " ;
1036
993
}
1037
994
1038
- const char *S9xGetFilenameInc (const char *, enum s9x_getdirtype)
1039
- {
1040
- return NULL ;
1041
- }
1042
-
1043
995
bool S9xPollButton (uint32 id , bool *pressed)
1044
996
{
1045
997
return true ;
0 commit comments