Skip to content

Commit

Permalink
Merge branch 'release/2.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeMatt committed Sep 14, 2021
2 parents 640bb34 + b15b702 commit 4002329
Show file tree
Hide file tree
Showing 62 changed files with 664 additions and 1,854 deletions.
1 change: 0 additions & 1 deletion .swift-version

This file was deleted.

22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.0.2] - 2020-09-14

More Bug fixes mostly.

### Added

- XCode will detect missing git submodules and auto-clone recursive before building the rest of the project

### Fixed

- #1586 Running same care twice in a row would crash
- #1593 Cheat codes menu crash fixes and other cheat code quality improvements

### Updated

- #1564 SteamController native SPM package port
- Jaguar core updated with libretro upstream + my performance hacks. PR made https://github.com/libretro/virtualjaguar-libretro/pull/53#issuecomment-919242560
- Fix many static analyzer warnigns about possible nil pointer/un-malloc'd memory usage, now we check and log nils or early exit where applicable
- SQLite.swift updated
- RxRealm updated from 5.0.2 to 5.0.3
- realm-cocoa updated from 10.14.0 to 10.15.0

## [2.0.1] - 2020-09-09

Bug fixes mostly.
Expand Down
31 changes: 17 additions & 14 deletions Cores/Atari800/Atari800Core/Source/ATR800GameCore.m
Original file line number Diff line number Diff line change
Expand Up @@ -237,19 +237,20 @@ - (BOOL)loadFileAtPath:(NSString *)path error:(NSError *__autoreleasing *)error
// Open and try to automatically detect file type, not 100% accurate
if(!AFILE_OpenFile([path UTF8String], 1, 1, FALSE))
{
NSLog(@"Failed to open file");
NSDictionary *userInfo = @{
NSLocalizedDescriptionKey: @"Failed to load game.",
NSLocalizedFailureReasonErrorKey: @"atari800 failed to load ROM.",
NSLocalizedRecoverySuggestionErrorKey: @"Check that file isn't corrupt and in format atari800 supports."
};

NSError *newError = [NSError errorWithDomain:PVEmulatorCoreErrorDomain
code:PVEmulatorCoreErrorCodeCouldNotLoadRom
userInfo:userInfo];

*error = newError;

ELOG(@"Failed to open file");
if(error != NULL) {
NSDictionary *userInfo = @{
NSLocalizedDescriptionKey: @"Failed to load game.",
NSLocalizedFailureReasonErrorKey: @"atari800 failed to load ROM.",
NSLocalizedRecoverySuggestionErrorKey: @"Check that file isn't corrupt and in format atari800 supports."
};

NSError *newError = [NSError errorWithDomain:PVEmulatorCoreErrorDomain
code:PVEmulatorCoreErrorCodeCouldNotLoadRom
userInfo:userInfo];

*error = newError;
}
return NO;
}

Expand Down Expand Up @@ -885,8 +886,10 @@ int UI_SelectCartType(int k)
// Determine if 16KB cart is one-chip (NS_16) or two-chip (EE_16)
if([One_Chip_16KB containsObject:[_currentCore.romMD5 lowercaseString]])
return CARTRIDGE_5200_NS_16;
else
else if([Two_Chip_16KB containsObject:[_currentCore.romMD5 lowercaseString]])
return CARTRIDGE_5200_EE_16;
else // Maybe an error condition since it should have been in two chip?
return CARTRIDGE_5200_EE_16;
case 32: return CARTRIDGE_5200_32;
case 40: return CARTRIDGE_5200_40; // Bounty Bob Strikes Back
default:
Expand Down
18 changes: 9 additions & 9 deletions Cores/FCEU/FCEU/fceu.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ extern int normalscanlines;
extern int totalscanlines;
extern int postrenderscanlines;
extern int vblankscanlines;
extern int pal_emulation;
extern int pal_emulation;

extern bool AutoResumePlay;
extern char romNameWhenClosingEmulator[];
Expand Down Expand Up @@ -150,14 +150,14 @@ extern uint8 vsdip;

//#define FCEUDEF_DEBUGGER //mbg merge 7/17/06 - cleaning out conditional compiles

#define JOY_A 1
#define JOY_B 2
#define JOY_SELECT 4
#define JOY_START 8
#define JOY_UP 0x10
#define JOY_DOWN 0x20
#define JOY_LEFT 0x40
#define JOY_RIGHT 0x80
#define JOY_A 1u
#define JOY_B 2u
#define JOY_SELECT 4u
#define JOY_START 8u
#define JOY_UP 0x10u
#define JOY_DOWN 0x20u
#define JOY_LEFT 0x40u
#define JOY_RIGHT 0x80u
#endif

#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
Expand Down
2 changes: 1 addition & 1 deletion Cores/FCEU/PVFCEU.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
B39E8CB320539B2500380DCD /* PVFCEUEmulatorCore.swift in Sources */ = {isa = PBXBuildFile; fileRef = B39E8CB220539B2500380DCD /* PVFCEUEmulatorCore.swift */; settings = {COMPILER_FLAGS = "-Weverything"; }; };
B39E8CB420539B2500380DCD /* PVFCEUEmulatorCore.swift in Sources */ = {isa = PBXBuildFile; fileRef = B39E8CB220539B2500380DCD /* PVFCEUEmulatorCore.swift */; };
B3A9F43A1DE877B4008450F5 /* PVFCEU.h in Headers */ = {isa = PBXBuildFile; fileRef = B3A9F4381DE877B4008450F5 /* PVFCEU.h */; settings = {ATTRIBUTES = (Public, ); }; };
B3A9F44F1DE87827008450F5 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A3A79AF1ABF1D41002274A3 /* OpenGLES.framework */; };
B3A9F44F1DE87827008450F5 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A3A79AF1ABF1D41002274A3 /* OpenGLES.framework */; platformFilter = ios; };
B3A9F4501DE87833008450F5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A3A79AE1ABF1D41002274A3 /* Foundation.framework */; };
B3A9F4551DE87840008450F5 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B3A9F4541DE87840008450F5 /* OpenGLES.framework */; };
B3A9F4591DE8784B008450F5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B3A9F4581DE8784B008450F5 /* Foundation.framework */; };
Expand Down
55 changes: 31 additions & 24 deletions Cores/FCEU/PVFCEUEmulatorCore.mm
Original file line number Diff line number Diff line change
Expand Up @@ -121,17 +121,19 @@ - (BOOL)loadFileAtPath:(NSString *)path error:(NSError**)error
FCEUGameInfo = FCEUI_LoadGame([path UTF8String], 1, false);

if(!FCEUGameInfo) {
NSDictionary *userInfo = @{
NSLocalizedDescriptionKey: @"Failed to load game.",
NSLocalizedFailureReasonErrorKey: @"FCEUI failed to load game.",
NSLocalizedRecoverySuggestionErrorKey: @"Check the file isn't corrupt and supported FCEUI ROM format."
};

NSError *newError = [NSError errorWithDomain:PVEmulatorCoreErrorDomain
code:PVEmulatorCoreErrorCodeCouldNotLoadRom
userInfo:userInfo];

*error = newError;
if(error != NULL) {
NSDictionary *userInfo = @{
NSLocalizedDescriptionKey: @"Failed to load game.",
NSLocalizedFailureReasonErrorKey: @"FCEUI failed to load game.",
NSLocalizedRecoverySuggestionErrorKey: @"Check the file isn't corrupt and supported FCEUI ROM format."
};

NSError *newError = [NSError errorWithDomain:PVEmulatorCoreErrorDomain
code:PVEmulatorCoreErrorCodeCouldNotLoadRom
userInfo:userInfo];

*error = newError;
}
return NO;
}

Expand Down Expand Up @@ -258,17 +260,19 @@ - (BOOL)loadStateFromFileAtPath:(NSString *)fileName error:(NSError**)error
@synchronized(self) {
BOOL success = FCEUSS_Load([fileName UTF8String], false);
if (!success) {
NSDictionary *userInfo = @{
NSLocalizedDescriptionKey: @"Failed to save state.",
NSLocalizedFailureReasonErrorKey: @"Core failed to load save state.",
NSLocalizedRecoverySuggestionErrorKey: @""
};

NSError *newError = [NSError errorWithDomain:PVEmulatorCoreErrorDomain
code:PVEmulatorCoreErrorCodeCouldNotLoadState
userInfo:userInfo];

*error = newError;
if(error != NULL) {
NSDictionary *userInfo = @{
NSLocalizedDescriptionKey: @"Failed to save state.",
NSLocalizedFailureReasonErrorKey: @"Core failed to load save state.",
NSLocalizedRecoverySuggestionErrorKey: @""
};

NSError *newError = [NSError errorWithDomain:PVEmulatorCoreErrorDomain
code:PVEmulatorCoreErrorCodeCouldNotLoadState
userInfo:userInfo];

*error = newError;
}
}
return success;
}
Expand Down Expand Up @@ -330,7 +334,8 @@ void FCEUD_GetPalette(unsigned char i, unsigned char *r, unsigned char *g, unsig
}
EMUFILE_FILE *FCEUD_UTF8_fstream(const char *fn, const char *m)
{
std::ios_base::openmode mode = std::ios_base::binary;
#if 0
std::ios_base::openmode mode = std::ios_base::binary;
if(!strcmp(m,"r") || !strcmp(m,"rb"))
mode |= std::ios_base::in;
else if(!strcmp(m,"w") || !strcmp(m,"wb"))
Expand All @@ -343,8 +348,10 @@ void FCEUD_GetPalette(unsigned char i, unsigned char *r, unsigned char *g, unsig
mode |= std::ios_base::in | std::ios_base::out | std::ios_base::trunc;
else if(!strcmp(m,"a+") || !strcmp(m,"a+b"))
mode |= std::ios_base::in | std::ios_base::out | std::ios_base::app;
return new std::fstream(fn,mode);
#else
return new EMUFILE_FILE(fn, m);
//return new std::fstream(fn,mode);
#endif
}
void FCEUD_NetplayText(uint8 *text) {}
void FCEUD_NetworkClose(void) {}
Expand Down
2 changes: 1 addition & 1 deletion Cores/Gambatte/PVGB.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
B3C9D49C1DEA6DE80068D057 /* initstate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AABE04E1ABE373800FF6AEF /* initstate.cpp */; };
B3C9D49D1DEA6DE80068D057 /* makesinckernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AABE0121ABE373800FF6AEF /* makesinckernel.cpp */; };
B3C9D49E1DEA6DE80068D057 /* ppu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1AABE0871ABE373800FF6AEF /* ppu.cpp */; };
B3C9D49F1DEA6DFC0068D057 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AABE0C51ABE379500FF6AEF /* OpenGLES.framework */; };
B3C9D49F1DEA6DFC0068D057 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AABE0C51ABE379500FF6AEF /* OpenGLES.framework */; platformFilter = ios; };
B3C9D4A11DEA6E0D0068D057 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AABE0C31ABE378D00FF6AEF /* Foundation.framework */; };
B3C9D4A21DEA6E120068D057 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AABE0C11ABE378800FF6AEF /* UIKit.framework */; };
B3C9D4A41DEA6E270068D057 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B3C9D4A31DEA6E270068D057 /* OpenGLES.framework */; };
Expand Down
2 changes: 1 addition & 1 deletion Cores/Genesis-Plus-GX/PVGenesis.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
B37303351DE7DB1B00D0B366 /* system.c in Sources */ = {isa = PBXBuildFile; fileRef = 1ACEA7F217F752600031B1C9 /* system.c */; };
B373033A1DE7DB6F00D0B366 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ACEA6E117F751590031B1C9 /* CoreGraphics.framework */; };
B373033B1DE7DB7300D0B366 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ACEA6DD17F751380031B1C9 /* AudioToolbox.framework */; };
B373033C1DE7DB7A00D0B366 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ACEA6DB17F751320031B1C9 /* OpenGLES.framework */; };
B373033C1DE7DB7A00D0B366 /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ACEA6DB17F751320031B1C9 /* OpenGLES.framework */; platformFilter = ios; };
B373033D1DE7DB8300D0B366 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ACEA6D917F7512B0031B1C9 /* UIKit.framework */; };
B373033E1DE7DB8800D0B366 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ACEA6AF17F74D150031B1C9 /* Foundation.framework */; };
B373033F1DE7DBA300D0B366 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ACEA6AF17F74D150031B1C9 /* Foundation.framework */; };
Expand Down
96 changes: 52 additions & 44 deletions Cores/Genesis-Plus-GX/PVGenesis/Genesis/PVGenesisEmulatorCore.m
Original file line number Diff line number Diff line change
Expand Up @@ -240,17 +240,19 @@ - (BOOL)loadFileAtPath:(NSString*)path error:(NSError**)error
NSData* dataObj = [NSData dataWithContentsOfFile:[path stringByStandardizingPath]];
if (dataObj == nil)
{
NSDictionary *userInfo = @{
NSLocalizedDescriptionKey: @"Failed to load game.",
NSLocalizedFailureReasonErrorKey: @"File was unreadble.",
NSLocalizedRecoverySuggestionErrorKey: @"Check the file isn't corrupt and exists."
};

NSError *newError = [NSError errorWithDomain:PVEmulatorCoreErrorDomain
code:PVEmulatorCoreErrorCodeCouldNotLoadRom
userInfo:userInfo];

*error = newError;
if(error != NULL) {
NSDictionary *userInfo = @{
NSLocalizedDescriptionKey: @"Failed to load game.",
NSLocalizedFailureReasonErrorKey: @"File was unreadble.",
NSLocalizedRecoverySuggestionErrorKey: @"Check the file isn't corrupt and exists."
};

NSError *newError = [NSError errorWithDomain:PVEmulatorCoreErrorDomain
code:PVEmulatorCoreErrorCodeCouldNotLoadRom
userInfo:userInfo];

*error = newError;
}
return false;
}
size = [dataObj length];
Expand Down Expand Up @@ -314,19 +316,21 @@ - (BOOL)loadFileAtPath:(NSString*)path error:(NSError**)error

return YES;
}

NSDictionary *userInfo = @{
NSLocalizedDescriptionKey: @"Failed to load game.",
NSLocalizedFailureReasonErrorKey: @"GenPlusGX failed to load game.",
NSLocalizedRecoverySuggestionErrorKey: @"Check the file isn't corrupt and supported GenPlusGX ROM format."
};

NSError *newError = [NSError errorWithDomain:PVEmulatorCoreErrorDomain
code:PVEmulatorCoreErrorCodeCouldNotLoadRom
userInfo:userInfo];

*error = newError;


if(error != NULL) {
NSDictionary *userInfo = @{
NSLocalizedDescriptionKey: @"Failed to load game.",
NSLocalizedFailureReasonErrorKey: @"GenPlusGX failed to load game.",
NSLocalizedRecoverySuggestionErrorKey: @"Check the file isn't corrupt and supported GenPlusGX ROM format."
};

NSError *newError = [NSError errorWithDomain:PVEmulatorCoreErrorDomain
code:PVEmulatorCoreErrorCodeCouldNotLoadRom
userInfo:userInfo];

*error = newError;
}

return NO;
}

Expand Down Expand Up @@ -884,32 +888,36 @@ - (BOOL)loadStateFromFileAtPath:(NSString *)path error:(NSError *__autoreleasing
NSData *saveStateData = [NSData dataWithContentsOfFile:path];
if (!saveStateData)
{
NSDictionary *userInfo = @{
NSLocalizedDescriptionKey: @"Failed to load save state.",
NSLocalizedFailureReasonErrorKey: @"Genesis failed to read savestate data.",
NSLocalizedRecoverySuggestionErrorKey: @"Check that the path is correct and file exists."
};

NSError *newError = [NSError errorWithDomain:PVEmulatorCoreErrorDomain
code:PVEmulatorCoreErrorCodeCouldNotLoadState
userInfo:userInfo];
*error = newError;
if(error != NULL) {
NSDictionary *userInfo = @{
NSLocalizedDescriptionKey: @"Failed to load save state.",
NSLocalizedFailureReasonErrorKey: @"Genesis failed to read savestate data.",
NSLocalizedRecoverySuggestionErrorKey: @"Check that the path is correct and file exists."
};

NSError *newError = [NSError errorWithDomain:PVEmulatorCoreErrorDomain
code:PVEmulatorCoreErrorCodeCouldNotLoadState
userInfo:userInfo];
*error = newError;
}
ELOG(@"Unable to load save state from path: %@", path);
return NO;
}

if (!retro_unserialize([saveStateData bytes], [saveStateData length]))
{
NSDictionary *userInfo = @{
NSLocalizedDescriptionKey: @"Failed to load save state.",
NSLocalizedFailureReasonErrorKey: @"Genesis failed to load savestate data.",
NSLocalizedRecoverySuggestionErrorKey: @"Check that the path is correct and file exists."
};

NSError *newError = [NSError errorWithDomain:PVEmulatorCoreErrorDomain
code:PVEmulatorCoreErrorCodeCouldNotLoadState
userInfo:userInfo];
*error = newError;
if(error != NULL) {
NSDictionary *userInfo = @{
NSLocalizedDescriptionKey: @"Failed to load save state.",
NSLocalizedFailureReasonErrorKey: @"Genesis failed to load savestate data.",
NSLocalizedRecoverySuggestionErrorKey: @"Check that the path is correct and file exists."
};

NSError *newError = [NSError errorWithDomain:PVEmulatorCoreErrorDomain
code:PVEmulatorCoreErrorCodeCouldNotLoadState
userInfo:userInfo];
*error = newError;
}
DLOG(@"Unable to load save state");
return NO;
}
Expand Down
Loading

0 comments on commit 4002329

Please sign in to comment.