From 3c3bfa7883447a03b674057b3561c2739685924d Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Mon, 4 Mar 2024 18:12:55 +0100 Subject: New working clones ------------------ Rail Chase (Japan, Rev B) [CoolMod, The Dumping Union] Run Run (Do! Run Run bootleg) [Bisboch] - unico/unico.cpp: consolidated driver in single file --- src/mame/exidy/exidyttl.cpp | 88 ++--- src/mame/mame.lst | 2 + src/mame/sega/segaybd.cpp | 57 ++++ src/mame/unico/unico.cpp | 708 ++++++++++++++++++++++++++++++---------- src/mame/unico/unico.h | 126 ------- src/mame/unico/unico_v.cpp | 269 --------------- src/mame/universal/docastle.cpp | 37 +++ 7 files changed, 651 insertions(+), 636 deletions(-) delete mode 100644 src/mame/unico/unico.h delete mode 100644 src/mame/unico/unico_v.cpp diff --git a/src/mame/exidy/exidyttl.cpp b/src/mame/exidy/exidyttl.cpp index 289c5d3df13..e4794dfcc4e 100644 --- a/src/mame/exidy/exidyttl.cpp +++ b/src/mame/exidy/exidyttl.cpp @@ -55,20 +55,11 @@ public: } void attack(machine_config &config); - void deathrac(machine_config &config); - void destdrby(machine_config &config); private: // devices required_device m_maincpu; required_device m_video; - - // driver_device overrides - virtual void machine_start() override; - virtual void machine_reset() override; - - virtual void video_start() override; - }; @@ -86,20 +77,6 @@ static NETLIST_START(attack) } - -void exidyttl_state::machine_start() -{ -} - -void exidyttl_state::machine_reset() -{ -} - - -void exidyttl_state::video_start() -{ -} - void exidyttl_state::attack(machine_config &config) { /* basic machine hardware */ @@ -115,25 +92,6 @@ void exidyttl_state::attack(machine_config &config) m_video->set_threshold(0.30); } -void exidyttl_state::destdrby(machine_config &config) -{ - /* basic machine hardware */ - NETLIST_CPU(config, m_maincpu, netlist::config::DEFAULT_CLOCK()).set_source(netlist_attack); - - /* video hardware */ - SCREEN(config, "screen", SCREEN_TYPE_RASTER); - FIXFREQ(config, m_video).set_screen("screen"); - m_video->set_monitor_clock(MASTER_CLOCK); - m_video->set_horz_params(H_TOTAL-67,H_TOTAL-40,H_TOTAL-8,H_TOTAL); - m_video->set_vert_params(V_TOTAL-22,V_TOTAL-19,V_TOTAL-12,V_TOTAL); - m_video->set_fieldcount(1); - m_video->set_threshold(0.30); -} - -void exidyttl_state::deathrac(machine_config& config) -{ - destdrby(config); -} /*************************************************************************** @@ -154,7 +112,7 @@ ROM_START( attckexd ) ROM_LOAD( "attack.k6", 0x0000, 0x0100, CRC(e120839f) SHA1(74dc19a732238d35e467d814ead581a60463aaa2) ) ROM_END -ROM_START( attckexd2 ) // These are likely an overdump, but we are waiting for confirmation before removing the files +ROM_START( attckexd2 ) // These are likely an overdump, but confirmation is needed before removing the files ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 ) ROM_REGION( 0x0400, "roms", ROMREGION_ERASE00 ) @@ -254,24 +212,24 @@ ROM_START( deathrac ) ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASE00 ) ROM_REGION( 0x0400, "roms", ROMREGION_ERASE00 ) - ROM_LOAD( "6331-31.a11", 0x0000, 0x0020, CRC(f304a1fb) SHA1(0f029274bb99723ebcc271d761e1500ca50b2738) ) - ROM_LOAD( "6331-32.c12", 0x0000, 0x0020, CRC(f8dbd779) SHA1(55bdaf9eb1ba6185e20512c4874ebb625861508e) ) - ROM_LOAD( "6331-33.p14", 0x0000, 0x0020, CRC(2e83bf80) SHA1(02fcc1e879c06759a21ef4f004fe7aa790814112) ) + ROM_LOAD( "6331-31.11a", 0x0000, 0x0020, CRC(f304a1fb) SHA1(0f029274bb99723ebcc271d761e1500ca50b2738) ) + ROM_LOAD( "6331-32.12c", 0x0000, 0x0020, CRC(f8dbd779) SHA1(55bdaf9eb1ba6185e20512c4874ebb625861508e) ) + ROM_LOAD( "6331-33.14p", 0x0000, 0x0020, CRC(2e83bf80) SHA1(02fcc1e879c06759a21ef4f004fe7aa790814112) ) // Note: Image for 36 has all zeros in the second half, which is unused. This is verified correct from a real board. - // Other roms in this series (34,35) all have duplicate content in the second half - ROM_LOAD( "6331-36.e7", 0x0000, 0x0020, CRC(bb743b79) SHA1(8eb73782bcea7dbba7b75db32307e562248691bb) ) - ROM_LOAD( "6331-35.g7", 0x0000, 0x0020, CRC(5ed8cdd2) SHA1(d193d819ad634c43d648ce49073799b4df6dfd2f) ) - ROM_LOAD( "6331-36.r7", 0x0000, 0x0020, CRC(bb743b79) SHA1(8eb73782bcea7dbba7b75db32307e562248691bb) ) - ROM_LOAD( "6331-35.t7", 0x0000, 0x0020, CRC(5ed8cdd2) SHA1(d193d819ad634c43d648ce49073799b4df6dfd2f) ) - - ROM_LOAD( "6301-91.j10", 0x0000, 0x0100, CRC(c3823f0b) SHA1(42fe8c1e0f54b3f968a630dd564a8941410c5d86) ) - ROM_LOAD( "6301-91.v10", 0x0000, 0x0100, CRC(c3823f0b) SHA1(42fe8c1e0f54b3f968a630dd564a8941410c5d86) ) - ROM_LOAD( "6301-92.j5", 0x0000, 0x0100, CRC(82d7d25f) SHA1(d4b3a6655f91647545d493c2ff996daa66df0395) ) - ROM_LOAD( "6301-92.v5", 0x0000, 0x0100, CRC(82d7d25f) SHA1(d4b3a6655f91647545d493c2ff996daa66df0395) ) - ROM_LOAD( "6301-97.m11", 0x0000, 0x0100, CRC(2b02444f) SHA1(e1fc01f7271109515438542a223efc0042f794a5) ) - ROM_LOAD( "6301-98.l11", 0x0000, 0x0100, CRC(0bdaf1eb) SHA1(67976e73bfdc4d42a520212d020dd52d51667674) ) - ROM_LOAD( "6301-99.k11", 0x0000, 0x0100, CRC(34763c8f) SHA1(2012ace666e8b82a89a0c15511ee80173d9700bc) ) - ROM_LOAD( "6301-100.j11", 0x0000, 0x0100, CRC(d751bd57) SHA1(a6208af40661bf3cd50363d2ece38cd3b9f6a7a0) ) + // Other ROMs in this series (34,35) all have duplicate content in the second half + ROM_LOAD( "6331-36.7e", 0x0000, 0x0020, CRC(bb743b79) SHA1(8eb73782bcea7dbba7b75db32307e562248691bb) ) + ROM_LOAD( "6331-35.7g", 0x0000, 0x0020, CRC(5ed8cdd2) SHA1(d193d819ad634c43d648ce49073799b4df6dfd2f) ) + ROM_LOAD( "6331-36.7r", 0x0000, 0x0020, CRC(bb743b79) SHA1(8eb73782bcea7dbba7b75db32307e562248691bb) ) + ROM_LOAD( "6331-35.7t", 0x0000, 0x0020, CRC(5ed8cdd2) SHA1(d193d819ad634c43d648ce49073799b4df6dfd2f) ) + + ROM_LOAD( "6301-91.10j", 0x0000, 0x0100, CRC(c3823f0b) SHA1(42fe8c1e0f54b3f968a630dd564a8941410c5d86) ) + ROM_LOAD( "6301-91.10v", 0x0000, 0x0100, CRC(c3823f0b) SHA1(42fe8c1e0f54b3f968a630dd564a8941410c5d86) ) + ROM_LOAD( "6301-92.5j", 0x0000, 0x0100, CRC(82d7d25f) SHA1(d4b3a6655f91647545d493c2ff996daa66df0395) ) + ROM_LOAD( "6301-92.5v", 0x0000, 0x0100, CRC(82d7d25f) SHA1(d4b3a6655f91647545d493c2ff996daa66df0395) ) + ROM_LOAD( "6301-97.11m", 0x0000, 0x0100, CRC(2b02444f) SHA1(e1fc01f7271109515438542a223efc0042f794a5) ) + ROM_LOAD( "6301-98.11l", 0x0000, 0x0100, CRC(0bdaf1eb) SHA1(67976e73bfdc4d42a520212d020dd52d51667674) ) + ROM_LOAD( "6301-99.11k", 0x0000, 0x0100, CRC(34763c8f) SHA1(2012ace666e8b82a89a0c15511ee80173d9700bc) ) + ROM_LOAD( "6301-100.11j", 0x0000, 0x0100, CRC(d751bd57) SHA1(a6208af40661bf3cd50363d2ece38cd3b9f6a7a0) ) ROM_END #define rom_rhunting rom_deathrac @@ -279,8 +237,8 @@ ROM_END } // anonymous namespace -GAME( 1977, attckexd, 0, attack, 0, exidyttl_state, empty_init, ROT0, "Exidy", "Attack (set 1) [TTL]", MACHINE_IS_SKELETON ) -GAME( 1977, attckexd2, attckexd, attack, 0, exidyttl_state, empty_init, ROT0, "Exidy", "Attack (set 2) [TTL]", MACHINE_IS_SKELETON ) -GAME( 1976, deathrac, 0, deathrac, 0, exidyttl_state, empty_init, ROT0, "Exidy", "Death Race [TTL]", MACHINE_IS_SKELETON ) -GAME( 1976, destdrby, 0, destdrby, 0, exidyttl_state, empty_init, ROT0, "Exidy", "Destruction Derby [TTL]", MACHINE_IS_SKELETON) -GAME( 1976, rhunting, deathrac, deathrac, 0, exidyttl_state, empty_init, ROT0, "bootleg", "Robot Hunting (bootleg of Death Race) [TTL]",MACHINE_IS_SKELETON ) +GAME( 1977, attckexd, 0, attack, 0, exidyttl_state, empty_init, ROT0, "Exidy", "Attack (set 1) [TTL]", MACHINE_IS_SKELETON ) +GAME( 1977, attckexd2, attckexd, attack, 0, exidyttl_state, empty_init, ROT0, "Exidy", "Attack (set 2) [TTL]", MACHINE_IS_SKELETON ) +GAME( 1976, deathrac, 0, attack, 0, exidyttl_state, empty_init, ROT0, "Exidy", "Death Race [TTL]", MACHINE_IS_SKELETON ) +GAME( 1976, destdrby, 0, attack, 0, exidyttl_state, empty_init, ROT0, "Exidy", "Destruction Derby [TTL]", MACHINE_IS_SKELETON) +GAME( 1976, rhunting, deathrac, attack, 0, exidyttl_state, empty_init, ROT0, "bootleg", "Robot Hunting (bootleg of Death Race) [TTL]",MACHINE_IS_SKELETON ) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 6e6f3549715..26e659471eb 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -40164,6 +40164,7 @@ pdriftj // 1988.09 Power Drift (Japan) pdriftl // rchase // 1991.09 Rail Chase (World) rchasej // 1991.09 Rail Chase (Japan) +rchasejb // 1991.09 Rail Chase (Japan) strkfgtr // 1991.06 Strike Fighter (World) strkfgtrj // 1991.06 Strike Fighter (Japan) @@ -45334,6 +45335,7 @@ idsoccera // ???? (c) 1985 idsoccert // 8461A (c) 1985 jjack // ???? (c) 1984 kickridr // ???? (c) 1984 +runrun // bootleg spiero // ???? (c) 1987 @source:universal/getaway.cpp diff --git a/src/mame/sega/segaybd.cpp b/src/mame/sega/segaybd.cpp index cbd8c7285c0..404e738aebe 100644 --- a/src/mame/sega/segaybd.cpp +++ b/src/mame/sega/segaybd.cpp @@ -2744,6 +2744,62 @@ ROM_START( rchasej ) ROM_LOAD( "mpr-13994.105", 0x100000, 0x80000, CRC(76095538) SHA1(aab830e3675116c475fe69e0e991118c045b131b) ) ROM_END +ROM_START( rchasejb ) // only the "suby" CPU ROMs were updated (?) + ROM_REGION( 0x080000, "maincpu", 0 ) // M + ROM_LOAD16_BYTE( "epr-13986.25", 0x000000, 0x20000, CRC(388b2365) SHA1(0f006f9120b96b8d8be968878ce1d6dd853cd977) ) + ROM_LOAD16_BYTE( "epr-13985.24", 0x000001, 0x20000, CRC(14dba5d4) SHA1(ad09c55273ab1105630f2f76019aedc234fb9292) ) + ROM_LOAD16_BYTE( "epr-13988.27", 0x040000, 0x20000, CRC(dc1cd5a4) SHA1(3b2b6afbeb7daa7c0cc75279bc495221c2508e25) ) + ROM_LOAD16_BYTE( "epr-13987.26", 0x040001, 0x20000, CRC(43be9e60) SHA1(107a9c126c2bff9030fe621f6b4ab8f29c994ef2) ) + + ROM_REGION( 0x040000, "subx", 0 ) // X + ROM_LOAD16_BYTE( "epr-13992a.81", 0x000000, 0x20000, CRC(c5d525b6) SHA1(1fab7f761be67b67ee346a1af1f1fe12aef87dc5) ) + ROM_LOAD16_BYTE( "epr-13991a.80", 0x000001, 0x20000, CRC(299e3c7c) SHA1(e4903816ec364e9352abd1180e8a609fed75e1a7) ) + + ROM_REGION( 0x040000, "suby", 0 ) // Y + ROM_LOAD16_BYTE( "epr-13990b.54", 0x000000, 0x20000, CRC(eeffbeeb) SHA1(5f2f808cd37158d14dd2e4a0a68a41514d3954fb) ) + ROM_LOAD16_BYTE( "epr-13989b.53", 0x000001, 0x20000, CRC(fea9f1e9) SHA1(54daad8bf25b17c494615fd4ec619d9693d85ba0) ) + + ROM_REGION16_BE( 0x080000, "bsprites", 0 ) + ROM_LOAD16_BYTE( "mpr-13999.16", 0x000000, 0x40000, CRC(9a1dd53c) SHA1(cb01f2c64554914ea693879dfcb498181a1e7a9a) ) + ROM_LOAD16_BYTE( "mpr-13997.14", 0x000001, 0x40000, CRC(1fdf1b87) SHA1(ed46af0f72081d545015b73a8d12240664f29506) ) + + ROM_REGION64_BE( 0xc00000, "ysprites", 0) + ROM_LOAD64_BYTE( "mpr-14021.67", 0x000000, 0x80000, CRC(9fa88781) SHA1(a035fd0fe1d37a589adf3a5029c20d237d5cc827) ) + ROM_LOAD64_BYTE( "mpr-14022.75", 0x000001, 0x80000, CRC(49e824bb) SHA1(c1330719b5718aa664b5788244d8cb7b7103a57c) ) + ROM_LOAD64_BYTE( "mpr-14009.63", 0x000002, 0x80000, CRC(35b5187e) SHA1(6f0f6471c4135d07a2c852cdc50322b99176712e) ) + ROM_LOAD64_BYTE( "mpr-14010.71", 0x000003, 0x80000, CRC(9a538b9b) SHA1(cd84a39bd3858fa6c1d8eb4a349d939261cea6b6) ) + ROM_LOAD64_BYTE( "mpr-14023.86", 0x000004, 0x80000, CRC(e11c6c67) SHA1(839e71690e75e47d11b758f5b525452bcc75b823) ) + ROM_LOAD64_BYTE( "mpr-14024.114", 0x000005, 0x80000, CRC(16344535) SHA1(a9bd101ae93c24a2e8002ad6a111cf0d0d3b1a64) ) + ROM_LOAD64_BYTE( "mpr-14011.82", 0x000006, 0x80000, CRC(78e9983b) SHA1(c0f6577b55acda2cc8cdf0884d5c0517f79de4e9) ) + ROM_LOAD64_BYTE( "mpr-14012.110", 0x000007, 0x80000, CRC(e9daa1a4) SHA1(24ad782e88a586fbb31f7ad86be4cdeb38823102) ) + + ROM_LOAD64_BYTE( "mpr-14017.66", 0x400000, 0x80000, CRC(b83df159) SHA1(f0cf99e6ddae1d26fd68240a731f3e28e9c6073b) ) + ROM_LOAD64_BYTE( "mpr-14018.74", 0x400001, 0x80000, CRC(76dbe9ce) SHA1(2f5af8d015cf8fb90a0862bc37235bc20d4dac0d) ) + ROM_LOAD64_BYTE( "mpr-14005.62", 0x400002, 0x80000, CRC(9e998209) SHA1(c0d39d11d554fd6a43db77ccf96ac04dd634edff) ) + ROM_LOAD64_BYTE( "mpr-14006.70", 0x400003, 0x80000, CRC(2caddf1a) SHA1(a2e891e65c7cd156a3131a084ff51ae9b1663bc0) ) + ROM_LOAD64_BYTE( "mpr-14019.85", 0x400004, 0x80000, CRC(b15e19ff) SHA1(947c35301875b4842835f2ba6aca216f087a3fc7) ) + ROM_LOAD64_BYTE( "mpr-14020.113", 0x400005, 0x80000, CRC(84c7008f) SHA1(b92f3c636c5d91c5b1c6090a48be7bb1be6b927e) ) + ROM_LOAD64_BYTE( "mpr-14007.81", 0x400006, 0x80000, CRC(c3cf5faa) SHA1(02bca1b248fcb6313cd529ca2aa0f7516177166b) ) + ROM_LOAD64_BYTE( "mpr-14008.109", 0x400007, 0x80000, CRC(7e91beb2) SHA1(bc1a7ce68d6b825daf93ca437dda803857cee0a2) ) + + ROM_LOAD64_BYTE( "mpr-14013.65", 0x800000, 0x80000, CRC(31dbb2c3) SHA1(3efeff785d78056e2615dc2267f7bb80a6d4c663) ) + ROM_LOAD64_BYTE( "mpr-14014.73", 0x800001, 0x80000, CRC(7e68257d) SHA1(600d1066cfa83f5df46e240a473a8f04179e70f8) ) + ROM_LOAD64_BYTE( "mpr-14001.61", 0x800002, 0x80000, CRC(71031ad0) SHA1(02b6240461d66907199f846310e72d37faa5fb50) ) + ROM_LOAD64_BYTE( "mpr-14002.69", 0x800003, 0x80000, CRC(27e70a5e) SHA1(fa767f6cc8e46c0e804c37666a8499376c09b025) ) + ROM_LOAD64_BYTE( "mpr-14015.84", 0x800004, 0x80000, CRC(7540bf85) SHA1(e8f9208aea6ecedb6ae810a362476cdf1d424319) ) + ROM_LOAD64_BYTE( "mpr-14016.112", 0x800005, 0x80000, CRC(7d87b94d) SHA1(4ef5b7b114c25b9e274e3f3dd7e3d7bd29d2d8b9) ) + ROM_LOAD64_BYTE( "mpr-14003.80", 0x800006, 0x80000, CRC(87725d74) SHA1(d284512ad15362a886072aaa1a3af98f7a0bddf9) ) + ROM_LOAD64_BYTE( "mpr-14004.108", 0x800007, 0x80000, CRC(73477291) SHA1(1fe9d7666d89ee55a0178dceb7cfea7ce94b9e18) ) + + ROM_REGION( 0x10000, "soundcpu", 0 ) // Z80 sound CPU + ROM_LOAD( "epr-13993.102", 0x000000, 0x10000, CRC(7cc3b543) SHA1(c5e6a2dca891d0b6528e6d66ccd18b24ed4a9464) ) + + ROM_REGION( 0x200000, "pcm", ROMREGION_ERASEFF ) // SegaPCM samples + ROM_LOAD( "mpr-13996.107", 0x000000, 0x80000, CRC(345f5a41) SHA1(d414c3485ba31863c2b36282756709e06a41d262) ) + ROM_LOAD( "mpr-13995.106", 0x080000, 0x80000, CRC(f604c270) SHA1(02023786fec2f2702c2f19f51aff5b7e4928ae91) ) + ROM_LOAD( "mpr-13994.105", 0x100000, 0x80000, CRC(76095538) SHA1(aab830e3675116c475fe69e0e991118c045b131b) ) +ROM_END + //************************************************************************************************************************* //************************************************************************************************************************* @@ -2983,6 +3039,7 @@ GAMEL(1988, pdriftl, 0, yboard_link, pdriftl, segaybd_state, init_pd GAME( 1991, rchase, 0, yboard, rchase, segaybd_state, init_rchase, ROT0, "Sega", "Rail Chase (World)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, rchasej, rchase, yboard, rchase, segaybd_state, init_rchase, ROT0, "Sega", "Rail Chase (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1991, rchasejb, rchase, yboard, rchase, segaybd_state, init_rchase, ROT0, "Sega", "Rail Chase (Japan, Rev B)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, strkfgtr, 0, yboard, strkfgtr, segaybd_state, init_gloc, ROT0, "Sega", "Strike Fighter (World)", MACHINE_SUPPORTS_SAVE ) GAME( 1991, strkfgtrj, strkfgtr, yboard, strkfgtr, segaybd_state, init_gloc, ROT0, "Sega", "Strike Fighter (Japan)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/unico/unico.cpp b/src/mame/unico/unico.cpp index b4caf8aa6ee..3186102115d 100644 --- a/src/mame/unico/unico.cpp +++ b/src/mame/unico/unico.cpp @@ -1,5 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:Luca Elia +// copyright-holders: Luca Elia + /*************************************************************************** -= Unico Games =- @@ -25,17 +26,390 @@ Year + Game PCB Notes ***************************************************************************/ #include "emu.h" -#include "unico.h" #include "cpu/m68000/m68000.h" #include "cpu/m68000/m68020.h" #include "machine/eepromser.h" #include "sound/okim6295.h" -#include "sound/ymopm.h" #include "sound/ymopl.h" +#include "sound/ymopm.h" + +#include "emupal.h" +#include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class burglarx_state : public driver_device +{ +public: + burglarx_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_palette(*this, "palette"), + m_gfxdecode(*this, "gfxdecode"), + m_oki(*this, "oki"), + m_leds(*this, "led%u", 0U), + m_vram(*this, "vram", 0xc000, ENDIANNESS_BIG), + m_scroll(*this, "scroll", 22, ENDIANNESS_BIG), + m_spriteram(*this, "spriteram", 0x800, ENDIANNESS_BIG) + { } + + void burglarx(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void video_start() override; + + static rgb_t unico_R6G6B6X(uint32_t raw); + uint16_t vram_r(offs_t offset); + void vram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + uint16_t scroll_r(offs_t offset); + void scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + uint16_t spriteram_r(offs_t offset); + void spriteram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); + + void okibank_w(uint8_t data); + TILE_GET_INFO_MEMBER(get_tile_info); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + void program_map(address_map &map); + + required_device m_maincpu; + required_device m_palette; + required_device m_gfxdecode; + optional_device m_oki; + output_finder<2> m_leds; + +private: + memory_share_creator m_vram; + memory_share_creator m_scroll; + tilemap_t *m_tilemap[3]{}; + int m_sprites_scrolldx = 0; + int m_sprites_scrolldy = 0; + memory_share_creator m_spriteram; +}; + +class zeropnt_state : public burglarx_state +{ +public: + zeropnt_state(const machine_config &mconfig, device_type type, const char *tag) : + burglarx_state(mconfig, type, tag), + m_okibank(*this, "okibank"), + m_screen(*this, "screen"), + m_gun_axes(*this, { "Y0", "X0", "Y1", "X1" }) + { } + + void zeropnt(machine_config &config); + +protected: + virtual void machine_start() override; + + required_memory_bank m_okibank; + + required_device m_screen; + + enum { Y0, X0, Y1, X1 }; // gun axis indices + + template uint16_t gunx_msb_r(); + template uint16_t guny_msb_r(); + + void oki_map(address_map &map); + +private: + required_ioport_array<4> m_gun_axes; + + void okibank_leds_w(uint8_t data); + + void program_map(address_map &map); +}; + +class zeropnt2_state : public zeropnt_state +{ +public: + zeropnt2_state(const machine_config &mconfig, device_type type, const char *tag) : + zeropnt_state(mconfig, type, tag), + m_eeprom(*this, "eeprom") + { } + + void zeropnt2(machine_config &config); + +protected: + virtual void machine_start() override; + +private: + required_device m_eeprom; + + template uint32_t gunx_msb_r(); + template uint32_t guny_msb_r(); + void okibank(uint8_t data); + void leds_w(uint8_t data); + + void eeprom_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); + + void program_map(address_map &map); +}; + + +// video + +/*************************************************************************** + +Note: if MAME_DEBUG is defined, pressing Z with: + + Q / W / E Shows Layer 0 / 1 / 2 + A Shows Sprites + + Keys can be used together! + + + [ 3 Scrolling Layers ] + + Tile Size: 16 x 16 x 8 + Layer Size (tiles): 64 x 64 + + [ 512 Sprites ] + + Sprites are made of 16 x 16 x 8 tiles. Size can vary from 1 to + 16 tiles horizontally, while their height is always 1 tile. + There seems to be 4 levels of priority (wrt layers) for each + sprite, following this simple scheme: + + [if we denote the three layers with 0-3 (0 being the backmost) + and the sprite with S] + + Sprite Priority Order (back -> front) + 0 S 0 1 2 + 1 0 S 1 2 + 2 0 1 S 2 + 3 0 1 2 S + +***************************************************************************/ + +/*************************************************************************** + + Palette + + Byte: 0 1 2 3 + Gun: R G B 0 + + 6 Bits x Gun + +***************************************************************************/ + +rgb_t burglarx_state::unico_R6G6B6X(uint32_t raw) +{ + int const red = (raw >> 24) & 0xfc; + int const green = (raw >> 16) & 0xfc; + int const blue = (raw >> 8) & 0xfc; + + return rgb_t(red | (red >> 6), green | (green >> 6), blue | (blue >> 6)); +} + +/*************************************************************************** + + Tilemaps + + Offset: Bits: Value: + + 0.w Code + 2.w fedc ba98 7--- ---- + ---- ---- -6-- ---- Flip Y + ---- ---- --5- ---- Flip X + ---- ---- ---4 3210 Color + +***************************************************************************/ + + +TILE_GET_INFO_MEMBER(burglarx_state::get_tile_info) +{ + uint16_t const *vram = (uint16_t *)tilemap.user_data(); + uint16_t const code = vram[2 * tile_index + 0]; + uint16_t const attr = vram[2 * tile_index + 1]; + tileinfo.set(1, code, attr & 0x1f, TILE_FLIPYX(attr >> 5)); +} + +uint16_t burglarx_state::vram_r(offs_t offset) { return m_vram[offset]; } + +void burglarx_state::vram_w(offs_t offset, uint16_t data, uint16_t mem_mask) +{ + int const tile = ((offset / 0x2000) + 1) % 3; + COMBINE_DATA(&m_vram[offset]); + m_tilemap[tile]->mark_tile_dirty((offset & 0x1fff) / 2); +} + + +uint16_t burglarx_state::scroll_r(offs_t offset) { return m_scroll[offset]; } +void burglarx_state::scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask) { COMBINE_DATA(&m_scroll[offset]); } +uint16_t burglarx_state::spriteram_r(offs_t offset) { return m_spriteram[offset]; } +void burglarx_state::spriteram_w(offs_t offset, uint16_t data, uint16_t mem_mask) { COMBINE_DATA(&m_spriteram[offset]); } +/*************************************************************************** + + + Video Hardware Init + + +***************************************************************************/ + + +void burglarx_state::video_start() +{ + m_tilemap[0] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(burglarx_state::get_tile_info)), TILEMAP_SCAN_ROWS, 0x10, 0x10, 0x40, 0x40); + + m_tilemap[1] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(burglarx_state::get_tile_info)), TILEMAP_SCAN_ROWS, 0x10, 0x10, 0x40, 0x40); + + m_tilemap[2] = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(burglarx_state::get_tile_info)), TILEMAP_SCAN_ROWS, 0x10, 0x10, 0x40, 0x40); + + m_tilemap[0]->set_user_data(&m_vram[0x8000 / 2]); + m_tilemap[1]->set_user_data(&m_vram[0x0000 / 2]); + m_tilemap[2]->set_user_data(&m_vram[0x4000 / 2]); + + m_sprites_scrolldx = -0x3f; + m_sprites_scrolldy = -0x0e; + + m_tilemap[0]->set_scrolldx(-0x32, 0); + m_tilemap[1]->set_scrolldx(-0x30, 0); + m_tilemap[2]->set_scrolldx(-0x2e, 0); + + m_tilemap[0]->set_scrolldy(-0x0f, 0); + m_tilemap[1]->set_scrolldy(-0x0f, 0); + m_tilemap[2]->set_scrolldy(-0x0f, 0); + + m_tilemap[0]->set_transparent_pen(0x00); + m_tilemap[1]->set_transparent_pen(0x00); + m_tilemap[2]->set_transparent_pen(0x00); +} + + +/*************************************************************************** + + Sprites Drawing + + + 0.w X + + 2.w Y + + 4.w Code + + 6.w fe-- ---- ---- ---- + --dc ---- ---- ---- Priority + ---- ba98 ---- ---- Number of tiles along X, minus 1 + ---- ---- 7--- ---- + ---- ---- -6-- ---- Flip Y? + ---- ---- --5- ---- Flip X + ---- ---- ---4 3210 Color + + +***************************************************************************/ + +void burglarx_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + // Draw them backwards, for pdrawgfx + for (int offs = (0x800 - 8) / 2; offs >= 0 ; offs -= 8 / 2) + { + int sx = m_spriteram[offs + 0]; + int sy = m_spriteram[offs + 1]; + int code = m_spriteram[offs + 2]; + int const attr = m_spriteram[offs + 3]; + + int const flipx = attr & 0x020; + int const flipy = attr & 0x040; // not sure + + int const dimx = ((attr >> 8) & 0xf) + 1; + + int const priority = ((attr >> 12) & 0x3); + int pri_mask; + + switch (priority) + { + case 0: pri_mask = 0xfe; break; // below all + case 1: pri_mask = 0xf0; break; // above layer 0 + case 2: pri_mask = 0xfc; break; // above layer 1 + default: + case 3: pri_mask = 0x00; // above all + } + + sx += m_sprites_scrolldx; + sy += m_sprites_scrolldy; + + sx = (sx & 0x1ff) - (sx & 0x200); + sy = (sy & 0x1ff) - (sy & 0x200); + + int startx, endx, incx; + + if (flipx) { startx = sx + (dimx - 1) * 16; endx = sx - 16; incx = -16; } + else { startx = sx; endx = sx + dimx * 16; incx = +16; } + + for (int x = startx ; x != endx ; x += incx) + { + m_gfxdecode->gfx(0)->prio_transpen(bitmap, cliprect, + code++, + attr & 0x1f, + flipx, flipy, + x, sy, + screen.priority(), + pri_mask, 0x00); + } + } +} + + +/*************************************************************************** + + + Screen Drawing + + +***************************************************************************/ + +uint32_t burglarx_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + int layers_ctrl = -1; + + m_tilemap[0]->set_scrollx(0, m_scroll[0x00]); + m_tilemap[0]->set_scrolly(0, m_scroll[0x01]); + + m_tilemap[1]->set_scrollx(0, m_scroll[0x05]); + m_tilemap[1]->set_scrolly(0, m_scroll[0x0a]); + + m_tilemap[2]->set_scrollx(0, m_scroll[0x04]); + m_tilemap[2]->set_scrolly(0, m_scroll[0x02]); + +#ifdef MAME_DEBUG +if ( machine().input().code_pressed(KEYCODE_Z) || machine().input().code_pressed(KEYCODE_X) ) +{ + int msk = 0; + if (machine().input().code_pressed(KEYCODE_Q)) msk |= 1; + if (machine().input().code_pressed(KEYCODE_W)) msk |= 2; + if (machine().input().code_pressed(KEYCODE_E)) msk |= 4; + if (machine().input().code_pressed(KEYCODE_A)) msk |= 8; + if (msk != 0) layers_ctrl &= msk; +} +#endif + + // The background color is the first of the last palette + bitmap.fill(0x1f00, cliprect); + screen.priority().fill(0, cliprect); + + if (layers_ctrl & 1) m_tilemap[0]->draw(screen, bitmap, cliprect, 0, 1); + if (layers_ctrl & 2) m_tilemap[1]->draw(screen, bitmap, cliprect, 0, 2); + if (layers_ctrl & 4) m_tilemap[2]->draw(screen, bitmap, cliprect, 0, 4); + + // Sprites are drawn last, using pdrawgfx + if (layers_ctrl & 8) draw_sprites(screen, bitmap, cliprect); + + return 0; +} + + +// machine + /*************************************************************************** @@ -48,30 +422,30 @@ Year + Game PCB Notes Burglar X ***************************************************************************/ -void unico_state::burglarx_okibank_w(uint8_t data) +void burglarx_state::okibank_w(uint8_t data) { m_oki->set_rom_bank(data & 1); } -void unico_state::burglarx_map(address_map &map) +void burglarx_state::program_map(address_map &map) { - map(0x000000, 0x0fffff).rom(); // ROM - map(0xff0000, 0xffffff).ram(); // RAM + map(0x000000, 0x0fffff).rom(); + map(0xff0000, 0xffffff).ram(); map(0x800000, 0x800001).portr("INPUTS"); map(0x800018, 0x800019).portr("SYSTEM"); map(0x80001a, 0x80001b).portr("DSW1"); map(0x80001c, 0x80001d).portr("DSW2"); - map(0x800030, 0x800031).nopw(); // ? 0 - map(0x80010c, 0x800121).rw(FUNC(unico_state::scroll_r), FUNC(unico_state::scroll_w)); // Scroll - map(0x800189, 0x800189).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // Sound + map(0x800030, 0x800031).nopw(); // ? 0 + map(0x80010c, 0x800121).rw(FUNC(burglarx_state::scroll_r), FUNC(burglarx_state::scroll_w)); + map(0x800189, 0x800189).rw(m_oki, FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x80018a, 0x80018a).w("ymsnd", FUNC(ym3812_device::data_w)); map(0x80018c, 0x80018c).rw("ymsnd", FUNC(ym3812_device::status_r), FUNC(ym3812_device::address_w)); - map(0x80018e, 0x80018e).w(FUNC(unico_state::burglarx_okibank_w)); // - map(0x8001e0, 0x8001e1).nopw(); // IRQ Ack - map(0x904000, 0x90ffff).rw(FUNC(unico_state::vram_r), FUNC(unico_state::vram_w)); // Layers 1, 2, 0 - map(0x920000, 0x923fff).ram(); // ? 0 - map(0x930000, 0x9307ff).rw(FUNC(unico_state::spriteram_r), FUNC(unico_state::spriteram_w)); // Sprites - map(0x940000, 0x947fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette + map(0x80018e, 0x80018e).w(FUNC(burglarx_state::okibank_w)); + map(0x8001e0, 0x8001e1).nopw(); // IRQ Ack + map(0x904000, 0x90ffff).rw(FUNC(burglarx_state::vram_r), FUNC(burglarx_state::vram_w)); // Layers 1, 2, 0 + map(0x920000, 0x923fff).ram(); // ? 0 + map(0x930000, 0x9307ff).rw(FUNC(burglarx_state::spriteram_r), FUNC(burglarx_state::spriteram_w)); + map(0x940000, 0x947fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); } @@ -80,87 +454,69 @@ void unico_state::burglarx_map(address_map &map) Zero Point ***************************************************************************/ -void zeropnt_state::zeropnt_okibank_leds_w(uint8_t data) +void zeropnt_state::okibank_leds_w(uint8_t data) { /* Banked sound samples. The 3rd quarter of the ROM contains garbage. Indeed, only banks 0&1 are used */ m_okibank->set_entry(data & 1); - machine().bookkeeping().coin_counter_w(0,data & 0x10); + machine().bookkeeping().coin_counter_w(0, data & 0x10); m_leds[0] = BIT(data, 3); // Start 1 m_leds[1] = BIT(data, 2); // Start 2 } -/* Light Gun - need to wiggle the input slightly otherwise fire doesn't work */ -uint16_t zeropnt_state::gunx_0_msb_r() -{ - int x=m_gun_axes[X0]->read(); - - x=x*384/256; /* On screen pixel X */ - if (x<0x160) x=0x30 + (x*0xd0/0x15f); - else x=((x-0x160) * 0x20)/0x1f; - - return ((x&0xff) ^ (m_screen->frame_number()&1))<<8; -} - -uint16_t zeropnt_state::guny_0_msb_r() +// Light Gun - need to wiggle the input slightly otherwise fire doesn't work +template +uint16_t zeropnt_state::gunx_msb_r() { - int y=m_gun_axes[Y0]->read(); + int x = m_gun_axes[Which]->read(); - y=0x18+((y*0xe0)/0xff); + x = x * 384 / 256; // On screen pixel X + if (x < 0x160) x = 0x30 + (x * 0xd0 / 0x15f); + else x = ((x - 0x160) * 0x20) / 0x1f; - return ((y&0xff) ^ (m_screen->frame_number()&1))<<8; + return ((x & 0xff) ^ (m_screen->frame_number() & 1)) << 8; } -uint16_t zeropnt_state::gunx_1_msb_r() +template +uint16_t zeropnt_state::guny_msb_r() { - int x=m_gun_axes[X1]->read(); + int y = m_gun_axes[Which]->read(); - x=x*384/256; /* On screen pixel X */ - if (x<0x160) x=0x30 + (x*0xd0/0x15f); - else x=((x-0x160) * 0x20)/0x1f; + y = 0x18 + ((y * 0xe0) / 0xff); - return ((x&0xff) ^ (m_screen->frame_number()&1))<<8; + return ((y & 0xff) ^ (m_screen->frame_number() & 1)) << 8; } -uint16_t zeropnt_state::guny_1_msb_r() +void zeropnt_state::program_map(address_map &map) { - int y=m_gun_axes[Y1]->read(); - - y=0x18+((y*0xe0)/0xff); - - return ((y&0xff) ^ (m_screen->frame_number()&1))<<8; -} - -void zeropnt_state::zeropnt_map(address_map &map) -{ - map(0x000000, 0x0fffff).rom(); // ROM - map(0xef0000, 0xefffff).ram(); // RAM - map(0x800030, 0x800031).nopw(); // ? 0 + map(0x000000, 0x0fffff).rom(); + map(0xef0000, 0xefffff).ram(); + map(0x800030, 0x800031).nopw(); // ? 0 map(0x800018, 0x800019).portr("INPUTS"); map(0x80001a, 0x80001b).portr("DSW1"); map(0x80001c, 0x80001d).portr("DSW2"); - map(0x80010c, 0x800121).rw(FUNC(zeropnt_state::scroll_r), FUNC(zeropnt_state::scroll_w)); // Scroll - map(0x800170, 0x800171).r(FUNC(zeropnt_state::guny_0_msb_r)); // Light Guns - map(0x800174, 0x800175).r(FUNC(zeropnt_state::gunx_0_msb_r)); // - map(0x800178, 0x800179).r(FUNC(zeropnt_state::guny_1_msb_r)); // - map(0x80017c, 0x80017d).r(FUNC(zeropnt_state::gunx_1_msb_r)); // - map(0x800189, 0x800189).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // Sound + map(0x80010c, 0x800121).rw(FUNC(zeropnt_state::scroll_r), FUNC(zeropnt_state::scroll_w)); + map(0x800170, 0x800171).r(FUNC(zeropnt_state::guny_msb_r)); + map(0x800174, 0x800175).r(FUNC(zeropnt_state::gunx_msb_r)); + map(0x800178, 0x800179).r(FUNC(zeropnt_state::guny_msb_r)); + map(0x80017c, 0x80017d).r(FUNC(zeropnt_state::gunx_msb_r)); + map(0x800189, 0x800189).rw("oki", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); map(0x80018a, 0x80018a).w("ymsnd", FUNC(ym3812_device::data_w)); map(0x80018c, 0x80018c).rw("ymsnd", FUNC(ym3812_device::status_r), FUNC(ym3812_device::address_w)); - map(0x80018e, 0x80018e).w(FUNC(zeropnt_state::zeropnt_okibank_leds_w)); // - map(0x8001e0, 0x8001e1).nopw(); // ? IRQ Ack - map(0x904000, 0x90ffff).rw(FUNC(zeropnt_state::vram_r), FUNC(zeropnt_state::vram_w)); // Layers 1, 2, 0 + map(0x80018e, 0x80018e).w(FUNC(zeropnt_state::okibank_leds_w)); + map(0x8001e0, 0x8001e1).nopw(); // ? IRQ Ack + map(0x904000, 0x90ffff).rw(FUNC(zeropnt_state::vram_r), FUNC(zeropnt_state::vram_w)); // Layers 1, 2, 0 map(0x920000, 0x923fff).ram(); // ? 0 - map(0x930000, 0x9307ff).rw(FUNC(zeropnt_state::spriteram_r), FUNC(zeropnt_state::spriteram_w)); // Sprites - map(0x940000, 0x947fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); // Palette + map(0x930000, 0x9307ff).rw(FUNC(zeropnt_state::spriteram_r), FUNC(zeropnt_state::spriteram_w)); + map(0x940000, 0x947fff).ram().w(m_palette, FUNC(palette_device::write16)).share("palette"); } -void zeropnt_state::zeropnt_oki_map(address_map &map) +void zeropnt_state::oki_map(address_map &map) { map(0x00000, 0x1ffff).rom(); - map(0x20000, 0x3ffff).bankr("okibank"); + map(0x20000, 0x3ffff).bankr(m_okibank); } @@ -168,19 +524,17 @@ void zeropnt_state::zeropnt_oki_map(address_map &map) Zero Point 2 ***************************************************************************/ -uint32_t zeropnt2_state::zeropnt2_gunx_0_msb_r() { return (gunx_0_msb_r()-0x0800) << 16; } -uint32_t zeropnt2_state::zeropnt2_guny_0_msb_r() { return (guny_0_msb_r()+0x0800) << 16; } -uint32_t zeropnt2_state::zeropnt2_gunx_1_msb_r() { return (gunx_1_msb_r()-0x0800) << 16; } -uint32_t zeropnt2_state::zeropnt2_guny_1_msb_r() { return (guny_1_msb_r()+0x0800) << 16; } +template uint32_t zeropnt2_state::gunx_msb_r() { return (zeropnt_state::gunx_msb_r() - 0x0800) << 16; } +template uint32_t zeropnt2_state::guny_msb_r() { return (zeropnt_state::guny_msb_r() + 0x0800) << 16; } -void zeropnt2_state::zeropnt2_okibank(uint8_t data) +void zeropnt2_state::okibank(uint8_t data) { m_okibank->set_entry((data & 3) % 4); } void zeropnt2_state::leds_w(uint8_t data) { - machine().bookkeeping().coin_counter_w(0,data & 0x01); + machine().bookkeeping().coin_counter_w(0, data & 0x01); m_leds[0] = BIT(data, 7); // Start 1 m_leds[1] = BIT(data, 6); // Start 2 } @@ -190,7 +544,7 @@ void zeropnt2_state::eeprom_w(offs_t offset, uint32_t data, uint32_t mem_mask) if (data & ~0xfe00000) logerror("%s - Unknown EEPROM bit written %04X\n",machine().describe_context(),data); - if ( ACCESSING_BITS_24_31 ) + if (ACCESSING_BITS_24_31) { // latch the bit m_eeprom->di_write((data & 0x04000000) >> 26); @@ -203,30 +557,30 @@ void zeropnt2_state::eeprom_w(offs_t offset, uint32_t data, uint32_t mem_mask) } } -void zeropnt2_state::zeropnt2_map(address_map &map) +void zeropnt2_state::program_map(address_map &map) { - map(0x000000, 0x1fffff).rom(); // ROM + map(0x000000, 0x1fffff).rom(); map(0x800018, 0x80001b).portr("SYSTEM"); - map(0x800025, 0x800025).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // Sound - map(0x800028, 0x80002f).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)).umask32(0x00ff0000); // - map(0x800031, 0x800031).rw("oki2", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); // - map(0x800034, 0x800034).w(FUNC(zeropnt2_state::zeropnt2_okibank)); // - map(0x800039, 0x800039).w(FUNC(zeropnt2_state::leds_w)); // ? - map(0x80010c, 0x800123).rw(FUNC(zeropnt2_state::scroll_r), FUNC(zeropnt2_state::scroll_w)); // Scroll - map(0x800140, 0x800143).r(FUNC(zeropnt2_state::zeropnt2_guny_0_msb_r)); // Light Guns - map(0x800144, 0x800147).r(FUNC(zeropnt2_state::zeropnt2_gunx_0_msb_r)); // - map(0x800148, 0x80014b).r(FUNC(zeropnt2_state::zeropnt2_guny_1_msb_r)); // - map(0x80014c, 0x80014f).r(FUNC(zeropnt2_state::zeropnt2_gunx_1_msb_r)); // + map(0x800025, 0x800025).rw("oki1", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x800028, 0x80002f).rw("ymsnd", FUNC(ym2151_device::read), FUNC(ym2151_device::write)).umask32(0x00ff0000); + map(0x800031, 0x800031).rw("oki2", FUNC(okim6295_device::read), FUNC(okim6295_device::write)); + map(0x800034, 0x800034).w(FUNC(zeropnt2_state::okibank)); + map(0x800039, 0x800039).w(FUNC(zeropnt2_state::leds_w)); + map(0x80010c, 0x800123).rw(FUNC(zeropnt2_state::scroll_r), FUNC(zeropnt2_state::scroll_w)); + map(0x800140, 0x800143).r(FUNC(zeropnt2_state::guny_msb_r)); + map(0x800144, 0x800147).r(FUNC(zeropnt2_state::gunx_msb_r)); + map(0x800148, 0x80014b).r(FUNC(zeropnt2_state::guny_msb_r)); + map(0x80014c, 0x80014f).r(FUNC(zeropnt2_state::gunx_msb_r)); map(0x800150, 0x800153).portr("DSW1"); map(0x800154, 0x800157).portr("DSW2"); map(0x80015c, 0x80015f).portr("BUTTONS"); - map(0x8001e0, 0x8001e3).nopw(); // ? IRQ Ack - map(0x8001f0, 0x8001f3).w(FUNC(zeropnt2_state::eeprom_w)); // EEPROM - map(0x904000, 0x90ffff).rw(FUNC(zeropnt2_state::vram_r), FUNC(zeropnt2_state::vram_w)); // Layers 1, 2, 0 - map(0x920000, 0x923fff).ram(); // ? 0 - map(0x930000, 0x9307ff).rw(FUNC(zeropnt2_state::spriteram_r), FUNC(zeropnt2_state::spriteram_w)); // Sprites - map(0x940000, 0x947fff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette"); // Palette - map(0xfe0000, 0xffffff).ram(); // RAM + map(0x8001e0, 0x8001e3).nopw(); // ? IRQ Ack + map(0x8001f0, 0x8001f3).w(FUNC(zeropnt2_state::eeprom_w)); + map(0x904000, 0x90ffff).rw(FUNC(zeropnt2_state::vram_r), FUNC(zeropnt2_state::vram_w)); // Layers 1, 2, 0 + map(0x920000, 0x923fff).ram(); // ? 0 + map(0x930000, 0x9307ff).rw(FUNC(zeropnt2_state::spriteram_r), FUNC(zeropnt2_state::spriteram_w)); + map(0x940000, 0x947fff).ram().w(m_palette, FUNC(palette_device::write32)).share("palette"); + map(0xfe0000, 0xffffff).ram(); } @@ -243,7 +597,7 @@ void zeropnt2_state::zeropnt2_map(address_map &map) ***************************************************************************/ static INPUT_PORTS_START( burglarx ) - PORT_START("INPUTS") /* $800000.w */ + PORT_START("INPUTS") // $800000.w PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) @@ -262,7 +616,7 @@ static INPUT_PORTS_START( burglarx ) PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_START("SYSTEM") /* $800019.b */ + PORT_START("SYSTEM") // $800019.b PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) @@ -273,7 +627,7 @@ static INPUT_PORTS_START( burglarx ) PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_START("DSW1") /* $80001a.b */ + PORT_START("DSW1") // $80001a.b PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_SERVICE( 0x0100, IP_ACTIVE_LOW ) PORT_DIPLOCATION("DIP-A:1") PORT_DIPNAME( 0x0200, 0x0200, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("DIP-A:2") @@ -298,7 +652,7 @@ static INPUT_PORTS_START( burglarx ) PORT_DIPSETTING( 0xa000, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x8000, DEF_STR( 1C_4C ) ) - PORT_START("DSW2") /* $80001c.b */ + PORT_START("DSW2") // $80001c.b PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_DIPNAME( 0x0300, 0x0300, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("DIP-B:1,2") PORT_DIPSETTING( 0x0200, DEF_STR( None ) ) @@ -330,7 +684,7 @@ INPUT_PORTS_END ***************************************************************************/ static INPUT_PORTS_START( zeropnt ) - PORT_START("INPUTS") /* $800018.w */ + PORT_START("INPUTS") // $800018.w PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_COIN2 ) PORT_SERVICE_NO_TOGGLE( 0x0004, IP_ACTIVE_HIGH ) @@ -350,7 +704,7 @@ static INPUT_PORTS_START( zeropnt ) PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_START("DSW1") /* $80001a.b */ + PORT_START("DSW1") // $80001a.b PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIP-A:!1") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) @@ -377,7 +731,7 @@ static INPUT_PORTS_START( zeropnt ) PORT_DIPSETTING( 0x4000, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x6000, DEF_STR( 1C_4C ) ) - PORT_START("DSW2") /* $80001c.b */ + PORT_START("DSW2") // $80001c.b PORT_BIT( 0x00ff, IP_ACTIVE_HIGH, IPT_UNKNOWN ) PORT_DIPNAME( 0x0100, 0x0000, DEF_STR( Unused ) ) PORT_DIPLOCATION("DIP-B:!1") PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) @@ -401,16 +755,16 @@ static INPUT_PORTS_START( zeropnt ) PORT_DIPSETTING( 0x8000, "4" ) PORT_DIPSETTING( 0xc000, "5" ) - PORT_START("Y0") /* $800170.b */ + PORT_START("Y0") // $800170.b PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(2) - PORT_START("X0") /* $800174.b */ + PORT_START("X0") // $800174.b PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(2) - PORT_START("Y1") /* $800178.b */ + PORT_START("Y1") // $800178.b PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(1) - PORT_START("X1") /* $80017c.b */ + PORT_START("X1") // $80017c.b PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(1) INPUT_PORTS_END @@ -421,7 +775,7 @@ INPUT_PORTS_END ***************************************************************************/ static INPUT_PORTS_START( zeropnt2 ) - PORT_START("SYSTEM") /* $800019.b */ + PORT_START("SYSTEM") // $800019.b PORT_BIT( 0x0000ffff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x00010000, IP_ACTIVE_HIGH, IPT_COIN1 ) PORT_BIT( 0x00020000, IP_ACTIVE_HIGH, IPT_COIN2 ) @@ -433,20 +787,20 @@ static INPUT_PORTS_START( zeropnt2 ) PORT_BIT( 0x00800000, IP_ACTIVE_HIGH, IPT_SERVICE1 ) PORT_BIT( 0xff000000, IP_ACTIVE_HIGH, IPT_UNKNOWN ) - PORT_START("DSW1") /* $80001a.b */ + PORT_START("DSW1") // $80001a.b PORT_BIT( 0x0000ffff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x00ff0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_DIPNAME( 0x01000000, 0x01000000, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("DIP-A:1") PORT_DIPSETTING( 0x01000000, DEF_STR( Off ) ) PORT_DIPSETTING( 0x00000000, DEF_STR( On ) ) - PORT_DIPNAME( 0x02000000, 0x02000000, "Continue Mode" ) PORT_DIPLOCATION("DIP-A:2") // Doesn't work? - PORT_DIPSETTING( 0x00000000, DEF_STR( Off ) ) // Manual says 'Continue Mode' and defaults to ON but it doesn't appear to do anthing different when on - PORT_DIPSETTING( 0x02000000, DEF_STR( On ) ) // or off and continue with 1 credit is always available regardless. Maybe it wasn't implemented in the code? + PORT_DIPNAME( 0x02000000, 0x02000000, "1 Coin to Continue" ) PORT_DIPLOCATION("DIP-A:2") // Used when coinage is NOT 1 Coin 1 Credit + PORT_DIPSETTING( 0x00000000, DEF_STR( Off ) ) // Must insert number of coins as per coinage setting to continue + PORT_DIPSETTING( 0x02000000, DEF_STR( On ) ) // Only 1 coin is required to continue regardless of the coinage setting PORT_DIPNAME( 0x0c000000, 0x0c000000, "Gun Reloading" ) PORT_DIPLOCATION("DIP-A:3,4") PORT_DIPSETTING( 0x08000000, DEF_STR(No) ) PORT_DIPSETTING( 0x04000000, DEF_STR(Yes) ) PORT_DIPSETTING( 0x0c000000, "Factory Setting" ) -// PORT_DIPSETTING( 0x00000000, "unused?" ) + PORT_DIPSETTING( 0x00000000, "unused?" ) PORT_DIPNAME( 0x10000000, 0x10000000, DEF_STR( Language ) ) PORT_DIPLOCATION("DIP-A:5") PORT_DIPSETTING( 0x10000000, DEF_STR( English ) ) PORT_DIPSETTING( 0x00000000, DEF_STR( Japanese ) ) @@ -460,7 +814,7 @@ static INPUT_PORTS_START( zeropnt2 ) PORT_DIPSETTING( 0xa0000000, DEF_STR( 1C_3C ) ) PORT_DIPSETTING( 0x80000000, DEF_STR( 1C_4C ) ) - PORT_START("DSW2") /* $80001c.b */ + PORT_START("DSW2") // $80001c.b PORT_BIT( 0x0000ffff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x00ff0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_DIPNAME( 0x01000000, 0x01000000, "Korean Language" ) PORT_DIPLOCATION("DIP-B:1") @@ -487,7 +841,7 @@ static INPUT_PORTS_START( zeropnt2 ) PORT_DIPSETTING( 0x40000000, DEF_STR( Harder ) ) PORT_DIPSETTING( 0x00000000, DEF_STR( Hardest ) ) - PORT_START("BUTTONS") /* $80015c.b */ + PORT_START("BUTTONS") // $80015c.b PORT_BIT( 0x0000ffff, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_BIT( 0x00ff0000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x01000000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) @@ -497,18 +851,18 @@ static INPUT_PORTS_START( zeropnt2 ) PORT_BIT( 0x10000000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x20000000, IP_ACTIVE_LOW, IPT_UNKNOWN ) PORT_BIT( 0x40000000, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80000000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read) // EEPROM + PORT_BIT( 0x80000000, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_READ_LINE_DEVICE_MEMBER("eeprom", eeprom_serial_93cxx_device, do_read) - PORT_START("Y0") /* $800140.b */ + PORT_START("Y0") // $800140.b PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(2) - PORT_START("X0") /* $800144.b */ + PORT_START("X0") // $800144.b PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(2) - PORT_START("Y1") /* $800148.b */ + PORT_START("Y1") // $800148.b PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_Y ) PORT_CROSSHAIR(Y, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(1) - PORT_START("X1") /* $80014c.b */ + PORT_START("X1") // $80014c.b PORT_BIT( 0xff, 0x80, IPT_LIGHTGUN_X ) PORT_CROSSHAIR(X, 1.0, 0.0, 0) PORT_SENSITIVITY(35) PORT_KEYDELTA(15) PORT_PLAYER(1) INPUT_PORTS_END @@ -522,7 +876,7 @@ INPUT_PORTS_END ***************************************************************************/ -/* 16x16x8 */ +// 16x16x8 static const gfx_layout layout_16x16x8 = { 16,16, @@ -538,8 +892,8 @@ static const gfx_layout layout_16x16x8 = }; static GFXDECODE_START( gfx_unico ) - GFXDECODE_ENTRY( "gfx1", 0, layout_16x16x8, 0x0, 0x20 ) // [0] Sprites - GFXDECODE_ENTRY( "gfx2", 0, layout_16x16x8, 0x0, 0x20 ) // [1] Layers + GFXDECODE_ENTRY( "sprites", 0, layout_16x16x8, 0x0, 0x20 ) + GFXDECODE_ENTRY( "tiles", 0, layout_16x16x8, 0x0, 0x20 ) GFXDECODE_END @@ -553,7 +907,7 @@ GFXDECODE_END ***************************************************************************/ -void unico_state::machine_start() +void burglarx_state::machine_start() { m_leds.resolve(); } @@ -563,34 +917,34 @@ void unico_state::machine_start() Burglar X ***************************************************************************/ -void unico_state::burglarx(machine_config &config) +void burglarx_state::burglarx(machine_config &config) { - /* basic machine hardware */ - M68000(config, m_maincpu, 32_MHz_XTAL/2); /* 16MHz */ - m_maincpu->set_addrmap(AS_PROGRAM, &unico_state::burglarx_map); - m_maincpu->set_vblank_int("screen", FUNC(unico_state::irq2_line_hold)); + // basic machine hardware + M68000(config, m_maincpu, 32_MHz_XTAL / 2); // 16MHz + m_maincpu->set_addrmap(AS_PROGRAM, &burglarx_state::program_map); + m_maincpu->set_vblank_int("screen", FUNC(burglarx_state::irq2_line_hold)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_refresh_hz(60); screen.set_vblank_time(ATTOSECONDS_IN_USEC(0)); screen.set_size(384, 224); screen.set_visarea(0, 384-1, 0, 224-1); - screen.set_screen_update(FUNC(unico_state::screen_update)); + screen.set_screen_update(FUNC(burglarx_state::screen_update)); screen.set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_unico); - PALETTE(config, m_palette).set_format(4, &unico_state::unico_R6G6B6X, 8192); + PALETTE(config, m_palette).set_format(4, &burglarx_state::unico_R6G6B6X, 8192); - /* sound hardware */ + // sound hardware SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - ym3812_device &ymsnd(YM3812(config, "ymsnd", XTAL(14'318'181)/4)); /* 3.579545 MHz */ + ym3812_device &ymsnd(YM3812(config, "ymsnd", XTAL(14'318'181) / 4)); // 3.579545 MHz ymsnd.add_route(ALL_OUTPUTS, "lspeaker", 0.40); ymsnd.add_route(ALL_OUTPUTS, "rspeaker", 0.40); - OKIM6295(config, m_oki, 32_MHz_XTAL/32, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 verified + OKIM6295(config, m_oki, 32_MHz_XTAL / 32, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified m_oki->add_route(ALL_OUTPUTS, "lspeaker", 0.80); m_oki->add_route(ALL_OUTPUTS, "rspeaker", 0.80); } @@ -603,18 +957,18 @@ void unico_state::burglarx(machine_config &config) void zeropnt_state::machine_start() { - unico_state::machine_start(); + burglarx_state::machine_start(); m_okibank->configure_entries(0, 4, memregion("oki")->base() + 0x20000, 0x20000); } void zeropnt_state::zeropnt(machine_config &config) { - /* basic machine hardware */ - M68000(config, m_maincpu, 32_MHz_XTAL/2); /* 16MHz */ - m_maincpu->set_addrmap(AS_PROGRAM, &zeropnt_state::zeropnt_map); + // basic machine hardware + M68000(config, m_maincpu, 32_MHz_XTAL / 2); // 16MHz + m_maincpu->set_addrmap(AS_PROGRAM, &zeropnt_state::program_map); m_maincpu->set_vblank_int("screen", FUNC(zeropnt_state::irq2_line_hold)); - /* video hardware */ + // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); @@ -626,16 +980,16 @@ void zeropnt_state::zeropnt(machine_config &config) GFXDECODE(config, m_gfxdecode, m_palette, gfx_unico); PALETTE(config, m_palette).set_format(4, &zeropnt_state::unico_R6G6B6X, 8192); - /* sound hardware */ + // sound hardware SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - ym3812_device &ymsnd(YM3812(config, "ymsnd", XTAL(14'318'181)/4)); /* 3.579545 MHz */ + ym3812_device &ymsnd(YM3812(config, "ymsnd", XTAL(14'318'181) / 4)); // 3.579545 MHz ymsnd.add_route(ALL_OUTPUTS, "lspeaker", 0.40); ymsnd.add_route(ALL_OUTPUTS, "rspeaker", 0.40); - OKIM6295(config, m_oki, 32_MHz_XTAL/32, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 not verified - m_oki->set_addrmap(0, &zeropnt_state::zeropnt_oki_map); + OKIM6295(config, m_oki, 32_MHz_XTAL / 32, okim6295_device::PIN7_HIGH); // clock frequency & pin 7 verified + m_oki->set_addrmap(0, &zeropnt_state::oki_map); m_oki->add_route(ALL_OUTPUTS, "lspeaker", 0.80); m_oki->add_route(ALL_OUTPUTS, "rspeaker", 0.80); } @@ -648,20 +1002,20 @@ void zeropnt_state::zeropnt(machine_config &config) void zeropnt2_state::machine_start() { - unico_state::machine_start(); + burglarx_state::machine_start(); m_okibank->configure_entries(0, 4, memregion("oki1")->base() + 0x20000, 0x20000); } void zeropnt2_state::zeropnt2(machine_config &config) { - /* basic machine hardware */ - M68EC020(config, m_maincpu, 32_MHz_XTAL/2); /* 16MHz */ - m_maincpu->set_addrmap(AS_PROGRAM, &zeropnt2_state::zeropnt2_map); + // basic machine hardware + M68EC020(config, m_maincpu, 32_MHz_XTAL / 2); // 16MHz + m_maincpu->set_addrmap(AS_PROGRAM, &zeropnt2_state::program_map); m_maincpu->set_vblank_int("screen", FUNC(zeropnt2_state::irq2_line_hold)); EEPROM_93C46_8BIT(config, "eeprom"); - /* video hardware */ + // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(60); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(0)); @@ -673,14 +1027,14 @@ void zeropnt2_state::zeropnt2(machine_config &config) GFXDECODE(config, m_gfxdecode, m_palette, gfx_unico); PALETTE(config, m_palette).set_format(4, &zeropnt2_state::unico_R6G6B6X, 8192); - /* sound hardware */ + // sound hardware SPEAKER(config, "lspeaker").front_left(); SPEAKER(config, "rspeaker").front_right(); - YM2151(config, "ymsnd", XTAL(14'318'181)/4).add_route(0, "lspeaker", 0.70).add_route(1, "rspeaker", 0.70); /* 3.579545 MHz */ + YM2151(config, "ymsnd", XTAL(14'318'181) / 4).add_route(0, "lspeaker", 0.70).add_route(1, "rspeaker", 0.70); // 3.579545 MHz okim6295_device &oki1(OKIM6295(config, "oki1", 32_MHz_XTAL/32, okim6295_device::PIN7_HIGH)); // clock frequency & pin 7 not verified - oki1.set_addrmap(0, &zeropnt2_state::zeropnt_oki_map); + oki1.set_addrmap(0, &zeropnt2_state::oki_map); oki1.add_route(ALL_OUTPUTS, "lspeaker", 0.40); oki1.add_route(ALL_OUTPUTS, "rspeaker", 0.40); @@ -712,12 +1066,12 @@ by Unico ***************************************************************************/ ROM_START( burglarx ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */ + ROM_REGION( 0x100000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "bx-rom2.pgm", 0x000000, 0x080000, CRC(f81120c8) SHA1(f0240cf9aceb755e3c920bc3bcae0a9de29fd8c1) ) ROM_LOAD16_BYTE( "bx-rom3.pgm", 0x000001, 0x080000, CRC(080b4e82) SHA1(7eb08a7ea7684297e879123ae7ddc88d7fc1b87b) ) - /* Notice the weird ROMs order? Pretty much bit scrambling */ - ROM_REGION( 0x400000, "gfx1", ROMREGION_INVERT ) /* 16x16x8 Sprites */ + // Notice the weird ROMs order? Pretty much bit scrambling + ROM_REGION( 0x400000, "sprites", ROMREGION_INVERT ) // 16x16x8 ROM_LOAD16_BYTE( "bx-rom4", 0x000000, 0x080000, CRC(f74ce31f) SHA1(bafe247a2fdc918318ccf7b11f0406c78909dcaa) ) ROM_LOAD16_BYTE( "bx-rom10", 0x000001, 0x080000, CRC(6f56ca23) SHA1(5cfedda8d9fe4b575932a6a136d7b525d96e5454) ) ROM_LOAD16_BYTE( "bx-rom9", 0x100000, 0x080000, CRC(33f29d79) SHA1(287d8412842887af5a5c7a0f5e5736a741c3c7db) ) @@ -727,7 +1081,7 @@ ROM_START( burglarx ) ROM_LOAD16_BYTE( "bx-rom11", 0x300000, 0x080000, CRC(898d176a) SHA1(4c85948b7e639743d0f1676fdc463267f550f97c) ) ROM_LOAD16_BYTE( "bx-rom5", 0x300001, 0x080000, CRC(fdee1423) SHA1(319610435b3dea61276d412e2bf6a3f32809ae19) ) - ROM_REGION( 0x400000, "gfx2", ROMREGION_INVERT ) /* 16x16x8 Layers */ + ROM_REGION( 0x400000, "tiles", ROMREGION_INVERT ) // 16x16x8 ROM_LOAD16_BYTE( "bx-rom14", 0x000000, 0x080000, CRC(30413373) SHA1(37bbc4d2943a32ee9f6bb268c823ffe162fe92a2) ) ROM_LOAD16_BYTE( "bx-rom18", 0x000001, 0x080000, CRC(8e7fc99f) SHA1(81141e3c9111944aae97d27e5631b11eaf6f8734) ) ROM_LOAD16_BYTE( "bx-rom19", 0x100000, 0x080000, CRC(d40eabcd) SHA1(e41d5e921a1648d6d4907f18e0256dbe3a01e9d3) ) @@ -737,7 +1091,7 @@ ROM_START( burglarx ) ROM_LOAD16_BYTE( "bx-rom13", 0x300000, 0x080000, CRC(da34bbb5) SHA1(455c2412135b89670c2ecda9fd02f4da9b891ee4) ) ROM_LOAD16_BYTE( "bx-rom16", 0x300001, 0x080000, CRC(55b28ef9) SHA1(48615d53ac955ba6aca86ad4f8b61f4d2675d840) ) - ROM_REGION( 0x80000, "oki", 0 ) /* Samples */ + ROM_REGION( 0x80000, "oki", 0 ) ROM_LOAD( "bx-rom1.snd", 0x000000, 0x080000, CRC(8ae67138) SHA1(3ea44f805a1f978e0a1c1bb7f45507379b147bc0) ) // 2 x 40000 ROM_END @@ -777,67 +1131,67 @@ zpscrz08.BIN -/ ***************************************************************************/ ROM_START( zeropnt ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */ + ROM_REGION( 0x100000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "unico_2.rom2", 0x000000, 0x080000, CRC(1e599509) SHA1(5a562a3c85700126b95fbdf21ef8c0ddd35d9037) ) ROM_LOAD16_BYTE( "unico_3.rom3", 0x000001, 0x080000, CRC(588aeef7) SHA1(0dfa22c9e7b1fe493c16160b1ac76fa4d3bb2e68) ) - ROM_REGION( 0x800000, "gfx1", ROMREGION_INVERT ) /* 16x16x8 Sprites */ + ROM_REGION( 0x800000, "sprites", ROMREGION_INVERT ) // 16x16x8 ROM_LOAD( "unico_zpobj_z01.bin", 0x000000, 0x200000, CRC(1f2768a3) SHA1(75c83458afc527dda47bfbd86a8e9c5ded7a5444) ) ROM_LOAD( "unico_zpobj_z02.bin", 0x200000, 0x200000, CRC(de34f33a) SHA1(b77c7d508942176585afaeeaea2f34f60326eeb1) ) ROM_LOAD( "unico_zpobj_z03.bin", 0x400000, 0x200000, CRC(d7a657f7) SHA1(f1f9e6a01eef4d0c8c4b2e161136cc4438d770e2) ) ROM_LOAD( "unico_zpobj_z04.bin", 0x600000, 0x200000, CRC(3aec2f8d) SHA1(6fb1cfabfb0bddf688d3bfb60f7538209efbd8f1) ) - ROM_REGION( 0x800000, "gfx2", ROMREGION_INVERT ) /* 16x16x8 Layers */ + ROM_REGION( 0x800000, "tiles", ROMREGION_INVERT ) // 16x16x8 ROM_LOAD( "unico_zpscr_z06.bin", 0x000000, 0x200000, CRC(e1e53cf0) SHA1(b440e09f6229d486d1a8be476ac8a17adde1ff7e) ) ROM_LOAD( "unico_zpscr_z05.bin", 0x200000, 0x200000, CRC(0d7d4850) SHA1(43f87d0461fe022b68b4e57e6c9542bcd78e301b) ) ROM_LOAD( "unico_zpscr_z07.bin", 0x400000, 0x200000, CRC(bb178f32) SHA1(1354f4d90a8cec58d1f2b6809985776b309b96a8) ) ROM_LOAD( "unico_zpscr_z08.bin", 0x600000, 0x200000, CRC(672f02e5) SHA1(8e8b28a8b2293950764d453a3c385d7083eb5a57) ) - ROM_REGION( 0x80000 * 2, "oki", 0 ) /* Samples */ + ROM_REGION( 0x80000 * 2, "oki", 0 ) ROM_LOAD( "unico_1.rom1", 0x000000, 0x080000, CRC(fd2384fa) SHA1(8ae83665fe952c5d03bd62d2abb507c351cf0fb5) ) ROM_END ROM_START( zeropnta ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */ + ROM_REGION( 0x100000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "unico2.rom2", 0x000000, 0x080000, CRC(285fbca3) SHA1(61f8d48388a666ed9300c0688fbf844e316b8892) ) ROM_LOAD16_BYTE( "unico3.rom3", 0x000001, 0x080000, CRC(ad7b3129) SHA1(d814b5d9336d011386aa0b316b11225e5ea799fc) ) - ROM_REGION( 0x800000, "gfx1", ROMREGION_INVERT ) /* 16x16x8 Sprites */ + ROM_REGION( 0x800000, "sprites", ROMREGION_INVERT ) // 16x16x8 ROM_LOAD( "unico_zpobj_z01.bin", 0x000000, 0x200000, CRC(1f2768a3) SHA1(75c83458afc527dda47bfbd86a8e9c5ded7a5444) ) ROM_LOAD( "unico_zpobj_z02.bin", 0x200000, 0x200000, CRC(de34f33a) SHA1(b77c7d508942176585afaeeaea2f34f60326eeb1) ) ROM_LOAD( "unico_zpobj_z03.bin", 0x400000, 0x200000, CRC(d7a657f7) SHA1(f1f9e6a01eef4d0c8c4b2e161136cc4438d770e2) ) ROM_LOAD( "unico_zpobj_z04.bin", 0x600000, 0x200000, CRC(3aec2f8d) SHA1(6fb1cfabfb0bddf688d3bfb60f7538209efbd8f1) ) - ROM_REGION( 0x800000, "gfx2", ROMREGION_INVERT ) /* 16x16x8 Layers */ + ROM_REGION( 0x800000, "tiles", ROMREGION_INVERT ) // 16x16x8 ROM_LOAD( "unico_zpscr_z06.bin", 0x000000, 0x200000, CRC(e1e53cf0) SHA1(b440e09f6229d486d1a8be476ac8a17adde1ff7e) ) ROM_LOAD( "unico_zpscr_z05.bin", 0x200000, 0x200000, CRC(0d7d4850) SHA1(43f87d0461fe022b68b4e57e6c9542bcd78e301b) ) ROM_LOAD( "unico_zpscr_z07.bin", 0x400000, 0x200000, CRC(bb178f32) SHA1(1354f4d90a8cec58d1f2b6809985776b309b96a8) ) ROM_LOAD( "unico_zpscr_z08.bin", 0x600000, 0x200000, CRC(672f02e5) SHA1(8e8b28a8b2293950764d453a3c385d7083eb5a57) ) - ROM_REGION( 0x80000 * 2, "oki", 0 ) /* Samples */ + ROM_REGION( 0x80000 * 2, "oki", 0 ) ROM_LOAD( "unico_1.rom1", 0x000000, 0x080000, CRC(fd2384fa) SHA1(8ae83665fe952c5d03bd62d2abb507c351cf0fb5) ) ROM_END ROM_START( zeropntj ) - ROM_REGION( 0x100000, "maincpu", 0 ) /* 68000 Code */ + ROM_REGION( 0x100000, "maincpu", 0 ) // 68000 code ROM_LOAD16_BYTE( "unico_2.bin", 0x000000, 0x080000, CRC(098d9756) SHA1(c98ae2774d2eff7d0ea66887c57d4b55d6939ad8) ) ROM_LOAD16_BYTE( "unico_3.bin", 0x000001, 0x080000, CRC(58e105f3) SHA1(6069ec030d6ce11ec4b9514f366197068f1220ee) ) - ROM_REGION( 0x800000, "gfx1", ROMREGION_INVERT ) /* 16x16x8 Sprites */ + ROM_REGION( 0x800000, "sprites", ROMREGION_INVERT ) // 16x16x8 ROM_LOAD( "unico_zpobj_z01.bin", 0x000000, 0x200000, CRC(1f2768a3) SHA1(75c83458afc527dda47bfbd86a8e9c5ded7a5444) ) - ROM_LOAD( "unico_4.bin", 0x200000, 0x200000, CRC(529c36ee) SHA1(3c1d1b94b9cf84fd07689cd5fbfe86820bb878e6) ) /* EPROM Containing graphics data for Japanese text */ + ROM_LOAD( "unico_4.bin", 0x200000, 0x200000, CRC(529c36ee) SHA1(3c1d1b94b9cf84fd07689cd5fbfe86820bb878e6) ) // EPROM Containing graphics data for Japanese text ROM_LOAD( "unico_zpobj_z03.bin", 0x400000, 0x200000, CRC(d7a657f7) SHA1(f1f9e6a01eef4d0c8c4b2e161136cc4438d770e2) ) ROM_LOAD( "unico_zpobj_z04.bin", 0x600000, 0x200000, CRC(3aec2f8d) SHA1(6fb1cfabfb0bddf688d3bfb60f7538209efbd8f1) ) - ROM_REGION( 0x800000, "gfx2", ROMREGION_INVERT ) /* 16x16x8 Layers */ + ROM_REGION( 0x800000, "tiles", ROMREGION_INVERT ) // 16x16x8 ROM_LOAD( "unico_zpscr_z06.bin", 0x000000, 0x200000, CRC(e1e53cf0) SHA1(b440e09f6229d486d1a8be476ac8a17adde1ff7e) ) ROM_LOAD( "unico_zpscr_z05.bin", 0x200000, 0x200000, CRC(0d7d4850) SHA1(43f87d0461fe022b68b4e57e6c9542bcd78e301b) ) ROM_LOAD( "unico_zpscr_z07.bin", 0x400000, 0x200000, CRC(bb178f32) SHA1(1354f4d90a8cec58d1f2b6809985776b309b96a8) ) ROM_LOAD( "unico_zpscr_z08.bin", 0x600000, 0x200000, CRC(672f02e5) SHA1(8e8b28a8b2293950764d453a3c385d7083eb5a57) ) - ROM_REGION( 0x80000 * 2, "oki", 0 ) /* Samples */ + ROM_REGION( 0x80000 * 2, "oki", 0 ) ROM_LOAD( "unico_1.rom1", 0x000000, 0x080000, CRC(fd2384fa) SHA1(8ae83665fe952c5d03bd62d2abb507c351cf0fb5) ) ROM_END @@ -1004,29 +1358,31 @@ BrianT ***************************************************************************/ ROM_START( zeropnt2 ) - ROM_REGION( 0x200000, "maincpu", 0 ) /* 68020 Code */ + ROM_REGION( 0x200000, "maincpu", 0 ) // 68020 code ROM_LOAD32_WORD_SWAP( "d16-d31.4", 0x000000, 0x100000, CRC(48314fdb) SHA1(a5bdb6a3f520587ff5e73438dc414cfdff34167b) ) ROM_LOAD32_WORD_SWAP( "d0-d15.3", 0x000002, 0x100000, CRC(5ec4151e) SHA1(f7c857bdb6a92f76f09a089b37def7e6cf24b65a) ) - ROM_REGION( 0x1000000, "gfx1", ROMREGION_INVERT ) /* 16x16x8 Sprites */ + ROM_REGION( 0x1000000, "sprites", ROMREGION_INVERT ) // 16x16x8 ROM_LOAD( "db0db1zp.209", 0x000000, 0x400000, CRC(474b460c) SHA1(72104b7a00cb6d62b3cee2cfadc928669ca948c4) ) ROM_LOAD( "db2db3zp.210", 0x400000, 0x400000, CRC(0a1d0a88) SHA1(b0a6ba9eba539fff417557c9af60d408c2912491) ) ROM_LOAD( "db4db5zp.211", 0x800000, 0x400000, CRC(227169dc) SHA1(b03d8d46714e5aa3631fde7d65466334dafdc341) ) ROM_LOAD( "db6db7zp.212", 0xc00000, 0x400000, CRC(a6306cdb) SHA1(da48c5981b72b87df40602e03e56a40a24728262) ) - ROM_REGION( 0x1000000, "gfx2", ROMREGION_INVERT ) /* 16x16x8 Layers */ + ROM_REGION( 0x1000000, "tiles", ROMREGION_INVERT ) // 16x16x8 ROM_LOAD( "a0-a1zp.205", 0x000000, 0x400000, CRC(f7ca9c0e) SHA1(541139b617ff34c378a506cf88fe97234c93ee20) ) ROM_LOAD( "a2-a3zp.206", 0x400000, 0x400000, CRC(0581c8fe) SHA1(9bbffc9c758bbaba2b43a63811b725e51996268a) ) ROM_LOAD( "a4-a5zp.208", 0x800000, 0x400000, CRC(ddd091ef) SHA1(c1751aef2546a35f2fdbfeca9647a88fd3e65cdd) ) ROM_LOAD( "a6-a7zp.207", 0xc00000, 0x400000, CRC(3fd46113) SHA1(326684b92c258bde318693cd9b3a7660aed3cd6f) ) - ROM_REGION( 0x80000 * 2, "oki1", 0 ) /* Samples */ + ROM_REGION( 0x80000 * 2, "oki1", 0 ) ROM_LOAD( "uzp2-1.bin", 0x000000, 0x080000, CRC(ed0966ed) SHA1(a43b9c493f94d1fb11e1b189caaf37d3d792c730) ) - ROM_REGION( 0x40000, "oki2", 0 ) /* Samples */ + ROM_REGION( 0x40000, "oki2", 0 ) ROM_LOAD( "uzp2-2.bin", 0x000000, 0x040000, CRC(db8cb455) SHA1(6723b4018208d554bd1bf1e0640b72d2f4f47302) ) ROM_END +} // anonymous namespace + /*************************************************************************** @@ -1036,8 +1392,8 @@ ROM_END ***************************************************************************/ -GAME( 1997, burglarx, 0, burglarx, burglarx, unico_state, empty_init, ROT0, "Unico", "Burglar X" , 0 ) -GAME( 1998, zeropnt, 0, zeropnt, zeropnt, zeropnt_state, empty_init, ROT0, "Unico", "Zero Point (set 1)", 0 ) -GAME( 1998, zeropnta, zeropnt, zeropnt, zeropnt, zeropnt_state, empty_init, ROT0, "Unico", "Zero Point (set 2)", 0 ) -GAME( 1998, zeropntj, zeropnt, zeropnt, zeropnt, zeropnt_state, empty_init, ROT0, "Unico", "Zero Point (Japan)", 0 ) -GAME( 1999, zeropnt2, 0, zeropnt2, zeropnt2, zeropnt2_state, empty_init, ROT0, "Unico", "Zero Point 2", 0 ) +GAME( 1997, burglarx, 0, burglarx, burglarx, burglarx_state, empty_init, ROT0, "Unico", "Burglar X" , MACHINE_SUPPORTS_SAVE ) +GAME( 1998, zeropnt, 0, zeropnt, zeropnt, zeropnt_state, empty_init, ROT0, "Unico", "Zero Point (set 1)", MACHINE_SUPPORTS_SAVE ) +GAME( 1998, zeropnta, zeropnt, zeropnt, zeropnt, zeropnt_state, empty_init, ROT0, "Unico", "Zero Point (set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1998, zeropntj, zeropnt, zeropnt, zeropnt, zeropnt_state, empty_init, ROT0, "Unico", "Zero Point (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1999, zeropnt2, 0, zeropnt2, zeropnt2, zeropnt2_state, empty_init, ROT0, "Unico", "Zero Point 2", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/unico/unico.h b/src/mame/unico/unico.h deleted file mode 100644 index 29cc10c3c9b..00000000000 --- a/src/mame/unico/unico.h +++ /dev/null @@ -1,126 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Luca Elia -#ifndef MAME_UNICO_UNICO_H -#define MAME_UNICO_UNICO_H - -#pragma once - -#include "sound/okim6295.h" -#include "machine/eepromser.h" -#include "emupal.h" -#include "screen.h" -#include "tilemap.h" - -class unico_state : public driver_device -{ -public: - unico_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_palette(*this, "palette"), - m_gfxdecode(*this, "gfxdecode"), - m_oki(*this, "oki"), - m_leds(*this, "led%u", 0U), - m_vram(*this, "vram", 0xc000, ENDIANNESS_BIG), - m_scroll(*this, "scroll", 22, ENDIANNESS_BIG), - m_spriteram(*this, "spriteram", 0x800, ENDIANNESS_BIG) - { } - - void burglarx(machine_config &config); - -protected: - static rgb_t unico_R6G6B6X(uint32_t raw); - uint16_t vram_r(offs_t offset); - void vram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - uint16_t scroll_r(offs_t offset); - void scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - uint16_t spriteram_r(offs_t offset); - void spriteram_w(offs_t offset, uint16_t data, uint16_t mem_mask = ~0); - - void burglarx_okibank_w(uint8_t data); - TILE_GET_INFO_MEMBER(get_tile_info); - virtual void machine_start() override; - virtual void video_start() override; - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites(screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect); - - void burglarx_map(address_map &map); - - required_device m_maincpu; - required_device m_palette; - required_device m_gfxdecode; - optional_device m_oki; - output_finder<2> m_leds; - -private: - memory_share_creator m_vram; - memory_share_creator m_scroll; - tilemap_t *m_tilemap[3]{}; - int m_sprites_scrolldx = 0; - int m_sprites_scrolldy = 0; - memory_share_creator m_spriteram; -}; - -class zeropnt_state : public unico_state -{ -public: - zeropnt_state(const machine_config &mconfig, device_type type, const char *tag) : - unico_state(mconfig, type, tag), - m_okibank(*this, "okibank"), - m_screen(*this, "screen"), - m_gun_axes(*this, { "Y0", "X0", "Y1", "X1" }) - { } - - void zeropnt(machine_config &config); - -protected: - virtual void machine_start() override; - - void zeropnt_okibank_leds_w(uint8_t data); - uint16_t gunx_0_msb_r(); - uint16_t guny_0_msb_r(); - uint16_t gunx_1_msb_r(); - uint16_t guny_1_msb_r(); - - required_memory_bank m_okibank; - - required_device m_screen; - - void zeropnt_map(address_map &map); - void zeropnt_oki_map(address_map &map); - -private: - enum { Y0, X0, Y1, X1 }; // gun axis indices - - required_ioport_array<4> m_gun_axes; -}; - -class zeropnt2_state : public zeropnt_state -{ -public: - zeropnt2_state(const machine_config &mconfig, device_type type, const char *tag) : - zeropnt_state(mconfig, type, tag), - m_eeprom(*this, "eeprom") - { } - - void zeropnt2(machine_config &config); - -protected: - virtual void machine_start() override; - - uint32_t zeropnt2_gunx_0_msb_r(); - uint32_t zeropnt2_guny_0_msb_r(); - uint32_t zeropnt2_gunx_1_msb_r(); - uint32_t zeropnt2_guny_1_msb_r(); - void zeropnt2_okibank(uint8_t data); - void leds_w(uint8_t data); - - void eeprom_w(offs_t offset, uint32_t data, uint32_t mem_mask = ~0); - - void zeropnt2_map(address_map &map); - -private: - required_device m_eeprom; -}; - -#endif // MAME_UNICO_UNICO_H diff --git a/src/mame/unico/unico_v.cpp b/src/mame/unico/unico_v.cpp deleted file mode 100644 index 9a9edadae98..00000000000 --- a/src/mame/unico/unico_v.cpp +++ /dev/null @@ -1,269 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Luca Elia -/*************************************************************************** - - -= Unico Games =- - - driver by Luca Elia (l.elia@tin.it) - - -Note: if MAME_DEBUG is defined, pressing Z with: - - Q / W / E Shows Layer 0 / 1 / 2 - A Shows Sprites - - Keys can be used together! - - - [ 3 Scrolling Layers ] - - Tile Size: 16 x 16 x 8 - Layer Size (tiles): 64 x 64 - - [ 512 Sprites ] - - Sprites are made of 16 x 16 x 8 tiles. Size can vary from 1 to - 16 tiles horizontally, while their height is always 1 tile. - There seems to be 4 levels of priority (wrt layers) for each - sprite, following this simple scheme: - - [if we denote the three layers with 0-3 (0 being the backmost) - and the sprite with S] - - Sprite Priority Order (back -> front) - 0 S 0 1 2 - 1 0 S 1 2 - 2 0 1 S 2 - 3 0 1 2 S - -***************************************************************************/ - -#include "emu.h" -#include "unico.h" - - -/*************************************************************************** - - Palette - - Byte: 0 1 2 3 - Gun: R G B 0 - - 6 Bits x Gun - -***************************************************************************/ - -rgb_t unico_state::unico_R6G6B6X(uint32_t raw) -{ - int const red = (raw >> 24) & 0xfc; - int const green = (raw >> 16) & 0xfc; - int const blue = (raw >> 8) & 0xfc; - - return rgb_t(red | (red >> 6), green | (green >> 6), blue | (blue >> 6)); -} - -/*************************************************************************** - - Tilemaps - - Offset: Bits: Value: - - 0.w Code - 2.w fedc ba98 7--- ---- - ---- ---- -6-- ---- Flip Y - ---- ---- --5- ---- Flip X - ---- ---- ---4 3210 Color - -***************************************************************************/ - - -TILE_GET_INFO_MEMBER(unico_state::get_tile_info) -{ - uint16_t *vram = (uint16_t *)tilemap.user_data(); - uint16_t code = vram[2 * tile_index + 0 ]; - uint16_t attr = vram[2 * tile_index + 1 ]; - tileinfo.set(1, code, attr & 0x1f, TILE_FLIPYX( attr >> 5 )); -} - -uint16_t unico_state::vram_r(offs_t offset) { return m_vram[offset]; } - -void unico_state::vram_w(offs_t offset, uint16_t data, uint16_t mem_mask) -{ - int tile = ((offset / 0x2000) + 1) % 3; - COMBINE_DATA(&m_vram[offset]); - m_tilemap[tile]->mark_tile_dirty((offset & 0x1fff)/2); -} - - -uint16_t unico_state::scroll_r(offs_t offset) { return m_scroll[offset]; } -void unico_state::scroll_w(offs_t offset, uint16_t data, uint16_t mem_mask) { COMBINE_DATA(&m_scroll[offset]); } -uint16_t unico_state::spriteram_r(offs_t offset) { return m_spriteram[offset]; } -void unico_state::spriteram_w(offs_t offset, uint16_t data, uint16_t mem_mask) { COMBINE_DATA(&m_spriteram[offset]); } - - -/*************************************************************************** - - - Video Hardware Init - - -***************************************************************************/ - - -void unico_state::video_start() -{ - m_tilemap[0] = &machine().tilemap().create( - *m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(unico_state::get_tile_info)), TILEMAP_SCAN_ROWS, - 16,16, 0x40, 0x40); - - m_tilemap[1] = &machine().tilemap().create( - *m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(unico_state::get_tile_info)), TILEMAP_SCAN_ROWS, - 16,16, 0x40, 0x40); - - m_tilemap[2] = &machine().tilemap().create( - *m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(unico_state::get_tile_info)), TILEMAP_SCAN_ROWS, - 16,16, 0x40, 0x40); - - m_tilemap[0]->set_user_data(&m_vram[0x8000/2]); - m_tilemap[1]->set_user_data(&m_vram[0x0000/2]); - m_tilemap[2]->set_user_data(&m_vram[0x4000/2]); - - m_sprites_scrolldx = -0x3f; - m_sprites_scrolldy = -0x0e; - - m_tilemap[0]->set_scrolldx(-0x32,0); - m_tilemap[1]->set_scrolldx(-0x30,0); - m_tilemap[2]->set_scrolldx(-0x2e,0); - - m_tilemap[0]->set_scrolldy(-0x0f,0); - m_tilemap[1]->set_scrolldy(-0x0f,0); - m_tilemap[2]->set_scrolldy(-0x0f,0); - - m_tilemap[0]->set_transparent_pen(0x00); - m_tilemap[1]->set_transparent_pen(0x00); - m_tilemap[2]->set_transparent_pen(0x00); -} - - -/*************************************************************************** - - Sprites Drawing - - - 0.w X - - 2.w Y - - 4.w Code - - 6.w fe-- ---- ---- ---- - --dc ---- ---- ---- Priority - ---- ba98 ---- ---- Number of tiles along X, minus 1 - ---- ---- 7--- ---- - ---- ---- -6-- ---- Flip Y? - ---- ---- --5- ---- Flip X - ---- ---- ---4 3210 Color - - -***************************************************************************/ - -void unico_state::draw_sprites(screen_device &screen, bitmap_ind16 &bitmap,const rectangle &cliprect) -{ - int offs; - - /* Draw them backwards, for pdrawgfx */ - for ( offs = (0x800-8)/2; offs >= 0 ; offs -= 8/2 ) - { - int x, startx, endx, incx; - - int sx = m_spriteram[ offs + 0 ]; - int sy = m_spriteram[ offs + 1 ]; - int code = m_spriteram[ offs + 2 ]; - int attr = m_spriteram[ offs + 3 ]; - - int flipx = attr & 0x020; - int flipy = attr & 0x040; // not sure - - int dimx = ((attr >> 8) & 0xf) + 1; - - int priority = ((attr >> 12) & 0x3); - int pri_mask; - - switch( priority ) - { - case 0: pri_mask = 0xfe; break; // below all - case 1: pri_mask = 0xf0; break; // above layer 0 - case 2: pri_mask = 0xfc; break; // above layer 1 - default: - case 3: pri_mask = 0x00; // above all - } - - sx += m_sprites_scrolldx; - sy += m_sprites_scrolldy; - - sx = (sx & 0x1ff) - (sx & 0x200); - sy = (sy & 0x1ff) - (sy & 0x200); - - if (flipx) { startx = sx+(dimx-1)*16; endx = sx-16; incx = -16; } - else { startx = sx; endx = sx+dimx*16; incx = +16; } - - for (x = startx ; x != endx ; x += incx) - { - m_gfxdecode->gfx(0)->prio_transpen(bitmap,cliprect, - code++, - attr & 0x1f, - flipx, flipy, - x, sy, - screen.priority(), - pri_mask,0x00 ); - } - } -} - - -/*************************************************************************** - - - Screen Drawing - - -***************************************************************************/ - -uint32_t unico_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - int layers_ctrl = -1; - - m_tilemap[0]->set_scrollx(0, m_scroll[0x00]); - m_tilemap[0]->set_scrolly(0, m_scroll[0x01]); - - m_tilemap[1]->set_scrollx(0, m_scroll[0x05]); - m_tilemap[1]->set_scrolly(0, m_scroll[0x0a]); - - m_tilemap[2]->set_scrollx(0, m_scroll[0x04]); - m_tilemap[2]->set_scrolly(0, m_scroll[0x02]); - -#ifdef MAME_DEBUG -if ( machine().input().code_pressed(KEYCODE_Z) || machine().input().code_pressed(KEYCODE_X) ) -{ - int msk = 0; - if (machine().input().code_pressed(KEYCODE_Q)) msk |= 1; - if (machine().input().code_pressed(KEYCODE_W)) msk |= 2; - if (machine().input().code_pressed(KEYCODE_E)) msk |= 4; - if (machine().input().code_pressed(KEYCODE_A)) msk |= 8; - if (msk != 0) layers_ctrl &= msk; -} -#endif - - /* The background color is the first of the last palette */ - bitmap.fill(0x1f00, cliprect); - screen.priority().fill(0, cliprect); - - if (layers_ctrl & 1) m_tilemap[0]->draw(screen, bitmap, cliprect, 0,1); - if (layers_ctrl & 2) m_tilemap[1]->draw(screen, bitmap, cliprect, 0,2); - if (layers_ctrl & 4) m_tilemap[2]->draw(screen, bitmap, cliprect, 0,4); - - /* Sprites are drawn last, using pdrawgfx */ - if (layers_ctrl & 8) draw_sprites(screen,bitmap,cliprect); - - return 0; -} diff --git a/src/mame/universal/docastle.cpp b/src/mame/universal/docastle.cpp index 6e0618f922e..cbfae56c611 100644 --- a/src/mame/universal/docastle.cpp +++ b/src/mame/universal/docastle.cpp @@ -420,6 +420,15 @@ static INPUT_PORTS_START( dorunrun ) PORT_DIPSETTING( 0x00, "5" ) INPUT_PORTS_END +static INPUT_PORTS_START( runrun ) + PORT_INCLUDE( dorunrun ) + + PORT_MODIFY("DSW1") + PORT_DIPNAME( 0x80, 0x80, DEF_STR( Lives ) ) PORT_DIPLOCATION("SWA:1") + PORT_DIPSETTING( 0x80, "1" ) + PORT_DIPSETTING( 0x00, "2" ) +INPUT_PORTS_END + static INPUT_PORTS_START( dowild ) PORT_INCLUDE( docastle ) @@ -819,6 +828,33 @@ ROM_START( dorunrunca ) ROM_LOAD( "dorunrun.clr", 0x0000, 0x0100, CRC(d5bab5d5) SHA1(7a465fe30b6008793d33f6e07086c89111e1e407) ) ROM_END + // Italian bootleg of dorunrunc. Main PCB + 040285C riser board. Differences are just revised number of lives and the 'Do!' and copyright drawing routines NOPed out. +ROM_START( runrun ) + ROM_REGION( 0x10000, "maincpu", 0 ) + ROM_LOAD( "electric_1.bin", 0x0000, 0x2000, CRC(9f23896b) SHA1(609103729b0d9721166ee5e50e4adab09d343f0a) ) // only different ROM + ROM_LOAD( "electric_2.bin", 0x2000, 0x2000, CRC(dbe3e7db) SHA1(168026aacce73941329a72e78423f83f7c4f0f04) ) + ROM_LOAD( "electric_3.bin", 0x4000, 0x2000, CRC(e9b8181a) SHA1(6b960c3503589e62b61f9a2af372b98c48412bc0) ) + ROM_LOAD( "electric_4.bin", 0x6000, 0x2000, CRC(a63d0b89) SHA1(d2ab3b76149e6620f1eb93a051c802b208b8d6dc) ) + + ROM_REGION( 0x10000, "slave", 0 ) + ROM_LOAD( "electric_10.bin", 0x0000, 0x4000, CRC(6dac2fa3) SHA1(cd583f379f01788ce20f611f17689105d32ef97a) ) + + ROM_REGION( 0x10000, "cpu3", 0 ) + ROM_LOAD( "bprom2.bin", 0x0000, 0x0200, BAD_DUMP CRC(2747ca77) SHA1(abc0ca05925974c4b852827605ee2f1caefb8524) ) // not dumped for this set + + ROM_REGION( 0x4000, "gfx1", 0 ) + ROM_LOAD( "electric_5.bin", 0x0000, 0x4000, CRC(e20795b7) SHA1(ae4366d2c45580f3e60ae36f81a5fc912d1eb899) ) + + ROM_REGION( 0x8000, "gfx2", 0 ) + ROM_LOAD( "electric_6.bin", 0x0000, 0x2000, CRC(4bb231a0) SHA1(350423a1e602e23b229095021942d4b14a4736a7) ) + ROM_LOAD( "electric_7.bin", 0x2000, 0x2000, CRC(0c08508a) SHA1(1e235a0f44207c53af2c8da631e5a8e08b231258) ) + ROM_LOAD( "electric_8.bin", 0x4000, 0x2000, CRC(79287039) SHA1(e2e3c056f35a22e48115557e10fcd172ad2f91f1) ) + ROM_LOAD( "electric_9.bin", 0x6000, 0x2000, CRC(523aa999) SHA1(1d4aa0af79a2ed7b935d4ce92d978bf738f08eb3) ) + + ROM_REGION( 0x0100, "proms", 0 ) + ROM_LOAD( "dorunrun.clr", 0x0000, 0x0100, BAD_DUMP CRC(d5bab5d5) SHA1(7a465fe30b6008793d33f6e07086c89111e1e407) ) // not dumped for this set +ROM_END + ROM_START( dorunrun ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "2764.p1", 0x0000, 0x2000, CRC(95c86f8e) SHA1(9fe44911e0aa8d4c7299472a31c401e064d63d17) ) @@ -1118,6 +1154,7 @@ GAME( 1984, dorunrun, 0, dorunrun, dorunrun, docastle_state, empty_init GAME( 1984, dorunrun2, dorunrun, dorunrun, dorunrun, docastle_state, empty_init, ROT0, "Universal", "Do! Run Run (set 2)", MACHINE_SUPPORTS_SAVE ) GAME( 1984, dorunrunc, dorunrun, docastle, dorunrun, docastle_state, empty_init, ROT0, "Universal", "Do! Run Run (Do's Castle hardware, set 1)", MACHINE_SUPPORTS_SAVE ) GAME( 1984, dorunrunca, dorunrun, docastle, dorunrun, docastle_state, empty_init, ROT0, "Universal", "Do! Run Run (Do's Castle hardware, set 2)", MACHINE_SUPPORTS_SAVE ) +GAME( 1984, runrun, dorunrun, docastle, runrun, docastle_state, empty_init, ROT0, "bootleg", "Run Run (Do! Run Run bootleg)", MACHINE_SUPPORTS_SAVE ) GAME( 1987, spiero, dorunrun, dorunrun, dorunrun, docastle_state, empty_init, ROT0, "Universal", "Super Pierrot (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1984, dowild, 0, dorunrun, dowild, docastle_state, empty_init, ROT0, "Universal", "Mr. Do's Wild Ride", MACHINE_SUPPORTS_SAVE ) GAME( 1984, jjack, 0, dorunrun, jjack, docastle_state, empty_init, ROT270, "Universal", "Jumping Jack", MACHINE_SUPPORTS_SAVE ) -- cgit v1.2.3