feat: Implement FPS Tracking and Audio Status Display in Emulator

- Added frame rate tracking to the emulator, calculating and displaying current FPS in the UI.
- Enhanced audio management by monitoring queued audio frames and ensuring the audio buffer is filled appropriately.
- Updated texture handling to align with the PPU output format, improving visual consistency.
- Refactored timing management to cap time accumulation, preventing performance issues during frame processing.
This commit is contained in:
scawful
2025-10-06 20:01:10 -04:00
parent e41ea0df46
commit fdb817987f
6 changed files with 73 additions and 17 deletions

View File

@@ -82,7 +82,12 @@ class Emulator {
// timing
uint64_t count_frequency;
uint64_t last_count;
float time_adder = 0.0;
double time_adder = 0.0;
// FPS tracking
int frame_count_ = 0;
double fps_timer_ = 0.0;
double current_fps_ = 0.0;
int16_t* audio_buffer_;
SDL_AudioDeviceID audio_device_;