From e0be29af062f53feb61c4a5f0c960e9978bf87a1 Mon Sep 17 00:00:00 2001 From: TC1995 Date: Fri, 10 Jan 2020 12:33:20 +0100 Subject: [PATCH] Fixed GUS MIDI Out. --- src/sound/snd_gus.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sound/snd_gus.c b/src/sound/snd_gus.c index 3fbbfa5e0..9399c3dc5 100644 --- a/src/sound/snd_gus.c +++ b/src/sound/snd_gus.c @@ -181,15 +181,16 @@ void writegus(uint16_t addr, uint8_t val, void *p) switch (addr) { case 0x340: /*MIDI control*/ + old = gus->midi_ctrl; gus->midi_ctrl = val; gus->uart_out = 1; - if (((gus->midi_ctrl & 3) == 3) || !gus->midi_ctrl) { /*Master reset*/ + if ((val & 3) == 3) { /*Master reset*/ gus->uart_in = 0; gus->midi_status = 0; gus->midi_r = 0; gus->midi_w = 0; - } else if (gus->midi_ctrl & MIDI_CTRL_TRANSMIT) { + } else if ((old & 3) == 3) { gus->midi_status |= MIDI_INT_TRANSMIT; } else if (gus->midi_ctrl & MIDI_CTRL_RECEIVE) { gus->uart_in = 1;