From 02656060a3c8b1d7f54a41039912dfb4131cc58a Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Wed, 26 Jan 2022 01:59:50 -0500 Subject: [PATCH] Fixes in PAS16 --- src/include/86box/snd_mpu401.h | 5 +++++ src/sound/snd_pas16.c | 11 ++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/include/86box/snd_mpu401.h b/src/include/86box/snd_mpu401.h index 93df18a80..433bf09a1 100644 --- a/src/include/86box/snd_mpu401.h +++ b/src/include/86box/snd_mpu401.h @@ -19,6 +19,8 @@ * Copyright 2016-2020 Miran Grca. * Copyright 2016-2020 TheCollector1995. */ +#ifndef SOUND_MPU401_H +# define SOUND_MPU401_H #define MPU401_VERSION 0x15 #define MPU401_REVISION 0x01 @@ -160,3 +162,6 @@ extern void mpu401_irq_attach(mpu_t *mpu, void (*ext_irq_update)(void *priv, int extern int MPU401_InputSysex(void *p, uint8_t *buffer, uint32_t len, int abort); extern void MPU401_InputMsg(void *p, uint8_t *msg, uint32_t len); + + +#endif /*SOUND_MPU401_H*/ diff --git a/src/sound/snd_pas16.c b/src/sound/snd_pas16.c index 3a085241c..483b7548c 100644 --- a/src/sound/snd_pas16.c +++ b/src/sound/snd_pas16.c @@ -17,6 +17,7 @@ #include <86box/filters.h> #include <86box/snd_mpu401.h> #include <86box/snd_opl.h> +#include <86box/snd_sb.h> #include <86box/snd_sb_dsp.h> @@ -413,7 +414,7 @@ static void pas16_pit_out(uint16_t port, uint8_t val, void *p) { if (!(val & 0x20)) { - if (val & 2) pas16->pit.rl[0] = timer_get_remaining_u64(&pit.timer[0]) / PITCONST;; + if (val & 2) pas16->pit.rl[0] = timer_get_remaining_u64(&pas16->pit.timer[0]) / PITCONST;; if (val & 4) pas16->pit.rl[1] = pas16->pit.c[1]; if (val & 8) pas16->pit.rl[2] = pas16->pit.c[2]; } @@ -429,7 +430,7 @@ static void pas16_pit_out(uint16_t port, uint8_t val, void *p) if (!(pas16->pit.ctrl & 0x30)) { if (!t) - pas16->pit.rl[t] = timer_get_remaining_u64(&pit.timer[t]) / PITCONST; + pas16->pit.rl[t] = timer_get_remaining_u64(&pas16->pit.timer[t]) / PITCONST; else { pas16->pit.rl[t] = pas16->pit.c[t]; @@ -450,7 +451,7 @@ static void pas16_pit_out(uint16_t port, uint8_t val, void *p) { pas16->pit.rm[t] = 3; if (!t) - pas16->pit.rl[t] = timer_get_remaining_u64(&pit.timer[t]) / PITCONST; + pas16->pit.rl[t] = timer_get_remaining_u64(&pas16->pit.timer[t]) / PITCONST; else pas16->pit.rl[t] = pas16->pit.c[t]; } @@ -519,8 +520,8 @@ static uint8_t pas16_pit_in(uint16_t port, void *p) pas16->pit.rereadlatch[t] = 0; if (!t) { - pas16->pit.rl[t] = timer_get_remaining_u64(&pit.timer[t]) / PITCONST; - if ((timer_get_remaining_u64(&pit.timer[t]) / PITCONST) > 65536) + pas16->pit.rl[t] = timer_get_remaining_u64(&pas16->pit.timer[t]) / PITCONST; + if ((timer_get_remaining_u64(&pas16->pit.timer[t]) / PITCONST) > 65536) pas16->pit.rl[t] = 0xFFFF; } else