cbuster.cpp, darkseal.cpp, vaportra.cpp: Add workaround to 6280 core to fix music speed

This commit is contained in:
AJR 2019-09-09 14:00:51 -04:00
parent 986cec8f14
commit 3f4f237dde
5 changed files with 11 additions and 3 deletions

View File

@ -176,6 +176,7 @@ h6280_device::h6280_device(const machine_config &mconfig, const char *tag, devic
, m_port_in_cb(*this)
, m_port_out_cb(*this)
, m_psg(*this, "psg")
, m_timer_scale(1)
{
// build the opcode table
for (int op = 0; op < 256; op++)
@ -344,7 +345,7 @@ void h6280_device::device_reset()
/* timer off by default */
m_timer_status = 0;
m_timer_load = 128 * 1024;
m_timer_load = 128 * 1024 * m_timer_scale;
m_irq_pending = 0;
}
@ -2571,9 +2572,8 @@ WRITE8_MEMBER( h6280_device::timer_w )
switch (offset & 1)
{
case 0: /* Counter preload */
//m_timer_load = m_timer_value = ((data & 127) + 1) * 1024;
// matches HW behaviour, value is latched only with 0->1 counter enable transition
m_timer_load = ((data & 127) + 1) * 1024;
m_timer_load = ((data & 127) + 1) * 1024 * m_timer_scale;
return;
case 1: /* Counter enable */

View File

@ -41,6 +41,9 @@ public:
auto port_in_cb() { return m_port_in_cb.bind(); } // K0-7 at Pinout
auto port_out_cb() { return m_port_out_cb.bind(); } // O0-7 at Pinout
// hack to fix music speed in some Data East games (core bug, external strapping, DE 45 customization or ???)
void set_timer_scale(int scale) { m_timer_scale = scale; }
/* functions for use by the PSG and joypad port only! */
uint8_t io_get_buffer();
void io_set_buffer(uint8_t);
@ -374,6 +377,8 @@ protected:
// other internal states
int m_icount;
uint8_t m_timer_scale;
// address spaces
address_space *m_program;
address_space *m_io;

View File

@ -269,6 +269,7 @@ void cbuster_state::twocrude(machine_config &config)
H6280(config, m_audiocpu, XTAL(24'000'000)/4); /* Custom chip 45, 6MHz Verified */
m_audiocpu->set_addrmap(AS_PROGRAM, &cbuster_state::sound_map);
m_audiocpu->add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused
m_audiocpu->set_timer_scale(2);
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(58);

View File

@ -211,6 +211,7 @@ void darkseal_state::darkseal(machine_config &config)
H6280(config, m_audiocpu, XTAL(32'220'000)/4); /* Custom chip 45, Audio section crystal is 32.220 MHz */
m_audiocpu->set_addrmap(AS_PROGRAM, &darkseal_state::sound_map);
m_audiocpu->add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused
m_audiocpu->set_timer_scale(2);
/* video hardware */
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));

View File

@ -217,6 +217,7 @@ void vaportra_state::vaportra(machine_config &config)
H6280(config, m_audiocpu, XTAL(24'000'000)/4); /* Custom chip 45; Audio section crystal is 32.220 MHz but CPU clock is confirmed as coming from the 24MHz crystal (6Mhz exactly on the CPU) */
m_audiocpu->set_addrmap(AS_PROGRAM, &vaportra_state::sound_map);
m_audiocpu->add_route(ALL_OUTPUTS, "mono", 0); // internal sound unused
m_audiocpu->set_timer_scale(2);
/* video hardware */
BUFFERED_SPRITERAM16(config, m_spriteram);