Merge remote-tracking branch 'origin/master' into cdrom_changes
This commit is contained in:
@@ -789,6 +789,10 @@ pas16_in(uint16_t port, void *priv)
|
||||
scsi_bus = &pas16->scsi->ncr.scsibus;
|
||||
/* Bits 0-6 must absolutely be set for SCSI hard disk drivers to work. */
|
||||
ret = (((scsi_bus->tx_mode != PIO_TX_BUS) && (pas16->scsi->status & 0x04)) << 7) | 0x7f;
|
||||
if ((scsi_bus->tx_mode == PIO_TX_BUS) && !(ret & 0x80))
|
||||
ret |= 0x80;
|
||||
|
||||
pas16_log("5C01 read ret=%02x, status=%02x, txmode=%x.\n", ret, pas16->scsi->status & 0x06, scsi_bus->tx_mode);
|
||||
}
|
||||
break;
|
||||
case 0x5c03:
|
||||
@@ -1190,6 +1194,7 @@ pas16_scsi_callback(void *priv)
|
||||
|
||||
t128_callback(pas16->scsi);
|
||||
|
||||
pas16_log("TimeOutStatus=%02x, t128stat=%02x.\n", pas16->timeout_status, dev->status);
|
||||
if ((scsi_bus->tx_mode != PIO_TX_BUS) && (dev->status & 0x04)) {
|
||||
timer_stop(&pas16->scsi_timer);
|
||||
pas16->timeout_status &= 0x7f;
|
||||
|
||||
@@ -1727,6 +1727,7 @@ ess_mixer_read(uint16_t addr, void *priv)
|
||||
case 0x32:
|
||||
case 0x36:
|
||||
case 0x38:
|
||||
case 0x3a:
|
||||
case 0x3e:
|
||||
ret = mixer->regs[mixer->index];
|
||||
break;
|
||||
@@ -2593,10 +2594,10 @@ ess_soundpiper_mca_write(const int port, const uint8_t val, void *priv)
|
||||
ess->dsp.sb_addr = 0x0000;
|
||||
break;
|
||||
case 0x08:
|
||||
ess->dsp.sb_addr = 0x0240;
|
||||
ess->dsp.sb_addr = 0x0220;
|
||||
break;
|
||||
case 0x0c:
|
||||
ess->dsp.sb_addr = 0x0220;
|
||||
ess->dsp.sb_addr = 0x0240;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -2750,64 +2751,59 @@ ess_chipchat_mca_write(int port, uint8_t val, void *priv)
|
||||
|
||||
ess->pos_regs[port & 7] = val;
|
||||
|
||||
if (ess->pos_regs[2] & 1) {
|
||||
ess->dsp.sb_addr = (ess->pos_regs[2] == 0x51) ? 0x0220 : 0x0000;
|
||||
if (ess->pos_regs[2] & 0x01) {
|
||||
ess->dsp.sb_addr = 0x0220;
|
||||
|
||||
if (ess->dsp.sb_addr != 0x0000) {
|
||||
io_sethandler(ess->dsp.sb_addr, 0x0004,
|
||||
ess->opl.read, NULL, NULL,
|
||||
ess->opl.write, NULL, NULL,
|
||||
ess->opl.priv);
|
||||
io_sethandler(ess->dsp.sb_addr + 8, 0x0002,
|
||||
ess->opl.read, NULL, NULL,
|
||||
ess->opl.write, NULL, NULL,
|
||||
ess->opl.priv);
|
||||
io_sethandler(ess->dsp.sb_addr + 8, 0x0002,
|
||||
io_sethandler(ess->dsp.sb_addr, 0x0004,
|
||||
ess->opl.read, NULL, NULL,
|
||||
ess->opl.write, NULL, NULL,
|
||||
ess->opl.priv);
|
||||
io_sethandler(ess->dsp.sb_addr + 8, 0x0002,
|
||||
ess->opl.read, NULL, NULL,
|
||||
ess->opl.write, NULL, NULL,
|
||||
ess->opl.priv);
|
||||
io_sethandler(ess->dsp.sb_addr + 8, 0x0002,
|
||||
ess_fm_midi_read, NULL, NULL,
|
||||
ess_fm_midi_write, NULL, NULL,
|
||||
ess);
|
||||
io_sethandler(0x0388, 0x0004,
|
||||
ess->opl.read, NULL, NULL,
|
||||
ess->opl.write, NULL, NULL, ess->opl.priv);
|
||||
io_sethandler(0x0388, 0x0004,
|
||||
ess_fm_midi_read, NULL, NULL,
|
||||
ess_fm_midi_write, NULL, NULL,
|
||||
ess);
|
||||
io_sethandler(ess->dsp.sb_addr + 4, 0x0002,
|
||||
ess_mixer_read, NULL, NULL,
|
||||
ess_mixer_write, NULL, NULL,
|
||||
ess);
|
||||
|
||||
io_sethandler(ess->dsp.sb_addr + 2, 0x0004,
|
||||
ess_base_read, NULL, NULL,
|
||||
ess_base_write, NULL, NULL,
|
||||
ess);
|
||||
io_sethandler(ess->dsp.sb_addr + 6, 0x0001,
|
||||
ess_base_read, NULL, NULL,
|
||||
ess_base_write, NULL, NULL,
|
||||
ess);
|
||||
io_sethandler(ess->dsp.sb_addr + 0x0a, 0x0006,
|
||||
ess_base_read, NULL, NULL,
|
||||
ess_base_write, NULL, NULL,
|
||||
ess);
|
||||
|
||||
if (ess->dsp.sb_subtype == SB_SUBTYPE_ESS_ES1688) {
|
||||
mpu401_change_addr(ess->mpu, 0x0330);
|
||||
|
||||
io_sethandler(0x0330, 0x0002,
|
||||
ess_fm_midi_read, NULL, NULL,
|
||||
ess_fm_midi_write, NULL, NULL,
|
||||
ess);
|
||||
io_sethandler(0x0388, 0x0004,
|
||||
ess->opl.read, NULL, NULL,
|
||||
ess->opl.write, NULL, NULL, ess->opl.priv);
|
||||
io_sethandler(0x0388, 0x0004,
|
||||
ess_fm_midi_read, NULL, NULL,
|
||||
ess_fm_midi_write, NULL, NULL,
|
||||
ess);
|
||||
io_sethandler(ess->dsp.sb_addr + 4, 0x0004,
|
||||
ess_mixer_read, NULL, NULL,
|
||||
ess_mixer_write, NULL, NULL,
|
||||
ess);
|
||||
|
||||
io_sethandler(ess->dsp.sb_addr + 2, 0x0004,
|
||||
ess_base_read, NULL, NULL,
|
||||
ess_base_write, NULL, NULL,
|
||||
ess);
|
||||
io_sethandler(ess->dsp.sb_addr + 6, 0x0001,
|
||||
ess_base_read, NULL, NULL,
|
||||
ess_base_write, NULL, NULL,
|
||||
ess);
|
||||
io_sethandler(ess->dsp.sb_addr + 0x0a, 0x0006,
|
||||
ess_base_read, NULL, NULL,
|
||||
ess_base_write, NULL, NULL,
|
||||
ess);
|
||||
|
||||
if (ess->dsp.sb_subtype == SB_SUBTYPE_ESS_ES1688) {
|
||||
mpu401_change_addr(ess->mpu, (ess->pos_regs[2] == 0x51) ? 0x0330 : 0);
|
||||
|
||||
if (ess->pos_regs[2] == 0x51)
|
||||
io_sethandler(0x0330, 0x0002,
|
||||
ess_fm_midi_read, NULL, NULL,
|
||||
ess_fm_midi_write, NULL, NULL,
|
||||
ess);
|
||||
}
|
||||
}
|
||||
|
||||
/* DSP I/O handler is activated in sb_dsp_setaddr */
|
||||
sb_dsp_setaddr(&ess->dsp, ess->dsp.sb_addr);
|
||||
gameport_remap(ess->gameport, (ess->pos_regs[2] == 0x51) ? 0x200 : 0);
|
||||
}
|
||||
gameport_remap(ess->gameport, 0x0200);
|
||||
|
||||
if (ess->pos_regs[2] == 0x51) {
|
||||
sb_dsp_setirq(&ess->dsp, 7);
|
||||
mpu401_setirq(ess->mpu, 7);
|
||||
|
||||
|
||||
@@ -388,6 +388,7 @@ sb_update_status(sb_dsp_t *dsp, int bit, int set)
|
||||
{
|
||||
int masked = 0;
|
||||
|
||||
sb_dsp_log("SBIRQ8=%d, irqnum=%d, bit=%x, set=%x.\n", dsp->sb_irq8, dsp->sb_irqnum, bit, set);
|
||||
if (dsp->sb_irq8 || dsp->sb_irq16)
|
||||
return;
|
||||
|
||||
@@ -423,6 +424,7 @@ sb_update_status(sb_dsp_t *dsp, int bit, int set)
|
||||
}
|
||||
}
|
||||
|
||||
sb_dsp_log("Masked=%02x.\n", masked);
|
||||
if (set && !masked)
|
||||
dsp->irq_update(dsp->irq_priv, 1);
|
||||
else if (!set)
|
||||
@@ -1039,6 +1041,8 @@ sb_ess_write_reg(sb_dsp_t *dsp, const uint8_t reg, uint8_t data)
|
||||
{
|
||||
uint8_t chg;
|
||||
|
||||
sb_dsp_log("ESS Write reg=%02x, val=%02x.\n", reg, data);
|
||||
|
||||
switch (reg) {
|
||||
case 0xA1: /* Extended Mode Sample Rate Generator */
|
||||
{
|
||||
@@ -1110,6 +1114,7 @@ sb_ess_write_reg(sb_dsp_t *dsp, const uint8_t reg, uint8_t data)
|
||||
dsp->sb_irqnum = 10;
|
||||
break;
|
||||
}
|
||||
sb_dsp_log("Legacy Audio IRQ control=%d.\n", dsp->sb_irqnum);
|
||||
sb_ess_update_irq_drq_readback_regs(dsp, false);
|
||||
break;
|
||||
case 0xB2: /* DRQ Control */
|
||||
@@ -1131,6 +1136,7 @@ sb_ess_write_reg(sb_dsp_t *dsp, const uint8_t reg, uint8_t data)
|
||||
dsp->sb_8_dmanum = 3;
|
||||
break;
|
||||
}
|
||||
sb_dsp_log("Legacy Audio DRQ control=%d, chg=%02x.\n", dsp->sb_8_dmanum, chg);
|
||||
sb_ess_update_irq_drq_readback_regs(dsp, false);
|
||||
if (chg & 0x40)
|
||||
sb_ess_update_dma_status(dsp);
|
||||
@@ -1876,12 +1882,12 @@ sb_write(uint16_t addr, uint8_t val, void *priv)
|
||||
{
|
||||
sb_dsp_t *dsp = (sb_dsp_t *) priv;
|
||||
|
||||
sb_dsp_log("[%04X:%08X] DSP: [W] %04X = %02X\n", CS, cpu_state.pc, addr, val);
|
||||
|
||||
/* Sound Blasters prior to Sound Blaster 16 alias the I/O ports. */
|
||||
if ((dsp->sb_type < SB16_DSP_404) && (IS_NOT_ESS(dsp) || ((addr & 0xF) != 0xE)))
|
||||
addr &= 0xfffe;
|
||||
|
||||
sb_dsp_log("[%04X:%08X] DSP: [W] %04X = %02X\n", CS, cpu_state.pc, addr, val);
|
||||
|
||||
switch (addr & 0xF) {
|
||||
case 6: /* Reset */
|
||||
sb_do_reset(dsp, val);
|
||||
@@ -1962,7 +1968,7 @@ sb_read(uint16_t addr, void *priv)
|
||||
uint8_t ret = 0x00;
|
||||
|
||||
/* Sound Blasters prior to Sound Blaster 16 alias the I/O ports. */
|
||||
if ((dsp->sb_type < SB16_DSP_404) && (IS_NOT_ESS(dsp) || ((addr & 0xF) != 0xF)))
|
||||
if ((dsp->sb_type < SB16_DSP_404) && (IS_NOT_ESS(dsp) || ((addr & 0xF) != 0xE)))
|
||||
/* Exception: ESS AudioDrive does not alias port base+0xf */
|
||||
addr &= 0xfffe;
|
||||
|
||||
@@ -2085,7 +2091,7 @@ sb_read(uint16_t addr, void *priv)
|
||||
break;
|
||||
}
|
||||
|
||||
sb_dsp_log("[%04X:%08X] DSP: [R] %04X = %02X\n", CS, cpu_state.pc, a, ret);
|
||||
sb_dsp_log("[%04X:%08X] DSP: [R] %04X = %02X\n", CS, cpu_state.pc, addr, ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -2319,6 +2325,7 @@ pollsb(void *priv)
|
||||
if (dsp->sb_8_enable && dsp->sb_pausetime < 0 && dsp->sb_8_output) {
|
||||
sb_dsp_update(dsp);
|
||||
|
||||
sb_dsp_log("8-bit format=%02x, pause=%x, length=%d.\n", dsp->sb_8_format, dsp->sb_8_pause, dsp->sb_8_length);
|
||||
switch (dsp->sb_8_format) {
|
||||
case 0x00: /* Mono unsigned */
|
||||
if (!dsp->sb_8_pause) {
|
||||
|
||||
Reference in New Issue
Block a user