mirror of
https://github.com/libretro/Mu.git
synced 2026-07-08 17:57:01 +00:00
Use correct sound buffer size everywhere
This commit is contained in:
@@ -93,7 +93,7 @@ void EmuWrapper::emuThreadRun(){
|
||||
emulateFrame();
|
||||
if(!emuNewFrameReady){
|
||||
memcpy(emuDoubleBufferVideo, emuVideoWidth == 320 ? palmExtendedFramebuffer : palmFramebuffer, emuVideoWidth * emuVideoHeight * sizeof(uint16_t));
|
||||
memcpy(emuDoubleBufferAudio, palmAudio, AUDIO_SAMPLES);
|
||||
memcpy(emuDoubleBufferAudio, palmAudio, AUDIO_SAMPLES * 2/*channels*/ * sizeof(int16_t));
|
||||
emuNewFrameReady = true;
|
||||
}
|
||||
}
|
||||
@@ -207,7 +207,7 @@ uint32_t EmuWrapper::init(const QString& romPath, const QString& bootloaderPath,
|
||||
emuPaused = false;
|
||||
emuNewFrameReady = false;
|
||||
emuDoubleBufferVideo = new uint16_t[emuVideoWidth * emuVideoHeight];
|
||||
emuDoubleBufferAudio = new int16_t[CRYSTAL_FREQUENCY * AUDIO_DUTY_CYCLE_SIZE * 2/*channels*/];
|
||||
emuDoubleBufferAudio = new int16_t[AUDIO_SAMPLES * 2/*channels*/];
|
||||
emuThread = std::thread(&EmuWrapper::emuThreadRun, this);
|
||||
}
|
||||
else{
|
||||
|
||||
@@ -170,7 +170,7 @@ void MainWindow::updateDisplay(){
|
||||
ui->display->repaint();
|
||||
|
||||
//audio
|
||||
audioOut->write((const char*)emu.getAudioSamples(), AUDIO_SAMPLES * sizeof(int16_t));
|
||||
audioOut->write((const char*)emu.getAudioSamples(), AUDIO_SAMPLES * 2/*channels*/ * sizeof(int16_t));
|
||||
|
||||
//power LED
|
||||
ui->powerButtonLed->setStyleSheet(emu.getPowerButtonLed() ? "background: lime" : "");
|
||||
|
||||
@@ -95,7 +95,7 @@ uint32_t emulatorInit(buffer_t palmRomDump, buffer_t palmBootDump, uint32_t spec
|
||||
memset(palmExtendedFramebuffer, 0x00, 320 * 320 * sizeof(uint16_t));
|
||||
//add 320*320 silkscreen image later, 2xBRZ should be able to make 320*320 version of the 160*160 silkscreen
|
||||
}
|
||||
memset(palmAudio, 0x00, AUDIO_SAMPLES * 2 * sizeof(int16_t));
|
||||
memset(palmAudio, 0x00, AUDIO_SAMPLES * 2/*channels*/ * sizeof(int16_t));
|
||||
m68328Reset();
|
||||
sed1376Reset();
|
||||
ads7846Reset();
|
||||
|
||||
@@ -112,12 +112,12 @@ typedef struct{
|
||||
}misc_hw_t;
|
||||
|
||||
//config options
|
||||
#define EMU_FPS 60
|
||||
#define AUDIO_DUTY_CYCLE_SIZE 20//the amount of frequencys the PWM can play
|
||||
#define SAVE_STATE_VERSION 0
|
||||
|
||||
//system constants
|
||||
#define CRYSTAL_FREQUENCY 32768
|
||||
#define EMU_FPS 60
|
||||
#define AUDIO_SAMPLES (CRYSTAL_FREQUENCY / EMU_FPS * AUDIO_DUTY_CYCLE_SIZE)
|
||||
|
||||
//emulator data, some are GUI interface variables, some should be left alone
|
||||
|
||||
1
tests/audioAddress.txt
Normal file
1
tests/audioAddress.txt
Normal file
@@ -0,0 +1 @@
|
||||
Audio write, PC:0x10087FC4(printed 4 times)
|
||||
1
tools/palm/muExpansionDriver/soundDriver.c
Normal file
1
tools/palm/muExpansionDriver/soundDriver.c
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
1
tools/palm/muExpansionDriver/soundDriver.h
Normal file
1
tools/palm/muExpansionDriver/soundDriver.h
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
Reference in New Issue
Block a user