Skip to content

Commit

Permalink
Corrected MIDI serial IRQ.
Browse files Browse the repository at this point in the history
  • Loading branch information
captainys committed Apr 13, 2024
1 parent 936277f commit 2780df8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/towns/midi/midi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,14 @@ void TownsMIDI::MIDICard::IOWriteByte(unsigned int ioport,unsigned int data,uint
break;
case (TOWNSIO_MIDI_CARD1_CMDREG1&7): //0x0E51, // MIDI card(MT-402 or 403) No.1 cmdReg1 (Linux source)
ports[0].usart.VMWriteCommnand(data);
owner->UpdateInterruptRequestSerial();
break;
case (TOWNSIO_MIDI_CARD1_DATREG2&7): //0x0E54, // MIDI card(MT-402 or 403) No.1
ports[1].usart.VMWriteData(data,townsTime);
break;
case (TOWNSIO_MIDI_CARD1_CMDREG2&7): //0x0E55, // MIDI card(MT-402 or 403) No.1
ports[1].usart.VMWriteCommnand(data);
owner->UpdateInterruptRequestSerial();
break;
case (TOWNSIO_MIDI_CARD1_FIFODAT&7): //0x0E52, // MIDI card(MT-402 or 403) No.1
break;
Expand Down Expand Up @@ -265,7 +267,16 @@ void TownsMIDI::UpdateInterruptRequestSerial(void)
{
if(true==state.cards[i].enabled)
{
writeReady|=(3<<(i*2));
unsigned int TxEN=0;
if(true==state.cards[i].ports[0].usart.state.TxEN)
{
TxEN|=1;
}
if(true==state.cards[i].ports[1].usart.state.TxEN)
{
TxEN|=2;
}
writeReady|=(TxEN<<(i*2));
}
}
// I don't know what to do with FMT-401 2nd Gen.
Expand Down

0 comments on commit 2780df8

Please sign in to comment.