DCS audio: Re-enable speedups for external ram. (nw)

This commit is contained in:
Ted Green 2017-07-13 09:10:47 -06:00
parent ca88a7720b
commit b0d5d36764
4 changed files with 42 additions and 34 deletions

View File

@ -635,6 +635,9 @@ void dcs_audio_device::dcs_register_state()
save_item(NAME(m_transfer.sum));
save_item(NAME(m_transfer.fifo_entries));
save_item(NAME(m_polling_value));
save_item(NAME(m_polling32_value));
if (m_sram != nullptr)
save_pointer(NAME(m_sram), 0x8000*4 / sizeof(m_sram[0]));
@ -650,6 +653,7 @@ void dcs_audio_device::denver_postload()
m_data_bank->set_entry(DENV_DM_PG % m_sounddata_banks);
dmovlay_remap_memory();
denver_alloc_dmadac();
install_speedup();
}
//-------------------------------------------------
@ -699,8 +703,6 @@ dcs_audio_device::dcs_audio_device(const machine_config &mconfig, device_type ty
m_timer_period(0),
m_timers_fired(0),
m_sram(nullptr),
m_polling_base(nullptr),
m_polling32_base(nullptr),
m_internal_program_ram(nullptr),
m_external_program_ram(nullptr),
m_internal_data_ram(nullptr),
@ -859,17 +861,8 @@ void dcs2_audio_device::device_start()
m_auto_ack = false;
/* install the speedup handler */
if (m_polling_offset) {
if (m_rev < 3) {
m_cpu->space(AS_DATA).install_readwrite_handler(m_polling_offset, m_polling_offset, read16_delegate(FUNC(dcs_audio_device::dcs_polling_r), this), write16_delegate(FUNC(dcs_audio_device::dcs_polling_w), this));
m_polling_base = m_iram + (m_polling_offset - 0x3800);
}
else {
// ADSP 2181 (DSIO and DENVER) use program memory
m_cpu->space(AS_PROGRAM).install_readwrite_handler(m_polling_offset, m_polling_offset, read32_delegate(FUNC(dcs_audio_device::dcs_polling32_r), this), write32_delegate(FUNC(dcs_audio_device::dcs_polling32_w), this));
m_polling32_base = m_internal_program_ram + (m_polling_offset - 0x2000);
}
}
install_speedup();
/* allocate a watchdog timer for HLE transfers */
m_transfer.hle_enabled = (ENABLE_HLE_TRANSFERS && m_dram_in_mb != 0);
if (m_transfer.hle_enabled)
@ -883,6 +876,19 @@ void dcs2_audio_device::device_start()
}
void dcs_audio_device::install_speedup(void)
{
if (m_polling_offset) {
if (m_rev < 3) {
m_cpu->space(AS_DATA).install_readwrite_handler(m_polling_offset, m_polling_offset, read16_delegate(FUNC(dcs_audio_device::dcs_polling_r), this), write16_delegate(FUNC(dcs_audio_device::dcs_polling_w), this));
}
else {
// ADSP 2181 (DSIO and DENVER) use program memory
m_cpu->space(AS_PROGRAM).install_readwrite_handler(m_polling_offset, m_polling_offset, read32_delegate(FUNC(dcs_audio_device::dcs_polling32_r), this), write32_delegate(FUNC(dcs_audio_device::dcs_polling32_w), this));
}
}
}
void dcs_audio_device::set_auto_ack(int state)
{
m_auto_ack = state;
@ -1026,8 +1032,7 @@ void dcs_audio_device::sdrc_remap_memory()
sdrc_update_bank_pointers();
/* reinstall the polling hotspot */
if (m_polling_offset)
m_cpu->space(AS_DATA).install_readwrite_handler(m_polling_offset, m_polling_offset, read16_delegate(FUNC(dcs_audio_device::dcs_polling_r),this), write16_delegate(FUNC(dcs_audio_device::dcs_polling_w),this));
install_speedup();
}
@ -2077,26 +2082,26 @@ READ16_MEMBER( dcs_audio_device::dcs_polling_r )
{
if (m_polling_count++ > 5)
space.device().execute().eat_cycles(10000);
return *m_polling_base;
return m_polling_value;
}
WRITE16_MEMBER( dcs_audio_device::dcs_polling_w )
{
m_polling_count = 0;
COMBINE_DATA(m_polling_base);
COMBINE_DATA(&m_polling_value);
}
READ32_MEMBER(dcs_audio_device::dcs_polling32_r)
{
space.device().execute().eat_cycles(1000);
return *m_polling32_base;
return m_polling32_value;
}
WRITE32_MEMBER(dcs_audio_device::dcs_polling32_w)
{
m_polling_count = 0;
COMBINE_DATA(m_polling32_base);
COMBINE_DATA(&m_polling32_value);
}

View File

@ -50,6 +50,7 @@ public:
void dmovlay_remap_memory();
WRITE32_MEMBER(dmovlay_callback);
void denver_postload(void);
void install_speedup(void);
// non public
void dcs_boot();
@ -207,8 +208,8 @@ protected:
uint32_t m_timers_fired;
uint16_t *m_sram;
uint16_t *m_polling_base;
uint32_t *m_polling32_base;
uint16_t m_polling_value;
uint32_t m_polling32_value;
uint32_t *m_internal_program_ram;
uint32_t *m_external_program_ram;
uint32_t *m_internal_data_ram;

View File

@ -1941,7 +1941,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( blitz99, seattle150 )
MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_2115, 0)
MCFG_DCS2_AUDIO_DRAM_IN_MB(2)
// MCFG_DCS2_AUDIO_POLLING_OFFSET(0x0afb) -- Not in ram???
MCFG_DCS2_AUDIO_POLLING_OFFSET(0x0afb)
MCFG_DEVICE_ADD("ioasic", MIDWAY_IOASIC, 0)
MCFG_MIDWAY_IOASIC_SHUFFLE(MIDWAY_IOASIC_BLITZ99)
@ -1953,7 +1953,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( blitz2k, seattle150 )
MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_2115, 0)
MCFG_DCS2_AUDIO_DRAM_IN_MB(2)
// MCFG_DCS2_AUDIO_POLLING_OFFSET(0x0b5d) -- Not in ram???
MCFG_DCS2_AUDIO_POLLING_OFFSET(0x0b5d)
MCFG_DEVICE_ADD("ioasic", MIDWAY_IOASIC, 0)
MCFG_MIDWAY_IOASIC_SHUFFLE(MIDWAY_IOASIC_BLITZ99)
@ -1965,7 +1965,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( carnevil, seattle150 )
MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_2115, 0)
MCFG_DCS2_AUDIO_DRAM_IN_MB(2)
// MCFG_DCS2_AUDIO_POLLING_OFFSET(0x0af7) -- Not in ram???
MCFG_DCS2_AUDIO_POLLING_OFFSET(0x0af7)
MCFG_DEVICE_ADD("ioasic", MIDWAY_IOASIC, 0)
MCFG_MIDWAY_IOASIC_SHUFFLE(MIDWAY_IOASIC_CARNEVIL)
@ -1977,7 +1977,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( hyprdriv, seattle200_widget )
MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_2115, 0)
MCFG_DCS2_AUDIO_DRAM_IN_MB(2)
// MCFG_DCS2_AUDIO_POLLING_OFFSET(0x0af7) -- Not in ram???
MCFG_DCS2_AUDIO_POLLING_OFFSET(0x0af7)
MCFG_DEVICE_ADD("ioasic", MIDWAY_IOASIC, 0)
MCFG_MIDWAY_IOASIC_SHUFFLE(MIDWAY_IOASIC_HYPRDRIV)

View File

@ -668,7 +668,7 @@ READ8_MEMBER(vegas_state::sio_r)
break;
}
}
if (LOG_SIO && index != 0x4)
if (LOG_SIO && (index < 0x1 || index > 0x4))
logerror("%08X: sio_r: offset: %08x index: %d result: %02X\n", machine().device("maincpu")->safe_pc(), offset, index, result);
return result;
}
@ -779,7 +779,7 @@ WRITE8_MEMBER(vegas_state::cpu_io_w)
}
if (LOG_SIO) {
popmessage("System LED: %C", digit);
logerror("%08X: cpu_io_w System LED offset %X = %02X '%c'\n", machine().device("maincpu")->safe_pc(), offset, data, digit);
//logerror("%08X: cpu_io_w System LED offset %X = %02X '%c'\n", machine().device("maincpu")->safe_pc(), offset, data, digit);
}
}
break;
@ -1258,17 +1258,17 @@ static INPUT_PORTS_START( nbashowt )
PORT_DIPSETTING( 0x0020, DEF_STR( French ) )
PORT_DIPSETTING( 0x0010, DEF_STR( German ) )
PORT_DIPSETTING( 0x0000, DEF_STR( Free_Play ) )
PORT_DIPUNUSED( 0x0040, 0x0040 )
PORT_DIPUNUSED( 0x0040, 0x0000 )
PORT_DIPNAME( 0x0080, 0x0080, "Game Powerup" )
PORT_DIPSETTING( 0x0080, "NBA Showtime" )
PORT_DIPSETTING( 0x0000, "NFL Blitz" )
PORT_DIPNAME( 0x0100, 0x0100, "Joysticks" )
PORT_DIPNAME( 0x0100, 0x0000, "Joysticks" )
PORT_DIPSETTING( 0x0100, "8-Way" )
PORT_DIPSETTING( 0x0000, "49-Way" )
PORT_DIPNAME( 0x0200, 0x0200, "Graphics Mode" )
PORT_DIPSETTING( 0x0200, "Med Res" )
PORT_DIPSETTING( 0x0000, "Low Res" )
PORT_DIPUNUSED( 0x01c00, 0x01c00 )
PORT_DIPUNUSED( 0x1c00, 0x1c00 )
PORT_DIPNAME( 0x2000, 0x2000, "Number of Players" )
PORT_DIPSETTING( 0x2000, "2" )
PORT_DIPSETTING( 0x0000, "4" )
@ -1552,7 +1552,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( gauntleg, vegas )
MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_2104, 0)
MCFG_DCS2_AUDIO_DRAM_IN_MB(4)
// MCFG_DCS2_AUDIO_POLLING_OFFSET(0x0b5d) -- Not in ram???
MCFG_DCS2_AUDIO_POLLING_OFFSET(0x0b5d)
MCFG_DEVICE_ADD("ioasic", MIDWAY_IOASIC, 0)
MCFG_MIDWAY_IOASIC_SHUFFLE(MIDWAY_IOASIC_CALSPEED)
@ -1565,7 +1565,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( gauntdl, vegas )
MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_2104, 0)
MCFG_DCS2_AUDIO_DRAM_IN_MB(4)
// MCFG_DCS2_AUDIO_POLLING_OFFSET(0x0b5d) -- Not in ram???
MCFG_DCS2_AUDIO_POLLING_OFFSET(0x0b5d)
MCFG_DEVICE_ADD("ioasic", MIDWAY_IOASIC, 0)
MCFG_MIDWAY_IOASIC_SHUFFLE(MIDWAY_IOASIC_GAUNTDL)
@ -1578,7 +1578,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( warfa, vegas250 )
MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_2104, 0)
MCFG_DCS2_AUDIO_DRAM_IN_MB(4)
// MCFG_DCS2_AUDIO_POLLING_OFFSET(0x0b5d) -- Not in ram???
MCFG_DCS2_AUDIO_POLLING_OFFSET(0x0b5d)
MCFG_DEVICE_ADD("ioasic", MIDWAY_IOASIC, 0)
MCFG_MIDWAY_IOASIC_SHUFFLE(MIDWAY_IOASIC_MACE)
@ -1591,7 +1591,7 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( tenthdeg, vegas )
MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_2115, 0)
MCFG_DCS2_AUDIO_DRAM_IN_MB(4)
// MCFG_DCS2_AUDIO_POLLING_OFFSET(0x0afb) -- Not in ram???
MCFG_DCS2_AUDIO_POLLING_OFFSET(0x0afb)
MCFG_DEVICE_ADD("ioasic", MIDWAY_IOASIC, 0)
MCFG_MIDWAY_IOASIC_SHUFFLE(MIDWAY_IOASIC_GAUNTDL)
@ -1638,6 +1638,7 @@ static MACHINE_CONFIG_DERIVED( nbanfl, vegasban )
MCFG_MIDWAY_IOASIC_YEAR_OFFS(80)
MCFG_MIDWAY_IOASIC_IRQ_CALLBACK(WRITELINE(vegas_state, ioasic_irq))
//MCFG_MIDWAY_IOASIC_AUTO_ACK(1)
MCFG_MIDWAY_IOASIC_AUX_OUT_CB(WRITE32(vegas_state, i40_w))
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( nbagold, vegasban)
@ -1650,6 +1651,7 @@ static MACHINE_CONFIG_DERIVED( nbagold, vegasban)
MCFG_MIDWAY_IOASIC_YEAR_OFFS(80)
MCFG_MIDWAY_IOASIC_IRQ_CALLBACK(WRITELINE(vegas_state, ioasic_irq))
//MCFG_MIDWAY_IOASIC_AUTO_ACK(1)
MCFG_MIDWAY_IOASIC_AUX_OUT_CB(WRITE32(vegas_state, i40_w))
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( sf2049 , denver )