summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2018-05-03 12:37:04 -0400
committer AJR <ajrhacker@users.noreply.github.com>2018-05-03 12:37:04 -0400
commitaa96f47092f764f089c2ce9e0f26d756197150e8 (patch)
tree68d351209af35336eb54d3180ddf27bcad2109e7
parent6a1bd4e29e0ba8c9a623329b5e75fed38e28268c (diff)
asteroid: Swap start LEDs and suppress logging for many spurious writes
asteroid, astdelux, llander: Configure all lamp/LED outputs as line callbacks (nw)
-rw-r--r--src/mame/drivers/asteroid.cpp64
-rw-r--r--src/mame/includes/asteroid.h4
-rw-r--r--src/mame/machine/asteroid.cpp33
3 files changed, 33 insertions, 68 deletions
diff --git a/src/mame/drivers/asteroid.cpp b/src/mame/drivers/asteroid.cpp
index 33bb3a7eef3..3ddd74b0748 100644
--- a/src/mame/drivers/asteroid.cpp
+++ b/src/mame/drivers/asteroid.cpp
@@ -190,6 +190,7 @@ There is not a rev 03 known or dumped. An Asteroids rev 03 is not mentioned in a
#include "cpu/m6502/m6502.h"
#include "machine/74259.h"
#include "machine/atari_vg.h"
+#include "machine/output_latch.h"
#include "machine/watchdog.h"
#include "sound/pokey.h"
#include "video/avgdvg.h"
@@ -226,24 +227,6 @@ WRITE_LINE_MEMBER(asteroid_state::coin_counter_right_w)
/*************************************
*
- * Lunar Lander LEDs/lamps
- *
- *************************************/
-
-WRITE8_MEMBER(asteroid_state::llander_led_w)
-{
- static const char *const lampname[] =
- {
- "lamp0", "lamp1", "lamp2", "lamp3", "lamp4"
- };
-
- for (int i = 0; i < 5; i++)
- output().set_value(lampname[i], (data >> (4 - i)) & 1);
-}
-
-
-/*************************************
- *
* Main CPU memory handlers
*
*************************************/
@@ -254,11 +237,11 @@ void asteroid_state::asteroid_map(address_map &map)
map(0x0000, 0x01ff).ram();
map(0x0200, 0x02ff).bankrw("ram1").share("ram1");
map(0x0300, 0x03ff).bankrw("ram2").share("ram2");
- map(0x2000, 0x2007).r(this, FUNC(asteroid_state::asteroid_IN0_r)); /* IN0 */
+ map(0x2000, 0x2007).r(this, FUNC(asteroid_state::asteroid_IN0_r)).nopw(); /* IN0 */
map(0x2400, 0x2407).r(this, FUNC(asteroid_state::asteroid_IN1_r)); /* IN1 */
- map(0x2800, 0x2803).r(this, FUNC(asteroid_state::asteroid_DSW1_r)); /* DSW1 */
+ map(0x2800, 0x2803).r(this, FUNC(asteroid_state::asteroid_DSW1_r)).nopw(); /* DSW1 */
map(0x3000, 0x3000).w(m_dvg, FUNC(dvg_device::go_w));
- map(0x3200, 0x3200).w(this, FUNC(asteroid_state::asteroid_bank_switch_w));
+ map(0x3200, 0x3200).w("outlatch", FUNC(output_latch_device::write));
map(0x3400, 0x3400).w("watchdog", FUNC(watchdog_timer_device::reset_w));
map(0x3600, 0x3600).w(this, FUNC(asteroid_state::asteroid_explode_w));
map(0x3a00, 0x3a00).w(this, FUNC(asteroid_state::asteroid_thump_w));
@@ -276,13 +259,13 @@ void asteroid_state::astdelux_map(address_map &map)
map(0x0000, 0x01ff).ram();
map(0x0200, 0x02ff).bankrw("ram1").share("ram1");
map(0x0300, 0x03ff).bankrw("ram2").share("ram2");
- map(0x2000, 0x2007).r(this, FUNC(asteroid_state::asteroid_IN0_r)); /* IN0 */
- map(0x2400, 0x2407).r(this, FUNC(asteroid_state::asteroid_IN1_r)); /* IN1 */
+ map(0x2000, 0x2007).r(this, FUNC(asteroid_state::asteroid_IN0_r)).nopw(); /* IN0 */
+ map(0x2400, 0x2407).r(this, FUNC(asteroid_state::asteroid_IN1_r)).nopw(); /* IN1 */
map(0x2800, 0x2803).r(this, FUNC(asteroid_state::asteroid_DSW1_r)); /* DSW1 */
map(0x2c00, 0x2c0f).rw("pokey", FUNC(pokey_device::read), FUNC(pokey_device::write));
map(0x2c40, 0x2c7f).r("earom", FUNC(atari_vg_earom_device::read));
map(0x3000, 0x3000).w(m_dvg, FUNC(dvg_device::go_w));
- map(0x3200, 0x323f).w("earom", FUNC(atari_vg_earom_device::write));
+ map(0x3200, 0x323f).w("earom", FUNC(atari_vg_earom_device::write)).nopr();
map(0x3400, 0x3400).w("watchdog", FUNC(watchdog_timer_device::reset_w));
map(0x3600, 0x3600).w(this, FUNC(asteroid_state::asteroid_explode_w));
map(0x3a00, 0x3a00).w("earom", FUNC(atari_vg_earom_device::ctrl_w));
@@ -303,12 +286,13 @@ void asteroid_state::llander_map(address_map &map)
map(0x2800, 0x2803).r(this, FUNC(asteroid_state::asteroid_DSW1_r)); /* DSW1 */
map(0x2c00, 0x2c00).portr("THRUST");
map(0x3000, 0x3000).w(m_dvg, FUNC(dvg_device::go_w));
- map(0x3200, 0x3200).w(this, FUNC(asteroid_state::llander_led_w));
+ map(0x3200, 0x3200).w("outlatch", FUNC(output_latch_device::write));
map(0x3400, 0x3400).w("watchdog", FUNC(watchdog_timer_device::reset_w));
map(0x3c00, 0x3c00).w(this, FUNC(asteroid_state::llander_sounds_w));
map(0x3e00, 0x3e00).w(this, FUNC(asteroid_state::llander_snd_reset_w));
map(0x4000, 0x47ff).ram().share("vectorram").region("maincpu", 0x4000);
map(0x4800, 0x5fff).rom(); /* vector rom */
+ map(0x5800, 0x5800).nopw(); // INC access?
map(0x6000, 0x7fff).rom();
}
@@ -663,6 +647,15 @@ MACHINE_CONFIG_START(asteroid_state::asteroid_base)
MCFG_TTL153_ADD("dsw_sel")
+ MCFG_DEVICE_ADD("outlatch", OUTPUT_LATCH, 0) // LS174 at N11
+ MCFG_OUTPUT_LATCH_BIT0_HANDLER(OUTPUT("led1")) MCFG_DEVCB_INVERT // 2 PLYR START LAMP
+ MCFG_OUTPUT_LATCH_BIT1_HANDLER(OUTPUT("led0")) MCFG_DEVCB_INVERT // 1 PLYR START LAMP
+ MCFG_OUTPUT_LATCH_BIT2_HANDLER(MEMBANK("ram1")) // RAMSEL
+ MCFG_DEVCB_CHAIN_OUTPUT(MEMBANK("ram2"))
+ MCFG_OUTPUT_LATCH_BIT3_HANDLER(WRITELINE(asteroid_state, coin_counter_left_w)) // COIN CNTRL
+ MCFG_OUTPUT_LATCH_BIT4_HANDLER(WRITELINE(asteroid_state, coin_counter_center_w)) // COIN CNTRC
+ MCFG_OUTPUT_LATCH_BIT5_HANDLER(WRITELINE(asteroid_state, coin_counter_right_w)) // COIN CNTRR
+
/* video hardware */
MCFG_VECTOR_ADD("vector")
MCFG_SCREEN_ADD("screen", VECTOR)
@@ -708,14 +701,15 @@ MACHINE_CONFIG_START(asteroid_state::astdelux)
MCFG_POKEY_OUTPUT_RC(RES_K(10), CAP_U(0.015), 5.0)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
+ MCFG_DEVICE_REMOVE("outlatch")
MCFG_DEVICE_MODIFY("audiolatch")
- MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(asteroid_state, start1_led_w))
- MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(asteroid_state, start2_led_w))
- MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(MEMBANK("ram1"))
+ MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(OUTPUT("led0")) MCFG_DEVCB_INVERT // START1
+ MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(OUTPUT("led1")) MCFG_DEVCB_INVERT // START2
+ MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(MEMBANK("ram1")) // RAMSEL
MCFG_DEVCB_CHAIN_OUTPUT(MEMBANK("ram2"))
- MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(asteroid_state, coin_counter_left_w))
- MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(asteroid_state, coin_counter_center_w))
- MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(asteroid_state, coin_counter_right_w))
+ MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(asteroid_state, coin_counter_left_w)) // LEFT COIN
+ MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(asteroid_state, coin_counter_center_w)) // CENTER COIN
+ MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(asteroid_state, coin_counter_right_w)) // RIGHT COIN
MACHINE_CONFIG_END
@@ -732,6 +726,14 @@ MACHINE_CONFIG_START(asteroid_state::llander)
MCFG_SCREEN_VISIBLE_AREA(522, 1566, 270, 1070)
MCFG_SCREEN_UPDATE_DEVICE("vector", vector_device, screen_update)
+ MCFG_DEVICE_MODIFY("outlatch") // LS174 at N11
+ MCFG_OUTPUT_LATCH_BIT0_HANDLER(OUTPUT("lamp4")) // LAMP5 (COMMAND MISSION)
+ MCFG_OUTPUT_LATCH_BIT1_HANDLER(OUTPUT("lamp3")) // LAMP4 (PRIME MISSION)
+ MCFG_OUTPUT_LATCH_BIT2_HANDLER(OUTPUT("lamp2")) // LAMP3 (CADET MISSION)
+ MCFG_OUTPUT_LATCH_BIT3_HANDLER(OUTPUT("lamp1")) // LAMP2 (TRAINING MISSION)
+ MCFG_OUTPUT_LATCH_BIT4_HANDLER(OUTPUT("lamp0")) // START/SELECT LEDs
+ MCFG_OUTPUT_LATCH_BIT5_HANDLER(NOOP)
+
/* sound hardware */
llander_sound(config);
MACHINE_CONFIG_END
diff --git a/src/mame/includes/asteroid.h b/src/mame/includes/asteroid.h
index 984a55b9664..f72cb3fdead 100644
--- a/src/mame/includes/asteroid.h
+++ b/src/mame/includes/asteroid.h
@@ -37,14 +37,10 @@ public:
DECLARE_WRITE_LINE_MEMBER(coin_counter_left_w);
DECLARE_WRITE_LINE_MEMBER(coin_counter_center_w);
DECLARE_WRITE_LINE_MEMBER(coin_counter_right_w);
- DECLARE_WRITE8_MEMBER(llander_led_w);
DECLARE_READ8_MEMBER(asteroid_IN0_r);
DECLARE_READ8_MEMBER(asterock_IN0_r);
DECLARE_READ8_MEMBER(asteroid_IN1_r);
DECLARE_READ8_MEMBER(asteroid_DSW1_r);
- DECLARE_WRITE8_MEMBER(asteroid_bank_switch_w);
- DECLARE_WRITE_LINE_MEMBER(start1_led_w);
- DECLARE_WRITE_LINE_MEMBER(start2_led_w);
DECLARE_WRITE8_MEMBER(asteroid_explode_w);
DECLARE_WRITE8_MEMBER(asteroid_thump_w);
DECLARE_WRITE8_MEMBER(asteroid_noise_reset_w);
diff --git a/src/mame/machine/asteroid.cpp b/src/mame/machine/asteroid.cpp
index 80eebff4c2f..5269500ec1f 100644
--- a/src/mame/machine/asteroid.cpp
+++ b/src/mame/machine/asteroid.cpp
@@ -105,39 +105,6 @@ READ8_MEMBER(asteroid_state::asteroid_DSW1_r)
}
-WRITE8_MEMBER(asteroid_state::asteroid_bank_switch_w)
-{
- // 76------ not used
- // --5----- coin counter right coin
- // ---4---- coin counter center coin
- // ----3--- coin counter left coin
- // -----2-- ramsel
- // ------1- start2 led
- // -------0 start1 led
-
- start1_led_w(BIT(data, 0));
- start2_led_w(BIT(data, 1));
-
- int bank = BIT(data, 2);
- m_ram1->set_entry(bank);
- m_ram2->set_entry(bank);
-
- machine().bookkeeping().coin_counter_w(0, BIT(data, 3));
- machine().bookkeeping().coin_counter_w(1, BIT(data, 4));
- machine().bookkeeping().coin_counter_w(2, BIT(data, 5));
-}
-
-
-WRITE_LINE_MEMBER(asteroid_state::start1_led_w)
-{
- output().set_led_value(0, state ? 0 : 1);
-}
-
-WRITE_LINE_MEMBER(asteroid_state::start2_led_w)
-{
- output().set_led_value(1, state ? 0 : 1);
-}
-
void asteroid_state::machine_start()
{
/* configure RAM banks if present (not on llander) */