feat: Implement audio backend and APU debugging features

- Introduced a new audio backend system with SDL2 support, allowing for flexible audio management and improved performance.
- Added APU handshake tracking capabilities to monitor CPU-APU communication during audio program uploads, enhancing debugging and transfer diagnostics.
- Updated the Emulator class to integrate the new audio backend, ensuring compatibility with existing audio handling.
- Implemented an APU Debugger UI for real-time monitoring of handshake status, port activity, and transfer progress, improving user experience for debugging audio issues.
- Refactored audio-related code to streamline audio sample queuing and management, enhancing overall emulator performance.
This commit is contained in:
scawful
2025-10-08 20:57:43 -04:00
parent 7f4a0f546c
commit 3125ff4b76
14 changed files with 1057 additions and 122 deletions

View File

@@ -7,6 +7,7 @@
#include "app/emu/audio/apu.h"
#include "app/emu/cpu/cpu.h"
#include "app/emu/debug/apu_debugger.h"
#include "app/emu/memory/memory.h"
#include "app/emu/video/ppu.h"
@@ -69,6 +70,9 @@ class Snes {
auto memory() -> MemoryImpl& { return memory_; }
auto get_ram() -> uint8_t* { return ram; }
auto mutable_cycles() -> uint64_t& { return cycles_; }
// Audio debugging
auto apu_handshake_tracker() -> debug::ApuHandshakeTracker& { return apu_handshake_tracker_; }
bool fast_mem_ = false;
@@ -117,6 +121,9 @@ class Snes {
bool auto_joy_read_ = false;
uint16_t auto_joy_timer_ = 0;
bool ppu_latch_;
// Audio debugging
debug::ApuHandshakeTracker apu_handshake_tracker_;
};
} // namespace emu