From 81f426e59e947a53ee8f1514102241e5c3b2e8b9 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Tue, 17 Nov 2015 18:16:33 +0100 Subject: [PATCH] arkanoid.cpp: zero-fill and save some hexaa specific member variables. Also removed OVERRIDE macros since start and reset functions are common for all the machines in the driver. No functional change expected. (nw) --- src/mame/drivers/arkanoid.cpp | 37 +++++++++++++++++------------------ src/mame/includes/arkanoid.h | 20 ++++++++++--------- src/mame/video/arkanoid.cpp | 2 +- 3 files changed, 30 insertions(+), 29 deletions(-) diff --git a/src/mame/drivers/arkanoid.cpp b/src/mame/drivers/arkanoid.cpp index 3ed22627d6b..c7b60ad8acd 100644 --- a/src/mame/drivers/arkanoid.cpp +++ b/src/mame/drivers/arkanoid.cpp @@ -811,13 +811,13 @@ ADDRESS_MAP_END READ8_MEMBER(arkanoid_state::hexaa_f000_r) { -// return hexaa_from_sub; +// return m_hexaa_from_sub; return rand(); } WRITE8_MEMBER(arkanoid_state::hexaa_f000_w) { - hexaa_from_main = data; + m_hexaa_from_main = data; } static ADDRESS_MAP_START( hexaa_map, AS_PROGRAM, 8, arkanoid_state ) @@ -840,12 +840,12 @@ ADDRESS_MAP_END WRITE8_MEMBER(arkanoid_state::hexaa_sub_80_w) { - hexaa_from_sub = data; + m_hexaa_from_sub = data; } READ8_MEMBER(arkanoid_state::hexaa_sub_90_r) { - return hexaa_from_main; + return m_hexaa_from_main; // return rand(); } @@ -1183,7 +1183,7 @@ GFXDECODE_END /* Machine Drivers */ -MACHINE_START_MEMBER(arkanoid_state,arkanoid) +void arkanoid_state::machine_start() { save_item(NAME(m_bootleg_cmd)); @@ -1204,7 +1204,7 @@ MACHINE_START_MEMBER(arkanoid_state,arkanoid) save_item(NAME(m_palettebank)); } -MACHINE_RESET_MEMBER(arkanoid_state,arkanoid) +void arkanoid_state::machine_reset() { m_port_a_in = 0; m_port_a_out = 0; @@ -1245,9 +1245,6 @@ static MACHINE_CONFIG_START( arkanoid, arkanoid_state ) MCFG_QUANTUM_TIME(attotime::from_hz(6000)) // 100 CPU slices per second to synchronize between the MCU and the main CPU - MCFG_MACHINE_START_OVERRIDE(arkanoid_state,arkanoid) - MCFG_MACHINE_RESET_OVERRIDE(arkanoid_state,arkanoid) - /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) // MCFG_SCREEN_REFRESH_RATE(60) @@ -1260,7 +1257,6 @@ static MACHINE_CONFIG_START( arkanoid, arkanoid_state ) MCFG_GFXDECODE_ADD("gfxdecode", "palette", arkanoid) MCFG_PALETTE_ADD_RRRRGGGGBBBB_PROMS("palette", 512) - MCFG_VIDEO_START_OVERRIDE(arkanoid_state,arkanoid) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") @@ -1279,9 +1275,6 @@ static MACHINE_CONFIG_START( hexa, arkanoid_state ) MCFG_CPU_PROGRAM_MAP(hexa_map) MCFG_CPU_VBLANK_INT_DRIVER("screen", arkanoid_state, irq0_line_hold) - MCFG_MACHINE_START_OVERRIDE(arkanoid_state,arkanoid) - MCFG_MACHINE_RESET_OVERRIDE(arkanoid_state,arkanoid) - /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) // MCFG_SCREEN_REFRESH_RATE(60) @@ -1294,7 +1287,6 @@ static MACHINE_CONFIG_START( hexa, arkanoid_state ) MCFG_GFXDECODE_ADD("gfxdecode", "palette", hexa) MCFG_PALETTE_ADD_RRRRGGGGBBBB_PROMS("palette", 256) - MCFG_VIDEO_START_OVERRIDE(arkanoid_state,arkanoid) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") @@ -1335,9 +1327,6 @@ static MACHINE_CONFIG_START( brixian, arkanoid_state ) /* there is a 68705 but it's only role appears to be to copy data to RAM at startup */ /* the RAM is also battery backed, making the 68705 almost reundant as long as the battery doesn't die(!) */ - MCFG_MACHINE_START_OVERRIDE(arkanoid_state,arkanoid) - MCFG_MACHINE_RESET_OVERRIDE(arkanoid_state,arkanoid) - /* video hardware */ MCFG_SCREEN_ADD("screen", RASTER) // MCFG_SCREEN_REFRESH_RATE(60) @@ -1350,7 +1339,6 @@ static MACHINE_CONFIG_START( brixian, arkanoid_state ) MCFG_GFXDECODE_ADD("gfxdecode", "palette", arkanoid) MCFG_PALETTE_ADD_RRRRGGGGBBBB_PROMS("palette", 512) - MCFG_VIDEO_START_OVERRIDE(arkanoid_state,arkanoid) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") @@ -2037,6 +2025,17 @@ DRIVER_INIT_MEMBER(arkanoid_state,hexa) membank("bank1")->configure_entries(0, 2, &RAM[0x10000], 0x4000); } +DRIVER_INIT_MEMBER(arkanoid_state,hexaa) +{ + DRIVER_INIT_CALL(hexa); + + m_hexaa_from_main = 0; + m_hexaa_from_sub = 0; + + save_item(NAME(m_hexaa_from_main)); + save_item(NAME(m_hexaa_from_sub)); +} + DRIVER_INIT_MEMBER(arkanoid_state,brixian) { UINT8 *RAM = memregion("protdata")->base(); @@ -2076,6 +2075,6 @@ GAME( 1987, arkatour, 0, arkanoid, arkanoid, driver_device, 0, R GAME( 19??, tetrsark, 0, bootleg, tetrsark, arkanoid_state, tetrsark, ROT0, "D.R. Korea", "Tetris (D.R. Korea)", MACHINE_SUPPORTS_SAVE ) GAME( 199?, hexa, 0, hexa, hexa, arkanoid_state, hexa, ROT0, "D.R. Korea", "Hexa", MACHINE_IMPERFECT_SOUND | MACHINE_SUPPORTS_SAVE ) -GAME( 199?, hexaa, hexa, hexaa, hexa, arkanoid_state, hexa, ROT0, "D.R. Korea", "Hexa (with 2xZ80, protected)", MACHINE_NOT_WORKING ) +GAME( 199?, hexaa, hexa, hexaa, hexa, arkanoid_state, hexaa, ROT0, "D.R. Korea", "Hexa (with 2xZ80, protected)", MACHINE_NOT_WORKING ) GAME( 1993, brixian, 0, brixian, brixian, arkanoid_state, brixian, ROT0, "Cheil Computer System", "Brixian", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/includes/arkanoid.h b/src/mame/includes/arkanoid.h index 79cf2ea6739..2239c036cbd 100644 --- a/src/mame/includes/arkanoid.h +++ b/src/mame/includes/arkanoid.h @@ -20,8 +20,8 @@ public: m_videoram(*this,"videoram"), m_spriteram(*this,"spriteram"), m_protram(*this,"protram"), - m_mcu(*this, "mcu"), m_maincpu(*this, "maincpu"), + m_mcu(*this, "mcu"), m_gfxdecode(*this, "gfxdecode"), m_palette(*this, "palette") { } @@ -52,11 +52,15 @@ public: UINT8 m_bootleg_cmd; /* hexaa */ - UINT8 hexaa_from_main; - UINT8 hexaa_from_sub; + UINT8 m_hexaa_from_main; + UINT8 m_hexaa_from_sub; /* devices */ + required_device m_maincpu; optional_device m_mcu; + required_device m_gfxdecode; + required_device m_palette; + DECLARE_READ8_MEMBER(arkanoid_Z80_mcu_r); DECLARE_WRITE8_MEMBER(arkanoid_Z80_mcu_w); DECLARE_READ8_MEMBER(arkanoid_68705_port_a_r); @@ -84,6 +88,7 @@ public: DECLARE_DRIVER_INIT(block2); DECLARE_DRIVER_INIT(arkblock); DECLARE_DRIVER_INIT(hexa); + DECLARE_DRIVER_INIT(hexaa); DECLARE_DRIVER_INIT(paddle2); DECLARE_DRIVER_INIT(tetrsark); DECLARE_DRIVER_INIT(arkgcbl); @@ -92,15 +97,12 @@ public: DECLARE_DRIVER_INIT(arkangc); DECLARE_DRIVER_INIT(brixian); TILE_GET_INFO_MEMBER(get_bg_tile_info); - DECLARE_MACHINE_START(arkanoid); - DECLARE_MACHINE_RESET(arkanoid); - DECLARE_VIDEO_START(arkanoid); + virtual void machine_start(); + virtual void machine_reset(); + virtual void video_start(); UINT32 screen_update_arkanoid(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); UINT32 screen_update_hexa(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); TIMER_CALLBACK_MEMBER(test); void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); void arkanoid_bootleg_init( ); - required_device m_maincpu; - required_device m_gfxdecode; - required_device m_palette; }; diff --git a/src/mame/video/arkanoid.cpp b/src/mame/video/arkanoid.cpp index 12041d9742c..a7d2fdb62da 100644 --- a/src/mame/video/arkanoid.cpp +++ b/src/mame/video/arkanoid.cpp @@ -171,7 +171,7 @@ TILE_GET_INFO_MEMBER(arkanoid_state::get_bg_tile_info) SET_TILE_INFO_MEMBER(0, code, color, 0); } -VIDEO_START_MEMBER(arkanoid_state,arkanoid) +void arkanoid_state::video_start() { m_bg_tilemap = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(arkanoid_state::get_bg_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); }