summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/munchmo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/munchmo.cpp')
-rw-r--r--src/mame/drivers/munchmo.cpp52
1 files changed, 25 insertions, 27 deletions
diff --git a/src/mame/drivers/munchmo.cpp b/src/mame/drivers/munchmo.cpp
index 161fe5a81a5..f36713eac6b 100644
--- a/src/mame/drivers/munchmo.cpp
+++ b/src/mame/drivers/munchmo.cpp
@@ -29,7 +29,6 @@ Stephh's notes (based on the game Z80 code and some tests) :
#include "includes/munchmo.h"
#include "cpu/z80/z80.h"
-#include "sound/ay8910.h"
#include "screen.h"
#include "speaker.h"
@@ -76,17 +75,16 @@ WRITE8_MEMBER(munchmo_state::sound_nmi_ack_w)
READ8_MEMBER(munchmo_state::ay1reset_r)
{
- ay8910_device *ay8910 = machine().device<ay8910_device>("ay1");
- ay8910->reset_w(space,0,0);
+ m_ay8910[0]->reset_w(space, 0, 0);
return 0;
}
READ8_MEMBER(munchmo_state::ay2reset_r)
{
- ay8910_device *ay8910 = machine().device<ay8910_device>("ay2");
- ay8910->reset_w(space,0,0);
+ m_ay8910[1]->reset_w(space, 0, 0);
return 0;
}
+
/*************************************
*
* Address maps
@@ -97,12 +95,12 @@ void munchmo_state::mnchmobl_map(address_map &map)
{
map(0x0000, 0x3fff).rom();
map(0x8000, 0x83ff).ram();
- map(0xa000, 0xa3ff).mirror(0x0400).ram().share("sprite_xpos");
- map(0xa800, 0xabff).mirror(0x0400).ram().share("sprite_tile");
- map(0xb000, 0xb3ff).mirror(0x0400).ram().share("sprite_attr");
- map(0xb800, 0xb8ff).mirror(0x0100).ram().share("videoram");
+ map(0xa000, 0xa3ff).mirror(0x0400).ram().share(m_sprite_xpos);
+ map(0xa800, 0xabff).mirror(0x0400).ram().share(m_sprite_tile);
+ map(0xb000, 0xb3ff).mirror(0x0400).ram().share(m_sprite_attr);
+ map(0xb800, 0xb8ff).mirror(0x0100).ram().share(m_videoram);
map(0xbaba, 0xbaba).nopw(); /* ? */
- map(0xbc00, 0xbc7f).ram().share("status_vram");
+ map(0xbc00, 0xbc7f).ram().share(m_status_vram);
map(0xbe00, 0xbe00).w(m_soundlatch, FUNC(generic_latch_8_device::write));
map(0xbe01, 0xbe01).select(0x0070).lw8("mainlatch_w",
[this](address_space &space, offs_t offset, u8 data, u8 mem_mask){
@@ -114,7 +112,7 @@ void munchmo_state::mnchmobl_map(address_map &map)
map(0xbf01, 0xbf01).portr("SYSTEM");
map(0xbf02, 0xbf02).portr("P1");
map(0xbf03, 0xbf03).portr("P2");
- map(0xbf04, 0xbf07).writeonly().share("vreg"); // MY0 1-8C
+ map(0xbf04, 0xbf07).writeonly().share(m_vreg); // MY0 1-8C
}
/* memory map provided thru schematics */
@@ -122,12 +120,12 @@ void munchmo_state::sound_map(address_map &map)
{
map(0x0000, 0x1fff).rom();
map(0x2000, 0x3fff).r(m_soundlatch, FUNC(generic_latch_8_device::read));
- map(0x4000, 0x4fff).w("ay1", FUNC(ay8910_device::data_w));
- map(0x5000, 0x5fff).w("ay1", FUNC(ay8910_device::address_w));
- map(0x6000, 0x6fff).w("ay2", FUNC(ay8910_device::data_w));
- map(0x7000, 0x7fff).w("ay2", FUNC(ay8910_device::address_w));
- map(0x8000, 0x9fff).r(FUNC(munchmo_state::ay1reset_r)).w("ay1", FUNC(ay8910_device::reset_w));
- map(0xa000, 0xbfff).r(FUNC(munchmo_state::ay2reset_r)).w("ay2", FUNC(ay8910_device::reset_w));
+ map(0x4000, 0x4fff).w(m_ay8910[0], FUNC(ay8910_device::data_w));
+ map(0x5000, 0x5fff).w(m_ay8910[0], FUNC(ay8910_device::address_w));
+ map(0x6000, 0x6fff).w(m_ay8910[1], FUNC(ay8910_device::data_w));
+ map(0x7000, 0x7fff).w(m_ay8910[1], FUNC(ay8910_device::address_w));
+ map(0x8000, 0x9fff).r(FUNC(munchmo_state::ay1reset_r)).w(m_ay8910[0], FUNC(ay8910_device::reset_w));
+ map(0xa000, 0xbfff).r(FUNC(munchmo_state::ay2reset_r)).w(m_ay8910[1], FUNC(ay8910_device::reset_w));
map(0xc000, 0xdfff).w(FUNC(munchmo_state::sound_nmi_ack_w)); // NCL 1-8H
map(0xe000, 0xe7ff).mirror(0x1800).ram(); // is mirror ok?
}
@@ -320,15 +318,15 @@ void munchmo_state::machine_start()
MACHINE_CONFIG_START(munchmo_state::mnchmobl)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", Z80, XTAL(15'000'000)/4) // from pin 13 of XTAL-driven 163
+ MCFG_DEVICE_ADD(m_maincpu, Z80, XTAL(15'000'000)/4) // from pin 13 of XTAL-driven 163
MCFG_DEVICE_PROGRAM_MAP(mnchmobl_map)
MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(munchmo_state, generic_irq_ack) // IORQ clears flip-flop at 1-2C
- MCFG_DEVICE_ADD("audiocpu", Z80, XTAL(15'000'000)/8) // from pin 12 of XTAL-driven 163
+ MCFG_DEVICE_ADD(m_audiocpu, Z80, XTAL(15'000'000)/8) // from pin 12 of XTAL-driven 163
MCFG_DEVICE_PROGRAM_MAP(sound_map)
MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(munchmo_state, generic_irq_ack) // IORQ clears flip-flop at 1-7H
- MCFG_DEVICE_ADD("mainlatch", LS259, 0) // 12E
+ MCFG_DEVICE_ADD(m_mainlatch, LS259, 0) // 12E
MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(*this, munchmo_state, palette_bank_0_w)) // BCL0 2-11E
MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, munchmo_state, palette_bank_1_w)) // BCL1 2-11E
MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(NOOP) // CL2 2-11E
@@ -345,24 +343,24 @@ MACHINE_CONFIG_START(munchmo_state::mnchmobl)
MCFG_SCREEN_VISIBLE_AREA(0, 255+32+32,0, 255-16)
MCFG_SCREEN_UPDATE_DRIVER(munchmo_state, screen_update)
MCFG_SCREEN_VBLANK_CALLBACK(WRITELINE(*this, munchmo_state, vblank_irq))
- MCFG_SCREEN_PALETTE("palette")
+ MCFG_SCREEN_PALETTE(m_palette)
- MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_mnchmobl)
- MCFG_PALETTE_ADD("palette", 256)
+ MCFG_DEVICE_ADD(m_gfxdecode, GFXDECODE, m_palette, gfx_mnchmobl)
+ MCFG_PALETTE_ADD(m_palette, 256)
MCFG_PALETTE_INIT_OWNER(munchmo_state, munchmo)
/* sound hardware */
SPEAKER(config, "mono").front_center();
- MCFG_GENERIC_LATCH_8_ADD("soundlatch")
- MCFG_GENERIC_LATCH_DATA_PENDING_CB(ASSERTLINE("audiocpu", 0))
+ MCFG_GENERIC_LATCH_8_ADD(m_soundlatch)
+ MCFG_GENERIC_LATCH_DATA_PENDING_CB(ASSERTLINE(m_audiocpu, 0))
/* AY clock speeds confirmed to match known recording */
- MCFG_DEVICE_ADD("ay1", AY8910, XTAL(15'000'000)/8)
+ MCFG_DEVICE_ADD(m_ay8910[0], AY8910, XTAL(15'000'000)/8)
//MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
- MCFG_DEVICE_ADD("ay2", AY8910, XTAL(15'000'000)/8)
+ MCFG_DEVICE_ADD(m_ay8910[1], AY8910, XTAL(15'000'000)/8)
//MCFG_AY8910_OUTPUT_TYPE(AY8910_SINGLE_OUTPUT)
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
MACHINE_CONFIG_END