From 2a1603fe1a44aaa8654e78d18aeca04bcbcdde90 Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Tue, 3 Dec 2024 19:18:08 -0500 Subject: [PATCH 01/23] beetle sans libretro compiles Signed-off-by: Joseph Mattiello --- Cores/BeetlePSX/BuildFlags.xcconfig | 2 +- .../PVBeetlePSX.xcodeproj/project.pbxproj | 82 ++++++++++++++++++- .../PVBeetlePSXCore/PVBeetlePSXCore.h | 6 +- .../PVBeetlePSXCore/PVBeetlePSXCore.mm | 2 +- 4 files changed, 83 insertions(+), 9 deletions(-) diff --git a/Cores/BeetlePSX/BuildFlags.xcconfig b/Cores/BeetlePSX/BuildFlags.xcconfig index c359661ab5..fc027d7521 100644 --- a/Cores/BeetlePSX/BuildFlags.xcconfig +++ b/Cores/BeetlePSX/BuildFlags.xcconfig @@ -13,7 +13,7 @@ GL_APIENTRYP=GLAPIENTRY* // HAVE_VULKAN=0 HAVE_JIT=0 WANT_16BPP=0 WANT_8BPP=1 LIGHTREC_DEBUG=0 HAVE_OPENGL=0 HAVE_SHM=1 USE_FIXED // HAVE_CDROM=1 //OTHER_CFLAGS = $(inherited) -ObjC -ffast-math -ftree-vectorize -fno-strict-aliasing -fpermissive -fomit-frame-pointer -fmodules -fcxx-modules -OTHER_CFLAGS = $(inherited) -fmodules -fcxx-modules +OTHER_CFLAGS = $(inherited) -fmodules -fcxx-modules // OTHER_LDFLAGS = $(inherited) -ObjC -Wl,-all_load -all_load diff --git a/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj b/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj index 6c425bdd65..cc40e84961 100644 --- a/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj +++ b/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj @@ -33,6 +33,12 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + B3145FB12CFFD4D3009FB8B3 /* libbeetle_psx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B30178D3207C901D0051B93D /* libbeetle_psx.a */; }; + B3145FB42CFFD4E0009FB8B3 /* PVBeetlePSXCore.mm in Sources */ = {isa = PBXBuildFile; fileRef = B37022C6287253B300B3F6DA /* PVBeetlePSXCore.mm */; settings = {COMPILER_FLAGS = "-fmodules -fcxx-modules"; }; }; + B3145FB72CFFD5F6009FB8B3 /* PVCoreBridge in Frameworks */ = {isa = PBXBuildFile; productRef = B3145FB62CFFD5F6009FB8B3 /* PVCoreBridge */; }; + B3145FBA2CFFD632009FB8B3 /* PVPlists in Frameworks */ = {isa = PBXBuildFile; productRef = B3145FB92CFFD632009FB8B3 /* PVPlists */; }; + B3145FBD2CFFD66C009FB8B3 /* PVLogging in Frameworks */ = {isa = PBXBuildFile; productRef = B3145FBC2CFFD66C009FB8B3 /* PVLogging */; }; + B3145FBF2CFFD678009FB8B3 /* PVCoreBridgeRetro.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B3145FBE2CFFD678009FB8B3 /* PVCoreBridgeRetro.framework */; }; B3607AA428922A9900509A68 /* error.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0D72872978C00EAEB37 /* error.cpp */; }; B3607AA528922A9900509A68 /* mednafen-endian.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0D32872978C00EAEB37 /* mednafen-endian.cpp */; }; B3607AA628922A9900509A68 /* MemoryStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB1192872978C00EAEB37 /* MemoryStream.cpp */; }; @@ -184,6 +190,20 @@ remoteGlobalIDString = 9312496F298CEBB7002DE0C2; remoteInfo = BuildPSXTV; }; + B3145C9A2CFFC834009FB8B3 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B3C7620720783162009950E4 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 937EAAF2296C2022003D89EB; + remoteInfo = BuildPSXiOS; + }; + B3145FB22CFFD4D3009FB8B3 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = B3C7620720783162009950E4 /* Project object */; + proxyType = 1; + remoteGlobalIDString = B30178D2207C901D0051B93D; + remoteInfo = beetle_psx; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -210,6 +230,7 @@ /* Begin PBXFileReference section */ B30178D3207C901D0051B93D /* libbeetle_psx.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libbeetle_psx.a; sourceTree = BUILT_PRODUCTS_DIR; }; B3135BAA26E4CDC50047F338 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; }; + B3145FBE2CFFD678009FB8B3 /* PVCoreBridgeRetro.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVCoreBridgeRetro.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B324C31B2191964F009F4EDC /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk/System/Library/Frameworks/AVFoundation.framework; sourceTree = DEVELOPER_DIR; }; B3344BC32859E088006E6B3A /* libbeetle_psx-libretro.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libbeetle_psx-libretro.a"; sourceTree = BUILT_PRODUCTS_DIR; }; B339468820783F41008DBAB4 /* libpthread.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libpthread.tbd; path = usr/lib/libpthread.tbd; sourceTree = SDKROOT; }; @@ -1139,6 +1160,11 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + B3145FB72CFFD5F6009FB8B3 /* PVCoreBridge in Frameworks */, + B3145FB12CFFD4D3009FB8B3 /* libbeetle_psx.a in Frameworks */, + B3145FBF2CFFD678009FB8B3 /* PVCoreBridgeRetro.framework in Frameworks */, + B3145FBD2CFFD66C009FB8B3 /* PVLogging in Frameworks */, + B3145FBA2CFFD632009FB8B3 /* PVPlists in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1191,6 +1217,7 @@ B3C7621B20783242009950E4 /* Frameworks */ = { isa = PBXGroup; children = ( + B3145FBE2CFFD678009FB8B3 /* PVCoreBridgeRetro.framework */, B3AB13D42949B57E005DCCDE /* OpenGL.framework */, B3CE8037287405DC00B6BB5A /* liblzma.tbd */, B3CE8038287405DC00B6BB5A /* libz.tbd */, @@ -2872,7 +2899,9 @@ buildRules = ( ); dependencies = ( + B3145C9B2CFFC834009FB8B3 /* PBXTargetDependency */, 93124976298CEBD1002DE0C2 /* PBXTargetDependency */, + B3145FB32CFFD4D3009FB8B3 /* PBXTargetDependency */, ); name = PVBeetlePSX; productName = PVReicast; @@ -2923,6 +2952,11 @@ ); mainGroup = B3C7620620783162009950E4; minimizedProjectReferenceProxies = 1; + packageReferences = ( + B3145FB52CFFD5F6009FB8B3 /* XCLocalSwiftPackageReference "../../PVCoreBridge" */, + B3145FB82CFFD632009FB8B3 /* XCLocalSwiftPackageReference "../../PVPlists" */, + B3145FBB2CFFD66C009FB8B3 /* XCLocalSwiftPackageReference "../../PVLogging" */, + ); productRefGroup = B3C7621120783162009950E4 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -3163,6 +3197,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + B3145FB42CFFD4E0009FB8B3 /* PVBeetlePSXCore.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3172,15 +3207,26 @@ 93124976298CEBD1002DE0C2 /* PBXTargetDependency */ = { isa = PBXTargetDependency; platformFilters = ( - ios, - maccatalyst, tvos, - watchos, xros, ); target = 9312496F298CEBB7002DE0C2 /* BuildPSXTV */; targetProxy = 93124975298CEBD1002DE0C2 /* PBXContainerItemProxy */; }; + B3145C9B2CFFC834009FB8B3 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + platformFilters = ( + ios, + maccatalyst, + ); + target = 937EAAF2296C2022003D89EB /* BuildPSXiOS */; + targetProxy = B3145C9A2CFFC834009FB8B3 /* PBXContainerItemProxy */; + }; + B3145FB32CFFD4D3009FB8B3 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = B30178D2207C901D0051B93D /* beetle_psx */; + targetProxy = B3145FB22CFFD4D3009FB8B3 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ @@ -3630,6 +3676,36 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCLocalSwiftPackageReference section */ + B3145FB52CFFD5F6009FB8B3 /* XCLocalSwiftPackageReference "../../PVCoreBridge" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = ../../PVCoreBridge; + }; + B3145FB82CFFD632009FB8B3 /* XCLocalSwiftPackageReference "../../PVPlists" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = ../../PVPlists; + }; + B3145FBB2CFFD66C009FB8B3 /* XCLocalSwiftPackageReference "../../PVLogging" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = ../../PVLogging; + }; +/* End XCLocalSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + B3145FB62CFFD5F6009FB8B3 /* PVCoreBridge */ = { + isa = XCSwiftPackageProductDependency; + productName = PVCoreBridge; + }; + B3145FB92CFFD632009FB8B3 /* PVPlists */ = { + isa = XCSwiftPackageProductDependency; + productName = PVPlists; + }; + B3145FBC2CFFD66C009FB8B3 /* PVLogging */ = { + isa = XCSwiftPackageProductDependency; + productName = PVLogging; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = B3C7620720783162009950E4 /* Project object */; } diff --git a/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCore.h b/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCore.h index 15c3614e42..e085eacb8e 100644 --- a/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCore.h +++ b/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCore.h @@ -8,15 +8,13 @@ #import @import PVCoreBridge; -#import - #import #define GET_CURRENT_AND_RETURN(...) __strong __typeof__(_current) current = _current; if(current == nil) return __VA_ARGS__; #define GET_CURRENT_OR_RETURN(...) __strong __typeof__(_current) current = _current; if(current == nil) return __VA_ARGS__; -PVCORE_DIRECT_MEMBERS -@interface PVBeetlePSXCore : PVLibRetroGLESCore { +//PVCORE_DIRECT_MEMBERS +@interface PVBeetlePSXCore : PVLibRetroGLESCoreBridge { // uint8_t padData[4][PVDOSButtonCount]; // int8_t xAxis[4]; // int8_t yAxis[4]; diff --git a/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCore.mm b/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCore.mm index 5316a8e867..da96c262eb 100644 --- a/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCore.mm +++ b/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCore.mm @@ -14,7 +14,7 @@ //#import "PVBeetlePSXCore+Video.h" // //#import "PVBeetlePSXCore+Audio.h" - +#import #import @import PVCoreBridge; From f9a8f4fbc07511a3b29cb244ebcfc5ca9c0b130d Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Tue, 3 Dec 2024 19:21:49 -0500 Subject: [PATCH 02/23] compiles with libretro gles2 Signed-off-by: Joseph Mattiello --- Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj b/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj index cc40e84961..0e7c06d29f 100644 --- a/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj +++ b/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj @@ -39,6 +39,8 @@ B3145FBA2CFFD632009FB8B3 /* PVPlists in Frameworks */ = {isa = PBXBuildFile; productRef = B3145FB92CFFD632009FB8B3 /* PVPlists */; }; B3145FBD2CFFD66C009FB8B3 /* PVLogging in Frameworks */ = {isa = PBXBuildFile; productRef = B3145FBC2CFFD66C009FB8B3 /* PVLogging */; }; B3145FBF2CFFD678009FB8B3 /* PVCoreBridgeRetro.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B3145FBE2CFFD678009FB8B3 /* PVCoreBridgeRetro.framework */; }; + B3145FC22CFFD7E4009FB8B3 /* glsym_es2.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAE6F2872978A00EAEB37 /* glsym_es2.c */; }; + B3145FC32CFFD7FF009FB8B3 /* libbeetle_psx-libretro.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B3344BC32859E088006E6B3A /* libbeetle_psx-libretro.a */; }; B3607AA428922A9900509A68 /* error.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0D72872978C00EAEB37 /* error.cpp */; }; B3607AA528922A9900509A68 /* mednafen-endian.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0D32872978C00EAEB37 /* mednafen-endian.cpp */; }; B3607AA628922A9900509A68 /* MemoryStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB1192872978C00EAEB37 /* MemoryStream.cpp */; }; @@ -153,7 +155,6 @@ B3681B972874168A00C0136F /* pgxp_gpu.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0792872978C00EAEB37 /* pgxp_gpu.c */; }; B37022C92872554300B3F6DA /* PVBeetlePSXCore.h in Headers */ = {isa = PBXBuildFile; fileRef = B37022C5287253B300B3F6DA /* PVBeetlePSXCore.h */; settings = {ATTRIBUTES = (Public, ); }; }; B37022CD2872558F00B3F6DA /* PVBeetlePSX.h in Headers */ = {isa = PBXBuildFile; fileRef = B37022C0287253B300B3F6DA /* PVBeetlePSX.h */; settings = {ATTRIBUTES = (Public, ); }; }; - B3AB13D82949B9CE005DCCDE /* glsym_es3.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAE6C2872978A00EAEB37 /* glsym_es3.c */; }; B3AB13DB2949BA15005DCCDE /* glsm.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAEC52872978B00EAEB37 /* glsm.c */; }; B3AB13DC2949BB4D005DCCDE /* rsx_lib_gl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0652872978C00EAEB37 /* rsx_lib_gl.cpp */; }; B3AB13DD2949BBA0005DCCDE /* rglgen.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAE702872978A00EAEB37 /* rglgen.c */; }; @@ -1160,6 +1161,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + B3145FC32CFFD7FF009FB8B3 /* libbeetle_psx-libretro.a in Frameworks */, B3145FB72CFFD5F6009FB8B3 /* PVCoreBridge in Frameworks */, B3145FB12CFFD4D3009FB8B3 /* libbeetle_psx.a in Frameworks */, B3145FBF2CFFD678009FB8B3 /* PVCoreBridgeRetro.framework in Frameworks */, @@ -3185,9 +3187,9 @@ B3681B7C287412DC00C0136F /* beetle_psx_globals.c in Sources */, B3607B582892327600509A68 /* dma.cpp in Sources */, B3607ACB28922B0B00509A68 /* compat_strl.c in Sources */, - B3AB13D82949B9CE005DCCDE /* glsym_es3.c in Sources */, B3607ACC28922B0B00509A68 /* fopen_utf8.c in Sources */, B3607AF228922BEF00509A68 /* libretro_cbs.c in Sources */, + B3145FC22CFFD7E4009FB8B3 /* glsym_es2.c in Sources */, B3607ACA28922B0B00509A68 /* retro_dirent.c in Sources */, B3607ACE28922B0B00509A68 /* encoding_utf.c in Sources */, ); From bc2ab57817817bde0cb43f3492e84853ffb73aee Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Tue, 3 Dec 2024 19:31:39 -0500 Subject: [PATCH 03/23] pvbeetlepsx builds and links as a bridged core Signed-off-by: Joseph Mattiello --- Cores/BeetlePSX/PVBeetlePSX.h | 3 +- .../PVBeetlePSX.xcodeproj/project.pbxproj | 55 +++++++++++--- Cores/BeetlePSX/PVBeetlePSX/PVBeetlePSX.h | 2 +- .../PVBeetlePSXCore/CorePlist-Generated.swift | 39 ++++++++++ .../BeetlePSX/PVBeetlePSXCore/CorePlist.swift | 71 +++++++++++++++++++ .../PVBeetlePSXCore/PVBeetlePSXCore.swift | 43 +++++++++++ ...eetlePSXCore.h => PVBeetlePSXCoreBridge.h} | 5 +- ...tlePSXCore.mm => PVBeetlePSXCoreBridge.mm} | 6 +- Cores/BeetlePSX/beetle-psx-libretro | 2 +- 9 files changed, 209 insertions(+), 17 deletions(-) create mode 100644 Cores/BeetlePSX/PVBeetlePSXCore/CorePlist-Generated.swift create mode 100644 Cores/BeetlePSX/PVBeetlePSXCore/CorePlist.swift create mode 100644 Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCore.swift rename Cores/BeetlePSX/PVBeetlePSXCore/{PVBeetlePSXCore.h => PVBeetlePSXCoreBridge.h} (89%) rename Cores/BeetlePSX/PVBeetlePSXCore/{PVBeetlePSXCore.mm => PVBeetlePSXCoreBridge.mm} (98%) diff --git a/Cores/BeetlePSX/PVBeetlePSX.h b/Cores/BeetlePSX/PVBeetlePSX.h index 47f150bc8b..78d625df7c 100644 --- a/Cores/BeetlePSX/PVBeetlePSX.h +++ b/Cores/BeetlePSX/PVBeetlePSX.h @@ -15,5 +15,4 @@ FOUNDATION_EXPORT double PVBeetlePSXVersionNumber; FOUNDATION_EXPORT const unsigned char PVBeetlePSXVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import -#import - +#import diff --git a/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj b/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj index 0e7c06d29f..abd11a28b5 100644 --- a/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj +++ b/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj @@ -34,13 +34,18 @@ /* Begin PBXBuildFile section */ B3145FB12CFFD4D3009FB8B3 /* libbeetle_psx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B30178D3207C901D0051B93D /* libbeetle_psx.a */; }; - B3145FB42CFFD4E0009FB8B3 /* PVBeetlePSXCore.mm in Sources */ = {isa = PBXBuildFile; fileRef = B37022C6287253B300B3F6DA /* PVBeetlePSXCore.mm */; settings = {COMPILER_FLAGS = "-fmodules -fcxx-modules"; }; }; + B3145FB42CFFD4E0009FB8B3 /* PVBeetlePSXCoreBridge.mm in Sources */ = {isa = PBXBuildFile; fileRef = B37022C6287253B300B3F6DA /* PVBeetlePSXCoreBridge.mm */; settings = {COMPILER_FLAGS = "-fmodules -fcxx-modules"; }; }; B3145FB72CFFD5F6009FB8B3 /* PVCoreBridge in Frameworks */ = {isa = PBXBuildFile; productRef = B3145FB62CFFD5F6009FB8B3 /* PVCoreBridge */; }; B3145FBA2CFFD632009FB8B3 /* PVPlists in Frameworks */ = {isa = PBXBuildFile; productRef = B3145FB92CFFD632009FB8B3 /* PVPlists */; }; B3145FBD2CFFD66C009FB8B3 /* PVLogging in Frameworks */ = {isa = PBXBuildFile; productRef = B3145FBC2CFFD66C009FB8B3 /* PVLogging */; }; B3145FBF2CFFD678009FB8B3 /* PVCoreBridgeRetro.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B3145FBE2CFFD678009FB8B3 /* PVCoreBridgeRetro.framework */; }; B3145FC22CFFD7E4009FB8B3 /* glsym_es2.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAE6F2872978A00EAEB37 /* glsym_es2.c */; }; B3145FC32CFFD7FF009FB8B3 /* libbeetle_psx-libretro.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B3344BC32859E088006E6B3A /* libbeetle_psx-libretro.a */; }; + B3145FC72CFFD83B009FB8B3 /* PVBeetlePSXCore.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3145FC42CFFD83B009FB8B3 /* PVBeetlePSXCore.swift */; }; + B3145FC82CFFD83B009FB8B3 /* CorePlist.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3145FC52CFFD83B009FB8B3 /* CorePlist.swift */; }; + B3145FC92CFFD83B009FB8B3 /* CorePlist-Generated.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3145FC62CFFD83B009FB8B3 /* CorePlist-Generated.swift */; }; + B3145FCC2CFFD9B0009FB8B3 /* PVCoreObjCBridge in Frameworks */ = {isa = PBXBuildFile; productRef = B3145FCB2CFFD9B0009FB8B3 /* PVCoreObjCBridge */; }; + B3145FCF2CFFDA1A009FB8B3 /* PVEmulatorCore in Frameworks */ = {isa = PBXBuildFile; productRef = B3145FCE2CFFDA1A009FB8B3 /* PVEmulatorCore */; }; B3607AA428922A9900509A68 /* error.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0D72872978C00EAEB37 /* error.cpp */; }; B3607AA528922A9900509A68 /* mednafen-endian.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0D32872978C00EAEB37 /* mednafen-endian.cpp */; }; B3607AA628922A9900509A68 /* MemoryStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB1192872978C00EAEB37 /* MemoryStream.cpp */; }; @@ -153,7 +158,7 @@ B3681B932874167800C0136F /* pgxp_mem.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0752872978C00EAEB37 /* pgxp_mem.c */; }; B3681B952874167A00C0136F /* pgxp_cpu.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0782872978C00EAEB37 /* pgxp_cpu.c */; }; B3681B972874168A00C0136F /* pgxp_gpu.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0792872978C00EAEB37 /* pgxp_gpu.c */; }; - B37022C92872554300B3F6DA /* PVBeetlePSXCore.h in Headers */ = {isa = PBXBuildFile; fileRef = B37022C5287253B300B3F6DA /* PVBeetlePSXCore.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B37022C92872554300B3F6DA /* PVBeetlePSXCoreBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = B37022C5287253B300B3F6DA /* PVBeetlePSXCoreBridge.h */; settings = {ATTRIBUTES = (Public, ); }; }; B37022CD2872558F00B3F6DA /* PVBeetlePSX.h in Headers */ = {isa = PBXBuildFile; fileRef = B37022C0287253B300B3F6DA /* PVBeetlePSX.h */; settings = {ATTRIBUTES = (Public, ); }; }; B3AB13DB2949BA15005DCCDE /* glsm.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAEC52872978B00EAEB37 /* glsm.c */; }; B3AB13DC2949BB4D005DCCDE /* rsx_lib_gl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0652872978C00EAEB37 /* rsx_lib_gl.cpp */; }; @@ -232,6 +237,9 @@ B30178D3207C901D0051B93D /* libbeetle_psx.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libbeetle_psx.a; sourceTree = BUILT_PRODUCTS_DIR; }; B3135BAA26E4CDC50047F338 /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.0.sdk/System/Library/Frameworks/QuartzCore.framework; sourceTree = DEVELOPER_DIR; }; B3145FBE2CFFD678009FB8B3 /* PVCoreBridgeRetro.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVCoreBridgeRetro.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + B3145FC42CFFD83B009FB8B3 /* PVBeetlePSXCore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PVBeetlePSXCore.swift; sourceTree = ""; }; + B3145FC52CFFD83B009FB8B3 /* CorePlist.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CorePlist.swift; sourceTree = ""; }; + B3145FC62CFFD83B009FB8B3 /* CorePlist-Generated.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CorePlist-Generated.swift"; sourceTree = ""; }; B324C31B2191964F009F4EDC /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS12.1.sdk/System/Library/Frameworks/AVFoundation.framework; sourceTree = DEVELOPER_DIR; }; B3344BC32859E088006E6B3A /* libbeetle_psx-libretro.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libbeetle_psx-libretro.a"; sourceTree = BUILT_PRODUCTS_DIR; }; B339468820783F41008DBAB4 /* libpthread.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libpthread.tbd; path = usr/lib/libpthread.tbd; sourceTree = SDKROOT; }; @@ -247,8 +255,8 @@ B37022C0287253B300B3F6DA /* PVBeetlePSX.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PVBeetlePSX.h; sourceTree = ""; }; B37022C1287253B300B3F6DA /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; B37022C3287253B300B3F6DA /* PVBeetlePSX.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PVBeetlePSX.h; sourceTree = ""; }; - B37022C5287253B300B3F6DA /* PVBeetlePSXCore.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PVBeetlePSXCore.h; sourceTree = ""; }; - B37022C6287253B300B3F6DA /* PVBeetlePSXCore.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PVBeetlePSXCore.mm; sourceTree = ""; }; + B37022C5287253B300B3F6DA /* PVBeetlePSXCoreBridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PVBeetlePSXCoreBridge.h; sourceTree = ""; }; + B37022C6287253B300B3F6DA /* PVBeetlePSXCoreBridge.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PVBeetlePSXCoreBridge.mm; sourceTree = ""; }; B39769132859E3A300558958 /* PVLibrary.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVLibrary.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B39769172859E3AD00558958 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/CoreFoundation.framework; sourceTree = DEVELOPER_DIR; }; B39769182859E3AD00558958 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; @@ -1166,6 +1174,8 @@ B3145FB12CFFD4D3009FB8B3 /* libbeetle_psx.a in Frameworks */, B3145FBF2CFFD678009FB8B3 /* PVCoreBridgeRetro.framework in Frameworks */, B3145FBD2CFFD66C009FB8B3 /* PVLogging in Frameworks */, + B3145FCC2CFFD9B0009FB8B3 /* PVCoreObjCBridge in Frameworks */, + B3145FCF2CFFDA1A009FB8B3 /* PVEmulatorCore in Frameworks */, B3145FBA2CFFD632009FB8B3 /* PVPlists in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -1186,8 +1196,11 @@ B37022C4287253B300B3F6DA /* PVBeetlePSXCore */ = { isa = PBXGroup; children = ( - B37022C5287253B300B3F6DA /* PVBeetlePSXCore.h */, - B37022C6287253B300B3F6DA /* PVBeetlePSXCore.mm */, + B3145FC42CFFD83B009FB8B3 /* PVBeetlePSXCore.swift */, + B3145FC52CFFD83B009FB8B3 /* CorePlist.swift */, + B3145FC62CFFD83B009FB8B3 /* CorePlist-Generated.swift */, + B37022C5287253B300B3F6DA /* PVBeetlePSXCoreBridge.h */, + B37022C6287253B300B3F6DA /* PVBeetlePSXCoreBridge.mm */, ); path = PVBeetlePSXCore; sourceTree = ""; @@ -2848,7 +2861,7 @@ buildActionMask = 2147483647; files = ( B37022CD2872558F00B3F6DA /* PVBeetlePSX.h in Headers */, - B37022C92872554300B3F6DA /* PVBeetlePSXCore.h in Headers */, + B37022C92872554300B3F6DA /* PVBeetlePSXCoreBridge.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2930,6 +2943,7 @@ }; B3C7620F20783162009950E4 = { CreatedOnToolsVersion = 9.3; + LastSwiftMigration = 1610; }; }; }; @@ -2958,6 +2972,8 @@ B3145FB52CFFD5F6009FB8B3 /* XCLocalSwiftPackageReference "../../PVCoreBridge" */, B3145FB82CFFD632009FB8B3 /* XCLocalSwiftPackageReference "../../PVPlists" */, B3145FBB2CFFD66C009FB8B3 /* XCLocalSwiftPackageReference "../../PVLogging" */, + B3145FCA2CFFD9B0009FB8B3 /* XCLocalSwiftPackageReference "../../PVCoreObjCBridge" */, + B3145FCD2CFFDA1A009FB8B3 /* XCLocalSwiftPackageReference "../../PVEmulatorCore" */, ); productRefGroup = B3C7621120783162009950E4 /* Products */; projectDirPath = ""; @@ -3199,7 +3215,10 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - B3145FB42CFFD4E0009FB8B3 /* PVBeetlePSXCore.mm in Sources */, + B3145FB42CFFD4E0009FB8B3 /* PVBeetlePSXCoreBridge.mm in Sources */, + B3145FC72CFFD83B009FB8B3 /* PVBeetlePSXCore.swift in Sources */, + B3145FC82CFFD83B009FB8B3 /* CorePlist.swift in Sources */, + B3145FC92CFFD83B009FB8B3 /* CorePlist-Generated.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -3396,6 +3415,7 @@ isa = XCBuildConfiguration; buildSettings = { ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES; + CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = YES; @@ -3421,6 +3441,7 @@ SUPPORTS_MACCATALYST = YES; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES; + SWIFT_VERSION = 6.0; TARGETED_DEVICE_FAMILY = "1,2,3,4,6"; TVOS_DEPLOYMENT_TARGET = 16.6; }; @@ -3523,6 +3544,7 @@ isa = XCBuildConfiguration; buildSettings = { ALLOW_TARGET_PLATFORM_SPECIALIZATION = NO; + CLANG_ENABLE_MODULES = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = YES; @@ -3548,6 +3570,7 @@ SUPPORTS_MACCATALYST = YES; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES; + SWIFT_VERSION = 6.0; TARGETED_DEVICE_FAMILY = "1,2,3,4,6"; TVOS_DEPLOYMENT_TARGET = 16.6; }; @@ -3692,6 +3715,14 @@ isa = XCLocalSwiftPackageReference; relativePath = ../../PVLogging; }; + B3145FCA2CFFD9B0009FB8B3 /* XCLocalSwiftPackageReference "../../PVCoreObjCBridge" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = ../../PVCoreObjCBridge; + }; + B3145FCD2CFFDA1A009FB8B3 /* XCLocalSwiftPackageReference "../../PVEmulatorCore" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = ../../PVEmulatorCore; + }; /* End XCLocalSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ @@ -3707,6 +3738,14 @@ isa = XCSwiftPackageProductDependency; productName = PVLogging; }; + B3145FCB2CFFD9B0009FB8B3 /* PVCoreObjCBridge */ = { + isa = XCSwiftPackageProductDependency; + productName = PVCoreObjCBridge; + }; + B3145FCE2CFFDA1A009FB8B3 /* PVEmulatorCore */ = { + isa = XCSwiftPackageProductDependency; + productName = PVEmulatorCore; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = B3C7620720783162009950E4 /* Project object */; diff --git a/Cores/BeetlePSX/PVBeetlePSX/PVBeetlePSX.h b/Cores/BeetlePSX/PVBeetlePSX/PVBeetlePSX.h index f4650c02b4..4edac0e682 100644 --- a/Cores/BeetlePSX/PVBeetlePSX/PVBeetlePSX.h +++ b/Cores/BeetlePSX/PVBeetlePSX/PVBeetlePSX.h @@ -15,4 +15,4 @@ FOUNDATION_EXPORT double PVBeetlePSXVersionNumber; FOUNDATION_EXPORT const unsigned char PVBeetlePSXVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import -#import +#import diff --git a/Cores/BeetlePSX/PVBeetlePSXCore/CorePlist-Generated.swift b/Cores/BeetlePSX/PVBeetlePSXCore/CorePlist-Generated.swift new file mode 100644 index 0000000000..d3d00849bf --- /dev/null +++ b/Cores/BeetlePSX/PVBeetlePSXCore/CorePlist-Generated.swift @@ -0,0 +1,39 @@ +// swiftlint:disable all +// Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen + +import Foundation + +#if canImport(PVCoreBridge) +@_exported import PVCoreBridge +@_exported import PVPlists +#endif + +// swiftlint:disable superfluous_disable_command +// swiftlint:disable file_length + +// MARK: - Plist Files + +// swiftlint:disable identifier_name line_length number_separator type_body_length +public enum CorePlist { + public static let pvCoreIdentifier: String = "com.provenance.core.beetlepsx" + public static let pvPrincipleClass: String = "PVBeetlePSX.PVBeetlePSXCore" + public static let pvProjectName: String = "BeetlePSX" + public static let pvProjectURL: String = "https://github.com/libretro/beetle-psx-libretro" + public static let pvProjectVersion: String = "0" + public static let pvSupportedSystems: [String] = ["com.provenance.psx"] + + #if canImport(PVCoreBridge) + public static var corePlist: EmulatorCoreInfoPlist { + .init( + identifier: CorePlist.pvCoreIdentifier, + principleClass: CorePlist.pvPrincipleClass, + supportedSystems: CorePlist.pvSupportedSystems, + projectName: CorePlist.pvProjectName, + projectURL: CorePlist.pvProjectURL, + projectVersion: CorePlist.pvProjectVersion) + } + + public var corePlist: EmulatorCoreInfoPlist { Self.corePlist } + #endif +} +// swiftlint:enable identifier_name line_length number_separator type_body_length diff --git a/Cores/BeetlePSX/PVBeetlePSXCore/CorePlist.swift b/Cores/BeetlePSX/PVBeetlePSXCore/CorePlist.swift new file mode 100644 index 0000000000..b1c0fdc442 --- /dev/null +++ b/Cores/BeetlePSX/PVBeetlePSXCore/CorePlist.swift @@ -0,0 +1,71 @@ +// +// CorePlist.swift +// +// +// Created by Joseph Mattiello on 6/21/24. +// + +import Foundation +import PVLogging +import PVCoreBridge +import PVEmulatorCore +import PVPlists + +#if SWIFT_PACKAGE +public extension PVBundleFinder { + static var BeetlePSXModule: Bundle { Bundle.module } + static var BeetlePSXBundle: Bundle { Bundle(for: PVBeetlePSXCore.self) } +} +#else +public extension PVBundleFinder { + static var PVBeetlePSXCoreBundle: Bundle { Bundle(for: PVBeetlePSXCore.self) } +} +#endif + +@objc +extension PVBeetlePSXCore: EmulatorCoreInfoPlistProvider { + +#if SWIFT_PACKAGE + @objc + public static var resourceBundle: Bundle { Bundle.module } + + @objc + public override var resourceBundle: Bundle { Bundle.module } + #else + @objc + public static var resourceBundle: Bundle { PVBundleFinder.PVBeetlePSXCoreBundle } + + @objc + public override var resourceBundle: Bundle { PVBundleFinder.PVBeetlePSXCoreBundle } + + #endif + @objc(corePlistFromBundle) + public static var corePlistFromBundle: EmulatorCoreInfoPlist { + + guard let plistPath = resourceBundle.url(forResource: "Core", withExtension: "plist") else { + fatalError("Could not locate Core.plist") + } + + guard let data = try? Data(contentsOf: plistPath) else { + fatalError("Could not read Core.plist") + } + + guard let plistObject = try? PropertyListSerialization.propertyList(from: data, options: [], format: nil) as? [String: Any] else { + fatalError("Could not generate parse Core.plist") + } + + guard let corePlist = EmulatorCoreInfoPlist.init(fromInfoDictionary: plistObject) else { + fatalError("Could not generate EmulatorCoreInfoPlist from Core.plist") + } + + return corePlist + } + + /// Note: CorePlist is an enum generated by SwiftGen with a custom stencil + /// Change the swiftgen config to the local path to see the outputs and tweak + @objc(corePlist) + public static var corePlist: EmulatorCoreInfoPlist { CorePlist.corePlist } + + @objc + public var corePlist: EmulatorCoreInfoPlist { Self.corePlist } +} diff --git a/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCore.swift b/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCore.swift new file mode 100644 index 0000000000..f9da8429e7 --- /dev/null +++ b/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCore.swift @@ -0,0 +1,43 @@ +// +// PVBeetlePSXCore.swift +// PVBeetlePSX +// +// Created by Joseph Mattiello on 8/15/24. +// Copyright © 2024 Provenance Emu. All rights reserved. +// + +import Foundation +import PVEmulatorCore +import PVCoreBridge +import PVCoreObjCBridge +import PVCoreBridgeRetro + +@objc +@objcMembers +open class PVBeetlePSXCore: PVEmulatorCore { + + lazy var _bridge: PVBeetlePSXCoreBridge = .init() + + public required init() { + super.init() + self.bridge = (_bridge as! any ObjCBridgedCoreBridge) + } +} + +extension PVBeetlePSXCore: PVPSXSystemResponderClient { + public func didMoveJoystick(_ button: PVCoreBridge.PVPSXButton, withXValue xValue: CGFloat, withYValue yValue: CGFloat, forPlayer player: Int) { + (_bridge as! PVPSXSystemResponderClient).didMoveJoystick(button, withXValue: xValue, withYValue: yValue, forPlayer: player) + } + + public func didMoveJoystick(_ button: Int, withXValue xValue: CGFloat, withYValue yValue: CGFloat, forPlayer player: Int) { + (_bridge as! PVPSXSystemResponderClient).didMoveJoystick(button, withXValue: xValue, withYValue: yValue, forPlayer: player) + } + + public func didPush(_ button: PVCoreBridge.PVPSXButton, forPlayer player: Int) { + (_bridge as! PVPSXSystemResponderClient).didPush(button, forPlayer: player) + } + public func didRelease(_ button: PVCoreBridge.PVPSXButton, forPlayer player: Int) { + (_bridge as! PVPSXSystemResponderClient).didRelease(button, forPlayer: player) + } +} + diff --git a/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCore.h b/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.h similarity index 89% rename from Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCore.h rename to Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.h index e085eacb8e..71bf89fcf9 100644 --- a/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCore.h +++ b/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.h @@ -7,14 +7,15 @@ // #import -@import PVCoreBridge; #import #define GET_CURRENT_AND_RETURN(...) __strong __typeof__(_current) current = _current; if(current == nil) return __VA_ARGS__; #define GET_CURRENT_OR_RETURN(...) __strong __typeof__(_current) current = _current; if(current == nil) return __VA_ARGS__; +@protocol PVPSXSystemResponderClient; + //PVCORE_DIRECT_MEMBERS -@interface PVBeetlePSXCore : PVLibRetroGLESCoreBridge { +@interface PVBeetlePSXCoreBridge : PVLibRetroGLESCoreBridge { // uint8_t padData[4][PVDOSButtonCount]; // int8_t xAxis[4]; // int8_t yAxis[4]; diff --git a/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCore.mm b/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm similarity index 98% rename from Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCore.mm rename to Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm index da96c262eb..522c8343dd 100644 --- a/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCore.mm +++ b/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm @@ -6,7 +6,7 @@ // Copyright © 2022 Provenance. All rights reserved. // -#import "PVBeetlePSXCore.h" +#import "PVBeetlePSXCoreBridge.h" #include #include "libretro_options.h" //#import "PVBeetlePSXCore+Controls.h" @@ -23,7 +23,7 @@ #define OpenEmu 1 #pragma mark - Private -@interface PVBeetlePSXCore() { +@interface PVBeetlePSXCoreBridge() { } @@ -31,7 +31,7 @@ @interface PVBeetlePSXCore() { #pragma mark - PVBeetlePSXCore Begin -@implementation PVBeetlePSXCore +@implementation PVBeetlePSXCoreBridge { } diff --git a/Cores/BeetlePSX/beetle-psx-libretro b/Cores/BeetlePSX/beetle-psx-libretro index 4674700f0c..bafeb6c14e 160000 --- a/Cores/BeetlePSX/beetle-psx-libretro +++ b/Cores/BeetlePSX/beetle-psx-libretro @@ -1 +1 @@ -Subproject commit 4674700f0c46dbe610f3d860cddf4aad44ff2f7f +Subproject commit bafeb6c14e5049de8c7cdade1b6d137f291220b9 From a47d82b1f7e7f4db4547c326a60624037e180998 Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Tue, 3 Dec 2024 19:57:12 -0500 Subject: [PATCH 04/23] add psxbeetle to lite appstore Signed-off-by: Joseph Mattiello --- Provenance.xcodeproj/project.pbxproj | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Provenance.xcodeproj/project.pbxproj b/Provenance.xcodeproj/project.pbxproj index d3898d07e4..2cf3626b5c 100644 --- a/Provenance.xcodeproj/project.pbxproj +++ b/Provenance.xcodeproj/project.pbxproj @@ -1842,6 +1842,7 @@ B313544926E4C3B90047F338 /* PVPlay.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVPlay.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B313544C26E4C3BE0047F338 /* PVPlay.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVPlay.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B31364762970092D00C34FED /* PVDuckStation.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVDuckStation.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + B3145FD02CFFDAE2009FB8B3 /* PVBeetlePSX.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVBeetlePSX.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B31553612CC2FD5500C472CA /* PVPPSSPP.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVPPSSPP.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B316B4D12192652000693472 /* PVReicast.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVReicast.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B316B4D62192659900693472 /* PVVirtualJaguar.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVVirtualJaguar.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -3213,6 +3214,7 @@ 1A3D409617B2DCE4004DFFFC /* Frameworks */ = { isa = PBXGroup; children = ( + B3145FD02CFFDAE2009FB8B3 /* PVBeetlePSX.framework */, B35197FB2D1A5EF100D2B413 /* PVGenesis.framework */, B32C08F82D053FF60024A3E2 /* PVMupen64PlusBridge.framework */, B32C08EB2D053DD50024A3E2 /* PVEmuThree.framework */, From 34d79dc84c4b65f72f575f9dbb3109997d6a5979 Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Tue, 3 Dec 2024 22:40:38 -0500 Subject: [PATCH 05/23] beetle link all, still no work Signed-off-by: Joseph Mattiello --- Cores/BeetlePSX/BuildFlags.xcconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cores/BeetlePSX/BuildFlags.xcconfig b/Cores/BeetlePSX/BuildFlags.xcconfig index fc027d7521..9825031496 100644 --- a/Cores/BeetlePSX/BuildFlags.xcconfig +++ b/Cores/BeetlePSX/BuildFlags.xcconfig @@ -15,7 +15,7 @@ GL_APIENTRYP=GLAPIENTRY* //OTHER_CFLAGS = $(inherited) -ObjC -ffast-math -ftree-vectorize -fno-strict-aliasing -fpermissive -fomit-frame-pointer -fmodules -fcxx-modules OTHER_CFLAGS = $(inherited) -fmodules -fcxx-modules -// OTHER_LDFLAGS = $(inherited) -ObjC -Wl,-all_load -all_load + OTHER_LDFLAGS = $(inherited) -ObjC -Wl,-all_load -all_load // EXCLUDED_SOURCE_FILE_NAMES[sdk=macosx*] = $(inherited) From df31c2863662ec09e98962e20bb13204e50dacc7 Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Tue, 3 Dec 2024 22:41:10 -0500 Subject: [PATCH 06/23] enable melon because it has the same problem Signed-off-by: Joseph Mattiello --- Provenance.xcodeproj/project.pbxproj | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Provenance.xcodeproj/project.pbxproj b/Provenance.xcodeproj/project.pbxproj index 2cf3626b5c..7d47ea81d0 100644 --- a/Provenance.xcodeproj/project.pbxproj +++ b/Provenance.xcodeproj/project.pbxproj @@ -170,6 +170,10 @@ B312805F274C60EC00550720 /* SteamController in Frameworks */ = {isa = PBXBuildFile; productRef = B3D30FC026F0BCE60064603F /* SteamController */; }; B313647C2970095B00C34FED /* PVPCSXRearmed.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B38E0F10289290E5004720DA /* PVPCSXRearmed.framework */; }; B313647D2970095B00C34FED /* PVPCSXRearmed.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = B38E0F10289290E5004720DA /* PVPCSXRearmed.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + B3147AED2D00042B009FB8B3 /* PVMelonDS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B3147AEC2D00042B009FB8B3 /* PVMelonDS.framework */; }; + B3147AEE2D00042B009FB8B3 /* PVMelonDS.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = B3147AEC2D00042B009FB8B3 /* PVMelonDS.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + B3147AF02D000469009FB8B3 /* PVMelonDSRetro.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B3147AEF2D000469009FB8B3 /* PVMelonDSRetro.framework */; }; + B3147AF12D000469009FB8B3 /* PVMelonDSRetro.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = B3147AEF2D000469009FB8B3 /* PVMelonDSRetro.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; B31553622CC2FD5500C472CA /* PVPPSSPP.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B31553612CC2FD5500C472CA /* PVPPSSPP.framework */; }; B31553632CC2FD5500C472CA /* PVPPSSPP.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = B31553612CC2FD5500C472CA /* PVPPSSPP.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; B318E2772CAB4B3F00D0E599 /* PVGenesis.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B318E2762CAB4B3F00D0E599 /* PVGenesis.framework */; }; @@ -1476,6 +1480,7 @@ B3A1868C2CBCBAF900BB1FFE /* PVMupen64PlusBridge.framework in Embed Frameworks */, B37321A82C900B1E00CF59EF /* PVTGBDual-Dynamic in Embed Frameworks */, B31553632CC2FD5500C472CA /* PVPPSSPP.framework in Embed Frameworks */, + B3147AEE2D00042B009FB8B3 /* PVMelonDS.framework in Embed Frameworks */, B3A477C62C941F120052500A /* PVFCEU.framework in Embed Frameworks */, B351E7CF2CBE072D0000E087 /* libavformat.xcframework in Embed Frameworks */, B377ECCA2CB3533C00E9B750 /* PVVecX.framework in Embed Frameworks */, @@ -1486,6 +1491,7 @@ B351E7D32CBE072D0000E087 /* libavcodec.xcframework in Embed Frameworks */, B3C65E5B2CA53666000E37B0 /* PVMupen64Plus.framework in Embed Frameworks */, B3FE6DB32C93E60900792419 /* PVO2EM.framework in Embed Frameworks */, + B3147AF12D000469009FB8B3 /* PVMelonDSRetro.framework in Embed Frameworks */, B3E1C0482C96F86000EB4238 /* PVProSystem-Dynamic in Embed Frameworks */, B37321A52C900A9F00CF59EF /* PVCrabEmu-Dynamic in Embed Frameworks */, ); @@ -1843,6 +1849,8 @@ B313544C26E4C3BE0047F338 /* PVPlay.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVPlay.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B31364762970092D00C34FED /* PVDuckStation.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVDuckStation.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B3145FD02CFFDAE2009FB8B3 /* PVBeetlePSX.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVBeetlePSX.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + B3147AEC2D00042B009FB8B3 /* PVMelonDS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVMelonDS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + B3147AEF2D000469009FB8B3 /* PVMelonDSRetro.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVMelonDSRetro.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B31553612CC2FD5500C472CA /* PVPPSSPP.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVPPSSPP.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B316B4D12192652000693472 /* PVReicast.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVReicast.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B316B4D62192659900693472 /* PVVirtualJaguar.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVVirtualJaguar.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -2842,6 +2850,7 @@ B39CE2882C8E3E8400A1AC8C /* PVVirtualJaguar-Dynamic in Frameworks */, B35EEFD02C6C6D1A00EBD1A8 /* AudioToolbox.framework in Frameworks */, B3FC97302CB8B6BA00C6DB31 /* PVVisualBoyAdvance-Dynamic in Frameworks */, + B3147AED2D00042B009FB8B3 /* PVMelonDS.framework in Frameworks */, B35EEFD12C6C6D1A00EBD1A8 /* PVSettings in Frameworks */, B36C8E7B2C7ECE6100BD4377 /* PVStella-Dynamic in Frameworks */, B35EEFD22C6C6D1A00EBD1A8 /* MBProgressHUD in Frameworks */, @@ -2849,6 +2858,7 @@ B3E2AA542CB63A7B00E2636D /* PVBeetlePSX.framework in Frameworks */, B35EEFD32C6C6D1A00EBD1A8 /* UIKit.framework in Frameworks */, B35EEFD42C6C6D1A00EBD1A8 /* PVThemes in Frameworks */, + B3147AF02D000469009FB8B3 /* PVMelonDSRetro.framework in Frameworks */, B35EEFD52C6C6D1A00EBD1A8 /* Reachability in Frameworks */, B35EEFD62C6C6D1A00EBD1A8 /* SteamController in Frameworks */, B39680492CE720E300E1AB6D /* Perception in Frameworks */, @@ -3214,6 +3224,8 @@ 1A3D409617B2DCE4004DFFFC /* Frameworks */ = { isa = PBXGroup; children = ( + B3147AEF2D000469009FB8B3 /* PVMelonDSRetro.framework */, + B3147AEC2D00042B009FB8B3 /* PVMelonDS.framework */, B3145FD02CFFDAE2009FB8B3 /* PVBeetlePSX.framework */, B35197FB2D1A5EF100D2B413 /* PVGenesis.framework */, B32C08F82D053FF60024A3E2 /* PVMupen64PlusBridge.framework */, From 0a0a3d616a0c5ae650e4804bdb11367c59716d73 Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Mon, 30 Dec 2024 16:54:52 -0500 Subject: [PATCH 07/23] beetle ios tvos 16.0 Signed-off-by: Joseph Mattiello --- Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj b/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj index abd11a28b5..c97bd20902 100644 --- a/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj +++ b/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj @@ -3427,7 +3427,7 @@ GCC_WARN_INHIBIT_ALL_WARNINGS = YES; INFOPLIST_FILE = "$(SRCROOT)/PVBeetlePSX/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 15.6; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -3443,7 +3443,7 @@ SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_VERSION = 6.0; TARGETED_DEVICE_FAMILY = "1,2,3,4,6"; - TVOS_DEPLOYMENT_TARGET = 16.6; + TVOS_DEPLOYMENT_TARGET = 16.0; }; name = Release; }; @@ -3556,7 +3556,7 @@ GCC_WARN_INHIBIT_ALL_WARNINGS = YES; INFOPLIST_FILE = "$(SRCROOT)/PVBeetlePSX/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 15.6; + IPHONEOS_DEPLOYMENT_TARGET = 16.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -3572,7 +3572,7 @@ SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES; SWIFT_VERSION = 6.0; TARGETED_DEVICE_FAMILY = "1,2,3,4,6"; - TVOS_DEPLOYMENT_TARGET = 16.6; + TVOS_DEPLOYMENT_TARGET = 16.0; }; name = Debug; }; From 7daefb0f66ba3d1e39dd92e18d0f5ed677468364 Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Mon, 30 Dec 2024 17:23:34 -0500 Subject: [PATCH 08/23] fix xcodeproj overriding buildflags c and linker flags Signed-off-by: Joseph Mattiello --- Cores/BeetlePSX/BuildFlags.xcconfig | 5 +++-- Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj | 6 ------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Cores/BeetlePSX/BuildFlags.xcconfig b/Cores/BeetlePSX/BuildFlags.xcconfig index 9825031496..c8d5bd97cd 100644 --- a/Cores/BeetlePSX/BuildFlags.xcconfig +++ b/Cores/BeetlePSX/BuildFlags.xcconfig @@ -13,7 +13,7 @@ GL_APIENTRYP=GLAPIENTRY* // HAVE_VULKAN=0 HAVE_JIT=0 WANT_16BPP=0 WANT_8BPP=1 LIGHTREC_DEBUG=0 HAVE_OPENGL=0 HAVE_SHM=1 USE_FIXED // HAVE_CDROM=1 //OTHER_CFLAGS = $(inherited) -ObjC -ffast-math -ftree-vectorize -fno-strict-aliasing -fpermissive -fomit-frame-pointer -fmodules -fcxx-modules -OTHER_CFLAGS = $(inherited) -fmodules -fcxx-modules +OTHER_CFLAGS = $(inherited) -fmodules -fcxx-modules -Wno-module-import-in-extern-c OTHER_LDFLAGS = $(inherited) -ObjC -Wl,-all_load -all_load @@ -25,7 +25,7 @@ GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) TARGET_IPHONE=1 NEON= // TODO: Why does this result in some missing symbols? // HAVE_OPENGLES_3_1=1 -OTHER_CFLAGS[sdk=iphoneos*] = $(inherited) -mfpu=neon -D__VEC4_OPT -D__NEON_OPT +OTHER_CFLAGS[sdk=iphoneos*] = $(inherited) -D__VEC4_OPT -D__NEON_OPT EXCLUDED_SOURCE_FILE_NAMES[sdk=iphoneos*] = $(inherited) // Simulator @@ -34,6 +34,7 @@ GCC_PREPROCESSOR_DEFINITIONS[sdk=iphonesimulator*] = TARGET_IPHONE_SIMULATOR=1 I // tvOS Device //GCC_PREPROCESSOR_DEFINITIONS[sdk=appletvos*] = $(inherited) TARGET_IPHONE=1 IOS=1 HAVE_OPENGLES3=1 +OTHER_CFLAGS[sdk=appletvos*] = $(inherited) -D__VEC4_OPT -D__NEON_OPT // HAVE_OPENGLES_3_1=1 // tvOS Simulator diff --git a/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj b/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj index c97bd20902..089fd08d49 100644 --- a/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj +++ b/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj @@ -3393,11 +3393,8 @@ "\"$(SRCROOT)/beetle-psx-libretro/lightning-lightrec-include\"", ); IPHONEOS_DEPLOYMENT_TARGET = 13.0; - LD_MAP_FILE_PATH = ""; MTL_ENABLE_DEBUG_INFO = NO; ONLY_ACTIVE_ARCH = NO; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; SDKROOT = auto; SUPPORTED_PLATFORMS = "xrsimulator xros watchsimulator watchos macosx iphonesimulator iphoneos appletvsimulator appletvos"; SUPPORTS_MACCATALYST = YES; @@ -3522,11 +3519,8 @@ "\"$(SRCROOT)/beetle-psx-libretro/lightning-lightrec-include\"", ); IPHONEOS_DEPLOYMENT_TARGET = 13.0; - LD_MAP_FILE_PATH = ""; MTL_ENABLE_DEBUG_INFO = NO; ONLY_ACTIVE_ARCH = YES; - OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; SDKROOT = auto; SUPPORTED_PLATFORMS = "xrsimulator xros watchsimulator watchos macosx iphonesimulator iphoneos appletvsimulator appletvos"; SUPPORTS_MACCATALYST = YES; From f8b8b2a83fe62cd24d047370f3fa0f7c83e7a3b6 Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Mon, 30 Dec 2024 17:48:58 -0500 Subject: [PATCH 09/23] remove literec from build Signed-off-by: Joseph Mattiello --- Cores/BeetlePSX/BuildFlags.xcconfig | 42 ++++++++++++++++++- .../PVBeetlePSX.xcodeproj/project.pbxproj | 38 ++++------------- 2 files changed, 49 insertions(+), 31 deletions(-) diff --git a/Cores/BeetlePSX/BuildFlags.xcconfig b/Cores/BeetlePSX/BuildFlags.xcconfig index c8d5bd97cd..3bae5cd884 100644 --- a/Cores/BeetlePSX/BuildFlags.xcconfig +++ b/Cores/BeetlePSX/BuildFlags.xcconfig @@ -7,7 +7,47 @@ // // All -GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) __LIBRETRO__=1 HAVE_PBP=1 HAVE_CHD=1 _7ZIP_ST=1 WANT_THREADING=1 HAVE_THREADS=1 ENABLE_THREADED_COMPILER=1 HAVE_OPENGLES2=1 SIZEOF_DOUBLE=8 PACKAGE=mednafen MEDNAFEN_VERSION_NUMERIC=9386 PSS_STYLE=1 MPC_FIXED_POINT STDC_HEADERS __STDC_LIMIT_MACROS _LOW_ACCURACY_ _FILE_OFFSET_BITS=64 __STDC_CONSTANT_MACROS FRONTEND_SUPPORTS_RGB565=1 HAVE_CHD=1 LINK_STATIC_LIBCPLUSPLUS=1 THREADED_RECOMPILER=1 LIGHTREC_LOG_LEVEL=3 NEED_THREADING=1 HAVE_LIBRETRO=1 WANT_32BPP=1 NEED_CD=1 LIGHTREC_STATIC=1 NEED_TREMOR=1 NEED_BPP=32 NEED_DEINTERLACER=1 HAVE_HW=1 SET_HAVE_HW=1 WANT_PSX_EMU=1 HAVE_UNISTD_H=1 MEDNAFEN_VERSION=0.9.38.6 HAS_DEFAULT_ELM=0 ENABLE_DISASSEMBLER=0 HAVE_GRIFFIN=0 HAVE_OPENGLES=1 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) ENABLE_DISASSEMBLER=0 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) ENABLE_THREADED_COMPILER=1 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) FRONTEND_SUPPORTS_RGB565=1 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) HAS_DEFAULT_ELM=0 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) HAVE_CHD=1 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) HAVE_CHD=1 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) HAVE_GRIFFIN=0 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) HAVE_HW=1 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) HAVE_LIBRETRO=1 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) HAVE_OPENGLES2=1 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) HAVE_OPENGLES=1 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) HAVE_PBP=1 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) HAVE_THREADS=1 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) HAVE_UNISTD_H=1 +//GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) LIGHTREC_LOG_LEVEL=3 +//GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) LIGHTREC_STATIC=1 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) LINK_STATIC_LIBCPLUSPLUS=1 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) MEDNAFEN_VERSION=0.9.38.6 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) MEDNAFEN_VERSION_NUMERIC=9386 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) MPC_FIXED_POINT +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) NEED_BPP=32 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) NEED_CD=1 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) NEED_DEINTERLACER=1 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) NEED_THREADING=1 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) NEED_TREMOR=1 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) PACKAGE=mednafen +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) PSS_STYLE=1 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) SET_HAVE_HW=1 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) SIZEOF_DOUBLE=8 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) STDC_HEADERS +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) THREADED_RECOMPILER=1 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) WANT_32BPP=1 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) WANT_PSX_EMU=1 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) WANT_THREADING=1 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) _7ZIP_ST=1 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) _FILE_OFFSET_BITS=64 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) _LOW_ACCURACY_ +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) __LIBRETRO__=1 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) __STDC_CONSTANT_MACROS +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) __STDC_LIMIT_MACROS + GL_APIENTRYP=GLAPIENTRY* // HAVE_OPENGLES=1 // HAVE_VULKAN=0 HAVE_JIT=0 WANT_16BPP=0 WANT_8BPP=1 LIGHTREC_DEBUG=0 HAVE_OPENGL=0 HAVE_SHM=1 USE_FIXED diff --git a/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj b/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj index 089fd08d49..546034226e 100644 --- a/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj +++ b/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj @@ -117,19 +117,6 @@ B3607B2F28922E3300509A68 /* pgxp_main.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0802872978C00EAEB37 /* pgxp_main.c */; }; B3607B3428922ECA00509A68 /* surface.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0B22872978C00EAEB37 /* surface.cpp */; }; B3607B3528922ECA00509A68 /* Deinterlacer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0B02872978C00EAEB37 /* Deinterlacer.cpp */; }; - B3607B3828922FC700509A68 /* optimizer.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0322872978C00EAEB37 /* optimizer.c */; }; - B3607B3928922FC700509A68 /* reaper.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0432872978C00EAEB37 /* reaper.c */; }; - B3607B3A28922FC700509A68 /* blockcache.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB04C2872978C00EAEB37 /* blockcache.c */; }; - B3607B3B28922FC700509A68 /* interpreter.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB04A2872978C00EAEB37 /* interpreter.c */; }; - B3607B3C28922FC700509A68 /* lightrec.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB04B2872978C00EAEB37 /* lightrec.c */; }; - B3607B3D28922FC700509A68 /* emitter.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0472872978C00EAEB37 /* emitter.c */; }; - B3607B3E28922FC700509A68 /* memmanager.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0452872978C00EAEB37 /* memmanager.c */; }; - B3607B3F28922FC700509A68 /* regcache.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0482872978C00EAEB37 /* regcache.c */; }; - B3607B4828922FFC00509A68 /* jit_memory.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAF032872978B00EAEB37 /* jit_memory.c */; }; - B3607B4928922FFC00509A68 /* lightning.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAF302872978B00EAEB37 /* lightning.c */; }; - B3607B4B28922FFC00509A68 /* jit_note.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAF1C2872978B00EAEB37 /* jit_note.c */; }; - B3607B4D28922FFC00509A68 /* jit_names.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAF2D2872978B00EAEB37 /* jit_names.c */; }; - B3607B4E28922FFC00509A68 /* jit_size.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAF072872978B00EAEB37 /* jit_size.c */; }; B3607B562892310A00509A68 /* vorbisfile.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0A92872978C00EAEB37 /* vorbisfile.c */; }; B3607B582892327600509A68 /* dma.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0E72872978C00EAEB37 /* dma.cpp */; }; B3607B5A289232B200509A68 /* sio.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB1102872978C00EAEB37 /* sio.cpp */; }; @@ -145,7 +132,6 @@ B3607B6E2892348400509A68 /* floor1.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0A22872978C00EAEB37 /* floor1.c */; }; B3607B702892349600509A68 /* synthesis.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0A32872978C00EAEB37 /* synthesis.c */; }; B3607B72289234A900509A68 /* mdct.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0952872978C00EAEB37 /* mdct.c */; }; - B3607B74289234C100509A68 /* recompiler.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0412872978C00EAEB37 /* recompiler.c */; }; B3607B76289234DA00509A68 /* sharedbook.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0A12872978C00EAEB37 /* sharedbook.c */; }; B3607B78289234EC00509A68 /* floor0.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0992872978C00EAEB37 /* floor0.c */; }; B3681B7C287412DC00C0136F /* beetle_psx_globals.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0722872978C00EAEB37 /* beetle_psx_globals.c */; }; @@ -3067,7 +3053,6 @@ B3607B0528922C9C00509A68 /* guncon.cpp in Sources */, B3607B2528922E1800509A68 /* kirk_engine.c in Sources */, B3681B912874165100C0136F /* cpu.cpp in Sources */, - B3607B3828922FC700509A68 /* optimizer.c in Sources */, B3CE80222874050000B6BB5A /* zutil.c in Sources */, B3607AFE28922C8500509A68 /* frontio.cpp in Sources */, B3607AFF28922C8500509A68 /* mdec.cpp in Sources */, @@ -3075,8 +3060,6 @@ B3607AAA28922A9900509A68 /* Stream.cpp in Sources */, B3607B5C289233B400509A68 /* block.c in Sources */, B3CE8019287404EE00B6BB5A /* libchdr_chd.c in Sources */, - B3607B4928922FFC00509A68 /* lightning.c in Sources */, - B3607B3C28922FC700509A68 /* lightrec.c in Sources */, B3607B0B28922C9C00509A68 /* dualanalog.cpp in Sources */, B3607B72289234A900509A68 /* mdct.c in Sources */, B3607B2228922E1800509A68 /* ec.c in Sources */, @@ -3087,7 +3070,6 @@ B3607B5A289232B200509A68 /* sio.cpp in Sources */, B3607B0028922C8500509A68 /* timer.cpp in Sources */, B3681B89287415D200C0136F /* spu.cpp in Sources */, - B3607B3F28922FC700509A68 /* regcache.c in Sources */, B3681B952874167A00C0136F /* pgxp_cpu.c in Sources */, B3607B0228922C8500509A68 /* irq.cpp in Sources */, B3607B76289234DA00509A68 /* sharedbook.c in Sources */, @@ -3096,12 +3078,10 @@ B3607AD928922BCE00509A68 /* cdromif.cpp in Sources */, B3607AA828922A9900509A68 /* general.cpp in Sources */, B3607B1E28922E0E00509A68 /* aes.c in Sources */, - B3607B4828922FFC00509A68 /* jit_memory.c in Sources */, B3681B932874167800C0136F /* pgxp_mem.c in Sources */, B3607B0C28922C9C00509A68 /* negcon.cpp in Sources */, B3607B562892310A00509A68 /* vorbisfile.c in Sources */, B3607B0428922C9C00509A68 /* justifier.cpp in Sources */, - B3607B4D28922FFC00509A68 /* jit_names.c in Sources */, B3607AD628922BCE00509A68 /* CDAccess_Image.cpp in Sources */, B3681B7E2874130B00C0136F /* gpu.cpp in Sources */, B3CE8009287404B200B6BB5A /* LzFind.c in Sources */, @@ -3119,17 +3099,12 @@ B3607ADE28922BCE00509A68 /* CDAccess_CCD.cpp in Sources */, B3607B2328922E1800509A68 /* sha1.c in Sources */, B3607B6E2892348400509A68 /* floor1.c in Sources */, - B3607B3928922FC700509A68 /* reaper.c in Sources */, B3607B2D28922E3300509A68 /* pgxp_value.c in Sources */, B3607AE028922BCE00509A68 /* misc.cpp in Sources */, B3607B2128922E1800509A68 /* bn.c in Sources */, B3607B0728922C9C00509A68 /* mouse.cpp in Sources */, B3CE800B287404B200B6BB5A /* LzmaEnc.c in Sources */, B3CE800A287404B200B6BB5A /* Lzma86Dec.c in Sources */, - B3607B4E28922FFC00509A68 /* jit_size.c in Sources */, - B3607B3E28922FC700509A68 /* memmanager.c in Sources */, - B3607B74289234C100509A68 /* recompiler.c in Sources */, - B3607B4B28922FFC00509A68 /* jit_note.c in Sources */, B3607B0128922C8500509A68 /* gpu_polygon_sub.cpp in Sources */, B3607ADC28922BCE00509A68 /* galois.c in Sources */, B3607B3428922ECA00509A68 /* surface.cpp in Sources */, @@ -3141,7 +3116,6 @@ B3607ADF28922BCE00509A68 /* audioreader.cpp in Sources */, B3607B0828922C9C00509A68 /* gamepad.cpp in Sources */, B3607AD728922BCE00509A68 /* CDAccess.cpp in Sources */, - B3607B3B28922FC700509A68 /* interpreter.c in Sources */, B3607AD828922BCE00509A68 /* CDAccess_PBP.cpp in Sources */, B3607AA628922A9900509A68 /* MemoryStream.cpp in Sources */, B3607B0A28922C9C00509A68 /* dualshock.cpp in Sources */, @@ -3157,11 +3131,9 @@ B3607B2028922E1800509A68 /* des.c in Sources */, B3607B0928922C9C00509A68 /* memcard.cpp in Sources */, B3CE8007287404B200B6BB5A /* BraIA64.c in Sources */, - B3607B3A28922FC700509A68 /* blockcache.c in Sources */, B3607ADD28922BCE00509A68 /* lec.c in Sources */, B3CE8004287404B200B6BB5A /* CpuArch.c in Sources */, B3607AB228922AA800509A68 /* settings.c in Sources */, - B3607B3D28922FC700509A68 /* emitter.c in Sources */, B3CE80202874050000B6BB5A /* inflate.c in Sources */, B3607AA428922A9900509A68 /* error.cpp in Sources */, B3CE8003287404B200B6BB5A /* LzmaDec.c in Sources */, @@ -3367,7 +3339,10 @@ RELEASE, "$(inherited)", ); - GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = __LIBRETRO__; + GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = ( + __LIBRETRO__, + "$(inherited)", + ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; @@ -3493,7 +3468,10 @@ RELEASE, "$(inherited)", ); - GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = __LIBRETRO__; + GCC_PREPROCESSOR_DEFINITIONS_NOT_USED_IN_PRECOMPS = ( + __LIBRETRO__, + "$(inherited)", + ); GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNDECLARED_SELECTOR = YES; From ef30280b79f83a872009c2417cbd8df46b834d40 Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Mon, 30 Dec 2024 18:23:26 -0500 Subject: [PATCH 10/23] pvbetlepsx vulkan compiles Signed-off-by: Joseph Mattiello --- Cores/BeetlePSX/BuildFlags.xcconfig | 7 +- .../PVBeetlePSX.xcodeproj/project.pbxproj | 173 +++++++++++++----- 2 files changed, 134 insertions(+), 46 deletions(-) diff --git a/Cores/BeetlePSX/BuildFlags.xcconfig b/Cores/BeetlePSX/BuildFlags.xcconfig index 3bae5cd884..8ce68274de 100644 --- a/Cores/BeetlePSX/BuildFlags.xcconfig +++ b/Cores/BeetlePSX/BuildFlags.xcconfig @@ -12,15 +12,19 @@ GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) ENABLE_THREADED_COMPI GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) FRONTEND_SUPPORTS_RGB565=1 GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) HAS_DEFAULT_ELM=0 GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) HAVE_CHD=1 -GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) HAVE_CHD=1 GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) HAVE_GRIFFIN=0 GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) HAVE_HW=1 GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) HAVE_LIBRETRO=1 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) HAVE_VULKAN=1 +//GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) HAVE_OPENGL=1 +GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) HAVE_OPENGLES3=1 GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) HAVE_OPENGLES2=1 GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) HAVE_OPENGLES=1 GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) HAVE_PBP=1 GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) HAVE_THREADS=1 GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) HAVE_UNISTD_H=1 +//GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) PSX_DBGPRINT_ENABLE=1 +//GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) HAVE_LIGHTREC=0 //GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) LIGHTREC_LOG_LEVEL=3 //GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) LIGHTREC_STATIC=1 GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) LINK_STATIC_LIBCPLUSPLUS=1 @@ -47,7 +51,6 @@ GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) _LOW_ACCURACY_ GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) __LIBRETRO__=1 GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) __STDC_CONSTANT_MACROS GCC_PREPROCESSOR_DEFINITIONS[sdk=iphoneos*] = $(inherited) __STDC_LIMIT_MACROS - GL_APIENTRYP=GLAPIENTRY* // HAVE_OPENGLES=1 // HAVE_VULKAN=0 HAVE_JIT=0 WANT_16BPP=0 WANT_8BPP=1 LIGHTREC_DEBUG=0 HAVE_OPENGL=0 HAVE_SHM=1 USE_FIXED diff --git a/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj b/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj index 546034226e..a218026737 100644 --- a/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj +++ b/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj @@ -146,6 +146,40 @@ B3681B972874168A00C0136F /* pgxp_gpu.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0792872978C00EAEB37 /* pgxp_gpu.c */; }; B37022C92872554300B3F6DA /* PVBeetlePSXCoreBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = B37022C5287253B300B3F6DA /* PVBeetlePSXCoreBridge.h */; settings = {ATTRIBUTES = (Public, ); }; }; B37022CD2872558F00B3F6DA /* PVBeetlePSX.h in Headers */ = {isa = PBXBuildFile; fileRef = B37022C0287253B300B3F6DA /* PVBeetlePSX.h */; settings = {ATTRIBUTES = (Public, ); }; }; + B3775C072D235F2200C6FC18 /* rsx_lib_vulkan.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0632872978C00EAEB37 /* rsx_lib_vulkan.cpp */; }; + B3775C0A2D23608200C6FC18 /* MoltenVK in Frameworks */ = {isa = PBXBuildFile; productRef = B3775C092D23608200C6FC18 /* MoltenVK */; }; + B3775C0B2D2360D700C6FC18 /* renderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAD772872978900EAEB37 /* renderer.cpp */; }; + B3775C0C2D23614D00C6FC18 /* atlas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAE472872978A00EAEB37 /* atlas.cpp */; }; + B3775C0D2D23616D00C6FC18 /* texture_tracker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBADA22872978A00EAEB37 /* texture_tracker.cpp */; }; + B3775C0E2D23619100C6FC18 /* timer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAD8D2872978900EAEB37 /* timer.cpp */; }; + B3775C0F2D2361AC00C6FC18 /* image_io.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBADA82872978A00EAEB37 /* image_io.cpp */; }; + B3775C102D2361C000C6FC18 /* config_parser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBADA42872978A00EAEB37 /* config_parser.cpp */; }; + B3775C112D2361F500C6FC18 /* device.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAE0D2872978A00EAEB37 /* device.cpp */; }; + B3775C122D2361F500C6FC18 /* semaphore_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAE102872978A00EAEB37 /* semaphore_manager.cpp */; }; + B3775C142D2361F500C6FC18 /* buffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAE132872978A00EAEB37 /* buffer.cpp */; }; + B3775C152D2361F500C6FC18 /* vulkan.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAE272872978A00EAEB37 /* vulkan.cpp */; }; + B3775C162D2361F500C6FC18 /* memory_allocator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAE012872978A00EAEB37 /* memory_allocator.cpp */; }; + B3775C172D2361F500C6FC18 /* fence_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAE112872978A00EAEB37 /* fence_manager.cpp */; }; + B3775C182D2361F500C6FC18 /* event_manager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBADFC2872978A00EAEB37 /* event_manager.cpp */; }; + B3775C192D2361F500C6FC18 /* texture_format.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAE2B2872978A00EAEB37 /* texture_format.cpp */; }; + B3775C1A2D2361F500C6FC18 /* cookie.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAE172872978A00EAEB37 /* cookie.cpp */; }; + B3775C1B2D2361F500C6FC18 /* pipeline_event.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAE0B2872978A00EAEB37 /* pipeline_event.cpp */; }; + B3775C1C2D2361F500C6FC18 /* sampler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAE0E2872978A00EAEB37 /* sampler.cpp */; }; + B3775C1E2D2361F500C6FC18 /* render_pass.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBADF62872978A00EAEB37 /* render_pass.cpp */; }; + B3775C1F2D2361F500C6FC18 /* descriptor_set.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAE0C2872978A00EAEB37 /* descriptor_set.cpp */; }; + B3775C202D2361F500C6FC18 /* command_pool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAE042872978A00EAEB37 /* command_pool.cpp */; }; + B3775C212D2361F500C6FC18 /* fence.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAE252872978A00EAEB37 /* fence.cpp */; }; + B3775C222D2361F500C6FC18 /* semaphore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAE262872978A00EAEB37 /* semaphore.cpp */; }; + B3775C232D2361F500C6FC18 /* buffer_pool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBADF72872978A00EAEB37 /* buffer_pool.cpp */; }; + B3775C242D2361F500C6FC18 /* query_pool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAE242872978A00EAEB37 /* query_pool.cpp */; }; + B3775C252D2361F500C6FC18 /* image.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBADFD2872978A00EAEB37 /* image.cpp */; }; + B3775C262D2361F500C6FC18 /* command_buffer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAE0F2872978A00EAEB37 /* command_buffer.cpp */; }; + B3775C272D2361F500C6FC18 /* shader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAE122872978A00EAEB37 /* shader.cpp */; }; + B3775C282D23626300C6FC18 /* volk.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAD9F2872978A00EAEB37 /* volk.c */; }; + B3775C292D23627B00C6FC18 /* spirv_cross.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAD7E2872978900EAEB37 /* spirv_cross.cpp */; }; + B3775C2A2D23629A00C6FC18 /* spirv_cfg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAD7C2872978900EAEB37 /* spirv_cfg.cpp */; }; + B3775C2B2D2362A800C6FC18 /* spirv_cross_parsed_ir.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAD802872978900EAEB37 /* spirv_cross_parsed_ir.cpp */; }; + B3775C2C2D2362A800C6FC18 /* spirv_parser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAD832872978900EAEB37 /* spirv_parser.cpp */; }; B3AB13DB2949BA15005DCCDE /* glsm.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAEC52872978B00EAEB37 /* glsm.c */; }; B3AB13DC2949BB4D005DCCDE /* rsx_lib_gl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0652872978C00EAEB37 /* rsx_lib_gl.cpp */; }; B3AB13DD2949BBA0005DCCDE /* rglgen.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAE702872978A00EAEB37 /* rglgen.c */; }; @@ -1159,6 +1193,7 @@ B3145FB72CFFD5F6009FB8B3 /* PVCoreBridge in Frameworks */, B3145FB12CFFD4D3009FB8B3 /* libbeetle_psx.a in Frameworks */, B3145FBF2CFFD678009FB8B3 /* PVCoreBridgeRetro.framework in Frameworks */, + B3775C0A2D23608200C6FC18 /* MoltenVK in Frameworks */, B3145FBD2CFFD66C009FB8B3 /* PVLogging in Frameworks */, B3145FCC2CFFD9B0009FB8B3 /* PVCoreObjCBridge in Frameworks */, B3145FCF2CFFDA1A009FB8B3 /* PVEmulatorCore in Frameworks */, @@ -1350,17 +1385,17 @@ B3EBAD792872978900EAEB37 /* SPIRV-Cross */ = { isa = PBXGroup; children = ( - B3EBAD7A2872978900EAEB37 /* spirv_parser.hpp */, - B3EBAD7B2872978900EAEB37 /* spirv.hpp */, B3EBAD7C2872978900EAEB37 /* spirv_cfg.cpp */, - B3EBAD7D2872978900EAEB37 /* spirv_cross_parsed_ir.hpp */, - B3EBAD7E2872978900EAEB37 /* spirv_cross.cpp */, - B3EBAD7F2872978900EAEB37 /* spirv_cfg.hpp */, B3EBAD802872978900EAEB37 /* spirv_cross_parsed_ir.cpp */, - B3EBAD812872978900EAEB37 /* spirv_cross.hpp */, - B3EBAD822872978900EAEB37 /* GLSL.std.450.h */, + B3EBAD7E2872978900EAEB37 /* spirv_cross.cpp */, B3EBAD832872978900EAEB37 /* spirv_parser.cpp */, + B3EBAD822872978900EAEB37 /* GLSL.std.450.h */, + B3EBAD7F2872978900EAEB37 /* spirv_cfg.hpp */, B3EBAD842872978900EAEB37 /* spirv_common.hpp */, + B3EBAD7D2872978900EAEB37 /* spirv_cross_parsed_ir.hpp */, + B3EBAD812872978900EAEB37 /* spirv_cross.hpp */, + B3EBAD7A2872978900EAEB37 /* spirv_parser.hpp */, + B3EBAD7B2872978900EAEB37 /* spirv.hpp */, ); path = "SPIRV-Cross"; sourceTree = ""; @@ -1514,58 +1549,58 @@ B3EBADF52872978A00EAEB37 /* vulkan */ = { isa = PBXGroup; children = ( - B3EBADF62872978A00EAEB37 /* render_pass.cpp */, B3EBADF72872978A00EAEB37 /* buffer_pool.cpp */, - B3EBADF82872978A00EAEB37 /* query_pool.hpp */, - B3EBADF92872978A00EAEB37 /* fence.hpp */, - B3EBADFA2872978A00EAEB37 /* semaphore.hpp */, - B3EBADFB2872978A00EAEB37 /* vulkan.hpp */, + B3EBAE132872978A00EAEB37 /* buffer.cpp */, + B3EBAE0F2872978A00EAEB37 /* command_buffer.cpp */, + B3EBAE042872978A00EAEB37 /* command_pool.cpp */, + B3EBAE172872978A00EAEB37 /* cookie.cpp */, + B3EBAE0C2872978A00EAEB37 /* descriptor_set.cpp */, + B3EBAE0D2872978A00EAEB37 /* device.cpp */, B3EBADFC2872978A00EAEB37 /* event_manager.cpp */, + B3EBAE112872978A00EAEB37 /* fence_manager.cpp */, + B3EBAE252872978A00EAEB37 /* fence.cpp */, B3EBADFD2872978A00EAEB37 /* image.cpp */, - B3EBADFE2872978A00EAEB37 /* texture_format.hpp */, - B3EBADFF2872978A00EAEB37 /* wsi_timing.cpp */, - B3EBAE002872978A00EAEB37 /* quirks.hpp */, B3EBAE012872978A00EAEB37 /* memory_allocator.cpp */, - B3EBAE022872978A00EAEB37 /* vulkan_common.hpp */, - B3EBAE032872978A00EAEB37 /* wsi.cpp */, - B3EBAE042872978A00EAEB37 /* command_pool.cpp */, - B3EBAE052872978A00EAEB37 /* cookie.hpp */, - B3EBAE062872978A00EAEB37 /* managers */, B3EBAE0B2872978A00EAEB37 /* pipeline_event.cpp */, - B3EBAE0C2872978A00EAEB37 /* descriptor_set.cpp */, - B3EBAE0D2872978A00EAEB37 /* device.cpp */, + B3EBAE242872978A00EAEB37 /* query_pool.cpp */, + B3EBADF62872978A00EAEB37 /* render_pass.cpp */, B3EBAE0E2872978A00EAEB37 /* sampler.cpp */, - B3EBAE0F2872978A00EAEB37 /* command_buffer.cpp */, B3EBAE102872978A00EAEB37 /* semaphore_manager.cpp */, - B3EBAE112872978A00EAEB37 /* fence_manager.cpp */, + B3EBAE262872978A00EAEB37 /* semaphore.cpp */, B3EBAE122872978A00EAEB37 /* shader.cpp */, - B3EBAE132872978A00EAEB37 /* buffer.cpp */, - B3EBAE142872978A00EAEB37 /* limits.hpp */, + B3EBAE2B2872978A00EAEB37 /* texture_format.cpp */, + B3EBAE272872978A00EAEB37 /* vulkan.cpp */, + B3EBADFF2872978A00EAEB37 /* wsi_timing.cpp */, + B3EBAE032872978A00EAEB37 /* wsi.cpp */, + B3EBAE232872978A00EAEB37 /* buffer_pool.hpp */, + B3EBAE1F2872978A00EAEB37 /* buffer.hpp */, + B3EBAE1C2872978A00EAEB37 /* command_buffer.hpp */, B3EBAE152872978A00EAEB37 /* command_pool.hpp */, - B3EBAE162872978A00EAEB37 /* wsi.hpp */, - B3EBAE172872978A00EAEB37 /* cookie.cpp */, - B3EBAE182872978A00EAEB37 /* pipeline_event.hpp */, + B3EBAE052872978A00EAEB37 /* cookie.hpp */, B3EBAE192872978A00EAEB37 /* descriptor_set.hpp */, B3EBAE1A2872978A00EAEB37 /* device.hpp */, - B3EBAE1B2872978A00EAEB37 /* semaphore_manager.hpp */, - B3EBAE1C2872978A00EAEB37 /* command_buffer.hpp */, - B3EBAE1D2872978A00EAEB37 /* sampler.hpp */, + B3EBAE282872978A00EAEB37 /* event_manager.hpp */, B3EBAE1E2872978A00EAEB37 /* fence_manager.hpp */, - B3EBAE1F2872978A00EAEB37 /* buffer.hpp */, - B3EBAE202872978A00EAEB37 /* shader.hpp */, + B3EBADF92872978A00EAEB37 /* fence.hpp */, + B3EBAE2A2872978A00EAEB37 /* format.hpp */, + B3EBAE292872978A00EAEB37 /* image.hpp */, + B3EBAE142872978A00EAEB37 /* limits.hpp */, + B3EBAE2D2872978A00EAEB37 /* memory_allocator.hpp */, + B3EBAE182872978A00EAEB37 /* pipeline_event.hpp */, + B3EBADF82872978A00EAEB37 /* query_pool.hpp */, + B3EBAE002872978A00EAEB37 /* quirks.hpp */, B3EBAE212872978A00EAEB37 /* render_pass.hpp */, + B3EBAE1D2872978A00EAEB37 /* sampler.hpp */, + B3EBAE1B2872978A00EAEB37 /* semaphore_manager.hpp */, + B3EBADFA2872978A00EAEB37 /* semaphore.hpp */, + B3EBAE202872978A00EAEB37 /* shader.hpp */, + B3EBADFE2872978A00EAEB37 /* texture_format.hpp */, B3EBAE222872978A00EAEB37 /* type_to_string.hpp */, - B3EBAE232872978A00EAEB37 /* buffer_pool.hpp */, - B3EBAE242872978A00EAEB37 /* query_pool.cpp */, - B3EBAE252872978A00EAEB37 /* fence.cpp */, - B3EBAE262872978A00EAEB37 /* semaphore.cpp */, - B3EBAE272872978A00EAEB37 /* vulkan.cpp */, - B3EBAE282872978A00EAEB37 /* event_manager.hpp */, - B3EBAE292872978A00EAEB37 /* image.hpp */, - B3EBAE2A2872978A00EAEB37 /* format.hpp */, - B3EBAE2B2872978A00EAEB37 /* texture_format.cpp */, + B3EBAE022872978A00EAEB37 /* vulkan_common.hpp */, + B3EBADFB2872978A00EAEB37 /* vulkan.hpp */, B3EBAE2C2872978A00EAEB37 /* wsi_timing.hpp */, - B3EBAE2D2872978A00EAEB37 /* memory_allocator.hpp */, + B3EBAE162872978A00EAEB37 /* wsi.hpp */, + B3EBAE062872978A00EAEB37 /* managers */, ); path = vulkan; sourceTree = ""; @@ -2960,6 +2995,7 @@ B3145FBB2CFFD66C009FB8B3 /* XCLocalSwiftPackageReference "../../PVLogging" */, B3145FCA2CFFD9B0009FB8B3 /* XCLocalSwiftPackageReference "../../PVCoreObjCBridge" */, B3145FCD2CFFDA1A009FB8B3 /* XCLocalSwiftPackageReference "../../PVEmulatorCore" */, + B3775C082D23608200C6FC18 /* XCLocalSwiftPackageReference "../../MoltenVK" */, ); productRefGroup = B3C7621120783162009950E4 /* Products */; projectDirPath = ""; @@ -3152,18 +3188,26 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + B3775C0D2D23616D00C6FC18 /* texture_tracker.cpp in Sources */, + B3775C0F2D2361AC00C6FC18 /* image_io.cpp in Sources */, B3607AB428922AC500509A68 /* file_stream_transforms.c in Sources */, B3607AC928922B0B00509A68 /* rtime.c in Sources */, B3607AD328922B0B00509A68 /* string_list.c in Sources */, + B3775C2B2D2362A800C6FC18 /* spirv_cross_parsed_ir.cpp in Sources */, + B3775C2C2D2362A800C6FC18 /* spirv_parser.cpp in Sources */, + B3775C2A2D23629A00C6FC18 /* spirv_cfg.cpp in Sources */, B3607AD028922B0B00509A68 /* dir_list.c in Sources */, B3607AB528922AC500509A68 /* file_stream.c in Sources */, B3607AC728922B0B00509A68 /* compat_posix_string.c in Sources */, B3607AD128922B0B00509A68 /* memalign.c in Sources */, + B3775C0C2D23614D00C6FC18 /* atlas.cpp in Sources */, B3607AF528922C0300509A68 /* ugui_tools.c in Sources */, + B3775C282D23626300C6FC18 /* volk.c in Sources */, B3AB13DD2949BBA0005DCCDE /* rglgen.c in Sources */, B3607ACF28922B0B00509A68 /* file_path.c in Sources */, B3607AC628922B0B00509A68 /* stdstring.c in Sources */, B3AB13DC2949BB4D005DCCDE /* rsx_lib_gl.cpp in Sources */, + B3775C0E2D23619100C6FC18 /* timer.cpp in Sources */, B3607ACD28922B0B00509A68 /* compat_strcasestr.c in Sources */, B3607AD428922B3900509A68 /* rthreads.c in Sources */, B3607B1A28922D3600509A68 /* input.cpp in Sources */, @@ -3174,9 +3218,34 @@ B3AB13DB2949BA15005DCCDE /* glsm.c in Sources */, B3681B7C287412DC00C0136F /* beetle_psx_globals.c in Sources */, B3607B582892327600509A68 /* dma.cpp in Sources */, + B3775C0B2D2360D700C6FC18 /* renderer.cpp in Sources */, B3607ACB28922B0B00509A68 /* compat_strl.c in Sources */, + B3775C112D2361F500C6FC18 /* device.cpp in Sources */, + B3775C122D2361F500C6FC18 /* semaphore_manager.cpp in Sources */, + B3775C142D2361F500C6FC18 /* buffer.cpp in Sources */, + B3775C152D2361F500C6FC18 /* vulkan.cpp in Sources */, + B3775C162D2361F500C6FC18 /* memory_allocator.cpp in Sources */, + B3775C172D2361F500C6FC18 /* fence_manager.cpp in Sources */, + B3775C182D2361F500C6FC18 /* event_manager.cpp in Sources */, + B3775C192D2361F500C6FC18 /* texture_format.cpp in Sources */, + B3775C1A2D2361F500C6FC18 /* cookie.cpp in Sources */, + B3775C1B2D2361F500C6FC18 /* pipeline_event.cpp in Sources */, + B3775C1C2D2361F500C6FC18 /* sampler.cpp in Sources */, + B3775C1E2D2361F500C6FC18 /* render_pass.cpp in Sources */, + B3775C1F2D2361F500C6FC18 /* descriptor_set.cpp in Sources */, + B3775C292D23627B00C6FC18 /* spirv_cross.cpp in Sources */, + B3775C202D2361F500C6FC18 /* command_pool.cpp in Sources */, + B3775C212D2361F500C6FC18 /* fence.cpp in Sources */, + B3775C222D2361F500C6FC18 /* semaphore.cpp in Sources */, + B3775C232D2361F500C6FC18 /* buffer_pool.cpp in Sources */, + B3775C242D2361F500C6FC18 /* query_pool.cpp in Sources */, + B3775C252D2361F500C6FC18 /* image.cpp in Sources */, + B3775C262D2361F500C6FC18 /* command_buffer.cpp in Sources */, + B3775C272D2361F500C6FC18 /* shader.cpp in Sources */, B3607ACC28922B0B00509A68 /* fopen_utf8.c in Sources */, + B3775C072D235F2200C6FC18 /* rsx_lib_vulkan.cpp in Sources */, B3607AF228922BEF00509A68 /* libretro_cbs.c in Sources */, + B3775C102D2361C000C6FC18 /* config_parser.cpp in Sources */, B3145FC22CFFD7E4009FB8B3 /* glsym_es2.c in Sources */, B3607ACA28922B0B00509A68 /* retro_dirent.c in Sources */, B3607ACE28922B0B00509A68 /* encoding_utf.c in Sources */, @@ -3366,6 +3435,10 @@ "\"$(SRCROOT)/beetle-psx-libretro\"", "\"$(SRCROOT)/beetle-psx-libretro/deps/lightning/include/lightning\"", "\"$(SRCROOT)/beetle-psx-libretro/lightning-lightrec-include\"", + "\"$(SRCROOT)/beetle-psx-libretro/parallel-psx/khronos/include\"", + "\"$(SRCROOT)/beetle-psx-libretro/parallel-psx/volk\"", + "\"$(SRCROOT)/beetle-psx-libretro/parallel-psx/glsl/prebuilt\"", + "\"$(SRCROOT)/beetle-psx-libretro/parallel-psx/SPIRV-Cross\"", ); IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; @@ -3495,6 +3568,10 @@ "\"$(SRCROOT)/beetle-psx-libretro\"", "\"$(SRCROOT)/beetle-psx-libretro/deps/lightning/include/lightning\"", "\"$(SRCROOT)/beetle-psx-libretro/lightning-lightrec-include\"", + "\"$(SRCROOT)/beetle-psx-libretro/parallel-psx/khronos/include\"", + "\"$(SRCROOT)/beetle-psx-libretro/parallel-psx/volk\"", + "\"$(SRCROOT)/beetle-psx-libretro/parallel-psx/glsl/prebuilt\"", + "\"$(SRCROOT)/beetle-psx-libretro/parallel-psx/SPIRV-Cross\"", ); IPHONEOS_DEPLOYMENT_TARGET = 13.0; MTL_ENABLE_DEBUG_INFO = NO; @@ -3695,6 +3772,10 @@ isa = XCLocalSwiftPackageReference; relativePath = ../../PVEmulatorCore; }; + B3775C082D23608200C6FC18 /* XCLocalSwiftPackageReference "../../MoltenVK" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = ../../MoltenVK; + }; /* End XCLocalSwiftPackageReference section */ /* Begin XCSwiftPackageProductDependency section */ @@ -3718,6 +3799,10 @@ isa = XCSwiftPackageProductDependency; productName = PVEmulatorCore; }; + B3775C092D23608200C6FC18 /* MoltenVK */ = { + isa = XCSwiftPackageProductDependency; + productName = MoltenVK; + }; /* End XCSwiftPackageProductDependency section */ }; rootObject = B3C7620720783162009950E4 /* Project object */; From a74223a06b0a1c6dd4565e8a9b24311d45faef8a Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Mon, 30 Dec 2024 18:45:35 -0500 Subject: [PATCH 11/23] PVBeetlePSX add some core options Signed-off-by: Joseph Mattiello --- .../PVBeetlePSX.xcodeproj/project.pbxproj | 4 + .../PVBeetlePSXCore/CoreOptions.swift | 101 ++++++++++++++++++ .../PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm | 81 +++++++++----- 3 files changed, 159 insertions(+), 27 deletions(-) create mode 100644 Cores/BeetlePSX/PVBeetlePSXCore/CoreOptions.swift diff --git a/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj b/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj index a218026737..713c8ad0d5 100644 --- a/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj +++ b/Cores/BeetlePSX/PVBeetlePSX.xcodeproj/project.pbxproj @@ -180,6 +180,7 @@ B3775C2A2D23629A00C6FC18 /* spirv_cfg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAD7C2872978900EAEB37 /* spirv_cfg.cpp */; }; B3775C2B2D2362A800C6FC18 /* spirv_cross_parsed_ir.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAD802872978900EAEB37 /* spirv_cross_parsed_ir.cpp */; }; B3775C2C2D2362A800C6FC18 /* spirv_parser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAD832872978900EAEB37 /* spirv_parser.cpp */; }; + B3775C2E2D23645600C6FC18 /* CoreOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = B3775C2D2D23645600C6FC18 /* CoreOptions.swift */; }; B3AB13DB2949BA15005DCCDE /* glsm.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAEC52872978B00EAEB37 /* glsm.c */; }; B3AB13DC2949BB4D005DCCDE /* rsx_lib_gl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B3EBB0652872978C00EAEB37 /* rsx_lib_gl.cpp */; }; B3AB13DD2949BBA0005DCCDE /* rglgen.c in Sources */ = {isa = PBXBuildFile; fileRef = B3EBAE702872978A00EAEB37 /* rglgen.c */; }; @@ -277,6 +278,7 @@ B37022C3287253B300B3F6DA /* PVBeetlePSX.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PVBeetlePSX.h; sourceTree = ""; }; B37022C5287253B300B3F6DA /* PVBeetlePSXCoreBridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PVBeetlePSXCoreBridge.h; sourceTree = ""; }; B37022C6287253B300B3F6DA /* PVBeetlePSXCoreBridge.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PVBeetlePSXCoreBridge.mm; sourceTree = ""; }; + B3775C2D2D23645600C6FC18 /* CoreOptions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoreOptions.swift; sourceTree = ""; }; B39769132859E3A300558958 /* PVLibrary.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVLibrary.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B39769172859E3AD00558958 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/CoreFoundation.framework; sourceTree = DEVELOPER_DIR; }; B39769182859E3AD00558958 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk/System/Library/Frameworks/Foundation.framework; sourceTree = DEVELOPER_DIR; }; @@ -1217,6 +1219,7 @@ B37022C4287253B300B3F6DA /* PVBeetlePSXCore */ = { isa = PBXGroup; children = ( + B3775C2D2D23645600C6FC18 /* CoreOptions.swift */, B3145FC42CFFD83B009FB8B3 /* PVBeetlePSXCore.swift */, B3145FC52CFFD83B009FB8B3 /* CorePlist.swift */, B3145FC62CFFD83B009FB8B3 /* CorePlist-Generated.swift */, @@ -3257,6 +3260,7 @@ buildActionMask = 2147483647; files = ( B3145FB42CFFD4E0009FB8B3 /* PVBeetlePSXCoreBridge.mm in Sources */, + B3775C2E2D23645600C6FC18 /* CoreOptions.swift in Sources */, B3145FC72CFFD83B009FB8B3 /* PVBeetlePSXCore.swift in Sources */, B3145FC82CFFD83B009FB8B3 /* CorePlist.swift in Sources */, B3145FC92CFFD83B009FB8B3 /* CorePlist-Generated.swift in Sources */, diff --git a/Cores/BeetlePSX/PVBeetlePSXCore/CoreOptions.swift b/Cores/BeetlePSX/PVBeetlePSXCore/CoreOptions.swift new file mode 100644 index 0000000000..d263df9a28 --- /dev/null +++ b/Cores/BeetlePSX/PVBeetlePSXCore/CoreOptions.swift @@ -0,0 +1,101 @@ +// +// CoreOptions.swift +// Core-VirtualJaguar +// +// Created by Joseph Mattiello on 9/19/21. +// Copyright © 2021 Provenance Emu. All rights reserved. +// + +import Foundation +//import PVSupport +import PVCoreBridge +import PVCoreObjCBridge +import PVEmulatorCore + +@objc +public final class PVBeetlePSXCoreOptions: NSObject, CoreOptions, Sendable { + + public static var options: [CoreOption] { + var options = [CoreOption]() + + let coreGroup = CoreOption.group(.init(title: "Core", description: nil), + subOptions: Options.Core.allOptions) + let videoGroup = CoreOption.group(.init(title: "Video", description: nil), + subOptions: Options.Video.allOptions) + options.append(coreGroup) + options.append(videoGroup) + + return options + } + + enum Options { + enum Core { + + static var allOptions: [CoreOption] { [] } + } + enum Video { + static var renderer: CoreOption { + .enumeration(.init( + title: "Video Renderer", + description: "Which video backend to render with.", + requiresRestart: true), + // hardware, hardware_gl, hardware_vk, software + values:[ + .init(title: "Hardware", description: "", value: 0), + .init(title: "Hardware GL", description: "OpenGL/ES", value: 1), + .init(title: "Hardware Vulkan", description: "Vulkan", value: 2), + .init(title: "Software", description: "Software Renderer", value: 3), + ], + defaultValue: 2) + } + + static var rendererUpscale: CoreOption { + .enumeration(.init( + title: "Video Interal Upscale", + description: "Render to a larger internal buffer before scaling to screen.", + requiresRestart: true), + values:[ + .init(title: "1x", description: "", value: 0), + .init(title: "2x", description: "", value: 1), + .init(title: "4x", description: "", value: 2), + .init(title: "8x", description: "", value: 3), + .init(title: "16x", description: "", value: 4), + ], + defaultValue: 1) + } + + + static var rendererSoftwareFramebuffer: CoreOption { + .bool(.init(title: "Software Framebuffer", description: "Enable accurate emulation of framebuffer effects (e.g. motion blur, FF7 battle swirl) when using hardware renderers by running a copy of the software renderer at native resolution in the background. If disabled, these operations are omitted (OpenGL) or rendered on the GPU (Vulkan). Disabling can improve performance but may cause severe graphical errors. Leave enabled if unsure.", requiresRestart: true), defaultValue: true) + } + + static var allOptions: [CoreOption] { [renderer, rendererSoftwareFramebuffer] } + } + } +} + +extension PVBeetlePSXCore: CoreOptional { + public static var options: [PVCoreBridge.CoreOption] { + PVBeetlePSXCoreOptions.options + } +} + +@objc +public extension PVBeetlePSXCoreOptions { + @objc static var video_renderer: NSInteger { valueForOption(Options.Video.renderer) } + @objc static var video_renderer_upscale: NSInteger { valueForOption(Options.Video.rendererUpscale) } + @objc static var video_renderer_software_framebuffer: Bool { valueForOption(Options.Video.rendererSoftwareFramebuffer) } +} + +// +//extension PVBeetlePSXCore: CoreActions { +// public var coreActions: [CoreAction]? { +// let bios = CoreAction(title: "Use Jaguar BIOS", options: nil) +// let fastBlitter = CoreAction(title: "Use fast blitter", options:nil) +// return [bios, fastBlitter] +// } +// +// public func selected(action: CoreAction) { +// DLOG("\(action.title), \(String(describing: action.options))") +// } +//} diff --git a/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm b/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm index 522c8343dd..410d2b950e 100644 --- a/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm +++ b/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm @@ -7,6 +7,7 @@ // #import "PVBeetlePSXCoreBridge.h" +#import #include #include "libretro_options.h" //#import "PVBeetlePSXCore+Controls.h" @@ -138,17 +139,17 @@ - (BOOL)supportsCheatCode { return YES; } // return CGSizeMake(1024, 1024); //} // -//- (GLenum)pixelFormat { -// return GL_RGBA; -//} -// -//- (GLenum)pixelType { -// return GL_UNSIGNED_BYTE; -//} -// -//- (GLenum)internalPixelFormat { -// return GL_RGBA; -//} +- (GLenum)pixelFormat { + return GL_UNSIGNED_SHORT_5_6_5; +} + +- (GLenum)pixelType { + return GL_UNSIGNED_BYTE; +} + +- (GLenum)internalPixelFormat { + return GL_UNSIGNED_SHORT_5_6_5; +} //- (BOOL)isDoubleBuffered { // return YES; @@ -162,21 +163,8 @@ - (BOOL)supportsCheatCode { return YES; } //} -# pragma mark - Audio - -//- (GLenum)pixelFormat { -// return GL_BGRA; -//} -// -//- (GLenum)pixelType { -// return GL_UNSIGNED_BYTE; -//} -// -//- (GLenum)internalPixelFormat { -// return GL_RGBA; -//} - - (BOOL)rendersToOpenGL { return YES; } + # pragma mark - Audio - (double)audioSampleRate { @@ -192,7 +180,25 @@ - (void *)getVariable:(const char *)variable { #define V(x) strcmp(variable, x) == 0 if (V(BEETLE_OPT(hw_renderer))) { // hardware, hardware_gl, hardware_vk, software - char *value = strdup("hardware_gl"); + NSInteger intValue = PVBeetlePSXCoreOptions.video_renderer; + char *value = strdup("hardware"); + switch (intValue) { + case 0: + value = strdup("hardware"); + break; + case 1: + value = strdup("hardware_gl"); + break; + case 2: + value = strdup("hardware_vk"); + break; + case 3: + value = strdup("software"); + break; + + default: + break; + } return value; } else if (V(BEETLE_OPT(renderer_software_fb))) { // "Enable accurate emulation of framebuffer effects (e.g. motion blur, FF7 battle swirl) when using hardware renderers by running a copy of the software renderer at native resolution in the background. If disabled, these operations are omitted (OpenGL) or rendered on the GPU (Vulkan). Disabling can improve performance but may cause severe graphical errors. Leave enabled if unsure.", @@ -203,11 +209,32 @@ - (void *)getVariable:(const char *)variable { // { "disabled", NULL }, // { NULL, NULL }, // }, - char *value = strdup("disabled"); + BOOL boolValue = PVBeetlePSXCoreOptions.video_renderer_software_framebuffer; + char *value = boolValue ? strdup("enabled") : strdup("disabled"); return value; } else if (V(BEETLE_OPT(internal_resolution))) { // 1,2,4,8,16 char *value = strdup("2x"); + NSInteger intValue = PVBeetlePSXCoreOptions.video_renderer_upscale; + switch (intValue) { + case 0: + value = strdup("1x"); + break; + case 1: + value = strdup("2x"); + break; + case 2: + value = strdup("4x"); + break; + case 3: + value = strdup("8x"); + break; + case 4: + value = strdup("16x"); + break; + default: + break; + } return value; } else { ELOG(@"Unprocessed var: %s", variable); From e1e896205fbae81f089cd00e214680e386eb86cb Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Mon, 30 Dec 2024 18:45:48 -0500 Subject: [PATCH 12/23] Audio remove loud log line Signed-off-by: Joseph Mattiello --- .../Sources/PVEmulatorCore/PVEmulatorCore+Audio.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVEmulatorCore/Sources/PVEmulatorCore/PVEmulatorCore+Audio.swift b/PVEmulatorCore/Sources/PVEmulatorCore/PVEmulatorCore+Audio.swift index b3fdcab8ab..147eb9cb3d 100644 --- a/PVEmulatorCore/Sources/PVEmulatorCore/PVEmulatorCore+Audio.swift +++ b/PVEmulatorCore/Sources/PVEmulatorCore/PVEmulatorCore+Audio.swift @@ -57,7 +57,7 @@ extension PVEmulatorCore: EmulatorCoreAudioDataSource { } @objc dynamic open var channelCount: UInt { let channelCount = bridge.channelCount ?? 1 - DLOG("channelCount: \(channelCount)") + // DLOG("channelCount: \(channelCount)") return channelCount } From 5e01b01a45de5f1ac553e8e973ce08c40e147cfc Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Mon, 30 Dec 2024 19:15:23 -0500 Subject: [PATCH 13/23] beetle add missing option to menu Signed-off-by: Joseph Mattiello --- Cores/BeetlePSX/PVBeetlePSXCore/CoreOptions.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cores/BeetlePSX/PVBeetlePSXCore/CoreOptions.swift b/Cores/BeetlePSX/PVBeetlePSXCore/CoreOptions.swift index d263df9a28..a17018a389 100644 --- a/Cores/BeetlePSX/PVBeetlePSXCore/CoreOptions.swift +++ b/Cores/BeetlePSX/PVBeetlePSXCore/CoreOptions.swift @@ -69,7 +69,7 @@ public final class PVBeetlePSXCoreOptions: NSObject, CoreOptions, Sendable { .bool(.init(title: "Software Framebuffer", description: "Enable accurate emulation of framebuffer effects (e.g. motion blur, FF7 battle swirl) when using hardware renderers by running a copy of the software renderer at native resolution in the background. If disabled, these operations are omitted (OpenGL) or rendered on the GPU (Vulkan). Disabling can improve performance but may cause severe graphical errors. Leave enabled if unsure.", requiresRestart: true), defaultValue: true) } - static var allOptions: [CoreOption] { [renderer, rendererSoftwareFramebuffer] } + static var allOptions: [CoreOption] { [renderer, rendererUpscale, rendererSoftwareFramebuffer] } } } } From 78ef1d4b3cef70884857695ba1037ab07d091b1a Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Mon, 30 Dec 2024 19:19:13 -0500 Subject: [PATCH 14/23] beetle mess with pixel format Signed-off-by: Joseph Mattiello --- Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm b/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm index 410d2b950e..0498bfe21c 100644 --- a/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm +++ b/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm @@ -140,7 +140,7 @@ - (BOOL)supportsCheatCode { return YES; } //} // - (GLenum)pixelFormat { - return GL_UNSIGNED_SHORT_5_6_5; + return GL_RGBA; } - (GLenum)pixelType { @@ -148,7 +148,7 @@ - (GLenum)pixelType { } - (GLenum)internalPixelFormat { - return GL_UNSIGNED_SHORT_5_6_5; + return GL_RGBA; } //- (BOOL)isDoubleBuffered { From cf678c039e427a6e8efe7e946e7c6913446257ea Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Mon, 30 Dec 2024 19:19:28 -0500 Subject: [PATCH 15/23] =?UTF-8?q?metalvc=20don=E2=80=99t=20lock=20semaphor?= =?UTF-8?q?es=20on=20missing=20texture?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Joseph Mattiello --- .../PVMetalViewController.swift | 48 ++++++++++--------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/PVUI/Sources/PVUIBase/PVGLViewController/PVMetalViewController.swift b/PVUI/Sources/PVUIBase/PVGLViewController/PVMetalViewController.swift index 4b170b1cea..49e15da907 100644 --- a/PVUI/Sources/PVUIBase/PVGLViewController/PVMetalViewController.swift +++ b/PVUI/Sources/PVUIBase/PVGLViewController/PVMetalViewController.swift @@ -1566,15 +1566,20 @@ class PVMetalViewController : PVGPUViewController, PVRenderDelegate, MTKViewDele } func didRenderFrameOnAlternateThread() { - guard backingMTLTexture != nil else { - ELOG("backingMTLTexture was nil") - return - } glFlush() emulatorCore?.frontBufferLock.lock() previousCommandBuffer?.waitUntilScheduled() + + defer { + emulatorCore?.frontBufferLock.unlock() + + emulatorCore?.frontBufferCondition.lock() + emulatorCore?.isFrontBufferReady = true + emulatorCore?.frontBufferCondition.signal() + emulatorCore?.frontBufferCondition.unlock() + } guard let commandBuffer = commandQueue?.makeCommandBuffer() else { ELOG("commandBuffer was nil") @@ -1586,27 +1591,26 @@ class PVMetalViewController : PVGPUViewController, PVRenderDelegate, MTKViewDele return } - let screenRect = emulatorCore?.screenRect ?? .zero - - encoder.copy(from: backingMTLTexture!, - sourceSlice: 0, sourceLevel: 0, - sourceOrigin: MTLOrigin(x: Int(screenRect.origin.x), - y: Int(screenRect.origin.y), z: 0), - sourceSize: MTLSize(width: Int(screenRect.width), - height: Int(screenRect.height), depth: 1), - to: inputTexture!, - destinationSlice: 0, destinationLevel: 0, - destinationOrigin: MTLOrigin(x: 0, y: 0, z: 0)) + if let backingMTLTexture = backingMTLTexture { + let screenRect = emulatorCore?.screenRect ?? .zero - encoder.endEncoding() - commandBuffer.commit() + encoder.copy(from: backingMTLTexture, + sourceSlice: 0, sourceLevel: 0, + sourceOrigin: MTLOrigin(x: Int(screenRect.origin.x), + y: Int(screenRect.origin.y), z: 0), + sourceSize: MTLSize(width: Int(screenRect.width), + height: Int(screenRect.height), depth: 1), + to: inputTexture!, + destinationSlice: 0, destinationLevel: 0, + destinationOrigin: MTLOrigin(x: 0, y: 0, z: 0)) - emulatorCore?.frontBufferLock.unlock() + encoder.endEncoding() + commandBuffer.commit() - emulatorCore?.frontBufferCondition.lock() - emulatorCore?.isFrontBufferReady = true - emulatorCore?.frontBufferCondition.signal() - emulatorCore?.frontBufferCondition.unlock() + } else { + ELOG("backingMTLTexture was nil") + return + } } /// Cached viewport values From 9e2f52152ee7026b8f992d16586a927071c3d446 Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Tue, 31 Dec 2024 16:41:30 -0500 Subject: [PATCH 16/23] fix lite target, add beetle to it Signed-off-by: Joseph Mattiello --- Provenance.xcodeproj/project.pbxproj | 66 ++++++++++++++++++++++++---- 1 file changed, 58 insertions(+), 8 deletions(-) diff --git a/Provenance.xcodeproj/project.pbxproj b/Provenance.xcodeproj/project.pbxproj index 7d47ea81d0..5f863d5acc 100644 --- a/Provenance.xcodeproj/project.pbxproj +++ b/Provenance.xcodeproj/project.pbxproj @@ -139,7 +139,6 @@ 9361E6FB2BD62C1300E3891A /* PVEmuThree.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9361E6F92BD62BFA00E3891A /* PVEmuThree.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 93654F76298F400B0046503F /* PVSupergrafx.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 93654F75298F400B0046503F /* PVSupergrafx.framework */; }; 93654F77298F400B0046503F /* PVSupergrafx.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 93654F75298F400B0046503F /* PVSupergrafx.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 9368551E2A8956220087FE6B /* modules in Resources */ = {isa = PBXBuildFile; fileRef = 934BE9B3296F178400FB9933 /* modules */; }; 936BFD852986A6CA001FF097 /* libMoltenVK.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 936BFD802986A5B4001FF097 /* libMoltenVK.dylib */; platformFilter = maccatalyst; }; 936BFD862986A6CA001FF097 /* libMoltenVK.dylib in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 936BFD802986A5B4001FF097 /* libMoltenVK.dylib */; platformFilter = maccatalyst; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 939A43092A35ADE2001AFF6B /* PVRetroArch.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 934BE9AE296F177B00FB9933 /* PVRetroArch.framework */; platformFilters = (ios, maccatalyst, tvos, ); }; @@ -765,6 +764,14 @@ B3C65E612CA53668000E37B0 /* PVMupen64PlusVideoGlideN64.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = B3C65E582CA53666000E37B0 /* PVMupen64PlusVideoGlideN64.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; B3C65E622CA53668000E37B0 /* PVMupen64PlusVideoRice.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B3C65E592CA53666000E37B0 /* PVMupen64PlusVideoRice.framework */; }; B3C65E632CA53668000E37B0 /* PVMupen64PlusVideoRice.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = B3C65E592CA53666000E37B0 /* PVMupen64PlusVideoRice.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + B3CBB39A2D249AD500D5224E /* PVBeetlePSX.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B3CBB3992D249AD500D5224E /* PVBeetlePSX.framework */; }; + B3CBB39B2D249AD500D5224E /* PVBeetlePSX.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = B3CBB3992D249AD500D5224E /* PVBeetlePSX.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + B3CBB39E2D249B0200D5224E /* PVCoreBridgeRetro.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B3CBB39D2D249B0200D5224E /* PVCoreBridgeRetro.framework */; }; + B3CBB39F2D249B0200D5224E /* PVCoreBridgeRetro.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = B3CBB39D2D249B0200D5224E /* PVCoreBridgeRetro.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + B3CBB3A12D249CAB00D5224E /* MoltenVK in Frameworks */ = {isa = PBXBuildFile; productRef = B3CBB3A02D249CAB00D5224E /* MoltenVK */; }; + B3CBB3A32D249D0000D5224E /* PVCoreObjCBridge in Frameworks */ = {isa = PBXBuildFile; productRef = B3CBB3A22D249D0000D5224E /* PVCoreObjCBridge */; }; + B3CBB3A52D249D1200D5224E /* PVCoreBridge in Frameworks */ = {isa = PBXBuildFile; productRef = B3CBB3A42D249D1200D5224E /* PVCoreBridge */; }; + B3CBB3A72D249D1700D5224E /* PVEmulatorCore in Frameworks */ = {isa = PBXBuildFile; productRef = B3CBB3A62D249D1700D5224E /* PVEmulatorCore */; }; B3CE94B7293446AC0053B891 /* Introspect in Frameworks */ = {isa = PBXBuildFile; productRef = B3CE94B6293446AC0053B891 /* Introspect */; }; B3CEC5B22794D8DD004A7CC1 /* Strings.strings in Resources */ = {isa = PBXBuildFile; fileRef = B3296EEA26CAC3ED0088AC32 /* Strings.strings */; }; B3D1C1312CB70D4C00F1F46B /* PVCoremGBA-Dynamic in Frameworks */ = {isa = PBXBuildFile; productRef = B3D1C1302CB70D4C00F1F46B /* PVCoremGBA-Dynamic */; }; @@ -1592,6 +1599,18 @@ name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; }; + B3CBB39C2D249AD600D5224E /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + B3CBB39B2D249AD500D5224E /* PVBeetlePSX.framework in Embed Frameworks */, + B3CBB39F2D249B0200D5224E /* PVCoreBridgeRetro.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; B3DFEE132686D848005C6CF2 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -2160,6 +2179,8 @@ B3C9D5E61DEAA7E80068D057 /* PVStella.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVStella.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B3CB85BE1E9BFB07009155A6 /* PVPokeMini.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVPokeMini.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B3CB85C11E9BFB16009155A6 /* PVPokeMini.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVPokeMini.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + B3CBB3992D249AD500D5224E /* PVBeetlePSX.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVBeetlePSX.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + B3CBB39D2D249B0200D5224E /* PVCoreBridgeRetro.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVCoreBridgeRetro.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B3CE7FFF2873FB7600B6BB5A /* PVVecXGL.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = PVVecXGL.framework; sourceTree = BUILT_PRODUCTS_DIR; }; B3CEC5A62794CD8C004A7CC1 /* es */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/Strings.strings; sourceTree = ""; }; B3CEC5A72794CD8D004A7CC1 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = es.lproj/InfoPlist.strings; sourceTree = ""; }; @@ -3026,11 +3047,14 @@ B3E77F862D1F57F3004A3AD2 /* PVFeatureFlags in Frameworks */, B36A8D502CCD5518002357DD /* PVJIT in Frameworks */, B3F7E381297736BE00362B92 /* CoreServices.framework in Frameworks */, + B3CBB3A72D249D1700D5224E /* PVEmulatorCore in Frameworks */, B3F7E383297736BE00362B92 /* libz.dylib in Frameworks */, B3F7E384297736BE00362B92 /* libstdc++.dylib in Frameworks */, B3F7E388297736BE00362B92 /* libc++.dylib in Frameworks */, B3F7E38B297736BE00362B92 /* libsqlite3.dylib in Frameworks */, B3F7E38E297736BE00362B92 /* AVFoundation.framework in Frameworks */, + B3CBB3A52D249D1200D5224E /* PVCoreBridge in Frameworks */, + B3CBB3A12D249CAB00D5224E /* MoltenVK in Frameworks */, B323B00E2BF46DB900CEA3CF /* PVSupport in Frameworks */, B36A8D4C2CCD54CE002357DD /* PVThemes in Frameworks */, B3F7E393297736BE00362B92 /* CFNetwork.framework in Frameworks */, @@ -3048,10 +3072,13 @@ B3250A2F2CCEE29800E6D7CE /* FreemiumKit in Frameworks */, B3F7E3B5297736BE00362B92 /* OpenGLES.framework in Frameworks */, B3F7E3B7297736BE00362B92 /* Foundation.framework in Frameworks */, + B3CBB39A2D249AD500D5224E /* PVBeetlePSX.framework in Frameworks */, B3F7E3B8297736BE00362B92 /* OpenGL.framework in Frameworks */, B3F7E3BB297736BE00362B92 /* CoreGraphics.framework in Frameworks */, + B3CBB3A32D249D0000D5224E /* PVCoreObjCBridge in Frameworks */, B323B0092BF46D2800CEA3CF /* PVLibrary in Frameworks */, B3E88CBA2977AB5900C90E86 /* Reachability in Frameworks */, + B3CBB39E2D249B0200D5224E /* PVCoreBridgeRetro.framework in Frameworks */, B3F7E3BE297736BE00362B92 /* Introspect in Frameworks */, B395958F2BF47033004C5AA9 /* RxDataSources in Frameworks */, ); @@ -3224,6 +3251,8 @@ 1A3D409617B2DCE4004DFFFC /* Frameworks */ = { isa = PBXGroup; children = ( + B3CBB39D2D249B0200D5224E /* PVCoreBridgeRetro.framework */, + B3CBB3992D249AD500D5224E /* PVBeetlePSX.framework */, B3147AEF2D000469009FB8B3 /* PVMelonDSRetro.framework */, B3147AEC2D00042B009FB8B3 /* PVMelonDS.framework */, B3145FD02CFFDAE2009FB8B3 /* PVBeetlePSX.framework */, @@ -4631,6 +4660,7 @@ buildConfigurationList = B3F7E41D297736BE00362B92 /* Build configuration list for PBXNativeTarget "Provenance-Lite" */; buildPhases = ( B3F7E2A5297736BE00362B92 /* Sources */, + B3CBB39C2D249AD600D5224E /* Embed Frameworks */, B3F7E373297736BE00362B92 /* Frameworks */, B3F7E3C3297736BE00362B92 /* Resources */, B3F7E3E6297736BE00362B92 /* Script: Set Build Number */, @@ -4659,6 +4689,10 @@ B36A8D4F2CCD5518002357DD /* PVJIT */, B3250A2E2CCEE29800E6D7CE /* FreemiumKit */, B3E77F852D1F57F3004A3AD2 /* PVFeatureFlags */, + B3CBB3A02D249CAB00D5224E /* MoltenVK */, + B3CBB3A22D249D0000D5224E /* PVCoreObjCBridge */, + B3CBB3A42D249D1200D5224E /* PVCoreBridge */, + B3CBB3A62D249D1700D5224E /* PVEmulatorCore */, ); productName = Provenance; productReference = B3F7E421297736BE00362B92 /* Provenance-Lite.app */; @@ -5207,7 +5241,6 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 9368551E2A8956220087FE6B /* modules in Resources */, B362232F2D1A012F003CAD92 /* LaunchScreenTV.storyboard in Resources */, B3F7E3C5297736BE00362B92 /* InfoPlist.strings in Resources */, B394CDEB2BDF701A006B63E8 /* LaunchScreen.storyboard in Resources */, @@ -10005,7 +10038,6 @@ ); MTL_FAST_MATH = YES; OTHER_CFLAGS = "-Wno-deprecated-declarations"; - OTHER_LDFLAGS = "$(inherited)"; "PRODUCT_BUNDLE_IDENTIFIER[sdk=appletvos*]" = "org.provenance-emu.provenance.lite"; "PRODUCT_BUNDLE_IDENTIFIER[sdk=iphoneos*]" = "org.provenance-emu.provenance.lite"; "PRODUCT_BUNDLE_IDENTIFIER[sdk=macosx*]" = "org.provenance-emu.provenance.lite"; @@ -10013,7 +10045,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; "PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = ""; - SDKROOT = iphoneos; + SDKROOT = auto; SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = YES; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; @@ -10083,7 +10115,6 @@ "-DNS_BLOCK_ASSERTIONS=1", "-Wno-deprecated-declarations", ); - OTHER_LDFLAGS = "$(inherited)"; "PRODUCT_BUNDLE_IDENTIFIER[sdk=appletvos*]" = "org.provenance-emu.provenance.lite"; "PRODUCT_BUNDLE_IDENTIFIER[sdk=iphoneos*]" = "org.provenance-emu.provenance.lite"; "PRODUCT_BUNDLE_IDENTIFIER[sdk=macosx*]" = "org.provenance-emu.provenance.lite"; @@ -10091,7 +10122,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; "PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = ""; - SDKROOT = iphoneos; + SDKROOT = auto; SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = YES; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; @@ -10159,7 +10190,6 @@ "-DNS_BLOCK_ASSERTIONS=1", "-Wno-deprecated-declarations", ); - OTHER_LDFLAGS = "$(inherited)"; "PRODUCT_BUNDLE_IDENTIFIER[sdk=appletvos*]" = "org.provenance-emu.provenance.lite"; "PRODUCT_BUNDLE_IDENTIFIER[sdk=iphoneos*]" = "org.provenance-emu.provenance.lite"; "PRODUCT_BUNDLE_IDENTIFIER[sdk=macosx*]" = "org.provenance-emu.provenance.lite"; @@ -10167,7 +10197,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; "PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = ""; - SDKROOT = iphoneos; + SDKROOT = auto; SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator"; SUPPORTS_MACCATALYST = YES; SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = YES; @@ -12060,6 +12090,26 @@ package = B34A20132C62F96100E34059 /* XCLocalSwiftPackageReference "PVPlists" */; productName = PVPlists; }; + B3CBB3A02D249CAB00D5224E /* MoltenVK */ = { + isa = XCSwiftPackageProductDependency; + package = B3D1679D2CC481D600EBB132 /* XCLocalSwiftPackageReference "MoltenVK" */; + productName = MoltenVK; + }; + B3CBB3A22D249D0000D5224E /* PVCoreObjCBridge */ = { + isa = XCSwiftPackageProductDependency; + package = B383D5232C96680700469713 /* XCLocalSwiftPackageReference "PVCoreObjCBridge" */; + productName = PVCoreObjCBridge; + }; + B3CBB3A42D249D1200D5224E /* PVCoreBridge */ = { + isa = XCSwiftPackageProductDependency; + package = B3F904A52C2002F9002283B3 /* XCLocalSwiftPackageReference "PVCoreBridge" */; + productName = PVCoreBridge; + }; + B3CBB3A62D249D1700D5224E /* PVEmulatorCore */ = { + isa = XCSwiftPackageProductDependency; + package = B3E0CFA32C054FC200F45074 /* XCLocalSwiftPackageReference "PVEmulatorCore" */; + productName = PVEmulatorCore; + }; B3CE94B6293446AC0053B891 /* Introspect */ = { isa = XCSwiftPackageProductDependency; package = 37EEA2A927BC81880070E222 /* XCRemoteSwiftPackageReference "SwiftUI-Introspect" */; From 26b5e70b76a621daf2bf36bac25502e9c9b58155 Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Tue, 31 Dec 2024 16:46:09 -0500 Subject: [PATCH 17/23] moveable remove loud log line Signed-off-by: Joseph Mattiello --- PVUI/Sources/PVUIBase/Controller/OSD/Moveable.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVUI/Sources/PVUIBase/Controller/OSD/Moveable.swift b/PVUI/Sources/PVUIBase/Controller/OSD/Moveable.swift index 04a9b20618..3f8e8cf9fe 100644 --- a/PVUI/Sources/PVUIBase/Controller/OSD/Moveable.swift +++ b/PVUI/Sources/PVUIBase/Controller/OSD/Moveable.swift @@ -241,7 +241,7 @@ class MovableButtonView: UIView, Moveable { // Cache the successful key cachedPositionKey = key - ILOG("Generated and cached position key: \(key)") + // ILOG("Generated and cached position key: \(key)") return key } From 25c3ac6eac0b7f38672b4bf73496d82dd326a501 Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Tue, 31 Dec 2024 17:37:05 -0500 Subject: [PATCH 18/23] beetle add controls stubs Signed-off-by: Joseph Mattiello --- .../PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm b/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm index 0498bfe21c..4c0fc4cccd 100644 --- a/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm +++ b/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm @@ -244,4 +244,27 @@ - (void *)getVariable:(const char *)variable { return NULL; } +// Override buffer size for BeetlePSX's requirements +- (CGSize)bufferSize { + return CGSizeMake(640, 480); // Standard PSX resolution +} + +// Set aspect ratio +- (CGSize)aspectSize { + return CGSizeMake(4, 3); // Standard PSX aspect ratio +} + +#pragma MARK: Controls +- (void)didPushPSXButton:(PVPSXButton)button forPlayer:(NSInteger)player { + DLOG(@"TODO"); +} + +- (void)didReleasePSXButton:(PVPSXButton)button forPlayer:(NSInteger)player { + DLOG(@"TODO"); +} + +- (void)didMovePSXJoystickDirection:(PVPSXButton)button withXValue:(CGFloat)xValue withYValue:(CGFloat)yValue forPlayer:(NSInteger)player { + DLOG(@"TODO"); +} + @end From 94fa92442358205477e1233aff5ed1c5ded1fb0c Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Tue, 31 Dec 2024 19:03:21 -0500 Subject: [PATCH 19/23] =?UTF-8?q?Beetle=20don=E2=80=99t=20override=20gles?= =?UTF-8?q?=20video=20sizes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Joseph Mattiello --- .../PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm b/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm index 4c0fc4cccd..a9a4e13788 100644 --- a/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm +++ b/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm @@ -139,17 +139,17 @@ - (BOOL)supportsCheatCode { return YES; } // return CGSizeMake(1024, 1024); //} // -- (GLenum)pixelFormat { - return GL_RGBA; -} - -- (GLenum)pixelType { - return GL_UNSIGNED_BYTE; -} - -- (GLenum)internalPixelFormat { - return GL_RGBA; -} +//- (GLenum)pixelFormat { +// return GL_RGBA; +//} +// +//- (GLenum)pixelType { +// return GL_UNSIGNED_BYTE; +//} +// +//- (GLenum)internalPixelFormat { +// return GL_RGBA; +//} //- (BOOL)isDoubleBuffered { // return YES; @@ -245,14 +245,14 @@ - (void *)getVariable:(const char *)variable { } // Override buffer size for BeetlePSX's requirements -- (CGSize)bufferSize { - return CGSizeMake(640, 480); // Standard PSX resolution -} +//- (CGSize)bufferSize { +// return CGSizeMake(640, 480); // Standard PSX resolution +//} // Set aspect ratio -- (CGSize)aspectSize { - return CGSizeMake(4, 3); // Standard PSX aspect ratio -} +//- (CGSize)aspectSize { +// return CGSizeMake(4, 3); // Standard PSX aspect ratio +//} #pragma MARK: Controls - (void)didPushPSXButton:(PVPSXButton)button forPlayer:(NSInteger)player { From 5186e6341ef8ece138bb22858c0187afe18c6916 Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Tue, 31 Dec 2024 19:04:35 -0500 Subject: [PATCH 20/23] Beetle supports save states? Signed-off-by: Joseph Mattiello --- Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm b/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm index a9a4e13788..69e0190553 100644 --- a/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm +++ b/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm @@ -120,7 +120,7 @@ - (void)dealloc { //} // -- (BOOL)supportsSaveStates { return NO; } +- (BOOL)supportsSaveStates { return YES; } - (BOOL)supportsRumble { return YES; } - (BOOL)supportsCheatCode { return YES; } From eb31de64020ac301b70af7fc3bbe549d5e9963d8 Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Tue, 31 Dec 2024 21:08:29 -0500 Subject: [PATCH 21/23] beetle fix get hw_renderer to renderer Signed-off-by: Joseph Mattiello --- Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm b/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm index 69e0190553..d9e5676c82 100644 --- a/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm +++ b/Cores/BeetlePSX/PVBeetlePSXCore/PVBeetlePSXCoreBridge.mm @@ -178,7 +178,7 @@ - (void *)getVariable:(const char *)variable { #define V(x) strcmp(variable, x) == 0 - if (V(BEETLE_OPT(hw_renderer))) { + if (V(BEETLE_OPT(renderer))) { // hardware, hardware_gl, hardware_vk, software NSInteger intValue = PVBeetlePSXCoreOptions.video_renderer; char *value = strdup("hardware"); From b663f09b841c68f9577503469394cb1c7fcf482c Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Tue, 31 Dec 2024 21:08:54 -0500 Subject: [PATCH 22/23] libretro build flags and gles, vulkan, zlib, dylib Signed-off-by: Joseph Mattiello --- PVCoreBridgeRetro/PVLibRetro/PVLibRetro-Build.xcconfig | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PVCoreBridgeRetro/PVLibRetro/PVLibRetro-Build.xcconfig b/PVCoreBridgeRetro/PVLibRetro/PVLibRetro-Build.xcconfig index 1dfa7c484f..616963baf4 100644 --- a/PVCoreBridgeRetro/PVLibRetro/PVLibRetro-Build.xcconfig +++ b/PVCoreBridgeRetro/PVLibRetro/PVLibRetro-Build.xcconfig @@ -1,9 +1,8 @@ // Codesigning settings defined optionally, see `CodeSigning.xcconfig.example` #include "../../Build.xcconfig" - // All -GCC_PREPROCESSOR_DEFINITIONS = $(inherited) __LIBRETRO__=1 HAVE_THREADS=1 HAVE_OPENGL=1 HAVE_OPENGLES=1 HAVE_OPENGLES2=1 HAVE_OPENGLES3=1 GLES=1 GLES2=1 GLES3=1 GLES31=1 +GCC_PREPROCESSOR_DEFINITIONS = $(inherited) __LIBRETRO__=1 HAVE_THREADS=1 HAVE_OPENGL=1 HAVE_OPENGLES=1 HAVE_OPENGLES2=1 HAVE_OPENGLES3=1 HAVE_OPENGLES_3_1=1 GLES=1 GLES2=1 GLES3=1 GLES31=1 HAVE_GLSL=1 HAVE_VULKAN=1 HAVE_ZLIB=1 HAVE_DYLIB=1 // HAVE_PLAIN_DRM=1 OTHER_CFLAGS = $(inherited) -ObjC OTHER_LDFLAGS = $(inherited) -ObjC -all_load From 9ffa147036d7642c901263cc3b123d9617d2e2e2 Mon Sep 17 00:00:00 2001 From: Joseph Mattiello Date: Tue, 31 Dec 2024 21:21:26 -0500 Subject: [PATCH 23/23] libretrocore callbacks hw add temp versions Signed-off-by: Joseph Mattiello --- .../Sources/PVLibRetro/PVLibRetroCore.m | 50 ++++++++++++------- 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/PVCoreBridgeRetro/Sources/PVLibRetro/PVLibRetroCore.m b/PVCoreBridgeRetro/Sources/PVLibRetro/PVLibRetroCore.m index c29851dfda..b2534a41ba 100644 --- a/PVCoreBridgeRetro/Sources/PVLibRetro/PVLibRetroCore.m +++ b/PVCoreBridgeRetro/Sources/PVLibRetro/PVLibRetroCore.m @@ -1481,6 +1481,7 @@ static bool environment_callback(unsigned cmd, void *data) { ILOG(@"%i", *(const unsigned*)data); return false; case RETRO_ENVIRONMENT_SET_DISK_CONTROL_INTERFACE: + // TODO: We can support this /* const struct retro_disk_control_callback * -- * Sets an interface which frontend can use to eject and insert * disk images. @@ -1490,21 +1491,34 @@ static bool environment_callback(unsigned cmd, void *data) { // const struct retro_disk_control_callback* cb = (const struct retro_disk_control_callback*)data // ILOG(@"%i", cb->data); return false; - case RETRO_ENVIRONMENT_SET_HW_RENDER: - /* struct retro_hw_render_callback * -- - * Sets an interface to let a libretro core render with - * hardware acceleration. - * Should be called in retro_load_game(). - * If successful, libretro cores will be able to render to a - * frontend-provided framebuffer. - * The size of this framebuffer will be at least as large as - * max_width/max_height provided in get_av_info(). - * If HW rendering is used, pass only RETRO_HW_FRAME_BUFFER_VALID or - * NULL to retro_video_refresh_t. - */ -// struct retro_hw_render_callback* cb = (const struct retro_hw_render_callback*)data; -// ILOG(@"%i", cb); + case RETRO_ENVIRONMENT_GET_PREFERRED_HW_RENDER: + { + // TODO: Needed for 3D + ILOG(@"RETRO_ENVIRONMENT_GET_PREFERRED_HW_RENDER"); + return false; + } + case RETRO_ENVIRONMENT_SET_HW_RENDER: { + // TODO: Needed for 3D + /* struct retro_hw_render_callback * -- + * Sets an interface to let a libretro core render with + * hardware acceleration. + * Should be called in retro_load_game(). + * If successful, libretro cores will be able to render to a + * frontend-provided framebuffer. + * The size of this framebuffer will be at least as large as + * max_width/max_height provided in get_av_info(). + * If HW rendering is used, pass only RETRO_HW_FRAME_BUFFER_VALID or + * NULL to retro_video_refresh_t. + */ + struct retro_hw_render_callback* cb = (const struct retro_hw_render_callback*)data; + ILOG(@"RETRO_ENVIRONMENT_GET_PREFERRED_HW_RENDER: %i", cb); return true; + } +//// case RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE : { +//// struct retro_hw_render_interface* rend = (struct retro_hw_render_interface*)data; +//// +//// return true; +//// } case RETRO_ENVIRONMENT_GET_RUMBLE_INTERFACE: { /* struct retro_rumble_interface * -- * Gets an interface which is used by a libretro core to set @@ -1553,6 +1567,7 @@ static bool environment_callback(unsigned cmd, void *data) { * input_state_callback API. */ case RETRO_ENVIRONMENT_GET_CAMERA_INTERFACE: + // TODO: Support camera return false; /* struct retro_camera_callback * -- * Gets an interface to a video camera driver. @@ -1579,6 +1594,8 @@ static bool environment_callback(unsigned cmd, void *data) { * start and stop the camera driver. */ case RETRO_ENVIRONMENT_GET_LOCATION_INTERFACE : + // TODO: Support location + /* struct retro_location_callback * -- * Gets access to the location interface. * The purpose of this interface is to be able to retrieve @@ -1610,11 +1627,6 @@ static bool environment_callback(unsigned cmd, void *data) { // return true; // } // // TODO: When/if vulkan support add this -//// case RETRO_ENVIRONMENT_GET_HW_RENDER_INTERFACE : { -//// struct retro_hw_render_interface* rend = (struct retro_hw_render_interface*)data; -//// -//// return true; -//// } case RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY : { NSString *appSupportPath = [strongCurrent saveStatesPath];