Optimize audio output a bit

This commit is contained in:
wheremyfoodat 2024-02-23 23:49:10 +02:00
parent 53746e0511
commit 921250bcd2
4 changed files with 113 additions and 124 deletions

View file

@ -1,4 +1,6 @@
#pragma once
#include <array>
#include "audio/dsp_core.hpp"
#include "memory.hpp"
#include "swap.hpp"
@ -10,6 +12,11 @@ namespace Audio {
u32 pipeBaseAddr;
bool running; // Is the DSP running?
bool loaded; // Have we finished loading a binary with LoadComponent?
bool signalledData;
bool signalledSemaphore;
uint audioFrameIndex = 0; // Index in our audio frame
std::array<s16, 160 * 2> audioFrame;
// Get a pointer to a data memory address
u8* getDataPointer(u32 address) { return getDspMemory() + Memory::DSP_DATA_MEMORY_OFFSET + address; }
@ -62,10 +69,6 @@ namespace Audio {
std::memcpy(statusAddress + 6, &status.writePointer, sizeof(u16));
}
}
bool signalledData;
bool signalledSemaphore;
// Run 1 slice of DSP instructions
void runSlice() {
if (running) {