Skip to content

Commit a9699a2

Browse files
committed
coleco: add m1 and soundchip waitstates
1 parent 3e84f5b commit a9699a2

File tree

3 files changed

+34
-34
lines changed

3 files changed

+34
-34
lines changed

src/mame/coleco/coleco.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,6 @@ static INPUT_PORTS_START( bit90 )
345345
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL)
346346
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE)
347347
PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("FCTN") PORT_CODE(KEYCODE_RCONTROL)
348-
349348
INPUT_PORTS_END
350349

351350
/* Interrupts */
@@ -575,6 +574,7 @@ void coleco_state::coleco(machine_config &config)
575574
{
576575
/* basic machine hardware */
577576
Z80(config, m_maincpu, XTAL(7'159'090)/2); // 3.579545 MHz
577+
m_maincpu->z80_set_m1_cycles(4+1); // 1 WAIT CLK per M1
578578
m_maincpu->set_addrmap(AS_PROGRAM, &coleco_state::coleco_map);
579579
m_maincpu->set_addrmap(AS_IO, &coleco_state::coleco_io_map);
580580

@@ -589,8 +589,7 @@ void coleco_state::coleco(machine_config &config)
589589
SPEAKER(config, "mono").front_center();
590590
sn76489a_device &psg(SN76489A(config, "sn76489a", XTAL(7'159'090)/2)); // 3.579545 MHz
591591
psg.add_route(ALL_OUTPUTS, "mono", 1.00);
592-
// TODO: enable when Z80 has better WAIT pin emulation, this currently breaks pitfall2 for example
593-
//psg.ready_cb().set_inputline("maincpu", Z80_INPUT_LINE_WAIT).invert();
592+
psg.ready_cb().set_inputline("maincpu", Z80_INPUT_LINE_WAIT).invert();
594593

595594
/* cartridge */
596595
COLECOVISION_CARTRIDGE_SLOT(config, m_cart, colecovision_cartridges, nullptr);
@@ -624,6 +623,7 @@ void bit90_state::bit90(machine_config &config)
624623
{
625624
/* basic machine hardware */
626625
Z80(config, m_maincpu, XTAL(7'159'090)/2); // 3.579545 MHz
626+
m_maincpu->z80_set_m1_cycles(4+1); // 1 WAIT CLK per M1
627627
m_maincpu->set_addrmap(AS_PROGRAM, &bit90_state::bit90_map);
628628
m_maincpu->set_addrmap(AS_IO, &bit90_state::bit90_io_map);
629629

@@ -638,8 +638,7 @@ void bit90_state::bit90(machine_config &config)
638638
SPEAKER(config, "mono").front_center();
639639
sn76489a_device &psg(SN76489A(config, "sn76489a", XTAL(7'159'090)/2)); // 3.579545 MHz
640640
psg.add_route(ALL_OUTPUTS, "mono", 1.00);
641-
// TODO: enable when Z80 has better WAIT pin emulation, this currently breaks pitfall2 for example
642-
//psg.ready_cb().set_inputline("maincpu", Z80_INPUT_LINE_WAIT).invert();
641+
psg.ready_cb().set_inputline("maincpu", Z80_INPUT_LINE_WAIT).invert();
643642

644643
/* cartridge */
645644
COLECOVISION_CARTRIDGE_SLOT(config, m_cart, colecovision_cartridges, nullptr);

src/mame/coleco/coleco.h

+29-28
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,27 @@
1717
class coleco_state : public driver_device
1818
{
1919
public:
20-
coleco_state(const machine_config &mconfig, device_type type, const char *tag)
21-
: driver_device(mconfig, type, tag),
22-
m_maincpu(*this, "maincpu"),
23-
m_cart(*this, COLECOVISION_CARTRIDGE_SLOT_TAG),
24-
m_ctrlsel(*this, "CTRLSEL"),
25-
m_std_keypad1(*this, "STD_KEYPAD1"),
26-
m_std_joy1(*this, "STD_JOY1"),
27-
m_std_keypad2(*this, "STD_KEYPAD2"),
28-
m_std_joy2(*this, "STD_JOY2"),
29-
m_sac_keypad1(*this, "SAC_KEYPAD1"),
30-
m_sac_joy1(*this, "SAC_JOY1"),
31-
m_sac_slide1(*this, "SAC_SLIDE1"),
32-
m_sac_keypad2(*this, "SAC_KEYPAD2"),
33-
m_sac_joy2(*this, "SAC_JOY2"),
34-
m_sac_slide2(*this, "SAC_SLIDE2"),
35-
m_driv_wheel1(*this, "DRIV_WHEEL1"),
36-
m_driv_pedal1(*this, "DRIV_PEDAL1"),
37-
m_driv_wheel2(*this, "DRIV_WHEEL2"),
38-
m_driv_pedal2(*this, "DRIV_PEDAL2"),
39-
m_roller_x(*this, "ROLLER_X"),
40-
m_roller_y(*this, "ROLLER_Y")
20+
coleco_state(const machine_config &mconfig, device_type type, const char *tag) :
21+
driver_device(mconfig, type, tag),
22+
m_maincpu(*this, "maincpu"),
23+
m_cart(*this, COLECOVISION_CARTRIDGE_SLOT_TAG),
24+
m_ctrlsel(*this, "CTRLSEL"),
25+
m_std_keypad1(*this, "STD_KEYPAD1"),
26+
m_std_joy1(*this, "STD_JOY1"),
27+
m_std_keypad2(*this, "STD_KEYPAD2"),
28+
m_std_joy2(*this, "STD_JOY2"),
29+
m_sac_keypad1(*this, "SAC_KEYPAD1"),
30+
m_sac_joy1(*this, "SAC_JOY1"),
31+
m_sac_slide1(*this, "SAC_SLIDE1"),
32+
m_sac_keypad2(*this, "SAC_KEYPAD2"),
33+
m_sac_joy2(*this, "SAC_JOY2"),
34+
m_sac_slide2(*this, "SAC_SLIDE2"),
35+
m_driv_wheel1(*this, "DRIV_WHEEL1"),
36+
m_driv_pedal1(*this, "DRIV_PEDAL1"),
37+
m_driv_wheel2(*this, "DRIV_WHEEL2"),
38+
m_driv_pedal2(*this, "DRIV_PEDAL2"),
39+
m_roller_x(*this, "ROLLER_X"),
40+
m_roller_y(*this, "ROLLER_Y")
4141
{ }
4242

4343
virtual void machine_start() override ATTR_COLD;
@@ -67,8 +67,9 @@ class coleco_state : public driver_device
6767
void coleco_io_map(address_map &map) ATTR_COLD;
6868
void coleco_map(address_map &map) ATTR_COLD;
6969
void czz50_map(address_map &map) ATTR_COLD;
70+
7071
protected:
71-
required_device<cpu_device> m_maincpu;
72+
required_device<z80_device> m_maincpu;
7273
required_device<colecovision_cartridge_slot_device> m_cart;
7374

7475
int m_joy_mode = 0;
@@ -106,12 +107,12 @@ class coleco_state : public driver_device
106107
class bit90_state : public coleco_state
107108
{
108109
public:
109-
bit90_state(const machine_config &mconfig, device_type type, const char *tag)
110-
: coleco_state(mconfig, type, tag),
111-
m_bank(*this, "bank"),
112-
m_ram(*this, RAM_TAG),
113-
m_io_keyboard(*this, {"ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7"})
114-
{}
110+
bit90_state(const machine_config &mconfig, device_type type, const char *tag) :
111+
coleco_state(mconfig, type, tag),
112+
m_bank(*this, "bank"),
113+
m_ram(*this, RAM_TAG),
114+
m_io_keyboard(*this, {"ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", "ROW6", "ROW7"})
115+
{ }
115116

116117
virtual void machine_start() override ATTR_COLD;
117118
virtual void machine_reset() override ATTR_COLD;

src/mame/cxg/junior.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ ROM_START( sjunior )
235235
ROM_LOAD("1988_newcrest_614140ha27", 0x0000, 0x2000, CRC(9eb77d94) SHA1(84306ee39986847f9ae82a1117dc6fb8bd309bab) )
236236

237237
ROM_REGION( 57412, "screen", 0 )
238-
ROM_LOAD("cpchess.svg", 0, 57412, CRC(7859b1ac) SHA1(518c5cd08fa8562628345e8e28048c01c9e4edd6) )
238+
ROM_LOAD("pchess.svg", 0, 57412, CRC(7859b1ac) SHA1(518c5cd08fa8562628345e8e28048c01c9e4edd6) )
239239
ROM_END
240240

241241
} // anonymous namespace

0 commit comments

Comments
 (0)