Fallback to old MPU behaviour on SB cards. Fixes SB16/AWE32 initialisation on
Windows 3.1.
This commit is contained in:
parent
9db376c4d2
commit
5e437fc736
4 changed files with 22 additions and 9 deletions
|
|
@ -1446,7 +1446,7 @@ void *azt_common_init(const int type, char *nvr_filename)
|
||||||
io_sethandler(azt2316a->cur_addr+8, 0x0002, opl3_read, NULL, NULL, opl3_write, NULL, NULL, &azt2316a->sb->opl);
|
io_sethandler(azt2316a->cur_addr+8, 0x0002, opl3_read, NULL, NULL, opl3_write, NULL, NULL, &azt2316a->sb->opl);
|
||||||
io_sethandler(0x0388, 0x0004, opl3_read, NULL, NULL, opl3_write, NULL, NULL, &azt2316a->sb->opl);
|
io_sethandler(0x0388, 0x0004, opl3_read, NULL, NULL, opl3_write, NULL, NULL, &azt2316a->sb->opl);
|
||||||
io_sethandler(azt2316a->cur_addr+4, 0x0002, sb_ct1345_mixer_read, NULL, NULL, sb_ct1345_mixer_write, NULL, NULL, azt2316a->sb);
|
io_sethandler(azt2316a->cur_addr+4, 0x0002, sb_ct1345_mixer_read, NULL, NULL, sb_ct1345_mixer_write, NULL, NULL, azt2316a->sb);
|
||||||
mpu401_uart_init(&azt2316a->sb->mpu, azt2316a->cur_mpu401_addr, azt2316a->cur_mpu401_irq);
|
mpu401_uart_init(&azt2316a->sb->mpu, azt2316a->cur_mpu401_addr, azt2316a->cur_mpu401_irq, 1);
|
||||||
|
|
||||||
azt2316a_create_config_word(azt2316a); // recreate even if we have read it from EEPROM, because we have some overrides (CD interfaces always off, etc)
|
azt2316a_create_config_word(azt2316a); // recreate even if we have read it from EEPROM, because we have some overrides (CD interfaces always off, etc)
|
||||||
sound_add_handler(azt2316a_get_buffer, azt2316a);
|
sound_add_handler(azt2316a_get_buffer, azt2316a);
|
||||||
|
|
|
||||||
|
|
@ -31,16 +31,26 @@ static void mpu401_uart_write(uint16_t addr, uint8_t val, void *p)
|
||||||
// But actual behaviour is weird. For example, the MPU401 port test in the AZT1605 drivers for Windows NT
|
// But actual behaviour is weird. For example, the MPU401 port test in the AZT1605 drivers for Windows NT
|
||||||
// want this to return an Ack but the IRQ test in the same driver wants this to raise no interrupts!
|
// want this to return an Ack but the IRQ test in the same driver wants this to raise no interrupts!
|
||||||
mpu->rx_data = 0xfe; /*Acknowledge*/
|
mpu->rx_data = 0xfe; /*Acknowledge*/
|
||||||
mpu->status = STATUS_OUTPUT_NOT_READY;
|
|
||||||
mpu->uart_mode = 0;
|
mpu->uart_mode = 0;
|
||||||
//mpu401_uart_raise_irq(p);
|
if (mpu->is_aztech)
|
||||||
|
mpu->status = STATUS_OUTPUT_NOT_READY;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mpu->status = 0;
|
||||||
|
mpu401_uart_raise_irq(p);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x3f: /*Enter UART mode*/
|
case 0x3f: /*Enter UART mode*/
|
||||||
mpu->rx_data = 0xfe; /*Acknowledge*/
|
mpu->rx_data = 0xfe; /*Acknowledge*/
|
||||||
mpu->status = STATUS_OUTPUT_NOT_READY;
|
|
||||||
mpu->uart_mode = 1;
|
mpu->uart_mode = 1;
|
||||||
mpu401_uart_raise_irq(p);
|
if (mpu->is_aztech)
|
||||||
|
{
|
||||||
|
mpu->status = STATUS_OUTPUT_NOT_READY;
|
||||||
|
mpu401_uart_raise_irq(p);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
mpu->status = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
@ -63,12 +73,13 @@ static uint8_t mpu401_uart_read(uint16_t addr, void *p)
|
||||||
return mpu->rx_data;
|
return mpu->rx_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void mpu401_uart_init(mpu401_uart_t *mpu, uint16_t addr, int irq)
|
void mpu401_uart_init(mpu401_uart_t *mpu, uint16_t addr, int irq, int is_aztech)
|
||||||
{
|
{
|
||||||
mpu->status = STATUS_INPUT_NOT_READY;
|
mpu->status = STATUS_INPUT_NOT_READY;
|
||||||
mpu->uart_mode = 0;
|
mpu->uart_mode = 0;
|
||||||
mpu->addr = addr;
|
mpu->addr = addr;
|
||||||
mpu->irq = irq;
|
mpu->irq = irq;
|
||||||
|
mpu->is_aztech = is_aztech;
|
||||||
|
|
||||||
io_sethandler(addr, 0x0002, mpu401_uart_read, NULL, NULL, mpu401_uart_write, NULL, NULL, mpu);
|
io_sethandler(addr, 0x0002, mpu401_uart_read, NULL, NULL, mpu401_uart_write, NULL, NULL, mpu);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,11 @@ typedef struct mpu401_uart_t
|
||||||
int uart_mode;
|
int uart_mode;
|
||||||
uint16_t addr;
|
uint16_t addr;
|
||||||
int irq;
|
int irq;
|
||||||
|
|
||||||
|
int is_aztech;
|
||||||
} mpu401_uart_t;
|
} mpu401_uart_t;
|
||||||
|
|
||||||
void mpu401_uart_init(mpu401_uart_t *mpu, uint16_t addr, int irq);
|
void mpu401_uart_init(mpu401_uart_t *mpu, uint16_t addr, int irq, int is_aztech);
|
||||||
void mpu401_uart_update_addr(mpu401_uart_t *mpu, uint16_t addr);
|
void mpu401_uart_update_addr(mpu401_uart_t *mpu, uint16_t addr);
|
||||||
void mpu401_uart_update_irq(mpu401_uart_t *mpu, int irq);
|
void mpu401_uart_update_irq(mpu401_uart_t *mpu, int irq);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1052,7 +1052,7 @@ void *sb_16_init()
|
||||||
io_sethandler(0x0388, 0x0004, opl3_read, NULL, NULL, opl3_write, NULL, NULL, &sb->opl);
|
io_sethandler(0x0388, 0x0004, opl3_read, NULL, NULL, opl3_write, NULL, NULL, &sb->opl);
|
||||||
io_sethandler(addr+4, 0x0002, sb_ct1745_mixer_read, NULL, NULL, sb_ct1745_mixer_write, NULL, NULL, sb);
|
io_sethandler(addr+4, 0x0002, sb_ct1745_mixer_read, NULL, NULL, sb_ct1745_mixer_write, NULL, NULL, sb);
|
||||||
sound_add_handler(sb_get_buffer_sb16, sb);
|
sound_add_handler(sb_get_buffer_sb16, sb);
|
||||||
mpu401_uart_init(&sb->mpu, 0x330, -1);
|
mpu401_uart_init(&sb->mpu, 0x330, -1, 0);
|
||||||
|
|
||||||
|
|
||||||
return sb;
|
return sb;
|
||||||
|
|
@ -1082,7 +1082,7 @@ void *sb_awe32_init()
|
||||||
io_sethandler(0x0388, 0x0004, opl3_read, NULL, NULL, opl3_write, NULL, NULL, &sb->opl);
|
io_sethandler(0x0388, 0x0004, opl3_read, NULL, NULL, opl3_write, NULL, NULL, &sb->opl);
|
||||||
io_sethandler(addr+4, 0x0002, sb_ct1745_mixer_read, NULL, NULL, sb_ct1745_mixer_write, NULL, NULL, sb);
|
io_sethandler(addr+4, 0x0002, sb_ct1745_mixer_read, NULL, NULL, sb_ct1745_mixer_write, NULL, NULL, sb);
|
||||||
sound_add_handler(sb_get_buffer_emu8k, sb);
|
sound_add_handler(sb_get_buffer_emu8k, sb);
|
||||||
mpu401_uart_init(&sb->mpu, 0x330, -1);
|
mpu401_uart_init(&sb->mpu, 0x330, -1, 0);
|
||||||
emu8k_init(&sb->emu8k, emu_addr, onboard_ram);
|
emu8k_init(&sb->emu8k, emu_addr, onboard_ram);
|
||||||
|
|
||||||
return sb;
|
return sb;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue