Merge branch 'metal' into metal

This commit is contained in:
SamoZ256 2024-07-02 17:44:32 +02:00 committed by GitHub
commit 124622cf18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 93 additions and 11 deletions

View file

@ -176,6 +176,7 @@ namespace Audio {
// Decode an entire buffer worth of audio
void decodeBuffer(DSPSource& source);
SampleBuffer decodePCM8(const u8* data, usize sampleCount, Source& source);
SampleBuffer decodePCM16(const u8* data, usize sampleCount, Source& source);
SampleBuffer decodeADPCM(const u8* data, usize sampleCount, Source& source);

View file

@ -15,6 +15,7 @@
#include "services/service_manager.hpp"
class CPU;
struct Scheduler;
class Kernel {
std::span<u32, 16> regs;
@ -241,6 +242,7 @@ class Kernel {
}
ServiceManager& getServiceManager() { return serviceManager; }
Scheduler& getScheduler();
void sendGPUInterrupt(GPUInterrupt type) { serviceManager.sendGPUInterrupt(type); }
void clearInstructionCache();

View file

@ -11,7 +11,8 @@ struct Scheduler {
VBlank = 0, // End of frame event
UpdateTimers = 1, // Update kernel timer objects
RunDSP = 2, // Make the emulated DSP run for one audio frame
Panic = 3, // Dummy event that is always pending and should never be triggered (Timestamp = UINT64_MAX)
SignalY2R = 3, // Signal that a Y2R conversion has finished
Panic = 4, // Dummy event that is always pending and should never be triggered (Timestamp = UINT64_MAX)
TotalNumberOfEvents // How many event types do we have in total?
};
static constexpr usize totalNumberOfEvents = static_cast<usize>(EventType::TotalNumberOfEvents);

View file

@ -109,4 +109,5 @@ class ServiceManager {
HIDService& getHID() { return hid; }
NFCService& getNFC() { return nfc; }
DSPService& getDSP() { return dsp; }
Y2RService& getY2R() { return y2r; }
};

View file

@ -101,8 +101,12 @@ class Y2RService {
void startConversion(u32 messagePointer);
void stopConversion(u32 messagePointer);
public:
bool isBusy;
public:
Y2RService(Memory& mem, Kernel& kernel) : mem(mem), kernel(kernel) {}
void reset();
void handleSyncRequest(u32 messagePointer);
void signalConversionDone();
};