summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/atlus/cave.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/atlus/cave.cpp')
-rw-r--r--src/mame/atlus/cave.cpp112
1 files changed, 50 insertions, 62 deletions
diff --git a/src/mame/atlus/cave.cpp b/src/mame/atlus/cave.cpp
index f7e9906bfc7..38d5aefca69 100644
--- a/src/mame/atlus/cave.cpp
+++ b/src/mame/atlus/cave.cpp
@@ -270,26 +270,23 @@ u8 cave_z80_state::soundflags_r()
{
// bit 2 is low: can read command (lo)
// bit 3 is low: can read command (hi)
-// return (m_sound_flag[0] ? 0 : 4) |
-// (m_sound_flag[1] ? 0 : 8) ;
-return 0;
+ //return (m_sound_flag[0] ? 0 : 4) | (m_sound_flag[1] ? 0 : 8) ;
+ return 0;
}
u16 cave_z80_state::soundflags_ack_r()
{
// bit 0 is low: can write command
// bit 1 is low: can read answer
-// return ((m_sound_flag[0] | m_sound_flag[1]) ? 1 : 0) |
-// (m_soundbuf_empty ? 0 : 2) ;
-
+ //return ((m_sound_flag[0] | m_sound_flag[1]) ? 1 : 0) | (m_soundbuf_empty ? 0 : 2) ;
return m_soundbuf_empty ? 2 : 0;
}
/* Main CPU: write a 16 bit sound latch and generate a NMI on the sound CPU */
void cave_z80_state::sound_cmd_w(u16 data)
{
-// m_sound_flag[0] = 1;
-// m_sound_flag[1] = 1;
+ //m_sound_flag[0] = 1;
+ //m_sound_flag[1] = 1;
m_soundlatch->write(data);
m_maincpu->spin_until_time(attotime::from_usec(50)); // Allow the other cpu to reply
}
@@ -297,14 +294,14 @@ void cave_z80_state::sound_cmd_w(u16 data)
/* Sound CPU: read the low 8 bits of the 16 bit sound latch */
u8 cave_z80_state::soundlatch_lo_r()
{
-// m_sound_flag[0] = 0;
+ //m_sound_flag[0] = 0;
return m_soundlatch->read() & 0xff;
}
/* Sound CPU: read the high 8 bits of the 16 bit sound latch */
u8 cave_z80_state::soundlatch_hi_r()
{
-// m_sound_flag[1] = 0;
+ //m_sound_flag[1] = 0;
return m_soundlatch->read() >> 8;
}
@@ -674,7 +671,7 @@ void cave_z80_state::hotdogst_map(address_map &map)
void cave_state::show_leds()
{
#ifdef MAME_DEBUG
-// popmessage("led %04X eep %02X", m_leds[0], (m_leds[1] >> 8) & ~0x70);
+ //popmessage("led %04X eep %02X", m_leds[0], (m_leds[1] >> 8) & ~0x70);
#endif
}
@@ -684,13 +681,13 @@ void cave_state::korokoro_leds_w(offs_t offset, u16 data, u16 mem_mask)
m_led_outputs[0] = BIT(data, 15);
m_led_outputs[1] = BIT(data, 14);
- m_led_outputs[2] = BIT(data, 12); // square button
- m_led_outputs[3] = BIT(data, 11); // round button
-// machine().bookkeeping().coin_lockout_w(1, ~data & 0x0200); // coin lockouts?
-// machine().bookkeeping().coin_lockout_w(0, ~data & 0x0100);
+ m_led_outputs[2] = BIT(data, 12); // square button
+ m_led_outputs[3] = BIT(data, 11); // round button
+ //machine().bookkeeping().coin_lockout_w(1, ~data & 0x0200); // coin lockouts?
+ //machine().bookkeeping().coin_lockout_w(0, ~data & 0x0100);
-// machine().bookkeeping().coin_counter_w(2, data & 0x0080);
-// machine().bookkeeping().coin_counter_w(1, data & 0x0020);
+ //machine().bookkeeping().coin_counter_w(2, data & 0x0080);
+ //machine().bookkeeping().coin_counter_w(1, data & 0x0020);
machine().bookkeeping().coin_counter_w(0, data & 0x0010);
m_led_outputs[5] = BIT(data, 3);
@@ -713,7 +710,8 @@ void cave_state::korokoro_eeprom_w(offs_t offset, u16 data, u16 mem_mask)
if (ACCESSING_BITS_8_15) // even address
{
- m_hopper = data & 0x0100; // ???
+ // hopper motor
+ m_hopper->motor_w(BIT(data, 8));
// latch the bit
m_eeprom->di_write((data & 0x4000) >> 14);
@@ -726,11 +724,6 @@ void cave_state::korokoro_eeprom_w(offs_t offset, u16 data, u16 mem_mask)
}
}
-int cave_state::korokoro_hopper_r()
-{
- return m_hopper ? 1 : 0;
-}
-
void cave_state::korokoro_map(address_map &map)
{
@@ -871,7 +864,7 @@ u16 ppsatan_state::ppsatan_touch_r()
if ( ((m_ppsatan_io_mux >> 2) & (1 << slot_y)) || ((m_ppsatan_io_mux << 6) & (1 << slot_y)) )
ret_y |= 1 << (slot_y % 6);
-// if (!Player) popmessage("TOUCH %03x %03x -> %f -> %d", x, y, ((320.0f - 1 - x) - 12) / 20, slot_x);
+ //if (!Player) popmessage("TOUCH %03x %03x -> %f -> %d", x, y, ((320.0f - 1 - x) - 12) / 20, slot_x);
}
return ret_x | (ret_y << 8);
@@ -898,7 +891,7 @@ void ppsatan_state::ppsatan_out_w(offs_t offset, u16 data, u16 mem_mask)
m_oki[0]->set_rom_bank((data & 0x8000) >> 15);
}
-// popmessage("OUT %04x", data);
+ //popmessage("OUT %04x", data);
}
void ppsatan_state::ppsatan_map(address_map &map)
@@ -1002,7 +995,7 @@ void cave_z80_state::pwrinst2_map(address_map &map)
u16 cave_z80_state::sailormn_input0_r()
{
-// watchdog_reset16_r(0, 0); // written too rarely for mame.
+ //watchdog_reset16_r(0, 0); // written too rarely for mame.
return m_io_in0->read();
}
@@ -1108,15 +1101,10 @@ void cave_state::tjumpman_leds_w(u8 data)
m_led_outputs[3] = BIT(data, 3); // go
m_led_outputs[4] = BIT(data, 4); // 1 bet
m_led_outputs[5] = BIT(data, 5); // medal
- m_hopper = BIT(data, 6); // hopper
+ m_hopper->motor_w(BIT(data, 6)); // hopper
m_led_outputs[6] = BIT(data, 7); // 3 bet
-// popmessage("led %04X", data);
-}
-
-int cave_state::tjumpman_hopper_r()
-{
- return (m_hopper && !(m_screen[0]->frame_number() % 10)) ? 0 : 1;
+ //popmessage("led %04X", data);
}
void cave_state::tjumpman_map(address_map &map)
@@ -1145,15 +1133,15 @@ void cave_state::tjumpman_map(address_map &map)
void cave_state::pacslot_leds_w(u8 data)
{
- m_led_outputs[0] = data & 0x0001; // pac-man
- m_led_outputs[1] = data & 0x0002; // ms. pac-man
- m_led_outputs[2] = data & 0x0004; // payout
- m_led_outputs[3] = data & 0x0008; // start
- m_led_outputs[4] = data & 0x0010; // bet
- m_led_outputs[5] = data & 0x0020; // medal
- m_hopper = data & 0x0040; // hopper
+ m_led_outputs[0] = BIT(data, 0); // pac-man
+ m_led_outputs[1] = BIT(data, 1); // ms. pac-man
+ m_led_outputs[2] = BIT(data, 2); // payout
+ m_led_outputs[3] = BIT(data, 3); // start
+ m_led_outputs[4] = BIT(data, 4); // bet
+ m_led_outputs[5] = BIT(data, 5); // medal
+ m_hopper->motor_w(BIT(data, 6)); // hopper
-// popmessage("led %04X", data);
+ //popmessage("led %04X", data);
}
void cave_state::pacslot_map(address_map &map)
@@ -1707,7 +1695,7 @@ static INPUT_PORTS_START( korokoro )
PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_SERVICE2 ) // service medal out?
PORT_SERVICE( 0x2000, IP_ACTIVE_LOW )
PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_SERVICE1 ) // service coin
- PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(cave_state::korokoro_hopper_r)) // motor / hopper status ???
+ PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(ticket_dispenser_device::line_r))
PORT_START("IN1")
PORT_BIT( 0x1000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", FUNC(eeprom_serial_93cxx_device::do_read))
@@ -1724,7 +1712,7 @@ static INPUT_PORTS_START( tekkencw )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( DEF_STR( Yes ) ) PORT_CODE(KEYCODE_Y) // suru ("do")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Bet" )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(cave_state::tjumpman_hopper_r))
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(ticket_dispenser_device::line_r))
PORT_START("IN1")
PORT_CONFNAME( 0x08, 0x08, "Self Test" )
@@ -1746,7 +1734,7 @@ static INPUT_PORTS_START( tekkenbs )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Bet" )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(cave_state::tjumpman_hopper_r))
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(ticket_dispenser_device::line_r))
PORT_START("IN1")
PORT_CONFNAME( 0x08, 0x08, "Self Test" )
@@ -1767,7 +1755,7 @@ static INPUT_PORTS_START( tjumpman )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( DEF_STR( Yes ) ) PORT_CODE(KEYCODE_Y) // suru ("do")
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "1 Bet" )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(cave_state::tjumpman_hopper_r))
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(ticket_dispenser_device::line_r))
PORT_START("IN1")
PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -1790,7 +1778,7 @@ static INPUT_PORTS_START( pacslot )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME( "Pac-Man" ) PORT_CODE(KEYCODE_Y)
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_GAMBLE_PAYOUT )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Bet" )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(cave_state::tjumpman_hopper_r))
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(ticket_dispenser_device::line_r))
PORT_START("IN1")
PORT_CONFNAME( 0x08, 0x08, "Self Test" )
@@ -1822,7 +1810,7 @@ static INPUT_PORTS_START( paccarn )
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(cave_state::paccarn_bet4_r))
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME( "Bet 2" )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_START1 )
- PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(FUNC(cave_state::tjumpman_hopper_r))
+ PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("hopper", FUNC(ticket_dispenser_device::line_r))
PORT_START("IN1")
PORT_BIT( 0x07, IP_ACTIVE_LOW, IPT_UNKNOWN )
@@ -2458,6 +2446,8 @@ void cave_state::korokoro(machine_config &config)
EEPROM_93C46_16BIT(config, m_eeprom);
+ TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200));
+
/* video hardware */
m_screen[0]->set_visarea(0, 320-1-2, 0, 240-1-1);
@@ -2592,6 +2582,8 @@ void cave_state::pacslot(machine_config &config)
EEPROM_93C46_16BIT(config, m_eeprom, eeprom_serial_streaming::ENABLE);
+ TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200));
+
/* video hardware */
m_screen[0]->set_size(0x200, 240);
m_screen[0]->set_visarea(0x80, 0x80 + 0x140-1, 0, 240-1);
@@ -2804,7 +2796,7 @@ void cave_z80_state::sailormn(machine_config &config)
m_audiocpu->set_addrmap(AS_PROGRAM, &cave_z80_state::sailormn_sound_map);
m_audiocpu->set_addrmap(AS_IO, &cave_z80_state::sailormn_sound_portmap);
-// config.set_maximum_quantum(attotime::from_hz(600));
+ //config.set_maximum_quantum(attotime::from_hz(600));
MCFG_MACHINE_RESET_OVERRIDE(cave_z80_state,sailormn)
EEPROM_93C46_16BIT(config, m_eeprom);
@@ -2861,6 +2853,8 @@ void cave_state::tekkencw(machine_config &config)
EEPROM_93C46_16BIT(config, m_eeprom, eeprom_serial_streaming::ENABLE);
+ TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200));
+
/* video hardware */
m_screen[0]->set_size(0x200, 240);
m_screen[0]->set_visarea(0x80, 0x80 + 0x140-1, 0, 240-1);
@@ -2903,6 +2897,8 @@ void cave_state::tjumpman(machine_config &config)
EEPROM_93C46_16BIT(config, m_eeprom, eeprom_serial_streaming::ENABLE);
+ TICKET_DISPENSER(config, m_hopper, attotime::from_msec(200));
+
/* video hardware */
m_screen[0]->set_size(0x200, 240);
m_screen[0]->set_visarea(0x80, 0x80 + 0x140-1, 0, 240-1);
@@ -3871,8 +3867,7 @@ ROM_START( guwange )
ROM_RELOAD( 0x1800000, 0x400000 )
ROM_LOAD32_WORD_SWAP( "u085.bin", 0x1000002, 0x400000, CRC(a7d5659e) SHA1(10abac022ebe106a3ca7186ff18ca2757f903033) )
ROM_RELOAD( 0x1800002, 0x400000 )
-// sprite bug fix?
-// ROM_FILL( 0x1800000, 0x800000, 0xff )
+// ROM_FILL( 0x1800000, 0x800000, 0xff ) // sprite bug fix?
ROM_REGION( 0x800000, "layer0", 0 )
ROM_LOAD( "u101.bin", 0x000000, 0x800000, CRC(0369491f) SHA1(ca6b1345506f13a17c9bace01637d1f61a278644) )
@@ -3908,8 +3903,7 @@ ROM_START( guwanges )
ROM_RELOAD( 0x1800000, 0x400000 )
ROM_LOAD32_WORD_SWAP( "u085.bin", 0x1000002, 0x400000, CRC(a7d5659e) SHA1(10abac022ebe106a3ca7186ff18ca2757f903033) )
ROM_RELOAD( 0x1800002, 0x400000 )
-// sprite bug fix?
-// ROM_FILL( 0x1800000, 0x800000, 0xff )
+// ROM_FILL( 0x1800000, 0x800000, 0xff ) // sprite bug fix?
ROM_REGION( 0x800000, "layer0", 0 )
ROM_LOAD( "u101.bin", 0x000000, 0x800000, CRC(0369491f) SHA1(ca6b1345506f13a17c9bace01637d1f61a278644) )
@@ -5383,10 +5377,10 @@ ROM_END
Expand the 2 bit part into a 4 bit layout, so we can decode it */
void cave_z80_state::sailormn_unpack_tiles(int chip)
{
- const u32 len= m_tileregion[chip]->bytes();
- u8 *rgn = m_tileregion[chip]->base();
- u8 *src = rgn + (len/4)*3 - 1;
- u8 *dst = rgn + (len/4)*4 - 2;
+ const u32 len = m_tileregion[chip]->bytes();
+ u8 *rgn = m_tileregion[chip]->base();
+ u8 *src = rgn + (len/4)*3 - 1;
+ u8 *dst = rgn + (len/4)*4 - 2;
while (src <= dst)
{
@@ -5606,7 +5600,6 @@ void cave_z80_state::init_pwrinst2a()
rom[0xd46c / 2] = 0xd482; // kurara dash fix 0xd400 -> 0xd482
}
#endif
-
}
void cave_z80_state::init_sailormn()
@@ -5645,9 +5638,6 @@ void cave_state::init_tjumpman()
unpack_sprites(0);
m_kludge = 3;
m_time_vblank_irq = 17376;
-
- m_hopper = 0;
- save_item(NAME(m_hopper));
}
void cave_state::init_uopoko()
@@ -5670,9 +5660,7 @@ void cave_state::init_korokoro()
m_leds[0] = 0;
m_leds[1] = 0;
- m_hopper = 0;
save_item(NAME(m_leds));
- save_item(NAME(m_hopper));
}
/***************************************************************************