Commit Graph

29 Commits

Author SHA1 Message Date
scawful
5676d934f3 feat(apu): implement cycle budget model with fixed-point ratio
- Replace floating-point ratio with integer numerator/denominator
- Convert RunCycles() to use new Step() function
- Implement explicit cycle budget loop
- Add detailed comments explaining the conversion

Benefits:
- Perfect precision (no floating-point drift over long sessions)
- Explicit cycle counting for better debugging
- Faster integer arithmetic
- Testable cycle accuracy per instruction
2025-10-10 17:30:50 -04:00
scawful
3125ff4b76 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.
2025-10-08 20:57:43 -04:00
scawful
fdb817987f 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.
2025-10-06 20:01:10 -04:00
scawful
e41ea0df46 Update emu guide and set emu logs to debug 2025-10-06 19:36:22 -04:00
scawful
293ece69aa refactor: Improve Emulator Initialization and Resource Management
- Refactored SDL initialization process to enhance clarity and error handling, ensuring proper setup of video, audio, and event subsystems.
- Utilized RAII smart pointers for window and renderer management, improving resource cleanup during shutdown.
- Updated audio buffer allocation to use unique_ptr for automatic memory management.
- Enhanced logging for emulator state and initialization, providing better insights during execution.
- Streamlined timing management and frame processing logic for improved performance and maintainability.
2025-10-06 19:16:26 -04:00
scawful
a5d4722d13 fix: Reduce Logging Limits to Prevent Crashes During Emulator Execution
- Decreased logging limits in Snes, Apu, and Spc700 classes to prevent overflow crashes during execution.
- Updated comments in the APU boot ROM for clarity regarding the hardware dump and critical fixes.
- Enhanced logging to provide better insights while maintaining system stability.
2025-10-06 16:14:32 -04:00
scawful
a09d7d10c8 feat: Implement Deadlock Detection and Improve Emulator Shutdown Logging
- Added deadlock detection in the emulator's main loop to identify when the CPU is stuck, enhancing debugging capabilities.
- Updated logging during emulator shutdown to provide clearer status messages, including final CPU state and resource cleanup.
- Refactored audio and texture cleanup processes to ensure proper resource management during shutdown.
2025-10-06 15:21:48 -04:00
scawful
67a4a82e2e refactor: Update Emulator Command-Line Flags and CMake Configuration
- Renamed command-line flags for improved clarity and consistency, enhancing usability for ROM loading, GUI options, and state management.
- Adjusted default maximum frames for emulator execution to 180, optimizing performance settings.
- Refactored CMake configuration to reflect changes in source file structure, ensuring proper build setup for the emulator application.
2025-10-06 14:30:00 -04:00
scawful
ba40ddab2a feat: Enhance APU and SPC700 Logging and Instruction Handling
- Updated APU boot ROM comments for clarity and completeness, including details on multi-byte transfer acknowledgments.
- Improved logging in APU and SPC700 classes to provide comprehensive tracing during execution, particularly for transfer protocols and MOVS instructions.
- Refactored MOVS, MOVSX, and MOVSY methods to use consistent address handling, enhancing readability and maintainability.
- Added conditional logging for specific addresses to aid in debugging and tracking state changes during instruction execution.
2025-10-06 12:57:42 -04:00
scawful
a881c0f8e1 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.
2025-10-06 11:41:33 -04:00
scawful
f48cd171e1 Remove unused audio namespace and clean up includes in APU and DSP files 2024-12-30 07:49:46 -05:00
scawful
e05e7c35db remove app namespace 2024-12-28 21:28:51 -05:00
scawful
89edcaa2a3 remove clock from apu, use std::array 2024-04-25 23:51:37 -04:00
scawful
b4f2fdc57e cleanup apu and spc 2024-04-25 00:23:14 -04:00
scawful
8a06219353 update apu ram management 2024-04-24 15:42:07 -04:00
scawful
aaf9724531 Move Apu cycling from SNES to Apu class 2024-04-24 12:32:09 -04:00
scawful
6842c08b3a Update Apu class 2024-04-24 10:04:24 -04:00
scawful
1c9c1592eb Overhaul Apu, add cycling and port handling 2024-04-22 15:55:57 -04:00
scawful
e89d768b5a Add Dsp::GetSamples and cleanup Apu 2024-04-20 08:09:43 -04:00
scawful
a825ac36b2 Increase NotifyObservers data arg to uint16_t from uint8_t 2024-04-19 17:55:52 -04:00
scawful
ad08d998b5 Add audio namespace inside of emu 2024-04-13 23:32:30 -05:00
scawful
3effd03f1f Rename APU to Apu 2024-04-13 23:25:41 -05:00
scawful
87db938963 cleanup spc700 and add todos 2023-12-06 01:32:59 -05:00
scawful
d0c9229093 Reorganize emu cpu directory 2023-12-05 21:16:16 -05:00
scawful
d870ba2c9f Update Apu SignalReady, BeginTransfer sequence 2023-12-05 03:44:39 -05:00
scawful
ca9cc42d6b Apu callback, CPU instruction lengths 2023-12-03 05:37:42 -05:00
scawful
5a4ecc5b20 PPU upgrades, move Memory to own dir 2023-08-27 15:24:27 -04:00
scawful
559c2e4830 Add SignalReady to APU init 2023-08-26 04:51:50 -04:00
scawful
3d793c452d Reorganize emu folder, update S-SMP system infra 2023-08-26 01:59:57 -04:00