diff options
Diffstat (limited to 'src/mame/drivers/btoads.cpp')
-rw-r--r-- | src/mame/drivers/btoads.cpp | 95 |
1 files changed, 59 insertions, 36 deletions
diff --git a/src/mame/drivers/btoads.cpp b/src/mame/drivers/btoads.cpp index d6e70fca2d8..1868e0f257c 100644 --- a/src/mame/drivers/btoads.cpp +++ b/src/mame/drivers/btoads.cpp @@ -28,11 +28,34 @@ void btoads_state::machine_start() { + m_nvram_data = std::make_unique<uint8_t[]>(0x2000); + subdevice<nvram_device>("nvram")->set_base(m_nvram_data.get(), 0x2000); + save_item(NAME(m_main_to_sound_data)); save_item(NAME(m_main_to_sound_ready)); save_item(NAME(m_sound_to_main_data)); save_item(NAME(m_sound_to_main_ready)); save_item(NAME(m_sound_int_state)); + save_pointer(NAME(m_nvram_data), 0x2000); +} + + + +/************************************* + * + * NVRAM + * + *************************************/ + +void btoads_state::nvram_w(offs_t offset, uint8_t data) +{ + m_nvram_data[offset] = data; +} + + +uint8_t btoads_state::nvram_r(offs_t offset) +{ + return m_nvram_data[offset]; } @@ -180,11 +203,11 @@ void btoads_state::main_map(address_map &map) map(0x20000180, 0x200001ff).w(FUNC(btoads_state::display_control_w)); map(0x20000200, 0x2000027f).w(FUNC(btoads_state::scroll0_w)); map(0x20000280, 0x200002ff).w(FUNC(btoads_state::scroll1_w)); - map(0x20000300, 0x2000037f).rw(FUNC(btoads_state::paletteram_r), FUNC(btoads_state::paletteram_w)); + map(0x20000300, 0x2000037f).rw(m_tlc34076, FUNC(tlc34076_device::read), FUNC(tlc34076_device::write)).umask32(0x000000ff); map(0x20000380, 0x200003ff).rw(FUNC(btoads_state::main_sound_r), FUNC(btoads_state::main_sound_w)); map(0x20000400, 0x2000047f).w(FUNC(btoads_state::misc_control_w)); - map(0x40000000, 0x4000000f).nopw(); /* watchdog? */ - map(0x60000000, 0x6003ffff).ram().share("nvram"); + map(0x40000000, 0x4000001f).nopw(); /* watchdog? */ + map(0x60000000, 0x6003ffff).rw(FUNC(btoads_state::nvram_r), FUNC(btoads_state::nvram_w)).umask32(0x000000ff); map(0xa0000000, 0xa03fffff).rw(FUNC(btoads_state::vram_fg_display_r), FUNC(btoads_state::vram_fg_display_w)).share("vram_fg0"); map(0xa4000000, 0xa43fffff).rw(FUNC(btoads_state::vram_fg_draw_r), FUNC(btoads_state::vram_fg_draw_w)).share("vram_fg1"); map(0xa8000000, 0xa87fffff).ram().share("vram_fg_data"); @@ -228,46 +251,46 @@ void btoads_state::sound_io_map(address_map &map) static INPUT_PORTS_START( btoads ) PORT_START("P1") - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START1 ) - PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) + PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) + PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) + PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) + PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) + PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) + PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) + PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_START1 ) + PORT_BIT( 0xffffff00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("P2") - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START2 ) - PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) + PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) + PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) + PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) + PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) + PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) + PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) + PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_START2 ) + PORT_BIT( 0xffffff00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("P3") - PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(3) - PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3) - PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3) - PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3) - PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) - PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) - PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_IMPULSE(2) - PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_START3 ) - PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x00000001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(3) + PORT_BIT( 0x00000002, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(3) + PORT_BIT( 0x00000004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(3) + PORT_BIT( 0x00000008, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(3) + PORT_BIT( 0x00000010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(3) + PORT_BIT( 0x00000020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(3) + PORT_BIT( 0x00000040, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_IMPULSE(2) + PORT_BIT( 0x00000080, IP_ACTIVE_LOW, IPT_START3 ) + PORT_BIT( 0xffffff00, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_START("UNK") - PORT_BIT( 0xffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0xffffffff, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("SPECIAL") - PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(btoads_state, sound_to_main_r) + PORT_BIT( 0x00000001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(btoads_state, sound_to_main_r) PORT_SERVICE_NO_TOGGLE( 0x0002, IP_ACTIVE_LOW ) - PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(btoads_state, main_to_sound_r) - PORT_BIT( 0xff7c, IP_ACTIVE_LOW, IPT_UNKNOWN ) + PORT_BIT( 0x00000080, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_MEMBER(btoads_state, main_to_sound_r) + PORT_BIT( 0xffffff7c, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_START("SW1") PORT_DIPNAME( 0x0001, 0x0000, DEF_STR( Demo_Sounds )) PORT_DIPLOCATION("SW1:1") @@ -292,7 +315,7 @@ static INPUT_PORTS_START( btoads ) PORT_DIPSETTING( 0x0040, DEF_STR( Off )) PORT_DIPSETTING( 0x0000, DEF_STR( On )) PORT_DIPUNKNOWN_DIPLOC(0x0080, 0x0080, "SW1:8") - PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0xffffff00, IP_ACTIVE_LOW, IPT_UNUSED ) INPUT_PORTS_END @@ -348,7 +371,7 @@ ROM_START( btoads ) ROM_REGION( 0x10000, "audiocpu", 0 ) /* sound program, M27C256B rom */ ROM_LOAD( "bt.u102", 0x0000, 0x8000, CRC(a90b911a) SHA1(6ec25161e68df1c9870d48cc2b1f85cd1a49aba9) ) - ROM_REGION16_LE( 0x800000, "user1", 0 ) /* 34020 code, M27C322 roms */ + ROM_REGION32_LE( 0x800000, "user1", 0 ) /* 34020 code, M27C322 roms */ ROM_LOAD32_WORD( "btc0-p0.u120", 0x000000, 0x400000, CRC(0dfd1e35) SHA1(733a0a4235bebd598c600f187ed2628f28cf9bd0) ) ROM_LOAD32_WORD( "btc0-p1.u121", 0x000002, 0x400000, CRC(df7487e1) SHA1(67151b900767bb2653b5261a98c81ff8827222c3) ) |