Re: [hatari-devel] Enabling of ACIA IRQs |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/hatari-devel Archives
]
Hi,
On perjantai 31 toukokuu 2013, Nicolas Pomarède wrote:
> I don't use midi, so I never really noticed.
>
> In midi.c Midi_Data_WriteByte(), we have :
>
> if (!ConfigureParams.Midi.bEnableMidi)
> return;
>
> So, if midi is not enabled, byte are not processed and nothing will
> happen (including irq).
I don't think 1) is really a problem. But MIDI should work if we
have an option for enabling it at run-time.
> As for 2), maybe the files to communicate via midi are only opened when
> Hatari starts, not later when you check/uncheck ? But Midi_Init()
> already seems to be called in change.c, so I don't know what is missing..
Midi_Reset() which starts the MIDI interrupt:
-------
void Midi_Reset(void)
{
MidiControlRegister = 0;
MidiStatusRegister = ACIA_SR_TX_EMPTY;
nRxDataByte = 1;
if (ConfigureParams.Midi.bEnableMidi)
{
CycInt_AddRelativeInterrupt(2050, INT_CPU_CYCLE,
INTERRUPT_MIDI);
}
}
-------
Is called only when emulated is reseted.
couple of alternatives:
1) enabling MIDI triggers emulation reset
2) enabling MIDI calls Midi_Reset()
1) is probably the safer option.
I also guess the interrupt should be disabled in Midi_Reset(),
if MIDI isn't enabled...
- Eero