Skip to content

Commit

Permalink
Merge branch 'release/3.0.0' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeMatt committed Dec 3, 2024
2 parents 040e57e + e6c3d73 commit 02c3269
Show file tree
Hide file tree
Showing 40 changed files with 875 additions and 475 deletions.
2 changes: 1 addition & 1 deletion Build.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// https://help.apple.com/xcode/#/dev745c5c974

MARKETING_VERSION = 3.0.0
CURRENT_PROJECT_VERSION = 2818
CURRENT_PROJECT_VERSION = 2833

GCC_PREPROCESSOR_DEFINITIONS = $(inherited) GLES_SILENCE_DEPRECATION=1 NONJAILBROKEN=1

Expand Down
2 changes: 1 addition & 1 deletion Cores/BeetlePSX/PVBeetlePSX/Core.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<key>PVCoreIdentifier</key>
<string>com.provenance.core.beetlepsx</string>
<key>PVPrincipleClass</key>
<string>PVBeetlePSXCore</string>
<string>PVBeetlePSX.PVBeetlePSXCore</string>
<key>PVSupportedSystems</key>
<array>
<string>com.provenance.psx</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ - (BOOL)loadFileAtPath:(NSString *)path error:(NSError**)error {
//mednafenCoreAspect = OEIntSizeMake(game.nominal_width, game.nominal_height);
self->sampleRate = 48000;
}
else if([[self systemIdentifier] isEqualToString:@"com.provenance.nes"])
else if([[self systemIdentifier] isEqualToString:@"com.provenance.nes"] || [[self systemIdentifier] isEqualToString:@"com.provenance.fds"])
{
self.systemType = MednaSystemNES;

Expand Down
2 changes: 1 addition & 1 deletion Cores/PPSSPP/BuildFlags.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
//OTHER_CFLAGS[sdk=appletvos*] = $(inherited) -DDRC_SH2 -D_USE_CZ80
//OTHER_CFLAGS[sdk=appletvsimulator*] = $(inherited) -D_USE_CZ80
//OTHER_CFLAGS = $(inherited) -DXXH_VECTOR=XXH_SCALAR -DMASKED_PSP_MEMORY=TRUE
OTHER_CFLAGS = $(inherited) -fno-operator-names -ffast-math -ftree-vectorize -fno-strict-aliasing -frename-registers -fpermissive -fno-operator-names -fobjc-arc -fsingle-precision-constant -fomit-frame-pointer -fvisibility-inlines-hidden -fvisibility=hidden -flto -funsafe-math-optimizations -DXXH_VECTOR=XXH_SCALAR -DGLES_SILENCE_DEPRECATION=1
OTHER_CFLAGS = $(inherited) -fno-operator-names -ffast-math -ftree-vectorize -fno-strict-aliasing -frename-registers -fpermissive -fno-operator-names -fobjc-arc -fsingle-precision-constant -fomit-frame-pointer -fvisibility-inlines-hidden -fvisibility=hidden -flto -funsafe-math-optimizations -DXXH_VECTOR=XXH_SCALAR -DGLES_SILENCE_DEPRECATION=1 -DGLES_SILENCE_DEPRECATION
// Skip Simulator Build
EXCLUDED_SOURCE_FILE_NAMES[sdk=iphonesimulator*][arch=*] = *
INCLUDED_SOURCE_FILE_NAMES[sdk=iphonesimulator*][arch=*] = PVDebug.m
Expand Down
2 changes: 1 addition & 1 deletion Cores/PPSSPP/PVPPSSPPCore/Core/OGLGraphicsContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Copyright (c) 2012- PPSSPP Project.
//

#import "PVPPSSPPCore.h"
//#import "PVPPSSPPCore.h"
#import "PVPPSSPPCore+Controls.h"
#import "PVPPSSPPCore+Audio.h"
#import "PVPPSSPPCore+Video.h"
Expand Down
1 change: 0 additions & 1 deletion Cores/PPSSPP/PVPPSSPPCore/Core/PVPPSSPPCore+Saves.mm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

#import "PVPPSSPPCore+Saves.h"
#import "PVPPSSPPCore.h"
@import PVSupport;
@import PVEmulatorCore;
@import PVCoreBridge;
Expand Down
7 changes: 3 additions & 4 deletions Cores/PPSSPP/PVPPSSPPCore/Core/PVPPSSPPCore+Video.mm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
// Copyright © 2021 Provenance. All rights reserved.
//

#import "PVPPSSPPCore+Video.h"
#import "OGLGraphicsContext.h"
#import "VulkanGraphicsContext.h"

//#import "PVPPSSPPCore.h"
#import <OpenGLES/ES3/glext.h>
#import <OpenGLES/ES3/gl.h>
Expand Down Expand Up @@ -41,9 +43,6 @@
#include <dlfcn.h>
#endif

#include "OGLGraphicsContext.h"
#include "VulkanGraphicsContext.h"

/* PSP Includes */
//#import <dlfcn.h>
//#import <pthread.h>
Expand Down
1 change: 0 additions & 1 deletion Cores/PPSSPP/PVPPSSPPCore/Core/PVPPSSPPCore.mm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// Created by Joseph Mattiello on 4/6/18.
// Copyright © 2021 Provenance. All rights reserved.
//
#import "PVPPSSPPCore.h"
#import "PVPPSSPPCore+Controls.h"
#import "PVPPSSPPCore+Audio.h"
#import "PVPPSSPPCore+Video.h"
Expand Down
8 changes: 4 additions & 4 deletions Cores/PPSSPP/PVPPSSPPCore/Core/VulkanGraphicsContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
// Copyright (c) 2012- PPSSPP Project.
//

#import "PVPPSSPPCore.h"
#import "PVPPSSPPCore+Controls.h"
#import "PVPPSSPPCore+Audio.h"
#import "PVPPSSPPCore+Video.h"
#import <PVPPSSPP/PVPPSSPPCore.h>
#import <PVPPSSPP/PVPPSSPPCore+Controls.h>
#import <PVPPSSPP/PVPPSSPPCore+Audio.h>
#import <PVPPSSPP/PVPPSSPPCore+Video.h>
#import <PVPPSSPP/PVPPSSPP-Swift.h>
#import <Foundation/Foundation.h>
@import PVSupport;
Expand Down
2 changes: 1 addition & 1 deletion Cores/Reicast/reicast-emulator
2 changes: 2 additions & 0 deletions CoresRetro/RetroArch/PVRetroArch/Core.plist
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,8 @@
<string>https://docs.libretro.com/library/play/</string>
<key>PVProjectVersion</key>
<string>0.66</string>
<key>PVAppStoreDisabled</key>
<true/>
</dict>
<dict>
<key>PVCoreIdentifier</key>
Expand Down
6 changes: 4 additions & 2 deletions CoresRetro/RetroArch/PVRetroArchCore/Core/PVRetroArchCore.mm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#import <Foundation/Foundation.h>
#import <PVCoreObjCBridge/PVCoreObjCBridge.h>
#import <PVLogging/PVLoggingObjC.h>

/* RetroArch Includes */
#include <stdint.h>
Expand Down Expand Up @@ -61,12 +62,13 @@ - (instancetype)init {
self.extractArchive = false;
PVRetroArchCore.systemName = self.systemIdentifier;
PVRetroArchCore.coreClassName = self.coreIdentifier;
ILOG(@"PVRetroArchCore.coreClassName: %@, coreClassName: %@", PVRetroArchCore.systemName, PVRetroArchCore.coreClassName);
[self parseOptions];
CGRect bounds=[[UIScreen mainScreen] bounds];
_videoWidth = bounds.size.width;
_videoHeight = bounds.size.height;
_videoBitDepth = 32;
sampleRate = 44100;
sampleRate = 48000;
self->resFactor = 1;
self.ffSpeed = 300;
self.smSpeed = 300;
Expand Down Expand Up @@ -124,7 +126,7 @@ -(void)optionUpdated:(NSNotification *)notification {
for (NSString* key in info.allKeys) {
NSString *value=[info valueForKey:key];
[self processOption:key value:value];
printf("Received Option key:%s value:%s\n",key.UTF8String, value.UTF8String);
ILOG(@"Received Option key:%s value:%s\n",key.UTF8String, value.UTF8String);
}
}
-(void)processOption:(NSString *)key value:(NSString*)value {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ extension PVRetroArchCore: CoreOptional {
.init(title: "Angrylion", description: "Angrylion", value: 0),
.init(title: "GlideN64", description: "GlideN64", value: 1)
],
defaultValue: 1)
defaultValue: 0)
}
static var apple2MachineOption: CoreOption {
.enumeration(.init(title: "System Model",
Expand Down Expand Up @@ -149,6 +149,7 @@ extension PVRetroArchCore: CoreOptional {
var coreOptions: [CoreOption] = [gsOption]
var isDOS=false
coreOptions.append(retroArchControllerOption)
DLOG("Getting options for coreClassName: \(self.coreClassName) systemName:\(self.systemName)")
if (self.coreClassName.contains("mupen")) {
coreOptions.append(mupenRDPOption)
}
Expand Down Expand Up @@ -308,7 +309,7 @@ extension PVRetroArchCore: CoreOptional {
optionOverwrite = false
}
if (coreIdentifier.contains("mupen")) {
let rdpOpt = PVRetroArchCore.valueForOption(PVRetroArchCore.mupenRDPOption).asInt ?? 1
let rdpOpt = PVRetroArchCore.valueForOption(PVRetroArchCore.mupenRDPOption).asInt ?? 0
if (rdpOpt == 0) {
optionValues += "mupen64plus-rdp-plugin = \"angrylion\"\n"
} else {
Expand Down Expand Up @@ -420,7 +421,7 @@ extension PVRetroArchCoreCore: CoreActions {
menuToggle()
break;
default:
print("Unknown action: " + action.title)
WLOG("Unknown action: " + action.title)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,20 +140,130 @@ final public class AVAudioEngineGameAudioEngine: AudioEngineProtocol {
private func readBlockForBuffer(_ buffer: RingBufferProtocol) -> OEAudioBufferReadBlock {
return { buf, max -> Int in
let bytesAvailable = buffer.availableBytes
let bytesToRead = min(bytesAvailable, max)
let bytesPerSample = self.gameCore.audioBitDepth / 8
let is8Bit = bytesPerSample == 1
let sourceChannels = self.gameCore.channelCount(forBuffer: 0)

// For 8-bit audio, we need to read half as many bytes since we'll expand to 16-bit
let bytesToRead = min(bytesAvailable, is8Bit ? max / 2 : max)

if bytesToRead == 0 {
memset(buf, 0, max)
return max
}

let bytesRead = buffer.read(buf, preferredSize: bytesToRead)
if is8Bit {
// Create a temporary buffer for 8-bit data
var source8 = [Int8](repeating: 0, count: bytesToRead)
let bytesRead = buffer.read(UnsafeMutableRawPointer(&source8), preferredSize: bytesToRead)
let samplesRead = bytesRead
let output = buf.assumingMemoryBound(to: Int16.self)

if sourceChannels == 1 {
// Process 8 samples at a time for mono
let simdCount = samplesRead / 8
for i in 0..<simdCount {
// Load 8 samples
let monoVector = SIMD8<Int8>(
source8[i * 8 + 0],
source8[i * 8 + 1],
source8[i * 8 + 2],
source8[i * 8 + 3],
source8[i * 8 + 4],
source8[i * 8 + 5],
source8[i * 8 + 6],
source8[i * 8 + 7]
)

// Convert Int8 to Int16 and shift
let monoVector16 = SIMD8<Int16>(
Int16(monoVector[0]) << 8,
Int16(monoVector[1]) << 8,
Int16(monoVector[2]) << 8,
Int16(monoVector[3]) << 8,
Int16(monoVector[4]) << 8,
Int16(monoVector[5]) << 8,
Int16(monoVector[6]) << 8,
Int16(monoVector[7]) << 8
)

// Interleave mono samples to stereo
for j in 0..<8 {
let outputIndex = (i * 16) + (j * 2)
output[outputIndex] = monoVector16[j] // Left
output[outputIndex + 1] = monoVector16[j] // Right
}
}

// Handle remaining samples
let remaining = samplesRead % 8
if remaining > 0 {
let startIdx = simdCount * 8
for i in 0..<remaining {
let sample = Int16(source8[startIdx + i]) << 8
let outputIndex = (simdCount * 16) + (i * 2)
output[outputIndex] = sample // Left
output[outputIndex + 1] = sample // Right
}
}
} else {
// Process 16 samples at a time for stereo
let simdCount = (samplesRead / 16) * 2 // Process pairs for stereo
for i in 0..<simdCount {
let stereoVector = SIMD8<Int8>(
source8[i * 8 + 0],
source8[i * 8 + 1],
source8[i * 8 + 2],
source8[i * 8 + 3],
source8[i * 8 + 4],
source8[i * 8 + 5],
source8[i * 8 + 6],
source8[i * 8 + 7]
)

let stereoVector16 = SIMD8<Int16>(
Int16(stereoVector[0]) << 8,
Int16(stereoVector[1]) << 8,
Int16(stereoVector[2]) << 8,
Int16(stereoVector[3]) << 8,
Int16(stereoVector[4]) << 8,
Int16(stereoVector[5]) << 8,
Int16(stereoVector[6]) << 8,
Int16(stereoVector[7]) << 8
)

// Store converted stereo samples
for j in 0..<8 {
output[i * 8 + j] = stereoVector16[j]
}
}

// Handle remaining samples
let remaining = (samplesRead % 16) / 2
if remaining > 0 {
let startIdx = simdCount * 8
for i in 0..<remaining {
output[startIdx + i] = Int16(source8[startIdx * 2 + i * 2]) << 8
output[startIdx + i + 1] = Int16(source8[startIdx * 2 + i * 2 + 1]) << 8
}
}
}

if bytesRead * 2 < max {
memset(buf.advanced(by: bytesRead * 2), 0, max - (bytesRead * 2))
}

if bytesRead < max {
memset(buf.advanced(by: bytesRead), 0, max - bytesRead)
}
return max
} else {
// Handle 16-bit normally
let bytesRead = buffer.read(buf, preferredSize: bytesToRead)

return max
if bytesRead < max {
memset(buf.advanced(by: bytesRead), 0, max - bytesRead)
}

return max
}
}
}

Expand Down
Loading

0 comments on commit 02c3269

Please sign in to comment.