diff --git a/src/sound/midi.c b/src/sound/midi.c index 22efb56f2..19f1ce0a8 100644 --- a/src/sound/midi.c +++ b/src/sound/midi.c @@ -295,6 +295,9 @@ midi_in_device_init() void midi_raw_out_rt_byte(uint8_t val) { + if (!midi_in) + return; + if (!midi_in->midi_realtime) return; @@ -310,7 +313,7 @@ midi_raw_out_rt_byte(uint8_t val) void midi_raw_out_thru_rt_byte(uint8_t val) { - if (midi_in->thruchan) + if (midi_in && midi_in->thruchan) midi_raw_out_rt_byte(val); } diff --git a/src/sound/snd_adlibgold.c b/src/sound/snd_adlibgold.c index 09a51994b..b031a6835 100644 --- a/src/sound/snd_adlibgold.c +++ b/src/sound/snd_adlibgold.c @@ -820,7 +820,7 @@ void adgold_close(void *p) f = nvr_fopen(L"adgold.bin", L"wb"); if (f) { - fwrite(adgold->adgold_eeprom, 0x18, 1, f); + fwrite(adgold->adgold_eeprom, 0x1a, 1, f); fclose(f); }