feat: Refactor Emulator to Accept ROM Parameter and Enhance Logging

- Updated Emulator::Run method to accept a Rom* parameter, improving flexibility in ROM handling.
- Refactored texture creation and ROM data initialization to utilize the new parameter.
- Enhanced logging in Snes class to provide detailed information during initialization, reset, and frame processing, aiding in debugging and performance monitoring.
- Introduced cycle tracking in Apu and Spc700 classes for accurate synchronization and debugging.
- Added unit tests for APU DSP functionality and IPL ROM handshake to ensure reliability and correctness of audio processing.
This commit is contained in:
scawful
2025-10-06 11:41:33 -04:00
parent e58bc3f007
commit a881c0f8e1
16 changed files with 922 additions and 79 deletions

View File

@@ -38,7 +38,8 @@ struct EmulatorKeybindings {
class Emulator {
public:
Emulator() = default;
void Run();
~Emulator() = default;
void Run(Rom* rom);
auto snes() -> Snes& { return snes_; }
auto running() const -> bool { return running_; }
@@ -47,8 +48,6 @@ class Emulator {
audio_device_ = audio_device;
}
auto wanted_samples() const -> int { return wanted_samples_; }
auto rom() { return rom_; }
auto mutable_rom() { return rom_; }
private:
void RenderNavBar();
@@ -88,7 +87,6 @@ class Emulator {
int16_t* audio_buffer_;
SDL_AudioDeviceID audio_device_;
Rom* rom_;
Snes snes_;
SDL_Texture* ppu_texture_;