|
|
| version 1.9, 2005/03/23 08:07:48 | version 1.11, 2007/11/03 00:00:19 |
|---|---|
| Line 161 static void setrecvdata(REG8 data) { | Line 161 static void setrecvdata(REG8 data) { |
| static void sendmpushortmsg(const UINT8 *dat, UINT count) { | static void sendmpushortmsg(const UINT8 *dat, UINT count) { |
| UINT i; | UINT i; |
| COMMNG cm; | |
| #if 0 | #if 0 |
| if (!(mpu98.flag1 & MPUFLAG1_BENDERTOHOST)) { | if (!(mpu98.flag1 & MPUFLAG1_BENDERTOHOST)) { |
| Line 178 static void sendmpushortmsg(const UINT8 | Line 179 static void sendmpushortmsg(const UINT8 |
| } | } |
| } | } |
| #endif | #endif |
| cm = cm_mpu98; | |
| for (i=0; i<count; i++) { | for (i=0; i<count; i++) { |
| cm_mpu98->write(cm_mpu98, dat[i]); | cm->write(cm, dat[i]); |
| } | } |
| } | } |
| static void sendmpulongmsg(const UINT8 *dat, UINT count) { | static void sendmpulongmsg(const UINT8 *dat, UINT count) { |
| UINT i; | UINT i; |
| COMMNG cm; | |
| cm = cm_mpu98; | |
| for (i=0; i<count; i++) { | for (i=0; i<count; i++) { |
| cm_mpu98->write(cm_mpu98, dat[i]); | cm->write(cm, dat[i]); |
| } | |
| } | |
| static void sendmpureset(void) { | |
| UINT i; | |
| UINT8 sMessage[3]; | |
| for (i=0; i<0x10; i++) { | |
| sMessage[0] = (UINT8)(0xb0 + i); | |
| sMessage[1] = 0x7b; | |
| sMessage[2] = 0x00; | |
| sendmpushortmsg(sMessage, 3); | |
| } | } |
| } | } |
| Line 375 static REG8 mpucmd_md(REG8 cmd) { // 0 | Line 392 static REG8 mpucmd_md(REG8 cmd) { // 0 |
| static REG8 mpucmd_3f(REG8 cmd) { // 3F: UART | static REG8 mpucmd_3f(REG8 cmd) { // 3F: UART |
| mpu98.mode = 1; | mpu98.mode = 1; |
| cm_mpu98->msg(cm_mpu98, COMMSG_MIDIRESET, 0); | sendmpureset(); |
| (void)cmd; | (void)cmd; |
| return(MPUCMDP_IDLE); | return(MPUCMDP_IDLE); |
| } | } |
| Line 530 static REG8 mpucmd_fo(REG8 cmd) { // E | Line 547 static REG8 mpucmd_fo(REG8 cmd) { // E |
| static REG8 mpucmd_ff(REG8 cmd) { // FF: Reset | static REG8 mpucmd_ff(REG8 cmd) { // FF: Reset |
| cm_mpu98->msg(cm_mpu98, COMMSG_MIDIRESET, 0); | sendmpureset(); |
| nevent_reset(NEVENT_MIDIINT); | nevent_reset(NEVENT_MIDIINT); |
| setdefaultcondition(); | setdefaultcondition(); |
| (void)cmd; | (void)cmd; |
| Line 1044 void mpu98ii_destruct(void) { | Line 1061 void mpu98ii_destruct(void) { |
| cm_mpu98 = NULL; | cm_mpu98 = NULL; |
| } | } |
| void mpu98ii_reset(void) { | void mpu98ii_reset(const NP2CFG *pConfig) { |
| commng_destroy(cm_mpu98); | commng_destroy(cm_mpu98); |
| cm_mpu98 = NULL; | cm_mpu98 = NULL; |
| ZeroMemory(&mpu98, sizeof(mpu98)); | ZeroMemory(&mpu98, sizeof(mpu98)); |
| mpu98.data = MPUMSG_ACK; | mpu98.data = MPUMSG_ACK; |
| mpu98.port = 0xc0d0 | ((np2cfg.mpuopt & 0xf0) << 6); | mpu98.port = 0xc0d0 | ((pConfig->mpuopt & 0xf0) << 6); |
| mpu98.irqnum = mpuirqnum[np2cfg.mpuopt & 3]; | mpu98.irqnum = mpuirqnum[pConfig->mpuopt & 3]; |
| setdefaultcondition(); | setdefaultcondition(); |
| // pic_registext(mpu98.irqnum); | // pic_registext(mpu98.irqnum); |
| (void)pConfig; | |
| } | } |
| void mpu98ii_bind(void) { | void mpu98ii_bind(void) { |