Re: [hatari-devel] MIDI support for Windows & OSX (with PortMidi)

[ Thread Index | Date Index | More Archives ]

Le 04/10/2017 à 23:57, Eero Tamminen a écrit :


* Why changing any of the MIDI options requires reset, isn't
   host MIDI interface handling independent of the emulated
   Atari MIDI functionality?


Do you mean a complete reset of the emulated machine or just calling Midi_Reset ? And do you mean when changing settings in the "device" windows of the UI ? If so, I think that's legacy code that I didn't write, but I don't think a reset is required ; calling Midi's UnInit then Init should be enough.

* Or is it because MIDI write failing calls MIDI UnInit() and
   that removes pending MIDI interrupt(s)?  If yes, couldn't
   interrupt removal be moved to be done on write failure instead,
   so that MIDI host option changes could be done without emulation

Calling CycInt_RemovePendingInterrupt from Midi_UnInit should not be a problem, it will work in all case even if there was no Midi interrupt handler. What needs to be done is to call CycInt_AddRelativeInterrupt later, else midi won't work anymore.

So, the correct sequence when changing parameter without reseting the whole machine would be : Midi_Unit, then Midi_Init, then Midi_Reset

I don't think that's a problem to call Midi_Reset, as midi data are lost anyway when changing midi parameters.


Mail converted by MHonArc 2.6.19+