From 619982dc06b0d322f13092c943be98bd66136d8c Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Sat, 14 Feb 2015 08:27:47 +0100 Subject: exzisus.c: added save state support, removed trampolines (nw) --- src/mame/drivers/exzisus.c | 83 +++++++++++++++++++-------------------------- src/mame/includes/exzisus.h | 40 +++++++++------------- src/mame/video/exzisus.c | 54 +---------------------------- 3 files changed, 51 insertions(+), 126 deletions(-) diff --git a/src/mame/drivers/exzisus.c b/src/mame/drivers/exzisus.c index 2afad924eea..a122bfc9b57 100644 --- a/src/mame/drivers/exzisus.c +++ b/src/mame/drivers/exzisus.c @@ -46,39 +46,35 @@ TODO: ***************************************************************************/ -WRITE8_MEMBER(exzisus_state::exzisus_cpua_bankswitch_w) +WRITE8_MEMBER(exzisus_state::cpua_bankswitch_w) { - UINT8 *RAM = memregion("cpua")->base(); - if ( (data & 0x0f) != m_cpua_bank ) { m_cpua_bank = data & 0x0f; if (m_cpua_bank >= 2) { - membank("bank2")->set_base(&RAM[ 0x10000 + ( (m_cpua_bank - 2) * 0x4000 ) ] ); + membank("bank2")->set_entry(m_cpua_bank - 2); } } flip_screen_set(data & 0x40); } -WRITE8_MEMBER(exzisus_state::exzisus_cpub_bankswitch_w) +WRITE8_MEMBER(exzisus_state::cpub_bankswitch_w) { - UINT8 *RAM = memregion("cpub")->base(); - if ( (data & 0x0f) != m_cpub_bank ) { m_cpub_bank = data & 0x0f; if (m_cpub_bank >= 2) { - membank("bank1")->set_base(&RAM[ 0x10000 + ( (m_cpub_bank - 2) * 0x4000 ) ] ); + membank("bank1")->set_entry(m_cpub_bank - 2); } } flip_screen_set(data & 0x40); } -WRITE8_MEMBER(exzisus_state::exzisus_coincounter_w) +WRITE8_MEMBER(exzisus_state::coincounter_w) { coin_lockout_w(machine(), 0,~data & 0x01); coin_lockout_w(machine(), 1,~data & 0x02); @@ -86,34 +82,14 @@ WRITE8_MEMBER(exzisus_state::exzisus_coincounter_w) coin_counter_w(machine(), 1,data & 0x08); } -READ8_MEMBER(exzisus_state::exzisus_sharedram_ab_r) -{ - return m_sharedram_ab[offset]; -} - -READ8_MEMBER(exzisus_state::exzisus_sharedram_ac_r) -{ - return m_sharedram_ac[offset]; -} - -WRITE8_MEMBER(exzisus_state::exzisus_sharedram_ab_w) -{ - m_sharedram_ab[offset] = data; -} - -WRITE8_MEMBER(exzisus_state::exzisus_sharedram_ac_w) -{ - m_sharedram_ac[offset] = data; -} - // is it ok that cpub_reset refers to cpuc? -WRITE8_MEMBER(exzisus_state::exzisus_cpub_reset_w) +WRITE8_MEMBER(exzisus_state::cpub_reset_w) { m_cpuc->set_input_line(INPUT_LINE_RESET, PULSE_LINE); } #if 0 -// without exzisus_cpub_reset_w, the following patch would be needed for +// without cpub_reset_w, the following patch would be needed for // the RAM check to work DRIVER_INIT_MEMBER(exzisus_state,exzisus) { @@ -137,38 +113,38 @@ DRIVER_INIT_MEMBER(exzisus_state,exzisus) static ADDRESS_MAP_START( cpua_map, AS_PROGRAM, 8, exzisus_state ) AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank2") - AM_RANGE(0xc000, 0xc5ff) AM_READWRITE(exzisus_objectram_1_r, exzisus_objectram_1_w) AM_SHARE("objectram1") - AM_RANGE(0xc600, 0xdfff) AM_READWRITE(exzisus_videoram_1_r, exzisus_videoram_1_w) AM_SHARE("videoram1") - AM_RANGE(0xe000, 0xefff) AM_READWRITE(exzisus_sharedram_ac_r, exzisus_sharedram_ac_w) AM_SHARE("sharedram_ac") - AM_RANGE(0xf400, 0xf400) AM_WRITE(exzisus_cpua_bankswitch_w) - AM_RANGE(0xf404, 0xf404) AM_WRITE(exzisus_cpub_reset_w) // ?? - AM_RANGE(0xf800, 0xffff) AM_READWRITE(exzisus_sharedram_ab_r, exzisus_sharedram_ab_w) AM_SHARE("sharedram_ab") + AM_RANGE(0xc000, 0xc5ff) AM_RAM AM_SHARE("objectram1") + AM_RANGE(0xc600, 0xdfff) AM_RAM AM_SHARE("videoram1") + AM_RANGE(0xe000, 0xefff) AM_RAM AM_SHARE("sharedram_ac") + AM_RANGE(0xf400, 0xf400) AM_WRITE(cpua_bankswitch_w) + AM_RANGE(0xf404, 0xf404) AM_WRITE(cpub_reset_w) // ?? + AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("sharedram_ab") ADDRESS_MAP_END static ADDRESS_MAP_START( cpub_map, AS_PROGRAM, 8, exzisus_state ) AM_RANGE(0x0000, 0x7fff) AM_ROM AM_RANGE(0x8000, 0xbfff) AM_ROMBANK("bank1") - AM_RANGE(0xc000, 0xc5ff) AM_READWRITE(exzisus_objectram_0_r, exzisus_objectram_0_w) AM_SHARE("objectram0") - AM_RANGE(0xc600, 0xdfff) AM_READWRITE(exzisus_videoram_0_r, exzisus_videoram_0_w) AM_SHARE("videoram0") + AM_RANGE(0xc000, 0xc5ff) AM_RAM AM_SHARE("objectram0") + AM_RANGE(0xc600, 0xdfff) AM_RAM AM_SHARE("videoram0") AM_RANGE(0xe000, 0xefff) AM_RAM AM_RANGE(0xf000, 0xf000) AM_READNOP AM_DEVWRITE("tc0140syt", tc0140syt_device, master_port_w) AM_RANGE(0xf001, 0xf001) AM_DEVREADWRITE("tc0140syt", tc0140syt_device, master_comm_r, master_comm_w) AM_RANGE(0xf400, 0xf400) AM_READ_PORT("P1") - AM_RANGE(0xf400, 0xf400) AM_WRITE(exzisus_cpub_bankswitch_w) + AM_RANGE(0xf400, 0xf400) AM_WRITE(cpub_bankswitch_w) AM_RANGE(0xf401, 0xf401) AM_READ_PORT("P2") AM_RANGE(0xf402, 0xf402) AM_READ_PORT("SYSTEM") - AM_RANGE(0xf402, 0xf402) AM_WRITE(exzisus_coincounter_w) + AM_RANGE(0xf402, 0xf402) AM_WRITE(coincounter_w) AM_RANGE(0xf404, 0xf404) AM_READ_PORT("DSWA") AM_RANGE(0xf404, 0xf404) AM_WRITENOP // ?? AM_RANGE(0xf405, 0xf405) AM_READ_PORT("DSWB") - AM_RANGE(0xf800, 0xffff) AM_READWRITE(exzisus_sharedram_ab_r, exzisus_sharedram_ab_w) + AM_RANGE(0xf800, 0xffff) AM_RAM AM_SHARE("sharedram_ab") ADDRESS_MAP_END static ADDRESS_MAP_START( cpuc_map, AS_PROGRAM, 8, exzisus_state ) AM_RANGE(0x0000, 0x7fff) AM_ROM - AM_RANGE(0x8000, 0x85ff) AM_READWRITE(exzisus_objectram_1_r, exzisus_objectram_1_w) - AM_RANGE(0x8600, 0x9fff) AM_READWRITE(exzisus_videoram_1_r, exzisus_videoram_1_w) - AM_RANGE(0xa000, 0xafff) AM_READWRITE(exzisus_sharedram_ac_r, exzisus_sharedram_ac_w) + AM_RANGE(0x8000, 0x85ff) AM_RAM AM_SHARE("objectram1") + AM_RANGE(0x8600, 0x9fff) AM_RAM AM_SHARE("videoram1") + AM_RANGE(0xa000, 0xafff) AM_RAM AM_SHARE("sharedram_ac") AM_RANGE(0xb000, 0xbfff) AM_RAM ADDRESS_MAP_END @@ -234,6 +210,15 @@ INPUT_PORTS_END ***************************************************************************/ +void exzisus_state::machine_start() +{ + membank("bank1")->configure_entries(0, 16, memregion("cpub")->base() + 0x10000, 0x4000); + membank("bank2")->configure_entries(0, 16, memregion("cpua")->base() + 0x10000, 0x4000); + + save_item(NAME(m_cpua_bank)); + save_item(NAME(m_cpub_bank)); +} + static const gfx_layout charlayout = { 8, 8, @@ -279,7 +264,7 @@ static MACHINE_CONFIG_START( exzisus, exzisus_state ) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(0)) MCFG_SCREEN_SIZE(32*8, 32*8) MCFG_SCREEN_VISIBLE_AREA(0*8, 32*8-1, 2*8, 30*8-1) - MCFG_SCREEN_UPDATE_DRIVER(exzisus_state, screen_update_exzisus) + MCFG_SCREEN_UPDATE_DRIVER(exzisus_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_GFXDECODE_ADD("gfxdecode", "palette", exzisus) @@ -424,6 +409,6 @@ ROM_START( exzisust ) ROM_LOAD( "b23-05.16l", 0x00800, 0x00400, CRC(87f0f69a) SHA1(37df6fd56245fab9beaabfd86fd8f95d7c42c2a5) ) ROM_END -GAME( 1987, exzisus, 0, exzisus, exzisus, driver_device, 0, ROT0, "Taito Corporation", "Exzisus (Japan, dedicated)", 0 ) -GAME( 1987, exzisusa, exzisus, exzisus, exzisus, driver_device, 0, ROT0, "Taito Corporation", "Exzisus (Japan, conversion)", 0 ) -GAME( 1987, exzisust, exzisus, exzisus, exzisus, driver_device, 0, ROT0, "Taito Corporation (TAD license)", "Exzisus (TAD license)", 0 ) +GAME( 1987, exzisus, 0, exzisus, exzisus, driver_device, 0, ROT0, "Taito Corporation", "Exzisus (Japan, dedicated)", GAME_SUPPORTS_SAVE ) +GAME( 1987, exzisusa, exzisus, exzisus, exzisus, driver_device, 0, ROT0, "Taito Corporation", "Exzisus (Japan, conversion)", GAME_SUPPORTS_SAVE ) +GAME( 1987, exzisust, exzisus, exzisus, exzisus, driver_device, 0, ROT0, "Taito Corporation (TAD license)", "Exzisus (TAD license)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/includes/exzisus.h b/src/mame/includes/exzisus.h index 1e22a4818fb..387f4eb1660 100644 --- a/src/mame/includes/exzisus.h +++ b/src/mame/includes/exzisus.h @@ -3,44 +3,36 @@ class exzisus_state : public driver_device public: exzisus_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), + m_cpuc(*this, "cpuc"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette"), m_objectram1(*this, "objectram1"), m_videoram1(*this, "videoram1"), m_sharedram_ac(*this, "sharedram_ac"), m_sharedram_ab(*this, "sharedram_ab"), m_objectram0(*this, "objectram0"), - m_videoram0(*this, "videoram0"), - m_cpuc(*this, "cpuc"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") { } + m_videoram0(*this, "videoram0") { } + required_device m_cpuc; + required_device m_gfxdecode; + required_device m_palette; + required_shared_ptr m_objectram1; required_shared_ptr m_videoram1; required_shared_ptr m_sharedram_ac; required_shared_ptr m_sharedram_ab; required_shared_ptr m_objectram0; required_shared_ptr m_videoram0; - required_device m_cpuc; - required_device m_gfxdecode; - required_device m_palette; int m_cpua_bank; int m_cpub_bank; - DECLARE_WRITE8_MEMBER(exzisus_cpua_bankswitch_w); - DECLARE_WRITE8_MEMBER(exzisus_cpub_bankswitch_w); - DECLARE_WRITE8_MEMBER(exzisus_coincounter_w); - DECLARE_READ8_MEMBER(exzisus_sharedram_ab_r); - DECLARE_READ8_MEMBER(exzisus_sharedram_ac_r); - DECLARE_WRITE8_MEMBER(exzisus_sharedram_ab_w); - DECLARE_WRITE8_MEMBER(exzisus_sharedram_ac_w); - DECLARE_WRITE8_MEMBER(exzisus_cpub_reset_w); - DECLARE_READ8_MEMBER(exzisus_videoram_0_r); - DECLARE_READ8_MEMBER(exzisus_videoram_1_r); - DECLARE_READ8_MEMBER(exzisus_objectram_0_r); - DECLARE_READ8_MEMBER(exzisus_objectram_1_r); - DECLARE_WRITE8_MEMBER(exzisus_videoram_0_w); - DECLARE_WRITE8_MEMBER(exzisus_videoram_1_w); - DECLARE_WRITE8_MEMBER(exzisus_objectram_0_w); - DECLARE_WRITE8_MEMBER(exzisus_objectram_1_w); - UINT32 screen_update_exzisus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + DECLARE_WRITE8_MEMBER(cpua_bankswitch_w); + DECLARE_WRITE8_MEMBER(cpub_bankswitch_w); + DECLARE_WRITE8_MEMBER(coincounter_w); + DECLARE_WRITE8_MEMBER(cpub_reset_w); + + virtual void machine_start(); + + UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); }; diff --git a/src/mame/video/exzisus.c b/src/mame/video/exzisus.c index 6fef273743d..c1cb706014b 100644 --- a/src/mame/video/exzisus.c +++ b/src/mame/video/exzisus.c @@ -12,63 +12,11 @@ Functions to emulate the video hardware of the machine. #include "includes/exzisus.h" -/*************************************************************************** - Memory handlers -***************************************************************************/ - -READ8_MEMBER(exzisus_state::exzisus_videoram_0_r) -{ - return m_videoram0[offset]; -} - - -READ8_MEMBER(exzisus_state::exzisus_videoram_1_r) -{ - return m_videoram1[offset]; -} - - -READ8_MEMBER(exzisus_state::exzisus_objectram_0_r) -{ - return m_objectram0[offset]; -} - - -READ8_MEMBER(exzisus_state::exzisus_objectram_1_r) -{ - return m_objectram1[offset]; -} - - -WRITE8_MEMBER(exzisus_state::exzisus_videoram_0_w) -{ - m_videoram0[offset] = data; -} - - -WRITE8_MEMBER(exzisus_state::exzisus_videoram_1_w) -{ - m_videoram1[offset] = data; -} - - -WRITE8_MEMBER(exzisus_state::exzisus_objectram_0_w) -{ - m_objectram0[offset] = data; -} - - -WRITE8_MEMBER(exzisus_state::exzisus_objectram_1_w) -{ - m_objectram1[offset] = data; -} - - /*************************************************************************** Screen refresh ***************************************************************************/ -UINT32 exzisus_state::screen_update_exzisus(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +UINT32 exzisus_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { int offs; int sx, sy, xc, yc; -- cgit v1.2.3 From f366747d5f99be63f929c53a8be16653d73e59ac Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Sat, 14 Feb 2015 08:49:03 +0100 Subject: tnzs.c: enabled save state support (nw) --- src/mame/drivers/cchance.c | 2 -- src/mame/drivers/tnzs.c | 57 ++++++++++++++++++++++------------------------ src/mame/includes/tnzs.h | 37 +++++++++++++++--------------- src/mame/machine/tnzs.c | 13 +---------- 4 files changed, 46 insertions(+), 63 deletions(-) diff --git a/src/mame/drivers/cchance.c b/src/mame/drivers/cchance.c index 19795c2a568..b453f0db4cd 100644 --- a/src/mame/drivers/cchance.c +++ b/src/mame/drivers/cchance.c @@ -185,14 +185,12 @@ GFXDECODE_END MACHINE_START_MEMBER(cchance_state,cchance) { - save_item(NAME(m_screenflip)); save_item(NAME(m_hop_io)); save_item(NAME(m_bell_io)); } MACHINE_RESET_MEMBER(cchance_state,cchance) { - m_screenflip = 0; m_mcu_type = -1; m_hop_io = 0; m_bell_io = 0; diff --git a/src/mame/drivers/tnzs.c b/src/mame/drivers/tnzs.c index be38c2da691..e8768503b7c 100644 --- a/src/mame/drivers/tnzs.c +++ b/src/mame/drivers/tnzs.c @@ -622,10 +622,7 @@ Driver by Takahiro Nogi (nogi@kt.rim.or.jp) 1999/11/06 #include "emu.h" #include "cpu/z80/z80.h" #include "includes/taitoipt.h" -#include "cpu/mcs48/mcs48.h" #include "sound/2203intf.h" -#include "sound/dac.h" -#include "sound/samples.h" #include "includes/tnzs.h" #include "sound/2151intf.h" @@ -2660,38 +2657,38 @@ ROM_END // YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR,COMPANY,FULLNAME,FLAGS -GAME( 1987, plumppop, 0, drtoppel, plumppop, tnzs_state, plumpop, ROT0, "Taito Corporation", "Plump Pop (Japan)", 0 ) -GAME( 1992, jpopnics, 0, jpopnics, jpopnics, driver_device, 0, ROT0, "Nics", "Jumping Pop (Nics, Korean hack of Plump Pop)", GAME_IMPERFECT_GRAPHICS ) +GAME( 1987, plumppop, 0, drtoppel, plumppop, tnzs_state, plumpop, ROT0, "Taito Corporation", "Plump Pop (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1992, jpopnics, 0, jpopnics, jpopnics, driver_device, 0, ROT0, "Nics", "Jumping Pop (Nics, Korean hack of Plump Pop)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) -GAME( 1987, extrmatn, 0, arknoid2, extrmatn, tnzs_state, extrmatn, ROT270, "Taito Corporation Japan", "Extermination (World)", 0 ) -GAME( 1987, extrmatnu, extrmatn, arknoid2, extrmatn, tnzs_state, extrmatn, ROT270, "Taito (World Games license)", "Extermination (US)", 0 ) -GAME( 1987, extrmatnj, extrmatn, arknoid2, extrmatn, tnzs_state, extrmatn, ROT270, "Taito Corporation", "Extermination (Japan)", 0 ) +GAME( 1987, extrmatn, 0, arknoid2, extrmatn, tnzs_state, extrmatn, ROT270, "Taito Corporation Japan", "Extermination (World)", GAME_SUPPORTS_SAVE ) +GAME( 1987, extrmatnu, extrmatn, arknoid2, extrmatn, tnzs_state, extrmatn, ROT270, "Taito (World Games license)", "Extermination (US)", GAME_SUPPORTS_SAVE ) +GAME( 1987, extrmatnj, extrmatn, arknoid2, extrmatn, tnzs_state, extrmatn, ROT270, "Taito Corporation", "Extermination (Japan)", GAME_SUPPORTS_SAVE ) -GAME( 1987, arknoid2, 0, arknoid2, arknoid2, tnzs_state, arknoid2, ROT270, "Taito Corporation Japan", "Arkanoid - Revenge of DOH (World)", 0 ) -GAME( 1987, arknoid2u, arknoid2, arknoid2, arknid2u, tnzs_state, arknoid2, ROT270, "Taito America Corporation (Romstar license)", "Arkanoid - Revenge of DOH (US)", 0 ) -GAME( 1987, arknoid2j, arknoid2, arknoid2, arknid2u, tnzs_state, arknoid2, ROT270, "Taito Corporation", "Arkanoid - Revenge of DOH (Japan)", 0 ) -GAME( 1987, arknoid2b, arknoid2, arknoid2, arknid2u, tnzs_state, arknoid2, ROT270, "bootleg", "Arkanoid - Revenge of DOH (Japan bootleg)", 0 ) +GAME( 1987, arknoid2, 0, arknoid2, arknoid2, tnzs_state, arknoid2, ROT270, "Taito Corporation Japan", "Arkanoid - Revenge of DOH (World)", GAME_SUPPORTS_SAVE ) +GAME( 1987, arknoid2u, arknoid2, arknoid2, arknid2u, tnzs_state, arknoid2, ROT270, "Taito America Corporation (Romstar license)", "Arkanoid - Revenge of DOH (US)", GAME_SUPPORTS_SAVE ) +GAME( 1987, arknoid2j, arknoid2, arknoid2, arknid2u, tnzs_state, arknoid2, ROT270, "Taito Corporation", "Arkanoid - Revenge of DOH (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1987, arknoid2b, arknoid2, arknoid2, arknid2u, tnzs_state, arknoid2, ROT270, "bootleg", "Arkanoid - Revenge of DOH (Japan bootleg)", GAME_SUPPORTS_SAVE ) -GAME( 1987, drtoppel, 0, drtoppel, drtoppel, tnzs_state, drtoppel, ROT90, "Kaneko / Taito Corporation Japan", "Dr. Toppel's Adventure (World)", 0 ) /* Possible region hack */ -GAME( 1987, drtoppelu, drtoppel, drtoppel, drtopplu, tnzs_state, drtoppel, ROT90, "Kaneko / Taito America Corporation", "Dr. Toppel's Adventure (US)", 0 ) /* Possible region hack */ -GAME( 1987, drtoppelj, drtoppel, drtoppel, drtopplu, tnzs_state, drtoppel, ROT90, "Kaneko / Taito Corporation", "Dr. Toppel's Tankentai (Japan)", 0 ) +GAME( 1987, drtoppel, 0, drtoppel, drtoppel, tnzs_state, drtoppel, ROT90, "Kaneko / Taito Corporation Japan", "Dr. Toppel's Adventure (World)", GAME_SUPPORTS_SAVE ) /* Possible region hack */ +GAME( 1987, drtoppelu, drtoppel, drtoppel, drtopplu, tnzs_state, drtoppel, ROT90, "Kaneko / Taito America Corporation", "Dr. Toppel's Adventure (US)", GAME_SUPPORTS_SAVE ) /* Possible region hack */ +GAME( 1987, drtoppelj, drtoppel, drtoppel, drtopplu, tnzs_state, drtoppel, ROT90, "Kaneko / Taito Corporation", "Dr. Toppel's Tankentai (Japan)", GAME_SUPPORTS_SAVE ) -GAME( 1988, kageki, 0, kageki, kageki, tnzs_state, kageki, ROT90, "Kaneko / Taito America Corporation (Romstar license)", "Kageki (US)", 0 ) -GAME( 1988, kagekij, kageki, kageki, kagekij, tnzs_state, kageki, ROT90, "Kaneko / Taito Corporation", "Kageki (Japan)", 0 ) -GAME( 1992, kagekih, kageki, kageki, kageki, tnzs_state, kageki, ROT90, "hack", "Kageki (hack)", 0 ) // date is hacked at least, might also be a Japan set hacked to show english +GAME( 1988, kageki, 0, kageki, kageki, tnzs_state, kageki, ROT90, "Kaneko / Taito America Corporation (Romstar license)", "Kageki (US)", GAME_SUPPORTS_SAVE ) +GAME( 1988, kagekij, kageki, kageki, kagekij, tnzs_state, kageki, ROT90, "Kaneko / Taito Corporation", "Kageki (Japan)", GAME_SUPPORTS_SAVE ) +GAME( 1992, kagekih, kageki, kageki, kageki, tnzs_state, kageki, ROT90, "hack", "Kageki (hack)", GAME_SUPPORTS_SAVE ) // date is hacked at least, might also be a Japan set hacked to show english -GAME( 1988, chukatai, 0, tnzs, chukatai, tnzs_state, chukatai, ROT0, "Taito Corporation Japan", "Chuka Taisen (World)", 0 ) /* Possible region hack */ -GAME( 1988, chukataiu, chukatai, tnzs, chukatau, tnzs_state, chukatai, ROT0, "Taito America Corporation", "Chuka Taisen (US)", 0 ) /* Possible region hack */ -GAME( 1988, chukataij, chukatai, tnzs, chukatau, tnzs_state, chukatai, ROT0, "Taito Corporation", "Chuka Taisen (Japan)", 0 ) +GAME( 1988, chukatai, 0, tnzs, chukatai, tnzs_state, chukatai, ROT0, "Taito Corporation Japan", "Chuka Taisen (World)", GAME_SUPPORTS_SAVE ) /* Possible region hack */ +GAME( 1988, chukataiu, chukatai, tnzs, chukatau, tnzs_state, chukatai, ROT0, "Taito America Corporation", "Chuka Taisen (US)", GAME_SUPPORTS_SAVE ) /* Possible region hack */ +GAME( 1988, chukataij, chukatai, tnzs, chukatau, tnzs_state, chukatai, ROT0, "Taito Corporation", "Chuka Taisen (Japan)", GAME_SUPPORTS_SAVE ) -GAME( 1988, tnzs, 0, tnzsb, tnzs, tnzs_state, tnzsb, ROT0, "Taito Corporation Japan", "The NewZealand Story (World, new version) (newer PCB)", 0 ) -GAME( 1988, tnzsj, tnzs, tnzsb, tnzsj, tnzs_state, tnzsb, ROT0, "Taito Corporation", "The NewZealand Story (Japan, new version) (newer PCB)", 0 ) -GAME( 1988, tnzsjo, tnzs, tnzs, tnzsjo, tnzs_state, tnzs, ROT0, "Taito Corporation", "The NewZealand Story (Japan, old version) (older PCB)", 0 ) -GAME( 1988, tnzso, tnzs, tnzs, tnzsop, tnzs_state, tnzs, ROT0, "Taito Corporation Japan", "The NewZealand Story (World, old version) (older PCB)", 0 ) -GAME( 1988, tnzsop, tnzs, tnzs, tnzsop, tnzs_state, tnzs, ROT0, "Taito Corporation Japan", "The NewZealand Story (World, prototype?) (older PCB)", 0 ) +GAME( 1988, tnzs, 0, tnzsb, tnzs, tnzs_state, tnzsb, ROT0, "Taito Corporation Japan", "The NewZealand Story (World, new version) (newer PCB)", GAME_SUPPORTS_SAVE ) +GAME( 1988, tnzsj, tnzs, tnzsb, tnzsj, tnzs_state, tnzsb, ROT0, "Taito Corporation", "The NewZealand Story (Japan, new version) (newer PCB)", GAME_SUPPORTS_SAVE ) +GAME( 1988, tnzsjo, tnzs, tnzs, tnzsjo, tnzs_state, tnzs, ROT0, "Taito Corporation", "The NewZealand Story (Japan, old version) (older PCB)", GAME_SUPPORTS_SAVE ) +GAME( 1988, tnzso, tnzs, tnzs, tnzsop, tnzs_state, tnzs, ROT0, "Taito Corporation Japan", "The NewZealand Story (World, old version) (older PCB)", GAME_SUPPORTS_SAVE ) +GAME( 1988, tnzsop, tnzs, tnzs, tnzsop, tnzs_state, tnzs, ROT0, "Taito Corporation Japan", "The NewZealand Story (World, prototype?) (older PCB)", GAME_SUPPORTS_SAVE ) -GAME( 1988, kabukiz, 0, kabukiz, kabukiz, tnzs_state, kabukiz, ROT0, "Kaneko / Taito Corporation Japan", "Kabuki-Z (World)", 0 ) -GAME( 1988, kabukizj, kabukiz, kabukiz, kabukizj, tnzs_state, kabukiz, ROT0, "Kaneko / Taito Corporation", "Kabuki-Z (Japan)", 0 ) +GAME( 1988, kabukiz, 0, kabukiz, kabukiz, tnzs_state, kabukiz, ROT0, "Kaneko / Taito Corporation Japan", "Kabuki-Z (World)", GAME_SUPPORTS_SAVE ) +GAME( 1988, kabukizj, kabukiz, kabukiz, kabukizj, tnzs_state, kabukiz, ROT0, "Kaneko / Taito Corporation", "Kabuki-Z (Japan)", GAME_SUPPORTS_SAVE ) -GAME( 1989, insectx, 0, insectx, insectx, tnzs_state, insectx, ROT0, "Taito Corporation Japan", "Insector X (World)", 0 ) -GAME( 1989, insectxj, insectx, insectx, insectxj, tnzs_state, insectx, ROT0, "Taito Corporation", "Insector X (Japan)", 0 ) +GAME( 1989, insectx, 0, insectx, insectx, tnzs_state, insectx, ROT0, "Taito Corporation Japan", "Insector X (World)", GAME_SUPPORTS_SAVE ) +GAME( 1989, insectxj, insectx, insectx, insectxj, tnzs_state, insectx, ROT0, "Taito Corporation", "Insector X (Japan)", GAME_SUPPORTS_SAVE ) diff --git a/src/mame/includes/tnzs.h b/src/mame/includes/tnzs.h index 23fb3c25b49..6e3401ae0cd 100644 --- a/src/mame/includes/tnzs.h +++ b/src/mame/includes/tnzs.h @@ -25,19 +25,27 @@ class tnzs_state : public driver_device public: tnzs_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), m_subcpu(*this, "sub"), m_mcu(*this, "mcu"), - m_maincpu(*this, "maincpu"), m_seta001(*this, "spritegen"), m_dac(*this, "dac"), m_samples(*this, "samples"), m_palette(*this, "palette"), m_mainbank(*this, "mainbank") { } - - /* video-related */ - int m_screenflip; + + /* devices */ + required_device m_maincpu; + optional_device m_audiocpu; + optional_device m_subcpu; + optional_device m_mcu; + optional_device m_seta001; + optional_device m_dac; + optional_device m_samples; + required_device m_palette; + optional_device m_mainbank; /* sound-related */ INT16 *m_sampledata[MAX_SAMPLES]; @@ -59,12 +67,6 @@ public: UINT8 m_mcu_credits; int m_bank2; - UINT8* m_ROM; - - /* devices */ - optional_device m_audiocpu; - optional_device m_subcpu; - optional_device m_mcu; DECLARE_WRITE8_MEMBER(tnzsb_sound_command_w); DECLARE_WRITE8_MEMBER(jpopnics_subbankswitch_w); DECLARE_READ8_MEMBER(tnzs_port1_r); @@ -86,6 +88,7 @@ public: DECLARE_WRITE8_MEMBER(kageki_csport_w); DECLARE_WRITE8_MEMBER(kabukiz_sound_bank_w); DECLARE_WRITE8_MEMBER(kabukiz_sample_w); + DECLARE_WRITE_LINE_MEMBER(irqhandler); SAMPLES_START_CB_MEMBER(kageki_init_samples); @@ -104,18 +107,14 @@ public: DECLARE_PALETTE_INIT(arknoid2); DECLARE_MACHINE_START(tnzs_common); DECLARE_MACHINE_RESET(jpopnics); + UINT32 screen_update_tnzs(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); void screen_eof_tnzs(screen_device &screen, bool state); + INTERRUPT_GEN_MEMBER(arknoid2_interrupt); TIMER_CALLBACK_MEMBER(kludge_callback); + void tnzs_postload(); - void mcu_reset( ); - void mcu_handle_coins( int coin ); - DECLARE_WRITE_LINE_MEMBER(irqhandler); - required_device m_maincpu; - optional_device m_seta001; - optional_device m_dac; - optional_device m_samples; - required_device m_palette; - optional_device m_mainbank; + void mcu_reset(); + void mcu_handle_coins(int coin); }; diff --git a/src/mame/machine/tnzs.c b/src/mame/machine/tnzs.c index 28b382c59d7..a439f2eef45 100644 --- a/src/mame/machine/tnzs.c +++ b/src/mame/machine/tnzs.c @@ -624,7 +624,6 @@ MACHINE_RESET_MEMBER(tnzs_state,tnzs) break; } - m_screenflip = 0; m_kageki_csport_sel = 0; m_input_select = 0; m_mcu_readcredits = 0; // this might belong to mcu_reset @@ -633,31 +632,21 @@ MACHINE_RESET_MEMBER(tnzs_state,tnzs) MACHINE_RESET_MEMBER(tnzs_state,jpopnics) { - m_screenflip = 0; m_mcu_type = -1; } -void tnzs_state::tnzs_postload() -{ - membank("subbank")->set_entry(m_bank2); -} - MACHINE_START_MEMBER(tnzs_state,tnzs_common) { UINT8 *SUB = memregion("sub")->base(); - m_ROM = memregion("maincpu")->base(); - + membank("subbank")->configure_entries(0, 4, &SUB[0x08000], 0x2000); membank("subbank")->set_entry(m_bank2); m_bank2 = 0; m_mainbank->set_bank(2); - save_item(NAME(m_screenflip)); save_item(NAME(m_bank2)); - - machine().save().register_postload(save_prepost_delegate(FUNC(tnzs_state::tnzs_postload), this)); } MACHINE_START_MEMBER(tnzs_state,tnzs) -- cgit v1.2.3