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:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user