diff options
Diffstat (limited to 'src/mame/drivers/microtan.cpp')
-rw-r--r-- | src/mame/drivers/microtan.cpp | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/src/mame/drivers/microtan.cpp b/src/mame/drivers/microtan.cpp index 000a4eaad63..2468d6360b4 100644 --- a/src/mame/drivers/microtan.cpp +++ b/src/mame/drivers/microtan.cpp @@ -43,31 +43,27 @@ /* Components */ #include "cpu/m6502/m6502.h" -#include "machine/6522via.h" #include "machine/mos6551.h" -#include "sound/ay8910.h" #include "sound/wave.h" -/* Devices */ -#include "imagedev/cassette.h" #include "emupal.h" #include "screen.h" #include "speaker.h" -void microtan_state::microtan_map(address_map &map) +void microtan_state::main_map(address_map &map) { map(0x0000, 0x01ff).ram(); - map(0x0200, 0x03ff).ram().w(FUNC(microtan_state::microtan_videoram_w)).share("videoram"); - map(0xbc00, 0xbc00).w("ay8910.1", FUNC(ay8910_device::address_w)); - map(0xbc01, 0xbc01).rw("ay8910.1", FUNC(ay8910_device::data_r), FUNC(ay8910_device::data_w)); - map(0xbc02, 0xbc02).w("ay8910.2", FUNC(ay8910_device::address_w)); - map(0xbc03, 0xbc03).rw("ay8910.2", FUNC(ay8910_device::data_r), FUNC(ay8910_device::data_w)); - map(0xbfc0, 0xbfcf).rw(m_via6522_0, FUNC(via6522_device::read), FUNC(via6522_device::write)); + map(0x0200, 0x03ff).ram().w(FUNC(microtan_state::videoram_w)).share(m_videoram); + map(0xbc00, 0xbc00).w(m_ay8910[0], FUNC(ay8910_device::address_w)); + map(0xbc01, 0xbc01).rw(m_ay8910[0], FUNC(ay8910_device::data_r), FUNC(ay8910_device::data_w)); + map(0xbc02, 0xbc02).w(m_ay8910[1], FUNC(ay8910_device::address_w)); + map(0xbc03, 0xbc03).rw(m_ay8910[1], FUNC(ay8910_device::data_r), FUNC(ay8910_device::data_w)); + map(0xbfc0, 0xbfcf).rw(m_via6522[0], FUNC(via6522_device::read), FUNC(via6522_device::write)); map(0xbfd0, 0xbfd3).rw("acia", FUNC(mos6551_device::read), FUNC(mos6551_device::write)); - map(0xbfe0, 0xbfef).rw(m_via6522_1, FUNC(via6522_device::read), FUNC(via6522_device::write)); - map(0xbff0, 0xbfff).rw(FUNC(microtan_state::microtan_bffx_r), FUNC(microtan_state::microtan_bffx_w)); + map(0xbfe0, 0xbfef).rw(m_via6522[1], FUNC(via6522_device::read), FUNC(via6522_device::write)); + map(0xbff0, 0xbfff).rw(FUNC(microtan_state::bffx_r), FUNC(microtan_state::bffx_w)); map(0xc000, 0xe7ff).rom(); map(0xf000, 0xffff).rom(); } @@ -213,9 +209,9 @@ GFXDECODE_END MACHINE_CONFIG_START(microtan_state::microtan) /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M6502, XTAL(6'000'000) / 8) // 750 kHz - MCFG_DEVICE_PROGRAM_MAP(microtan_map) - MCFG_DEVICE_VBLANK_INT_DRIVER("screen", microtan_state, microtan_interrupt) + MCFG_DEVICE_ADD(m_maincpu, M6502, XTAL(6'000'000) / 8) // 750 kHz + MCFG_DEVICE_PROGRAM_MAP(main_map) + MCFG_DEVICE_VBLANK_INT_DRIVER("screen", microtan_state, interrupt) /* video hardware - include overscan */ @@ -224,7 +220,7 @@ MACHINE_CONFIG_START(microtan_state::microtan) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ MCFG_SCREEN_SIZE(32*8, 16*16) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 0*16, 16*16-1) - MCFG_SCREEN_UPDATE_DRIVER(microtan_state, screen_update_microtan) + MCFG_SCREEN_UPDATE_DRIVER(microtan_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_DEVICE_ADD("gfxdecode", GFXDECODE, "palette", gfx_microtan) @@ -233,10 +229,10 @@ MACHINE_CONFIG_START(microtan_state::microtan) /* sound hardware */ SPEAKER(config, "speaker").front_center(); - WAVE(config, "wave", "cassette").add_route(ALL_OUTPUTS, "speaker", 0.25); - MCFG_DEVICE_ADD("ay8910.1", AY8910, 1000000) + WAVE(config, "wave", m_cassette).add_route(ALL_OUTPUTS, "speaker", 0.25); + MCFG_DEVICE_ADD(m_ay8910[0], AY8910, 1000000) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) - MCFG_DEVICE_ADD("ay8910.2", AY8910, 1000000) + MCFG_DEVICE_ADD(m_ay8910[1], AY8910, 1000000) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "speaker", 0.5) /* snapshot/quickload */ @@ -244,14 +240,14 @@ MACHINE_CONFIG_START(microtan_state::microtan) MCFG_QUICKLOAD_ADD("quickload", microtan_state, microtan, "hex", 0.5) /* cassette */ - MCFG_CASSETTE_ADD( "cassette" ) + MCFG_CASSETTE_ADD( m_cassette ) /* acia */ MCFG_DEVICE_ADD("acia", MOS6551, 0) MCFG_MOS6551_XTAL(XTAL(1'843'200)) /* via */ - MCFG_DEVICE_ADD("via6522_0", VIA6522, XTAL(6'000'000) / 8) + MCFG_DEVICE_ADD(m_via6522[0], VIA6522, XTAL(6'000'000) / 8) MCFG_VIA6522_READPA_HANDLER(READ8(*this, microtan_state, via_0_in_a)) MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(*this, microtan_state, via_0_out_a)) MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, microtan_state, via_0_out_b)) @@ -259,7 +255,7 @@ MACHINE_CONFIG_START(microtan_state::microtan) MCFG_VIA6522_CB2_HANDLER(WRITELINE(*this, microtan_state, via_0_out_cb2)) MCFG_VIA6522_IRQ_HANDLER(WRITELINE(*this, microtan_state, via_0_irq)) - MCFG_DEVICE_ADD("via6522_1", VIA6522, XTAL(6'000'000) / 8) + MCFG_DEVICE_ADD(m_via6522[1], VIA6522, XTAL(6'000'000) / 8) MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(*this, microtan_state, via_1_out_a)) MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(*this, microtan_state, via_1_out_b)) MCFG_VIA6522_CA2_HANDLER(WRITELINE(*this, microtan_state, via_1_out_ca2)) |