Unverified Commit 0a1ffc3d authored by Kurtis Dinelle's avatar Kurtis Dinelle Committed by GitHub
Browse files

Merge pull request #9 from phcoder/int16

LIBRETRO: Fix audio sample type
parents 44ee02cd db759102
Pipeline #80535 passed with stages
in 1 minute and 28 seconds
......@@ -381,10 +381,10 @@ void retro_unload_game(void)
rom_size = 0;
}
int get_audio_sample(void)
int16_t get_audio_sample(void)
{
// Get the byte of the emulator's buffer that the next sample is in.
int x = chip8.RAM[AUDIO_BUF_ADDR + (snd_buf_pntr / 8)];
int16_t x = chip8.RAM[AUDIO_BUF_ADDR + (snd_buf_pntr / 8)];
// Get the actual sample bit.
x <<= (snd_buf_pntr % 8);
......@@ -463,7 +463,7 @@ void retro_run(void)
audio_counter_chip8 += ONE_SEC / chip8.cpu_freq;
while (audio_counter_chip8 > ONE_SEC / audio_freq_chip8) {
audio_counter_chip8 -= ONE_SEC / audio_freq_chip8;
int sample = get_audio_sample();
int16_t sample = get_audio_sample();
audio_counter_resample += ONE_SEC / audio_freq_chip8;
audio_sample(sample);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment