Skip to content

Commit

Permalink
timelimt,suprridr: take clock freqs from thepit driver
Browse files Browse the repository at this point in the history
  • Loading branch information
happppp committed Dec 4, 2024
1 parent 521ff6d commit af81cba
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 24 deletions.
6 changes: 4 additions & 2 deletions src/mame/thepit/thepit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -749,14 +749,16 @@ GFXDECODE_END
void thepit_state::thepit(machine_config &config)
{
/* basic machine hardware */
Z80(config, m_maincpu, PIXEL_CLOCK/2); /* 3.072 MHz */
Z80(config, m_maincpu, PIXEL_CLOCK/2); // 3.072 MHz
m_maincpu->set_addrmap(AS_PROGRAM, &thepit_state::thepit_main_map);

Z80(config, m_audiocpu, SOUND_CLOCK/4); /* 2.5 MHz */
Z80(config, m_audiocpu, SOUND_CLOCK/4); // 2.5 MHz
m_audiocpu->set_addrmap(AS_PROGRAM, &thepit_state::audio_map);
m_audiocpu->set_addrmap(AS_IO, &thepit_state::audio_io_map);
m_audiocpu->set_irq_acknowledge_callback(FUNC(thepit_state::vsync_int_ack));

config.set_maximum_quantum(attotime::from_hz(3000));

LS259(config, m_mainlatch); // IC42
m_mainlatch->q_out_cb<0>().set(FUNC(thepit_state::nmi_mask_w));
m_mainlatch->q_out_cb<2>().set_nop(); // marked "LOCK OUT" on Centuri schematic but never written
Expand Down
9 changes: 6 additions & 3 deletions src/mame/thepit/timelimt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ Progress (c) 1984 Chuo
driver by Ernesto Corvi
Notes:
- Sprite colors are wrong (missing colortable?)
- sprite colors are wrong (missing colortable?)
- driver should probably be merged with venture/suprridr.cpp and
thepit/thepit.cpp
- unused color bank for tilemaps? (colors 0x10-0x1f & 0x30-0x3f)
- verify clocks, they're currently borrowed from thepit, maincpu clock
used to be 5MHz in older MAME versions but that's doubtful
***************************************************************************/

Expand Down Expand Up @@ -445,6 +447,7 @@ INTERRUPT_GEN_MEMBER(timelimt_state::main_nmi)
{
m_nmi_state = !m_nmi_state;

// gameplay pace matches PCB video like this
if (m_nmi_enabled && m_nmi_state)
m_maincpu->set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
else if (!m_nmi_state)
Expand All @@ -456,12 +459,12 @@ INTERRUPT_GEN_MEMBER(timelimt_state::main_nmi)
void timelimt_state::timelimt(machine_config &config)
{
// basic machine hardware
Z80(config, m_maincpu, 5'000'000); // 5.000 MHz
Z80(config, m_maincpu, 18'432'000 / 6);
m_maincpu->set_addrmap(AS_PROGRAM, &timelimt_state::main_map);
m_maincpu->set_addrmap(AS_IO, &timelimt_state::main_io_map);
m_maincpu->set_vblank_int("screen", FUNC(timelimt_state::main_nmi));

Z80(config, m_audiocpu, 18'432'000 / 6); // 3.072 MHz
Z80(config, m_audiocpu, 10'000'000 / 4);
m_audiocpu->set_addrmap(AS_PROGRAM, &timelimt_state::sound_map);
m_audiocpu->set_addrmap(AS_IO, &timelimt_state::sound_io_map);
m_audiocpu->set_vblank_int("screen", FUNC(timelimt_state::irq0_line_hold)); // ?
Expand Down
38 changes: 19 additions & 19 deletions src/mame/venture/suprridr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Super Rider
Known issues:
* clocks on sound chips and CPU not verified yet
* clocks on sound chips and CPU not verified yet, taken from thepit
* the board seems to contain a discrete sound portion
Questions:
Expand Down Expand Up @@ -105,7 +105,6 @@ class suprridr_state : public driver_device
driver_device(mconfig, type, tag),
m_maincpu(*this, "maincpu"),
m_audiocpu(*this, "audiocpu"),
m_soundlatch(*this, "soundlatch"),
m_gfxdecode(*this, "gfxdecode"),
m_palette(*this, "palette"),
m_fgram(*this, "fgram"),
Expand All @@ -126,7 +125,6 @@ class suprridr_state : public driver_device
private:
required_device<cpu_device> m_maincpu;
required_device<cpu_device> m_audiocpu;
required_device<generic_latch_8_device> m_soundlatch;
required_device<gfxdecode_device> m_gfxdecode;
required_device<palette_device> m_palette;

Expand Down Expand Up @@ -361,6 +359,7 @@ uint32_t suprridr_state::screen_update(screen_device &screen, bitmap_ind16 &bitm
}
m_gfxdecode->gfx(2)->transpen(bitmap, cliprect, code, color, fx, fy, x, y, 0);
}

return 0;
}

Expand All @@ -372,9 +371,10 @@ void suprridr_state::machine_start()

void suprridr_state::machine_reset()
{
m_soundlatch->acknowledge_w();
}



/*************************************
*
* Interrupt generation
Expand Down Expand Up @@ -404,7 +404,7 @@ INTERRUPT_GEN_MEMBER(suprridr_state::main_nmi_gen)
void suprridr_state::coin_lock_w(uint8_t data)
{
// cleared when 9 credits are hit, but never reset!
// machine().bookkeeping().coin_lockout_global_w(~data & 1);
//machine().bookkeeping().coin_lockout_global_w(~data & 1);
}


Expand All @@ -430,7 +430,7 @@ void suprridr_state::main_map(address_map &map)
map(0xb002, 0xb003).w(FUNC(suprridr_state::coin_lock_w));
map(0xb006, 0xb006).w(FUNC(suprridr_state::flipx_w));
map(0xb007, 0xb007).w(FUNC(suprridr_state::flipy_w));
map(0xb800, 0xb800).w(m_soundlatch, FUNC(generic_latch_8_device::write));
map(0xb800, 0xb800).w("soundlatch", FUNC(generic_latch_8_device::write));
map(0xc801, 0xc801).w(FUNC(suprridr_state::fgdisable_w));
map(0xc802, 0xc802).w(FUNC(suprridr_state::fgscrolly_w));
map(0xc804, 0xc804).w(FUNC(suprridr_state::bgscrolly_w));
Expand Down Expand Up @@ -462,7 +462,7 @@ void suprridr_state::sound_map(address_map &map)
void suprridr_state::sound_portmap(address_map &map)
{
map.global_mask(0xff);
map(0x00, 0x00).w(m_soundlatch, FUNC(generic_latch_8_device::acknowledge_w));
map(0x00, 0x00).w("soundlatch", FUNC(generic_latch_8_device::clear_w));
map(0x8c, 0x8d).w("ay1", FUNC(ay8910_device::address_data_w));
map(0x8d, 0x8d).r("ay1", FUNC(ay8910_device::data_r));
map(0x8e, 0x8f).w("ay2", FUNC(ay8910_device::address_data_w));
Expand All @@ -481,7 +481,6 @@ void suprridr_state::sound_portmap(address_map &map)
ioport_value suprridr_state::control_r()
{
// screen flip multiplexes controls

return m_contp[m_flipx]->read(); // or is it flipy?
}

Expand All @@ -491,8 +490,8 @@ static INPUT_PORTS_START( suprridr )
PORT_BIT( 0xff, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(FUNC(suprridr_state::control_r))

PORT_START("SYSTEM")
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_SERVICE1 )
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SERVICE1 )
PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_START1 )
PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_START2 )
PORT_BIT( 0xf0, IP_ACTIVE_HIGH, IPT_UNKNOWN )
Expand Down Expand Up @@ -587,18 +586,21 @@ GFXDECODE_END
void suprridr_state::suprridr(machine_config &config)
{
// basic machine hardware
Z80(config, m_maincpu, XTAL(49'152'000) / 16); // 3 MHz
Z80(config, m_maincpu, 18'432'000 / 6);
m_maincpu->set_addrmap(AS_PROGRAM, &suprridr_state::main_map);
m_maincpu->set_addrmap(AS_IO, &suprridr_state::main_portmap);
m_maincpu->set_vblank_int("screen", FUNC(suprridr_state::main_nmi_gen));

Z80(config, m_audiocpu, 10000000 / 4); // 2.5 MHz
Z80(config, m_audiocpu, 10'000'000 / 4);
m_audiocpu->set_addrmap(AS_PROGRAM, &suprridr_state::sound_map);
m_audiocpu->set_addrmap(AS_IO, &suprridr_state::sound_portmap);
m_audiocpu->set_vblank_int("screen", FUNC(suprridr_state::irq0_line_hold)); // ?

config.set_maximum_quantum(attotime::from_hz(3000));

WATCHDOG_TIMER(config, "watchdog");

/* video hardware */
// video hardware
screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER));
screen.set_refresh_hz(60);
screen.set_vblank_time(ATTOSECONDS_IN_USEC(0));
Expand All @@ -613,15 +615,13 @@ void suprridr_state::suprridr(machine_config &config)
// sound hardware
SPEAKER(config, "mono").front_center();

AY8910(config, "ay1", XTAL(49'152'000) / 32).add_route(ALL_OUTPUTS, "mono", 0.25);
AY8910(config, "ay1", 18'432'000 / 12).add_route(ALL_OUTPUTS, "mono", 0.25);

ay8910_device &ay2(AY8910(config, "ay2", XTAL(49'152'000) / 32));
ay2.port_a_read_callback().set(m_soundlatch, FUNC(generic_latch_8_device::read));
ay8910_device &ay2(AY8910(config, "ay2", 18'432'000 / 12));
ay2.port_a_read_callback().set("soundlatch", FUNC(generic_latch_8_device::read));
ay2.add_route(ALL_OUTPUTS, "mono", 0.25);

GENERIC_LATCH_8(config, m_soundlatch);
m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, 0);
m_soundlatch->set_separate_acknowledge(true);
GENERIC_LATCH_8(config, "soundlatch");
}


Expand Down

0 comments on commit af81cba

Please sign in to comment.