Fixed some MIDI-related crashes and AdLib Gold now writes the correct amount of EEPROM bytes on close.

This commit is contained in:
OBattler
2020-07-13 20:07:47 +02:00
parent 6268c30ff8
commit 8732fb3e75
2 changed files with 5 additions and 2 deletions

View File

@@ -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);
}

View File

@@ -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);
}