refactor(emulator): enhance input handling and audio resampling features

- Renamed `turbo_mode()` to `is_turbo_mode()` for clarity in the Emulator class.
- Improved input handling in the Snes class by adding button state management and ensuring proper initialization of input controllers.
- Implemented multiple audio resampling methods (linear, cosine, cubic) in the Dsp class, allowing for enhanced audio quality during playback.
- Updated the user interface to include options for selecting audio interpolation methods and added keyboard shortcuts for emulator controls.

Benefits:
- Improved code readability and maintainability through clearer method naming and structured input management.
- Enhanced audio playback quality with new resampling techniques.
- Streamlined user experience with added UI features for audio settings and keyboard shortcuts.
This commit is contained in:
scawful
2025-10-11 13:56:49 -04:00
parent 0a4b17fdd0
commit 9ffb7803f5
11 changed files with 454 additions and 114 deletions

View File

@@ -7,6 +7,12 @@
namespace yaze {
namespace emu {
enum class InterpolationType {
Linear,
Cosine,
Cubic,
};
typedef struct DspChannel {
// pitch
uint16_t pitch;
@@ -104,6 +110,8 @@ class Dsp {
void GetSamples(int16_t* sample_data, int samples_per_frame, bool pal_timing);
InterpolationType interpolation_type = InterpolationType::Linear;
private:
// sample ring buffer (1024 samples, *2 for stereo)
int16_t sampleBuffer[0x400 * 2];