--- np2/win9x/cmmidi.cpp 2005/03/02 04:28:08 1.7 +++ np2/win9x/cmmidi.cpp 2007/11/11 07:11:26 1.11 @@ -44,21 +44,22 @@ enum { MIDI_MT32 = 0, MIDI_CM32L, MIDI MIDI_GM, MIDI_GS, MIDI_XG, MIDI_OTHER}; static const UINT8 EXCV_MTRESET[] = { - 0xfe, 0xfe, 0xfe}; + 0xf0,0x41,0x10,0x16,0x12,0x7f,0x00,0x00,0x00,0x01,0xf7}; static const UINT8 EXCV_GMRESET[] = { - 0xf0, 0x7e, 0x7f, 0x09, 0x01, 0xf7}; + 0xf0,0x7e,0x7f,0x09,0x01,0xf7}; +static const UINT8 EXCV_GM2RESET[] = { + 0xf0,0x7e,0x7f,0x09,0x03,0xf7}; static const UINT8 EXCV_GSRESET[] = { - 0xf0, 0x41, 0x10, 0x42, 0x12, 0x40, 0x00, 0x7f, 0x00, 0x41, 0xf7}; + 0xf0,0x41,0x10,0x42,0x12,0x40,0x00,0x7f,0x00,0x41,0xf7}; static const UINT8 EXCV_XGRESET[] = { - 0xf0, 0x43, 0x10, 0x4C, 0x00, 0x00, 0x7E, 0x00, 0xf7}; -static const UINT8 EXCV_GMVOLUME[] = { - 0xf0, 0x7F, 0x7F, 0x04, 0x01, 0x00, 0x00, 0xF7}; + 0xf0,0x43,0x10,0x4c,0x00,0x00,0x7e,0x00,0xf7}; enum { MIDI_EXCLUSIVE = 0xf0, MIDI_TIMECODE = 0xf1, MIDI_SONGPOS = 0xf2, MIDI_SONGSELECT = 0xf3, + MIDI_CABLESELECT = 0xf5, MIDI_TUNEREQUEST = 0xf6, MIDI_EOX = 0xf7, MIDI_TIMING = 0xf8, @@ -208,7 +209,7 @@ static UINT module2number(const OEMCHAR UINT i; for (i=0; ishortout(midi, MIDIOUTS3(msg)); + } +} + static void midireset(CMMIDI midi) { const UINT8 *excv; UINT excvsize; - UINT8 work[4]; switch(midi->midimodule) { case MIDI_GM: @@ -372,13 +386,7 @@ const UINT8 *excv; if (excv) { midi->longout(midi, excv, excvsize); } - - work[1] = 0x7b; - work[2] = 0x00; - for (work[0]=0xb0; work[0]<0xc0; work[0]++) { - keydisp_midi(work); - midi->shortout(midi, MIDIOUTS3(work)); - } + midiallnoteoff(midi); } static void midisetparam(CMMIDI midi) { @@ -478,11 +486,12 @@ static UINT midiwrite(COMMNG self, UINT8 midi->midisyscnt = 2; break; - case MIDI_TUNEREQUEST: + case MIDI_CABLESELECT: midi->midictrl = MIDICTRL_SYSTEM; midi->midisyscnt = 1; break; +// case MIDI_TUNEREQUEST: // case MIDI_EOX: default: return(1); @@ -694,6 +703,7 @@ static void midirelease(COMMNG self) { CMMIDI midi; midi = (CMMIDI)(self + 1); + midiallnoteoff(midi); if (midi->opened & CMMIDI_MIDIOUT) { waitlastexclusiveout(midi); midiOutReset(midi->out.win32.hmidiout); @@ -762,7 +772,7 @@ COMMNG cmmidi_create(const OEMCHAR *midi } } if (getmidiinid(midiin, &id) == SUCCESS) { - if (midiInOpen(&hmidiin, id, (DWORD)hWndMain, 0, CALLBACK_WINDOW) + if (midiInOpen(&hmidiin, id, (DWORD)g_hWndMain, 0, CALLBACK_WINDOW) == MMSYSERR_NOERROR) { midiInReset(hmidiin); opened |= CMMIDI_MIDIIN;