Assorted MIDI and MPU-401 intelligent mode fixes, fixes #4419.

This commit is contained in:
OBattler
2024-08-04 05:13:24 +02:00
parent 61e6052a9e
commit 6979b6a6c0
5 changed files with 486 additions and 524 deletions

View File

@@ -341,7 +341,7 @@ midi_raw_out_byte(uint8_t val)
else if ((midi_out->midi_sysex_data[5] == 0x10) && (midi_out->midi_sysex_data[6] == 0x00) && (midi_out->midi_sysex_data[7] == 0x01))
midi_out->midi_sysex_delay = 30; /* Dark Sun 1 */
else
midi_out->midi_sysex_delay = (unsigned int) (((float) (midi_out->midi_pos) * 1.25f) * 1000.0f / 3125.0f) + 2;
midi_out->midi_sysex_delay = (unsigned int) (((double) (midi_out->midi_pos) * 1.25) / 3.125) + 2;
midi_out->midi_sysex_start = plat_get_ticks();
}
@@ -584,3 +584,10 @@ midi_in_sysex(uint8_t *buffer, uint32_t len)
break;
}
}
void
midi_reset(void)
{
if (midi_out && midi_out->m_out_device && midi_out->m_out_device->reset)
midi_out->m_out_device->reset();
}

File diff suppressed because it is too large Load Diff

View File

@@ -442,7 +442,7 @@ sb_dsp_set_mpu(sb_dsp_t *dsp, mpu_t *mpu)
{
dsp->mpu = mpu;
if (mpu != NULL)
if (IS_NOT_ESS(dsp) && (mpu != NULL))
mpu401_irq_attach(mpu, sb_dsp_irq_update, sb_dsp_irq_pending, dsp);
}