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

@@ -258,6 +258,7 @@ class Ppu {
// Initialize the frame buffer
void Init() {
frame_buffer_.resize(256 * 240, 0);
// Set to XBGR format (1) for compatibility with SDL_PIXELFORMAT_ARGB8888
pixelOutputFormat = 1;
}
@@ -315,6 +316,9 @@ class Ppu {
// Returns the pixel data for the current frame
const std::vector<uint8_t>& GetFrameBuffer() const { return frame_buffer_; }
// Set pixel output format (0 = BGRX, 1 = XBGR)
void SetPixelFormat(uint8_t format) { pixelOutputFormat = format; }
private:
int GetPixelForMode7(int x, int layer, bool priority);