this is for mGB... replace the original function... (I hope this works)
void modeMidiGb()
{
while(1){ //Loop foreverrrr
if (Serial.available() > 0) { //If MIDI is sending
incomingMidiByte = Serial.read(); //Get the byte sent from MIDI
//if(!usbMode) Serial.print(incomingMidiByte, BYTE); //Echo the Byte to MIDI Output
if(incomingMidiByte > 0x7F) {
switch (incomingMidiByte & 0xF0) {
case 0xF0:
midiValueMode = false;
break;
default:
incomingMidiData[0] = incomingMidiByte;
midiValueMode =false;
midiAddressMode=true;
break;
}
} else if (midiAddressMode){
midiAddressMode = false;
midiValueMode = true;
incomingMidiData[1] = incomingMidiByte;
} else if (midiValueMode) {
incomingMidiData[2] = incomingMidiByte;
midiAddressMode = true;
midiValueMode = false;
if((incomingMidiData[0] & 0x0F) > 0x04) {
sendFSByteToGameboy((incomingMidiData[0] - 0x05));
delayMicroseconds(120);
sendFSByteToGameboy(incomingMidiData[1]);
delayMicroseconds(120);
sendFSByteToGameboy(incomingMidiData[2]);
}
blinkLight((incomingMidiData[0] - 0x05),incomingMidiData[2]);
}
} else {
setMode(); // Check if mode button was depressed
updateBlinkLights();