diff options
author | Ivan Vangelista <mesgnet@yahoo.it> | 2021-05-22 18:35:25 +0200 |
---|---|---|
committer | Ivan Vangelista <mesgnet@yahoo.it> | 2021-05-22 18:35:25 +0200 |
commit | ef6c7b9694ad5daeb4d243741e7631904ff97e7a (patch) | |
tree | c65d4770a0072cac22c0ead11629fef3db9303c8 | |
parent | 555453fcabde1ba76e1d29a26a2ceef083835004 (diff) |
sprint2.cpp: added dip locations [Guru]
-rw-r--r-- | src/mame/audio/sprint2.cpp | 56 | ||||
-rw-r--r-- | src/mame/drivers/sprint2.cpp | 286 | ||||
-rw-r--r-- | src/mame/includes/sprint2.h | 86 | ||||
-rw-r--r-- | src/mame/video/sprint2.cpp | 90 |
4 files changed, 247 insertions, 271 deletions
diff --git a/src/mame/audio/sprint2.cpp b/src/mame/audio/sprint2.cpp index b5cff7b1946..068143070c6 100644 --- a/src/mame/audio/sprint2.cpp +++ b/src/mame/audio/sprint2.cpp @@ -2,7 +2,7 @@ // copyright-holders:Hans Andersson /************************************************************************* - audio\sprint2.c + audio\sprint2.cpp *************************************************************************/ #include "emu.h" @@ -17,16 +17,16 @@ static const discrete_lfsr_desc sprint2_lfsr = { DISC_CLK_IS_FREQ, - 16, /* Bit Length */ - 0, /* Reset Value */ - 0, /* Use Bit 0 as XOR input 0 */ - 14, /* Use Bit 14 as XOR input 1 */ - DISC_LFSR_XNOR, /* Feedback stage1 is XNOR */ - DISC_LFSR_OR, /* Feedback stage2 is just stage 1 output OR with external feed */ - DISC_LFSR_REPLACE, /* Feedback stage3 replaces the shifted register contents */ - 0x000001, /* Everything is shifted into the first bit only */ - 0, /* Output is not inverted */ - 15 /* Output bit */ + 16, // Bit Length + 0, // Reset Value + 0, // Use Bit 0 as XOR input 0 + 14, // Use Bit 14 as XOR input 1 + DISC_LFSR_XNOR, // Feedback stage1 is XNOR + DISC_LFSR_OR, // Feedback stage2 is just stage 1 output OR with external feed + DISC_LFSR_REPLACE, // Feedback stage3 replaces the shifted register contents + 0x000001, // Everything is shifted into the first bit only + 0, // Output is not inverted + 15 // Output bit }; static const discrete_dac_r1_ladder sprint2_motor_v_dac = @@ -90,7 +90,7 @@ static const discrete_mixer_desc sprint2_mixer = 30000 // final gain }; -/* Nodes - Sounds */ +// Nodes - Sounds #define SPRINT2_MOTORSND1 NODE_10 #define SPRINT2_MOTORSND2 NODE_11 #define SPRINT2_CRASHSND NODE_12 @@ -118,7 +118,7 @@ DISCRETE_SOUND_START(sprint2_discrete) /************************************************/ /* Motor sound circuit is based on a 556 VCO */ /* with the input frequency set by the MotorSND */ - /* latch (4 bit). This freqency is then used to */ + /* latch (4 bit). This frequency is then used to*/ /* drive three counters, that are summed up */ /* and are output through a DAC */ /************************************************/ @@ -140,18 +140,18 @@ DISCRETE_SOUND_START(sprint2_discrete) RES_M(3.3), 0, 0, // R22 &sprint2_motor_vco) - /* QB-D of 7492 */ + // QB-D of 7492 DISCRETE_COUNTER_7492(NODE_23, 1, SPRINT2_ATTRACT_EN, NODE_22, DISC_CLK_ON_F_EDGE) - /* Mask the bits and XOR for clock input */ + // Mask the bits and XOR for clock input DISCRETE_TRANSFORM2(NODE_24, NODE_23, 1, "01&") DISCRETE_TRANSFORM2(NODE_25, NODE_23, 4, "01&") DISCRETE_LOGIC_XOR(NODE_26, NODE_24, NODE_25) - /* QA of 7492 */ + // QA of 7492 DISCRETE_COUNTER(NODE_27, 1, SPRINT2_ATTRACT_EN, NODE_26, 0, 1, 1, 0, DISC_CLK_ON_F_EDGE) - /* Mix QA and QB-D together */ + // Mix QA and QB-D together DISCRETE_TRANSFORM3(NODE_28, NODE_23, 2, NODE_27, "01*2+") DISCRETE_DAC_R1(SPRINT2_MOTORSND1, NODE_28, @@ -178,18 +178,18 @@ DISCRETE_SOUND_START(sprint2_discrete) RES_M(3.3), 0, 0, &sprint2_motor_vco) - /* QB-D of 7492 */ + // QB-D of 7492 DISCRETE_COUNTER_7492(NODE_43, 1, SPRINT2_ATTRACT_EN, NODE_42, DISC_CLK_ON_F_EDGE) - /* Mask the bits and XOR for clock input */ + // Mask the bits and XOR for clock input DISCRETE_TRANSFORM2(NODE_44, NODE_43, 1, "01&") DISCRETE_TRANSFORM2(NODE_45, NODE_43, 4, "01&") DISCRETE_LOGIC_XOR(NODE_46, NODE_44, NODE_45) - /* QA of 7492 */ + // QA of 7492 DISCRETE_COUNTER(NODE_47, 1, SPRINT2_ATTRACT_EN, NODE_46, 0, 1, 1, 0, DISC_CLK_ON_F_EDGE) - /* Mix QA and QB-D together */ + // Mix QA and QB-D together DISCRETE_TRANSFORM3(NODE_48, NODE_43, 2, NODE_47, "01*2+") DISCRETE_DAC_R1(SPRINT2_MOTORSND2, NODE_48, @@ -241,7 +241,7 @@ DISCRETE_SOUND_START(sprint1_discrete) /************************************************/ /* Motor sound circuit is based on a 556 VCO */ /* with the input frequency set by the MotorSND */ - /* latch (4 bit). This freqency is then used to */ + /* latch (4 bit). This frequency is then used to*/ /* drive three counters, that are summed up */ /* and are output through a DAC */ /************************************************/ @@ -263,18 +263,18 @@ DISCRETE_SOUND_START(sprint1_discrete) RES_M(3.3), 0, 0, // R22 &sprint2_motor_vco) - /* QB-D of 7492 */ + // QB-D of 7492 DISCRETE_COUNTER_7492(NODE_23, 1, SPRINT2_ATTRACT_EN, NODE_22, DISC_CLK_ON_F_EDGE) - /* Mask the bits and XOR for clock input */ + // Mask the bits and XOR for clock input DISCRETE_TRANSFORM2(NODE_24, NODE_23, 1, "01&") DISCRETE_TRANSFORM2(NODE_25, NODE_23, 4, "01&") DISCRETE_LOGIC_XOR(NODE_26, NODE_24, NODE_25) - /* QA of 7492 */ + // QA of 7492 DISCRETE_COUNTER(NODE_27, 1, SPRINT2_ATTRACT_EN, NODE_26, 0, 1, 1, 0, DISC_CLK_ON_F_EDGE) - /* Mix QA and QB-D together */ + // Mix QA and QB-D together DISCRETE_TRANSFORM3(NODE_28, NODE_23, 2, NODE_27, "01*2+") DISCRETE_DAC_R1(SPRINT2_MOTORSND1, NODE_28, @@ -355,10 +355,10 @@ static const discrete_mixer_desc dominos_mixer = 40000 // final gain }; -/* Nodes - Sounds */ +// Nodes - Sounds #define DOMINOS_TONE_SND NODE_10 #define DOMINOS_TOPPLE_SND NODE_11 -/* Nodes - Adjusters */ +// Nodes - Adjusters #define DOMINOS_R23 NODE_15 DISCRETE_SOUND_START(dominos_discrete) diff --git a/src/mame/drivers/sprint2.cpp b/src/mame/drivers/sprint2.cpp index 85bfeaae94a..874804aa4bb 100644 --- a/src/mame/drivers/sprint2.cpp +++ b/src/mame/drivers/sprint2.cpp @@ -30,6 +30,18 @@ #define MACHINE_IS_SPRINT2 (m_game == 2) #define MACHINE_IS_DOMINOS (m_game == 3) + +void sprint2_state::machine_start() +{ + m_gear_sel.resolve(); + + save_item(NAME(m_steering)); + save_item(NAME(m_gear)); + save_item(NAME(m_dial)); + save_item(NAME(m_collision)); +} + + void sprint2_state::init_sprint1() { m_game = 1; @@ -49,9 +61,9 @@ void sprint2_state::init_dominos4() m_maincpu->space(AS_PROGRAM).install_read_port(0x0880, 0x0880, "SELFTTEST"); } -int sprint2_state::service_mode() +uint8_t sprint2_state::service_mode() { - uint8_t v = ioport("INB")->read(); + uint8_t v = m_in[1]->read(); if (MACHINE_IS_SPRINT1) { @@ -70,17 +82,15 @@ int sprint2_state::service_mode() } -INTERRUPT_GEN_MEMBER(sprint2_state::sprint2_irq) +INTERRUPT_GEN_MEMBER(sprint2_state::irq) { - /* handle steering wheels */ + // handle steering wheels if (MACHINE_IS_SPRINT1 || MACHINE_IS_SPRINT2) { - int i; - - for (i = 0; i < 2; i++) + for (int i = 0; i < 2; i++) { - signed char delta = ioport(i ? "DIAL_P2" : "DIAL_P1")->read() - m_dial[i]; + signed char delta = m_dials[i]->read() - m_dial[i]; if (delta < 0) { @@ -93,15 +103,15 @@ INTERRUPT_GEN_MEMBER(sprint2_state::sprint2_irq) m_dial[i] += delta; - switch (ioport(i ? "GEAR_P2" : "GEAR_P1")->read() & 15) + switch (m_gears[i]->read() & 15) { case 1: m_gear[i] = 1; break; case 2: m_gear[i] = 2; break; case 4: m_gear[i] = 3; break; case 8: m_gear[i] = 4; break; } - output().set_value("P1gear", m_gear[0]); - output().set_value("P2gear", m_gear[1]); + m_gear_sel[0] = m_gear[0]; + m_gear_sel[1] = m_gear[1]; } } @@ -109,7 +119,7 @@ INTERRUPT_GEN_MEMBER(sprint2_state::sprint2_irq) m_discrete->write(SPRINT2_MOTORSND2_DATA, m_video_ram[0x395] & 15); m_discrete->write(SPRINT2_CRASHSND_DATA, m_video_ram[0x396] & 15); // also DOMINOS_AMP_DATA - /* interrupts and watchdog are disabled during service mode */ + // interrupts and watchdog are disabled during service mode m_watchdog->watchdog_enable(!service_mode()); @@ -118,21 +128,21 @@ INTERRUPT_GEN_MEMBER(sprint2_state::sprint2_irq) } -uint8_t sprint2_state::sprint2_wram_r(offs_t offset) +uint8_t sprint2_state::wram_r(offs_t offset) { return m_video_ram[0x380 + offset % 0x80]; } -uint8_t sprint2_state::sprint2_dip_r(offs_t offset) +uint8_t sprint2_state::dip_r(offs_t offset) { - return (ioport("DSW")->read() << (2 * ((offset & 3) ^ 3))) & 0xc0; + return (m_dsw->read() << (2 * ((offset & 3) ^ 3))) & 0xc0; } -uint8_t sprint2_state::sprint2_input_A_r(offs_t offset) +uint8_t sprint2_state::input_A_r(offs_t offset) { - uint8_t val = ioport("INA")->read(); + uint8_t val = m_in[0]->read(); if (m_game == 2)// (MACHINE_IS_SPRINT2) { @@ -148,9 +158,9 @@ uint8_t sprint2_state::sprint2_input_A_r(offs_t offset) } -uint8_t sprint2_state::sprint2_input_B_r(offs_t offset) +uint8_t sprint2_state::input_B_r(offs_t offset) { - uint8_t val = ioport("INB")->read(); + uint8_t val = m_in[1]->read(); if (m_game == 1) // (MACHINE_IS_SPRINT1) { @@ -163,7 +173,7 @@ uint8_t sprint2_state::sprint2_input_B_r(offs_t offset) } -uint8_t sprint2_state::sprint2_sync_r() +uint8_t sprint2_state::sync_r() { uint8_t val = 0; @@ -171,39 +181,33 @@ uint8_t sprint2_state::sprint2_sync_r() val |= 0x10; if (m_screen->vpos() == 261) - val |= 0x20; /* VRESET */ + val |= 0x20; // VRESET if (m_screen->vpos() >= 224) - val |= 0x40; /* VBLANK */ + val |= 0x40; // VBLANK if (m_screen->vpos() >= 131) - val |= 0x80; /* 60 Hz? */ + val |= 0x80; // 60 Hz? return val; } -uint8_t sprint2_state::sprint2_steering1_r() -{ - return m_steering[0]; -} -uint8_t sprint2_state::sprint2_steering2_r() +template <uint8_t Which> +uint8_t sprint2_state::steering_r() { - return m_steering[1]; + return m_steering[Which]; } -void sprint2_state::sprint2_steering_reset1_w(uint8_t data) +template <uint8_t Which> +void sprint2_state::steering_reset_w(uint8_t data) { - m_steering[0] |= 0x80; -} -void sprint2_state::sprint2_steering_reset2_w(uint8_t data) -{ - m_steering[1] |= 0x80; + m_steering[Which] |= 0x80; } -void sprint2_state::sprint2_wram_w(offs_t offset, uint8_t data) +void sprint2_state::wram_w(offs_t offset, uint8_t data) { m_video_ram[0x380 + offset % 0x80] = data; } @@ -215,72 +219,72 @@ void sprint2_state::output_latch_w(offs_t offset, uint8_t data) } -void sprint2_state::sprint2_noise_reset_w(uint8_t data) +void sprint2_state::noise_reset_w(uint8_t data) { m_discrete->write(SPRINT2_NOISE_RESET, 0); } -void sprint2_state::sprint2_map(address_map &map) +void sprint2_state::main_map(address_map &map) { map.global_mask(0x3fff); - map(0x0000, 0x03ff).rw(FUNC(sprint2_state::sprint2_wram_r), FUNC(sprint2_state::sprint2_wram_w)); - map(0x0400, 0x07ff).ram().w(FUNC(sprint2_state::sprint2_video_ram_w)).share("video_ram"); - map(0x0818, 0x081f).r(FUNC(sprint2_state::sprint2_input_A_r)); - map(0x0828, 0x082f).r(FUNC(sprint2_state::sprint2_input_B_r)); - map(0x0830, 0x0837).r(FUNC(sprint2_state::sprint2_dip_r)); + map(0x0000, 0x03ff).rw(FUNC(sprint2_state::wram_r), FUNC(sprint2_state::wram_w)); + map(0x0400, 0x07ff).ram().w(FUNC(sprint2_state::video_ram_w)).share(m_video_ram); + map(0x0818, 0x081f).r(FUNC(sprint2_state::input_A_r)); + map(0x0828, 0x082f).r(FUNC(sprint2_state::input_B_r)); + map(0x0830, 0x0837).r(FUNC(sprint2_state::dip_r)); map(0x0840, 0x087f).portr("COIN"); - map(0x0880, 0x08bf).r(FUNC(sprint2_state::sprint2_steering1_r)); - map(0x08c0, 0x08ff).r(FUNC(sprint2_state::sprint2_steering2_r)); - map(0x0c00, 0x0fff).r(FUNC(sprint2_state::sprint2_sync_r)); + map(0x0880, 0x08bf).r(FUNC(sprint2_state::steering_r<0>)); + map(0x08c0, 0x08ff).r(FUNC(sprint2_state::steering_r<1>)); + map(0x0c00, 0x0fff).r(FUNC(sprint2_state::sync_r)); map(0x0c00, 0x0c7f).w(FUNC(sprint2_state::output_latch_w)); map(0x0c80, 0x0cff).w(m_watchdog, FUNC(watchdog_timer_device::reset_w)); - map(0x0d00, 0x0d7f).w(FUNC(sprint2_state::sprint2_collision_reset1_w)); - map(0x0d80, 0x0dff).w(FUNC(sprint2_state::sprint2_collision_reset2_w)); - map(0x0e00, 0x0e7f).w(FUNC(sprint2_state::sprint2_steering_reset1_w)); - map(0x0e80, 0x0eff).w(FUNC(sprint2_state::sprint2_steering_reset2_w)); - map(0x0f00, 0x0f7f).w(FUNC(sprint2_state::sprint2_noise_reset_w)); - map(0x1000, 0x13ff).r(FUNC(sprint2_state::sprint2_collision1_r)); - map(0x1400, 0x17ff).r(FUNC(sprint2_state::sprint2_collision2_r)); - map(0x1800, 0x1800).nopr(); /* debugger ROM location? */ + map(0x0d00, 0x0d7f).lw8(NAME([this] (uint8_t data) { m_collision[0] = 0; })); + map(0x0d80, 0x0dff).lw8(NAME([this] (uint8_t data) { m_collision[1] = 0; })); + map(0x0e00, 0x0e7f).w(FUNC(sprint2_state::steering_reset_w<0>)); + map(0x0e80, 0x0eff).w(FUNC(sprint2_state::steering_reset_w<1>)); + map(0x0f00, 0x0f7f).w(FUNC(sprint2_state::noise_reset_w)); + map(0x1000, 0x13ff).lr8(NAME([this] () -> uint8_t { return m_collision[0]; })); + map(0x1400, 0x17ff).lr8(NAME([this] () -> uint8_t { return m_collision[1]; })); + map(0x1800, 0x1800).nopr(); // debugger ROM location? map(0x2000, 0x3fff).rom(); } static INPUT_PORTS_START( sprint2 ) PORT_START("DSW") - PORT_DIPNAME( 0x01, 0x00, "Tracks on Demo" ) + PORT_DIPNAME( 0x01, 0x00, "Tracks on Demo" ) PORT_DIPLOCATION("SW1:1") PORT_DIPSETTING( 0x00, "Easy Track Only" ) PORT_DIPSETTING( 0x01, "Cycle 12 Tracks" ) - PORT_DIPNAME( 0x02, 0x00, "Oil Slicks" ) + PORT_DIPNAME( 0x02, 0x00, "Oil Slicks" ) PORT_DIPLOCATION("SW1:2") PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) ) + PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:3,4") PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x0c, DEF_STR( Free_Play ) ) - PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused) ) + PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused) ) PORT_DIPLOCATION("SW1:5") PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, "Extended Play" ) + PORT_DIPNAME( 0x20, 0x00, "Extended Play" ) PORT_DIPLOCATION("SW1:6") PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0xc0, 0x00, "Play Time" ) + PORT_DIPNAME( 0xc0, 0x00, "Play Time" ) PORT_DIPLOCATION("SW1:7,8") PORT_DIPSETTING( 0xc0, "60 seconds" ) PORT_DIPSETTING( 0x80, "90 seconds" ) PORT_DIPSETTING( 0x40, "120 seconds" ) PORT_DIPSETTING( 0x00, "150 seconds" ) - PORT_START("INA") /* input A */ - PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_UNUSED ) /* P1 1st gear */ - PORT_BIT (0x02, IP_ACTIVE_LOW, IPT_UNUSED ) /* P2 1st gear */ - PORT_BIT (0x04, IP_ACTIVE_LOW, IPT_UNUSED ) /* P1 2nd gear */ - PORT_BIT (0x08, IP_ACTIVE_LOW, IPT_UNUSED ) /* P2 2nd gear */ - PORT_BIT (0x10, IP_ACTIVE_LOW, IPT_UNUSED ) /* P1 3rd gear */ - PORT_BIT (0x20, IP_ACTIVE_LOW, IPT_UNUSED ) /* P2 3rd gear */ + PORT_START("INA") // input A + PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_UNUSED ) // P1 1st gear + PORT_BIT (0x02, IP_ACTIVE_LOW, IPT_UNUSED ) // P2 1st gear + PORT_BIT (0x04, IP_ACTIVE_LOW, IPT_UNUSED ) // P1 2nd gear + PORT_BIT (0x08, IP_ACTIVE_LOW, IPT_UNUSED ) // P2 2nd gear + PORT_BIT (0x10, IP_ACTIVE_LOW, IPT_UNUSED ) // P1 3rd gear + PORT_BIT (0x20, IP_ACTIVE_LOW, IPT_UNUSED ) // P2 3rd gear - PORT_START("INB") /* input B */ + PORT_START("INB") // input B PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Player 1 Gas") PORT_PLAYER(1) PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Player 2 Gas") PORT_PLAYER(2) PORT_SERVICE( 0x04, IP_ACTIVE_LOW ) @@ -319,37 +323,37 @@ static INPUT_PORTS_START( sprint2 ) INPUT_PORTS_END -static INPUT_PORTS_START( sprint1 ) + static INPUT_PORTS_START( sprint1 ) PORT_START("DSW") - PORT_DIPNAME( 0x01, 0x00, "Change Track" ) + PORT_DIPNAME( 0x01, 0x00, "Change Track" ) PORT_DIPLOCATION("SW1:1") PORT_DIPSETTING( 0x01, "Every Lap" ) PORT_DIPSETTING( 0x00, "Every 2 Laps" ) - PORT_DIPNAME( 0x02, 0x00, "Oil Slicks" ) + PORT_DIPNAME( 0x02, 0x00, "Oil Slicks" ) PORT_DIPLOCATION("SW1:2") PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) ) + PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:3,4") PORT_DIPSETTING( 0x08, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x00, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x04, DEF_STR( 1C_2C ) ) PORT_DIPSETTING( 0x0c, DEF_STR( Free_Play ) ) - PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused) ) + PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused) ) PORT_DIPLOCATION("SW1:5") PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x00, "Extended Play" ) + PORT_DIPNAME( 0x20, 0x00, "Extended Play" ) PORT_DIPLOCATION("SW1:6") PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0xc0, 0x00, "Play Time" ) + PORT_DIPNAME( 0xc0, 0x00, "Play Time" ) PORT_DIPLOCATION("SW1:7,8") PORT_DIPSETTING( 0xc0, "60 seconds" ) PORT_DIPSETTING( 0x80, "90 seconds" ) PORT_DIPSETTING( 0x40, "120 seconds" ) PORT_DIPSETTING( 0x00, "150 seconds" ) - PORT_START("INA") /* input A */ + PORT_START("INA") // input A - PORT_START("INB") /* input B */ - PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) /* 1st gear */ - PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) /* 2nd gear */ - PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) /* 3rd gear */ + PORT_START("INB") // input B + PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) // 1st gear + PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) // 2nd gear + PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) // 3rd gear PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_NAME("Gas") PORT_SERVICE( 0x10, IP_ACTIVE_LOW ) PORT_BIT ( 0x20, IP_ACTIVE_LOW, IPT_START1 ) @@ -378,35 +382,35 @@ INPUT_PORTS_END static INPUT_PORTS_START( dominos ) PORT_START("DSW") - PORT_DIPNAME( 0x03, 0x01, "Points to Win" ) + PORT_DIPNAME( 0x03, 0x01, "Points to Win" ) PORT_DIPLOCATION("SW1:1,2") PORT_DIPSETTING( 0x03, "6" ) PORT_DIPSETTING( 0x02, "5" ) PORT_DIPSETTING( 0x01, "4" ) PORT_DIPSETTING( 0x00, "3" ) - PORT_DIPNAME( 0x0C, 0x08, DEF_STR( Coinage ) ) + PORT_DIPNAME( 0x0C, 0x08, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:3,4") PORT_DIPSETTING( 0x04, DEF_STR( 2C_1C ) ) PORT_DIPSETTING( 0x08, DEF_STR( 1C_1C ) ) PORT_DIPSETTING( 0x0c, DEF_STR( 1C_2C ) ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x10, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:5") // Manual says "Always on" for dips 5-8 PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x20, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:6") PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x40, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) + PORT_DIPNAME( 0x80, 0x00, DEF_STR( Unused ) ) PORT_DIPLOCATION("SW1:8") PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - PORT_START("INA") /* input A */ + PORT_START("INA") // input A PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(2) PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(2) PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(2) PORT_BIT ( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2) - PORT_START("INB") /* input B */ + PORT_START("INB") // input B PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(1) PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(1) PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(1) @@ -426,7 +430,7 @@ INPUT_PORTS_END static INPUT_PORTS_START( dominos4 ) PORT_INCLUDE(dominos) - PORT_MODIFY("INA") /* input A */ + PORT_MODIFY("INA") // input A PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(1) PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(1) PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(1) @@ -436,7 +440,7 @@ static INPUT_PORTS_START( dominos4 ) PORT_BIT ( 0x40, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(2) PORT_BIT ( 0x80, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_4WAY PORT_PLAYER(2) - PORT_MODIFY("INB") /* input A */ + PORT_MODIFY("INB") // input B PORT_BIT ( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_4WAY PORT_PLAYER(3) PORT_BIT ( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_4WAY PORT_PLAYER(3) PORT_BIT ( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_4WAY PORT_PLAYER(3) @@ -484,31 +488,31 @@ static const gfx_layout car_layout = static GFXDECODE_START( gfx_sprint2 ) - GFXDECODE_ENTRY( "gfx1", 0, tile_layout, 0, 2 ) - GFXDECODE_ENTRY( "gfx2", 0, car_layout, 4, 4 ) + GFXDECODE_ENTRY( "tiles", 0, tile_layout, 0, 2 ) + GFXDECODE_ENTRY( "sprites", 0, car_layout, 4, 4 ) GFXDECODE_END void sprint2_state::sprint2(machine_config &config) { - /* basic machine hardware */ + // basic machine hardware M6502(config, m_maincpu, 12.096_MHz_XTAL / 16); - m_maincpu->set_addrmap(AS_PROGRAM, &sprint2_state::sprint2_map); - m_maincpu->set_vblank_int("screen", FUNC(sprint2_state::sprint2_irq)); + m_maincpu->set_addrmap(AS_PROGRAM, &sprint2_state::main_map); + m_maincpu->set_vblank_int("screen", FUNC(sprint2_state::irq)); WATCHDOG_TIMER(config, m_watchdog).set_vblank_count(m_screen, 8); - /* video hardware */ + // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_raw(12.096_MHz_XTAL, 768, 0, 512, 262, 0, 224); - m_screen->set_screen_update(FUNC(sprint2_state::screen_update_sprint2)); - m_screen->screen_vblank().set(FUNC(sprint2_state::screen_vblank_sprint2)); + m_screen->set_screen_update(FUNC(sprint2_state::screen_update)); + m_screen->screen_vblank().set(FUNC(sprint2_state::screen_vblank)); m_screen->set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_sprint2); - PALETTE(config, m_palette, FUNC(sprint2_state::sprint2_palette), 12, 4); + PALETTE(config, m_palette, FUNC(sprint2_state::palette), 12, 4); - /* sound hardware */ + // sound hardware SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); @@ -518,7 +522,7 @@ void sprint2_state::sprint2(machine_config &config) m_outlatch->q_out_cb<2>().set("discrete", FUNC(discrete_device::write_line<SPRINT2_SKIDSND2_EN>)); m_outlatch->q_out_cb<3>().set_output("led0"); // START LAMP1 m_outlatch->q_out_cb<4>().set_output("led1"); // START LAMP2 - //m_outlatch->q_out_cb<6>().set(FUNC(sprint2_state::sprint2_spare_w)); + //m_outlatch->q_out_cb<6>().set(FUNC(sprint2_state::spare_w)); DISCRETE(config, m_discrete, sprint2_discrete); m_discrete->add_route(0, "lspeaker", 1.0); @@ -530,29 +534,21 @@ void sprint2_state::sprint1(machine_config &config) { sprint2(config); - /* sound hardware */ + // sound hardware config.device_remove("lspeaker"); config.device_remove("rspeaker"); SPEAKER(config, "mono").front_center(); - config.device_remove("discrete"); - - DISCRETE(config, m_discrete, sprint1_discrete).add_route(ALL_OUTPUTS, "mono", 1.0); + DISCRETE(config.replace(), m_discrete, sprint1_discrete).add_route(ALL_OUTPUTS, "mono", 1.0); } void sprint2_state::dominos(machine_config &config) { - sprint2(config); - - /* sound hardware */ - config.device_remove("lspeaker"); - config.device_remove("rspeaker"); - SPEAKER(config, "mono").front_center(); - - config.device_remove("discrete"); + sprint1(config); - DISCRETE(config, m_discrete, dominos_discrete).add_route(ALL_OUTPUTS, "mono", 1.0); + // sound hardware + DISCRETE(config.replace(), m_discrete, dominos_discrete).add_route(ALL_OUTPUTS, "mono", 1.0); } void sprint2_state::dominos4(machine_config &config) @@ -569,17 +565,17 @@ ROM_START( sprint1 ) ROM_LOAD( "6442-01.d1", 0x3000, 0x0800, CRC(e9ff0124) SHA1(42fe028e2e595573ccc0821de3bb6970364c585d) ) ROM_LOAD( "6443-01.e1", 0x3800, 0x0800, CRC(d6bb00d0) SHA1(cdcd4bb7b32be7a11480d3312fcd8d536e2d0caf) ) - ROM_REGION( 0x0200, "gfx1", 0 ) /* tiles */ + ROM_REGION( 0x0200, "tiles", 0 ) ROM_LOAD_NIB_HIGH( "6396-01.p4", 0x0000, 0x0200, CRC(801b42dd) SHA1(1db58390d803f404253cbf36d562016441ca568d) ) ROM_LOAD_NIB_LOW ( "6397-01.r4", 0x0000, 0x0200, CRC(135ba1aa) SHA1(0465259440f73e1a2c8d8101f29e99b4885420e4) ) - ROM_REGION( 0x0200, "gfx2", 0 ) /* cars */ + ROM_REGION( 0x0200, "sprites", 0 ) // cars ROM_LOAD_NIB_HIGH( "6399-01.j6", 0x0000, 0x0200, CRC(63d685b2) SHA1(608746163e25dbc14cde43c17aecbb9a14fac875) ) ROM_LOAD_NIB_LOW ( "6398-01.k6", 0x0000, 0x0200, CRC(c9e1017e) SHA1(e7279a13e4a812d2e0218be0bc5162f2e56c6b66) ) ROM_REGION( 0x0120, "proms", 0 ) - ROM_LOAD( "6400-01.m2", 0x0000, 0x0100, CRC(b8094b4c) SHA1(82dc6799a19984f3b204ee3aeeb007e55afc8be3) ) /* SYNC */ - ROM_LOAD( "6401-01.e2", 0x0100, 0x0020, CRC(857df8db) SHA1(06313d5bde03220b2bc313d18e50e4bb1d0cfbbb) ) /* address */ + ROM_LOAD( "6400-01.m2", 0x0000, 0x0100, CRC(b8094b4c) SHA1(82dc6799a19984f3b204ee3aeeb007e55afc8be3) ) // SYNC + ROM_LOAD( "6401-01.e2", 0x0100, 0x0020, CRC(857df8db) SHA1(06313d5bde03220b2bc313d18e50e4bb1d0cfbbb) ) // address ROM_END @@ -590,17 +586,17 @@ ROM_START( sprint2 ) ROM_LOAD( "6404.d1", 0x3000, 0x0800, CRC(d2878ff6) SHA1(b742a8896c1bf1cfacf48d06908920d88a2c9ea8) ) ROM_LOAD( "6405.e1", 0x3800, 0x0800, CRC(6c991c80) SHA1(c30a5b340f05dd702c7a186eb62607a48fa19f72) ) - ROM_REGION( 0x0200, "gfx1", 0 ) /* tiles */ + ROM_REGION( 0x0200, "tiles", 0 ) ROM_LOAD_NIB_HIGH( "6396-01.p4", 0x0000, 0x0200, CRC(801b42dd) SHA1(1db58390d803f404253cbf36d562016441ca568d) ) ROM_LOAD_NIB_LOW ( "6397-01.r4", 0x0000, 0x0200, CRC(135ba1aa) SHA1(0465259440f73e1a2c8d8101f29e99b4885420e4) ) - ROM_REGION( 0x0200, "gfx2", 0 ) /* cars */ + ROM_REGION( 0x0200, "sprites", 0 ) // cars ROM_LOAD_NIB_HIGH( "6399-01.j6", 0x0000, 0x0200, CRC(63d685b2) SHA1(608746163e25dbc14cde43c17aecbb9a14fac875) ) ROM_LOAD_NIB_LOW ( "6398-01.k6", 0x0000, 0x0200, CRC(c9e1017e) SHA1(e7279a13e4a812d2e0218be0bc5162f2e56c6b66) ) ROM_REGION( 0x0120, "proms", 0 ) - ROM_LOAD( "6400-01.m2", 0x0000, 0x0100, CRC(b8094b4c) SHA1(82dc6799a19984f3b204ee3aeeb007e55afc8be3) ) /* SYNC */ - ROM_LOAD( "6401-01.e2", 0x0100, 0x0020, CRC(857df8db) SHA1(06313d5bde03220b2bc313d18e50e4bb1d0cfbbb) ) /* address */ + ROM_LOAD( "6400-01.m2", 0x0000, 0x0100, CRC(b8094b4c) SHA1(82dc6799a19984f3b204ee3aeeb007e55afc8be3) ) // SYNC + ROM_LOAD( "6401-01.e2", 0x0100, 0x0020, CRC(857df8db) SHA1(06313d5bde03220b2bc313d18e50e4bb1d0cfbbb) ) // address ROM_END @@ -611,17 +607,17 @@ ROM_START( sprint2a ) ROM_LOAD( "6404.d1", 0x3000, 0x0800, CRC(d2878ff6) SHA1(b742a8896c1bf1cfacf48d06908920d88a2c9ea8) ) ROM_LOAD( "6405-02.e1", 0x3800, 0x0800, CRC(e80fd249) SHA1(7bcf7dfd72ca83fdd80593eaf392570da1f71298) ) // sldh - ROM_REGION( 0x0200, "gfx1", 0 ) /* tiles */ + ROM_REGION( 0x0200, "tiles", 0 ) ROM_LOAD_NIB_HIGH( "6396-01.p4", 0x0000, 0x0200, CRC(801b42dd) SHA1(1db58390d803f404253cbf36d562016441ca568d) ) ROM_LOAD_NIB_LOW ( "6397-01.r4", 0x0000, 0x0200, CRC(135ba1aa) SHA1(0465259440f73e1a2c8d8101f29e99b4885420e4) ) - ROM_REGION( 0x0200, "gfx2", 0 ) /* cars */ + ROM_REGION( 0x0200, "sprites", 0 ) // cars ROM_LOAD_NIB_HIGH( "6399-01.j6", 0x0000, 0x0200, CRC(63d685b2) SHA1(608746163e25dbc14cde43c17aecbb9a14fac875) ) ROM_LOAD_NIB_LOW ( "6398-01.k6", 0x0000, 0x0200, CRC(c9e1017e) SHA1(e7279a13e4a812d2e0218be0bc5162f2e56c6b66) ) ROM_REGION( 0x0120, "proms", 0 ) - ROM_LOAD( "6400-01.m2", 0x0000, 0x0100, CRC(b8094b4c) SHA1(82dc6799a19984f3b204ee3aeeb007e55afc8be3) ) /* SYNC */ - ROM_LOAD( "6401-01.e2", 0x0100, 0x0020, CRC(857df8db) SHA1(06313d5bde03220b2bc313d18e50e4bb1d0cfbbb) ) /* address */ + ROM_LOAD( "6400-01.m2", 0x0000, 0x0100, CRC(b8094b4c) SHA1(82dc6799a19984f3b204ee3aeeb007e55afc8be3) ) // SYNC + ROM_LOAD( "6401-01.e2", 0x0100, 0x0020, CRC(857df8db) SHA1(06313d5bde03220b2bc313d18e50e4bb1d0cfbbb) ) // address ROM_END @@ -632,17 +628,17 @@ ROM_START( sprint2h ) ROM_LOAD( "6404.d1", 0x3000, 0x0800, CRC(d2878ff6) SHA1(b742a8896c1bf1cfacf48d06908920d88a2c9ea8) ) ROM_LOAD( "6405-02.e1", 0x3800, 0x0800, CRC(6de291f1) SHA1(00c2826011d80ac0784649a7bc156a97c26565fd) ) // sldh - ROM_REGION( 0x0200, "gfx1", 0 ) /* tiles */ + ROM_REGION( 0x0200, "tiles", 0 ) ROM_LOAD_NIB_HIGH( "6396-01.p4", 0x0000, 0x0200, CRC(801b42dd) SHA1(1db58390d803f404253cbf36d562016441ca568d) ) ROM_LOAD_NIB_LOW ( "6397-01.r4", 0x0000, 0x0200, CRC(135ba1aa) SHA1(0465259440f73e1a2c8d8101f29e99b4885420e4) ) - ROM_REGION( 0x0200, "gfx2", 0 ) /* cars */ + ROM_REGION( 0x0200, "sprites", 0 ) // cars ROM_LOAD_NIB_HIGH( "6399-01.j6", 0x0000, 0x0200, CRC(63d685b2) SHA1(608746163e25dbc14cde43c17aecbb9a14fac875) ) ROM_LOAD_NIB_LOW ( "6398-01.k6", 0x0000, 0x0200, CRC(c9e1017e) SHA1(e7279a13e4a812d2e0218be0bc5162f2e56c6b66) ) ROM_REGION( 0x0120, "proms", 0 ) - ROM_LOAD( "6400-01.m2", 0x0000, 0x0100, CRC(b8094b4c) SHA1(82dc6799a19984f3b204ee3aeeb007e55afc8be3) ) /* SYNC */ - ROM_LOAD( "6401-01.e2", 0x0100, 0x0020, CRC(857df8db) SHA1(06313d5bde03220b2bc313d18e50e4bb1d0cfbbb) ) /* address */ + ROM_LOAD( "6400-01.m2", 0x0000, 0x0100, CRC(b8094b4c) SHA1(82dc6799a19984f3b204ee3aeeb007e55afc8be3) ) // SYNC + ROM_LOAD( "6401-01.e2", 0x0100, 0x0020, CRC(857df8db) SHA1(06313d5bde03220b2bc313d18e50e4bb1d0cfbbb) ) // address ROM_END @@ -651,16 +647,15 @@ ROM_START( dominos ) ROM_LOAD( "7352-02.d1", 0x3000, 0x0800, CRC(738b4413) SHA1(3a90ab25bb5f65504692f97da43f03e21392dcd8) ) ROM_LOAD( "7438-02.e1", 0x3800, 0x0800, CRC(c84e54e2) SHA1(383b388a1448a195f28352fc5e4ff1a2af80cc95) ) - ROM_REGION( 0x200, "gfx1", 0 ) /* tiles */ + ROM_REGION( 0x200, "tiles", 0 ) ROM_LOAD_NIB_HIGH( "7439-01.p4", 0x0000, 0x0200, CRC(4f42fdd6) SHA1(f8ea4b582e26cad37b746174cdc9f1c7ae0819c3) ) ROM_LOAD_NIB_LOW ( "7440-01.r4", 0x0000, 0x0200, CRC(957dd8df) SHA1(280457392f40cd66eae34d2fcdbd4d2142793402) ) - ROM_REGION( 0x200, "gfx2", 0 ) /* sprites, not used */ - ROM_FILL( 0x0000, 0x0200, 0x00 ) + ROM_REGION( 0x200, "sprites", ROMREGION_ERASE00 ) // not used ROM_REGION( 0x0120, "proms", 0 ) - ROM_LOAD( "6400-01.m2", 0x0000, 0x0100, CRC(b8094b4c) SHA1(82dc6799a19984f3b204ee3aeeb007e55afc8be3) ) /* SYNC */ - ROM_LOAD( "6401-01.e2", 0x0100, 0x0020, CRC(857df8db) SHA1(06313d5bde03220b2bc313d18e50e4bb1d0cfbbb) ) /* address */ + ROM_LOAD( "6400-01.m2", 0x0000, 0x0100, CRC(b8094b4c) SHA1(82dc6799a19984f3b204ee3aeeb007e55afc8be3) ) // SYNC + ROM_LOAD( "6401-01.e2", 0x0100, 0x0020, CRC(857df8db) SHA1(06313d5bde03220b2bc313d18e50e4bb1d0cfbbb) ) // address ROM_END ROM_START( dominos4 ) // built from original Atari source code @@ -674,21 +669,20 @@ ROM_START( dominos4 ) // built from original Atari source code ROM_LOAD_NIB_HIGH( "007760-01.p1", 0x3c00, 0x0400, CRC(7dc2a7a1) SHA1(9d02572cf689c6476b33226a5358dd1f72c4e61d) ) ROM_LOAD_NIB_LOW ( "007761-01.p0", 0x3c00, 0x0400, CRC(04365e0d) SHA1(fefc3c04e55f1aa8c80b1e5e1e403af8698c3530) ) - ROM_REGION( 0x200, "gfx1", 0 ) /* tiles */ + ROM_REGION( 0x200, "tiles", 0 ) ROM_LOAD_NIB_HIGH( "007764-01.p4", 0x0000, 0x0200, CRC(e4332dc0) SHA1(1f16c5b9f9fd7d478fd729cc79968f17746111f4) ) ROM_LOAD_NIB_LOW ( "007765-01.r4", 0x0000, 0x0200, CRC(6e4e6c75) SHA1(0fc77fecaa73eac57baf778bc51387c75883aad4) ) - ROM_REGION( 0x200, "gfx2", 0 ) /* sprites, not used */ - ROM_FILL( 0x0000, 0x0200, 0x00 ) + ROM_REGION( 0x200, "sprites", ROMREGION_ERASE00 ) // not used ROM_REGION( 0x0120, "proms", 0 ) - ROM_LOAD( "6400-01.m2", 0x0000, 0x0100, CRC(b8094b4c) SHA1(82dc6799a19984f3b204ee3aeeb007e55afc8be3) ) /* SYNC */ - ROM_LOAD( "6401-01.e2", 0x0100, 0x0020, CRC(857df8db) SHA1(06313d5bde03220b2bc313d18e50e4bb1d0cfbbb) ) /* address */ + ROM_LOAD( "6400-01.m2", 0x0000, 0x0100, CRC(b8094b4c) SHA1(82dc6799a19984f3b204ee3aeeb007e55afc8be3) ) // SYNC + ROM_LOAD( "6401-01.e2", 0x0100, 0x0020, CRC(857df8db) SHA1(06313d5bde03220b2bc313d18e50e4bb1d0cfbbb) ) // address ROM_END -GAME( 1978, sprint1, 0, sprint1, sprint1, sprint2_state, init_sprint1, ROT0, "Atari (Kee Games)", "Sprint 1", 0 ) -GAME( 1976, sprint2, sprint1, sprint2, sprint2, sprint2_state, init_sprint2, ROT0, "Atari (Kee Games)", "Sprint 2 (set 1)", 0 ) -GAME( 1976, sprint2a, sprint1, sprint2, sprint2, sprint2_state, init_sprint2, ROT0, "Atari (Kee Games)", "Sprint 2 (set 2)", 0 ) -GAME( 1976, sprint2h, sprint1, sprint2, sprint2, sprint2_state, init_sprint2, ROT0, "hack", "Sprint 2 (color kit, Italy)", MACHINE_WRONG_COLORS ) // Italian hack, supposedly is color instead of b/w? how? -GAME( 1977, dominos, 0, dominos, dominos, sprint2_state, init_dominos, ROT0, "Atari", "Dominos", 0 ) -GAME( 1977, dominos4, dominos, dominos4,dominos4,sprint2_state, init_dominos4,ROT0, "Atari", "Dominos 4 (Cocktail)", 0 ) +GAME( 1978, sprint1, 0, sprint1, sprint1, sprint2_state, init_sprint1, ROT0, "Atari (Kee Games)", "Sprint 1", MACHINE_SUPPORTS_SAVE ) +GAME( 1976, sprint2, sprint1, sprint2, sprint2, sprint2_state, init_sprint2, ROT0, "Atari (Kee Games)", "Sprint 2 (set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1976, sprint2a, sprint1, sprint2, sprint2, sprint2_state, init_sprint2, ROT0, "Atari (Kee Games)", "Sprint 2 (set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1976, sprint2h, sprint1, sprint2, sprint2, sprint2_state, init_sprint2, ROT0, "hack", "Sprint 2 (color kit, Italy)", MACHINE_WRONG_COLORS | MACHINE_SUPPORTS_SAVE ) // Italian hack, supposedly is color instead of b/w? how? +GAME( 1977, dominos, 0, dominos, dominos, sprint2_state, init_dominos, ROT0, "Atari", "Dominos", MACHINE_SUPPORTS_SAVE ) +GAME( 1977, dominos4, dominos, dominos4,dominos4,sprint2_state, init_dominos4,ROT0, "Atari", "Dominos 4 (Cocktail)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/includes/sprint2.h b/src/mame/includes/sprint2.h index 2715ad5651c..52c8f8bfb6a 100644 --- a/src/mame/includes/sprint2.h +++ b/src/mame/includes/sprint2.h @@ -17,7 +17,7 @@ #include "screen.h" #include "tilemap.h" -/* Discrete Sound Input Nodes */ +// Discrete Sound Input Nodes #define SPRINT2_SKIDSND1_EN NODE_01 #define SPRINT2_SKIDSND2_EN NODE_02 #define SPRINT2_MOTORSND1_DATA NODE_03 @@ -44,7 +44,12 @@ public: m_discrete(*this, "discrete"), m_gfxdecode(*this, "gfxdecode"), m_screen(*this, "screen"), - m_palette(*this, "palette") + m_palette(*this, "palette"), + m_in(*this, { "INA", "INB" }), + m_dials(*this, "DIAL_P%u", 1U), + m_gears(*this, "GEAR_P%u", 1U), + m_dsw(*this, "DSW"), + m_gear_sel(*this, "P%ugear", 1U) { } void sprint1(machine_config &config); @@ -57,43 +62,12 @@ public: void init_dominos(); void init_dominos4(); +protected: + virtual void machine_start() override; + virtual void video_start() override; + private: - int m_steering[2]; - int m_gear[2]; - int m_game; - uint8_t m_dial[2]; required_shared_ptr<uint8_t> m_video_ram; - tilemap_t* m_bg_tilemap; - bitmap_ind16 m_helper; - int m_collision[2]; - uint8_t sprint2_wram_r(offs_t offset); - uint8_t sprint2_dip_r(offs_t offset); - uint8_t sprint2_input_A_r(offs_t offset); - uint8_t sprint2_input_B_r(offs_t offset); - uint8_t sprint2_sync_r(); - uint8_t sprint2_steering1_r(); - uint8_t sprint2_steering2_r(); - void sprint2_steering_reset1_w(uint8_t data); - void sprint2_steering_reset2_w(uint8_t data); - void sprint2_wram_w(offs_t offset, uint8_t data); - void output_latch_w(offs_t offset, uint8_t data); - uint8_t sprint2_collision1_r(); - uint8_t sprint2_collision2_r(); - void sprint2_collision_reset1_w(uint8_t data); - void sprint2_collision_reset2_w(uint8_t data); - void sprint2_video_ram_w(offs_t offset, uint8_t data); - void sprint2_noise_reset_w(uint8_t data); - TILE_GET_INFO_MEMBER(get_tile_info); - virtual void video_start() override; - void sprint2_palette(palette_device &palette) const; - uint32_t screen_update_sprint2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - DECLARE_WRITE_LINE_MEMBER(screen_vblank_sprint2); - INTERRUPT_GEN_MEMBER(sprint2_irq); - uint8_t collision_check(rectangle& rect); - inline int get_sprite_code(uint8_t *video_ram, int n); - inline int get_sprite_x(uint8_t *video_ram, int n); - inline int get_sprite_y(uint8_t *video_ram, int n); - int service_mode(); required_device<cpu_device> m_maincpu; required_device<watchdog_timer_device> m_watchdog; required_device<f9334_device> m_outlatch; @@ -101,11 +75,45 @@ private: required_device<gfxdecode_device> m_gfxdecode; required_device<screen_device> m_screen; required_device<palette_device> m_palette; + required_ioport_array<2> m_in; + optional_ioport_array<2> m_dials, m_gears; + required_ioport m_dsw; + output_finder<2> m_gear_sel; + + uint8_t m_steering[2]; + uint8_t m_gear[2]; + uint8_t m_game; + uint8_t m_dial[2]; + tilemap_t* m_bg_tilemap; + bitmap_ind16 m_helper; + uint8_t m_collision[2]; + + uint8_t wram_r(offs_t offset); + uint8_t dip_r(offs_t offset); + uint8_t input_A_r(offs_t offset); + uint8_t input_B_r(offs_t offset); + uint8_t sync_r(); + template <uint8_t Which> uint8_t steering_r(); + template <uint8_t Which> void steering_reset_w(uint8_t data); + void wram_w(offs_t offset, uint8_t data); + void output_latch_w(offs_t offset, uint8_t data); + void video_ram_w(offs_t offset, uint8_t data); + void noise_reset_w(uint8_t data); + TILE_GET_INFO_MEMBER(get_tile_info); + void palette(palette_device &palette) const; + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + DECLARE_WRITE_LINE_MEMBER(screen_vblank); + INTERRUPT_GEN_MEMBER(irq); + uint8_t collision_check(rectangle& rect); + inline int get_sprite_code(int n); + inline int get_sprite_x(int n); + inline int get_sprite_y(int n); + uint8_t service_mode(); - void sprint2_map(address_map &map); + void main_map(address_map &map); }; -/*----------- defined in audio/sprint2.c -----------*/ +//----------- defined in audio/sprint2.cpp ----------- DISCRETE_SOUND_EXTERN( sprint2_discrete ); DISCRETE_SOUND_EXTERN( sprint1_discrete ); DISCRETE_SOUND_EXTERN( dominos_discrete ); diff --git a/src/mame/video/sprint2.cpp b/src/mame/video/sprint2.cpp index 96e04846aa5..dbcc0a21d2d 100644 --- a/src/mame/video/sprint2.cpp +++ b/src/mame/video/sprint2.cpp @@ -10,7 +10,7 @@ #include "includes/sprint2.h" -void sprint2_state::sprint2_palette(palette_device &palette) const +void sprint2_state::palette(palette_device &palette) const { palette.set_indirect_color(0, rgb_t(0x00, 0x00, 0x00)); palette.set_indirect_color(1, rgb_t(0x5b, 0x5b, 0x5b)); @@ -49,27 +49,7 @@ void sprint2_state::video_start() } -uint8_t sprint2_state::sprint2_collision1_r() -{ - return m_collision[0]; -} -uint8_t sprint2_state::sprint2_collision2_r() -{ - return m_collision[1]; -} - - -void sprint2_state::sprint2_collision_reset1_w(uint8_t data) -{ - m_collision[0] = 0; -} -void sprint2_state::sprint2_collision_reset2_w(uint8_t data) -{ - m_collision[1] = 0; -} - - -void sprint2_state::sprint2_video_ram_w(offs_t offset, uint8_t data) +void sprint2_state::video_ram_w(offs_t offset, uint8_t data) { m_video_ram[offset] = data; m_bg_tilemap->mark_tile_dirty(offset); @@ -96,50 +76,44 @@ uint8_t sprint2_state::collision_check(rectangle& rect) } -inline int sprint2_state::get_sprite_code(uint8_t *video_ram, int n) +inline int sprint2_state::get_sprite_code(int n) { - return video_ram[0x398 + 2 * n + 1] >> 3; + return m_video_ram[0x398 + 2 * n + 1] >> 3; } -inline int sprint2_state::get_sprite_x(uint8_t *video_ram, int n) +inline int sprint2_state::get_sprite_x(int n) { - return 2 * (248 - video_ram[0x390 + 1 * n]); + return 2 * (248 - m_video_ram[0x390 + 1 * n]); } -inline int sprint2_state::get_sprite_y(uint8_t *video_ram, int n) +inline int sprint2_state::get_sprite_y(int n) { - return 1 * (248 - video_ram[0x398 + 2 * n]); + return 1 * (248 - m_video_ram[0x398 + 2 * n]); } -uint32_t sprint2_state::screen_update_sprint2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +uint32_t sprint2_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - uint8_t *video_ram = m_video_ram; - int i; - m_bg_tilemap->draw(*m_screen, bitmap, cliprect, 0, 0); - /* draw the sprites */ + // draw the sprites - for (i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) { m_gfxdecode->gfx(1)->transpen(bitmap,cliprect, - get_sprite_code(video_ram, i), + get_sprite_code(i), i, 0, 0, - get_sprite_x(video_ram, i), - get_sprite_y(video_ram, i), 0); + get_sprite_x(i), + get_sprite_y(i), 0); } return 0; } -WRITE_LINE_MEMBER(sprint2_state::screen_vblank_sprint2) +WRITE_LINE_MEMBER(sprint2_state::screen_vblank) { // rising edge if (state) { - uint8_t *video_ram = m_video_ram; - int i; - int j; const rectangle &visarea = m_screen->visible_area(); /* @@ -150,47 +124,47 @@ WRITE_LINE_MEMBER(sprint2_state::screen_vblank_sprint2) * */ - for (i = 0; i < 2; i++) + for (int i = 0; i < 2; i++) { rectangle rect( - get_sprite_x(video_ram, i), - get_sprite_x(video_ram, i) + m_gfxdecode->gfx(1)->width() - 1, - get_sprite_y(video_ram, i), - get_sprite_y(video_ram, i) + m_gfxdecode->gfx(1)->height() - 1); + get_sprite_x(i), + get_sprite_x(i) + m_gfxdecode->gfx(1)->width() - 1, + get_sprite_y(i), + get_sprite_y(i) + m_gfxdecode->gfx(1)->height() - 1); rect &= visarea; - /* check for sprite-tilemap collisions */ + // check for sprite-tilemap collisions m_bg_tilemap->draw(*m_screen, m_helper, rect, 0, 0); m_gfxdecode->gfx(1)->transpen(m_helper,rect, - get_sprite_code(video_ram, i), + get_sprite_code(i), 0, 0, 0, - get_sprite_x(video_ram, i), - get_sprite_y(video_ram, i), 1); + get_sprite_x(i), + get_sprite_y(i), 1); m_collision[i] |= collision_check(rect); - /* check for sprite-sprite collisions */ + // check for sprite-sprite collisions - for (j = 0; j < 4; j++) + for (int j = 0; j < 4; j++) if (j != i) { m_gfxdecode->gfx(1)->transpen(m_helper,rect, - get_sprite_code(video_ram, j), + get_sprite_code(j), 1, 0, 0, - get_sprite_x(video_ram, j), - get_sprite_y(video_ram, j), 0); + get_sprite_x(j), + get_sprite_y(j), 0); } m_gfxdecode->gfx(1)->transpen(m_helper,rect, - get_sprite_code(video_ram, i), + get_sprite_code(i), 0, 0, 0, - get_sprite_x(video_ram, i), - get_sprite_y(video_ram, i), 1); + get_sprite_x(i), + get_sprite_y(i), 1); m_collision[i] |= collision_check(rect); } |