Exemplo n.º 1
0
void philipsMidiWriteData(PhilipsMidi* midi, UInt8 value)
{
    if (!(midi->status & STAT_TXEMPTY)) {
        return;
    }

    if (midi->txPending == 0) {
        midiIoTransmit(midi->midiIo, value);
        midi->timeTrans = boardSystemTime() + midi->charTime;
        boardTimerAdd(midi->timerTrans, midi->timeTrans);
        midi->txPending = 1;
    }
    else {
        midi->status &= ~STAT_TXEMPTY;
        midi->txBuffer = value;
    }
}
Exemplo n.º 2
0
static void onTrans(PhilipsMidi* midi, UInt32 time)
{
    midi->timeTrans = 0;

    if (midi->status & STAT_TXEMPTY) {
        midi->txPending = 0;
    }
    else {
        midiIoTransmit(midi->midiIo, midi->txBuffer);
        midi->timeTrans = boardSystemTime() + midi->charTime;
        boardTimerAdd(midi->timerTrans, midi->timeTrans);

        midi->status |= STAT_TXEMPTY;
        if (midi->command & CMD_WRINT) {
            boardSetInt(0x400);
            midi->status |= ST_INT;
        }
    }
}
Exemplo n.º 3
0
static void onTrans(YM2148* midi, UInt32 time)
{
    midi->timeTrans  = 0;

    midiIoTransmit(midi->midiIo, midi->sendByte);
	if (midi->status &  STAT_TXRDY) {
		midi->status |= STAT_TXEMPTY;
        if (midi->command & CMD_TXINT) {
            boardSetDataBus(midi->vector, 0, 0);
            boardSetInt(0x800);
            midi->status |= ST_INT;
        }
	}
    else {
		midi->status |= STAT_TXRDY;
	    midi->status &= ~STAT_TXEMPTY;
	    midi->sendByte = midi->sendBuffer;

        midi->timeTrans = boardSystemTime() + midi->charTime;
        boardTimerAdd(midi->timerTrans, midi->timeTrans);
	}
}
Exemplo n.º 4
0
/*****************************************
** I8251 callbacks
******************************************
*/
static int transmit(MSXMidi* msxMidi, UInt8 value) 
{
    midiIoTransmit(msxMidi->midiIo, value);
    return 1;
}