MPU-401 reset now sends ACK also in UART mode, fixes MEGAMID and possibly other programs.

This commit is contained in:
OBattler
2017-06-04 16:19:11 +02:00
parent 9c79acd3c8
commit 95cfba9715
2 changed files with 15 additions and 1 deletions

View File

@@ -162,7 +162,7 @@ static void MPU401_ResetDone(void *p)
static void MPU401_WriteCommand(mpu_t *mpu, uint8_t val)
{
uint8_t i;
if (mpu->state.reset)
{
mpu->state.cmd_pending=val+1;
@@ -301,7 +301,9 @@ static void MPU401_WriteCommand(mpu_t *mpu, uint8_t val)
mpu401_reset_callback = MPU401_RESETBUSY * 33 * TIMER_USEC;
mpu->state.reset=1;
MPU401_Reset(mpu);
#if 0
if (mpu->mode==M_UART) return;//do not send ack in UART mode
#endif
break;
case 0x3f: /* UART mode */
pclog("MPU-401:Set UART mode %X\n",val);
@@ -733,6 +735,14 @@ next_event:
void mpu401_init(mpu_t *mpu, uint16_t addr, int irq, int mode)
{
#if 0
if (mode != M_INTELLIGENT)
{
mpu401_uart_init(mpu, addr);
return;
}
#endif
mpu->status = STATUS_INPUT_NOT_READY;
mpu->irq = irq;
mpu->queue_used = 0;

View File

@@ -43,6 +43,8 @@ typedef enum MpuDataType {T_OVERFLOW,T_MARK,T_MIDI_SYS,T_MIDI_NORM,T_COMMAND} Mp
typedef struct mpu_t
{
int uart_mode;
uint8_t rx_data;
int intelligent;
MpuMode mode;
int irq;
@@ -88,3 +90,5 @@ extern int mpu401_standalone_enable;
void mpu401_device_add(void);
device_t mpu401_device;
void mpu401_uart_init(mpu_t *mpu, uint16_t addr);