From fb30007f9ec804b4788af27b29eb9f1cffe7031b Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Tue, 26 Apr 2022 20:32:28 +0200 Subject: brkthru.cpp, gunsmoke.cpp, bfm_adr2.cpp: used finders and other small cleanups --- scripts/target/mame/arcade.lua | 4 - src/mame/drivers/bfm_sc1.cpp | 4 +- src/mame/drivers/bfm_sc2.cpp | 56 ++-- src/mame/drivers/brkthru.cpp | 711 ++++++++++++++++++++++++++------------- src/mame/drivers/gunsmoke.cpp | 744 +++++++++++++++++++++++++++-------------- src/mame/includes/brkthru.h | 77 ----- src/mame/includes/gunsmoke.h | 68 ---- src/mame/video/bfm_adr2.cpp | 393 ++++++++-------------- src/mame/video/bfm_adr2.h | 62 ++-- src/mame/video/brkthru.cpp | 264 --------------- src/mame/video/gunsmoke.cpp | 189 ----------- 11 files changed, 1175 insertions(+), 1397 deletions(-) delete mode 100644 src/mame/includes/brkthru.h delete mode 100644 src/mame/includes/gunsmoke.h delete mode 100644 src/mame/video/brkthru.cpp delete mode 100644 src/mame/video/gunsmoke.cpp diff --git a/scripts/target/mame/arcade.lua b/scripts/target/mame/arcade.lua index 1b0fac67d74..80724fc4d72 100644 --- a/scripts/target/mame/arcade.lua +++ b/scripts/target/mame/arcade.lua @@ -1556,8 +1556,6 @@ files { MAME_DIR .. "src/mame/includes/fcrash.h", MAME_DIR .. "src/mame/drivers/gng.cpp", MAME_DIR .. "src/mame/drivers/gunsmoke.cpp", - MAME_DIR .. "src/mame/includes/gunsmoke.h", - MAME_DIR .. "src/mame/video/gunsmoke.cpp", MAME_DIR .. "src/mame/drivers/higemaru.cpp", MAME_DIR .. "src/mame/includes/higemaru.h", MAME_DIR .. "src/mame/video/higemaru.cpp", @@ -1692,8 +1690,6 @@ files { MAME_DIR .. "src/mame/includes/boogwing.h", MAME_DIR .. "src/mame/video/boogwing.cpp", MAME_DIR .. "src/mame/drivers/brkthru.cpp", - MAME_DIR .. "src/mame/includes/brkthru.h", - MAME_DIR .. "src/mame/video/brkthru.cpp", MAME_DIR .. "src/mame/drivers/btime.cpp", MAME_DIR .. "src/mame/includes/btime.h", MAME_DIR .. "src/mame/machine/btime.cpp", diff --git a/src/mame/drivers/bfm_sc1.cpp b/src/mame/drivers/bfm_sc1.cpp index ef52ed1c28e..00092d95722 100644 --- a/src/mame/drivers/bfm_sc1.cpp +++ b/src/mame/drivers/bfm_sc1.cpp @@ -1344,10 +1344,10 @@ ROM_START( m_tppokr ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD( "95750899.bin", 0x00000, 0x10000, CRC(639d1d62) SHA1(80620c14bf9f953588555510fc2e6e930140923f)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD( "tpk010.vid", 0x00000, 0x20000, CRC(ea4eddca) SHA1(5fb805d35376ec7ee8d58684e584621dbb2b2a9c)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD( "tpk011.chr", 0x00000, 0x20000, CRC(4dc23ad8) SHA1(8e8cc699412dbb092e16e14518f407353f477ee1)) ROM_END diff --git a/src/mame/drivers/bfm_sc2.cpp b/src/mame/drivers/bfm_sc2.cpp index e346dbe7f8e..3e94b8a4759 100644 --- a/src/mame/drivers/bfm_sc2.cpp +++ b/src/mame/drivers/bfm_sc2.cpp @@ -2485,13 +2485,13 @@ ROM_START( quintoon ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95750206.p1", 0x00000, 0x10000, CRC(05f4bfad) SHA1(22751573f3a51a9fd2d2a75a7d1b20d78112e0bb)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("quinp132", 0x00000, 0x20000, CRC(63896a7f) SHA1(81aa56874a15faa3aabdfc0fc524b2e25b751f22)) ROM_REGION( 0x20000, "upd", 0 ) // using Dutch samples, need to check a UK Quintoon PCB ROM_LOAD("95001016.snd", 0x00000, 0x20000, BAD_DUMP CRC(cf097d41) SHA1(6712f93896483360256d8baffc05977c8e532ef1)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("quinp233", 0x00000, 0x20000, CRC(3d4ebecf) SHA1(b339cf16797ccf7a1ec20fcebf52b6edad9a1047)) ROM_END @@ -2501,13 +2501,13 @@ ROM_START( quintono ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95750203.bin", 0x00000, 0x10000, CRC(037ef2d0) SHA1(6958624e29629a7639a80e8929b833a8b0201833)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("quinp132", 0x00000, 0x20000, CRC(63896a7f) SHA1(81aa56874a15faa3aabdfc0fc524b2e25b751f22)) ROM_REGION( 0x20000, "upd", 0 ) // using Dutch samples, need to check a UK Quintoon PCB ROM_LOAD("95001016.snd", 0x00000, 0x20000, BAD_DUMP CRC(cf097d41) SHA1(6712f93896483360256d8baffc05977c8e532ef1)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("quinp233", 0x00000, 0x20000, CRC(3d4ebecf) SHA1(b339cf16797ccf7a1ec20fcebf52b6edad9a1047)) ROM_END @@ -2517,13 +2517,13 @@ ROM_START( quintond ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95751206.bin", 0x00000, 0x10000, CRC(63def707) SHA1(d016df74f4f83cd72b16f9ccbe78cc382bf056c8)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("quinp132", 0x00000, 0x20000, CRC(63896a7f) SHA1(81aa56874a15faa3aabdfc0fc524b2e25b751f22)) ROM_REGION( 0x20000, "upd", 0 ) // using Dutch samples, need to check a UK Quintoon PCB ROM_LOAD("95001016.snd", 0x00000, 0x20000, BAD_DUMP CRC(cf097d41) SHA1(6712f93896483360256d8baffc05977c8e532ef1)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("quinp233", 0x00000, 0x20000, CRC(3d4ebecf) SHA1(b339cf16797ccf7a1ec20fcebf52b6edad9a1047)) ROM_END @@ -2533,13 +2533,13 @@ ROM_START( qntoond ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95750243.bin", 0x00000, 0x10000, CRC(36a8dcd1) SHA1(ab21301312fbb6609f850e1cf6bcda5a2b7f66f5)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("95770024.vid", 0x00000, 0x20000, CRC(5bc7ac55) SHA1(b54e9684f750b73c357d41b88ca8c527258e2a10)) ROM_REGION( 0x20000, "upd", 0 ) ROM_LOAD("95001016.snd", 0x00000, 0x20000, CRC(cf097d41) SHA1(6712f93896483360256d8baffc05977c8e532ef1)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("95770025.chr", 0x00000, 0x20000, CRC(f59748ea) SHA1(f0f7f914fdf72db8eb60717b95e7d027c0081339)) ROM_END @@ -2549,13 +2549,13 @@ ROM_START( qntoondo ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95750136.bin", 0x00000, 0x10000, CRC(839ea01d) SHA1(d7f77dbaea4e87c3d782408eb50d10f44b6df5e2)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("95770024.vid", 0x00000, 0x20000, CRC(5bc7ac55) SHA1(b54e9684f750b73c357d41b88ca8c527258e2a10)) ROM_REGION( 0x20000, "upd", 0 ) ROM_LOAD("95001016.snd", 0x00000, 0x20000, CRC(cf097d41) SHA1(6712f93896483360256d8baffc05977c8e532ef1)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("95770025.chr", 0x00000, 0x20000, CRC(f59748ea) SHA1(f0f7f914fdf72db8eb60717b95e7d027c0081339)) ROM_END @@ -2565,13 +2565,13 @@ ROM_START( gldncrwn ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95752011.bin", 0x00000, 0x10000, CRC(54f7cca0) SHA1(835727d88113700a38060f880b4dfba2ded41487)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("95770117.vid", 0x00000, 0x20000, CRC(598ba7cb) SHA1(ab518d7df24b0b453ec3fcddfc4db63e0391fde7)) ROM_REGION( 0x20000, "upd", 0 ) ROM_LOAD("95001039.snd", 0x00000, 0x20000, CRC(6af26157) SHA1(9b3a85f5dd760c4430e38e2844928b74aadc7e75)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("95770118.ch1", 0x00000, 0x20000, CRC(9c9ac946) SHA1(9a571e7d00f6654242aface032c2fb186ef44aba)) ROM_LOAD("95770119.ch2", 0x20000, 0x20000, CRC(9e0fdb2e) SHA1(05e8257285b0009df4fcc73e93490876358a8be8)) @@ -2583,13 +2583,13 @@ ROM_START( gldncrwnhop ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95752007.gam", 0x00000, 0x10000, CRC(ba009ab7) SHA1(df58f5ff4e9fdf8db5931833b909fb0e4ba8e23d)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("95770146.vid", 0x00000, 0x20000, CRC(f3109cd5) SHA1(8da5207c07015d6f5a72397eaa6ab70800785f7f)) ROM_REGION( 0x20000, "upd", 0 ) ROM_LOAD("95770139.snd", 0x00000, 0x20000, CRC(e76ca414) SHA1(2c441e3369e374c033b5585e8f6a9c34a4c5ec0f)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("95770147.chr", 0x00000, 0x20000, CRC(5a4d2b79) SHA1(c2f2f39ef6816e0da1b2ff4b723612c671c6215f)) ROM_REGION( 0x10, "proms", 0 ) @@ -2603,13 +2603,13 @@ ROM_START( paradice ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95750615.bin", 0x00000, 0x10000, CRC(f51192e5) SHA1(a1290e32bba698006e83fd8d6075202586232929)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("95770084.vid", 0x00000, 0x20000, CRC(8f27bd34) SHA1(fccf7283b5c952b74258ee6e5138c1ca89384e24)) ROM_REGION( 0x20000, "upd", 0 ) ROM_LOAD("95001037.snd", 0x00000, 0x20000, CRC(82f74276) SHA1(c51c3caeb7bf514ec7a1b452c8effc4c79186062)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("95770085.ch1", 0x00000, 0x20000, CRC(4d1fb82f) SHA1(054f683d1d7c884911bd2d0f85aab4c59ddf9930)) ROM_LOAD("95770086.ch2", 0x20000, 0x20000, CRC(7b566e11) SHA1(f34c82ad75a0f88204ac4ae83a00801215c46ca9)) @@ -2623,13 +2623,13 @@ ROM_START( pokio ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95750278.bin", 0x00000, 0x10000, CRC(5124b24d) SHA1(9bc63891a8e9283c2baa64c264a5d6d1625d44b2)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("95770044.vid", 0x00000, 0x20000, CRC(46d7a6d8) SHA1(01f58e735621661b57c61491b3769ae99e92476a)) ROM_REGION( 0x20000, "upd", 0 ) ROM_LOAD("95001016.snd", 0x00000, 0x20000, CRC(98aaff76) SHA1(4a59cf83daf018d93f1ff7805e06309d2f3d7252)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("95770045.chr", 0x00000, 0x20000, CRC(dd30da90) SHA1(b4f5a229d88613c0c7d43adf3f325c619abe38a3)) ROM_REGION( 0x10, "proms", 0 ) @@ -2642,13 +2642,13 @@ ROM_START( pyramid ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95750898.bin", 0x00000, 0x10000, CRC(3b0df16c) SHA1(9af599fe604f86c72986aa1610d74837852e023f)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("95770108.vid", 0x00000, 0x20000, CRC(216ff683) SHA1(227764771600ce88c5f36bed9878e6bb9988ae8f)) ROM_REGION( 0x20000, "upd", 0 ) ROM_LOAD("95001038.snd", 0x00000, 0x20000, CRC(f885c42e) SHA1(4d79fc5ae4c58247740d78d81302bfbb43331c43)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("95770106.ch1", 0x00000, 0x20000, CRC(a83c27ae) SHA1(f61ca3cdf19a933bae18c1b32a5fb0a2204dde78)) ROM_LOAD("95770107.ch2", 0x20000, 0x20000, CRC(52e59f64) SHA1(ea4828c2cfb72cd77c92c60560b4d5ee424f7dca)) @@ -2662,13 +2662,13 @@ ROM_START( slotsnl ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95750368.bin", 0x00000, 0x10000, CRC(3a43048c) SHA1(13728e05b334cba90ea9cc51ea00c4384baa8614)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("video.vid", 0x00000, 0x20000, CRC(cc760208) SHA1(cc01b1e31335b26f2d0f3470d8624476b153655f)) ROM_REGION( 0x20000, "upd", 0 ) ROM_LOAD("95001029.snd", 0x00000, 0x20000, CRC(7749c724) SHA1(a87cce0c99e392f501bba44b3936a7059d682c9c)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("charset.chr", 0x00000, 0x20000, CRC(ef4300b6) SHA1(a1f765f38c2f146651fc685ea6195af72465f559)) ROM_REGION( 0x10, "proms", 0 ) @@ -2681,13 +2681,13 @@ ROM_START( sltblgtk ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95750943.bin", 0x00000, 0x10000, CRC(c9fb8153) SHA1(7c1d0660c15f05b1e0784d8322c62981fe8dc4c9)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("adder121.bin", 0x00000, 0x20000, CRC(cedbbf28) SHA1(559ae341b55462feea771127394a54fc65266818)) ROM_REGION( 0x20000, "upd", 0 ) ROM_LOAD("sound029.bin", 0x00000, 0x20000, CRC(7749c724) SHA1(a87cce0c99e392f501bba44b3936a7059d682c9c)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("chr122.bin", 0x00000, 0x20000, CRC(a1e3bdf4) SHA1(f0cabe08dee028e2014cbf0fc3fe0806cdfa60c6)) ROM_REGION( 0x10, "proms", 0 ) @@ -2700,13 +2700,13 @@ ROM_START( sltblgp1 ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95752008.bin", 0x00000, 0x10000, CRC(3167d3b9) SHA1(a28563f65d55c4d47f3e7fdb41e050d8a733b9bd)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("adder142.bin", 0x00000, 0x20000, CRC(a6f6356b) SHA1(b3d3063155ee3ea888273081f844279b6e33f7d9)) ROM_REGION( 0x20000, "upd", 0 ) ROM_LOAD("sound033.bin", 0x00000, 0x20000, CRC(bb1dfa55) SHA1(442454fccfe03e6f4c3353551cb7459e184a099d)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("chr143.bin", 0x00000, 0x20000, CRC(a40e91e2) SHA1(87dc76963ea961fcfbe4f3e25df9162348d39d79)) ROM_REGION( 0x10, "proms", 0 ) @@ -2719,13 +2719,13 @@ ROM_START( sltblgpo ) ROM_REGION( 0x10000, "maincpu", 0 ) ROM_LOAD("95770938.bin", 0x00000, 0x10000, CRC(7e802634) SHA1(fecf86e632546649d5e647c42a248b39fc2cf982)) - ROM_REGION( 0x20000, "adder2", 0 ) + ROM_REGION( 0x20000, "adder2:cpu", 0 ) ROM_LOAD("95770120.chr", 0x00000, 0x20000, CRC(ad505138) SHA1(67ccd8dc30e76283247ab5a62b22337ebaff74cd)) ROM_REGION( 0x20000, "upd", 0 ) ROM_LOAD("sound033.bin", 0x00000, 0x20000, CRC(bb1dfa55) SHA1(442454fccfe03e6f4c3353551cb7459e184a099d)) - ROM_REGION( 0x40000, "gfx1", ROMREGION_ERASEFF ) + ROM_REGION( 0x40000, "adder2:tiles", ROMREGION_ERASEFF ) ROM_LOAD("95770110.add", 0x00000, 0x20000, CRC(64b03284) SHA1(4b1c17b75e449c9762bb949d7cde0694a3aaabeb)) ROM_REGION( 0x10, "proms", 0 ) diff --git a/src/mame/drivers/brkthru.cpp b/src/mame/drivers/brkthru.cpp index 07c4f573647..451d4f75568 100644 --- a/src/mame/drivers/brkthru.cpp +++ b/src/mame/drivers/brkthru.cpp @@ -63,7 +63,7 @@ Data East, 1986 | separation = solder -upper pcb - 3002A +upper PCB - 3002A |-------------------------------------------------| |t |-------| | |o |---------| |YM2203C| | @@ -103,7 +103,7 @@ Notes: -lower pcb - 3002B +lower PCB - 3002B |-----------------------------------------------------| |t |-----| | |o |------| |epr11| | @@ -142,17 +142,297 @@ buttons down after the game has started then pressing F3 to reset the game. ***************************************************************************/ #include "emu.h" -#include "includes/brkthru.h" #include "cpu/m6809/m6809.h" -#include "sound/ymopn.h" +#include "machine/gen_latch.h" #include "sound/ymopl.h" +#include "sound/ymopn.h" + +#include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class brkthru_state : public driver_device +{ +public: + brkthru_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_fg_videoram(*this, "fg_videoram"), + m_videoram(*this, "videoram"), + m_spriteram(*this, "spriteram"), + m_mainbank(*this, "mainbank"), + m_maincpu(*this, "maincpu"), + m_audiocpu(*this, "audiocpu"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette") + { } + + void brkthru(machine_config &config); + void darwin(machine_config &config); + + DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + +private: + // memory pointers + required_shared_ptr m_fg_videoram; + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + required_memory_bank m_mainbank; + + // video-related + tilemap_t *m_fg_tilemap = nullptr; + tilemap_t *m_bg_tilemap = nullptr; + uint16_t m_bgscroll = 0; + uint8_t m_bgbasecolor = 0; + uint8_t m_flipscreen = 0; + + // devices + required_device m_maincpu; + required_device m_audiocpu; + required_device m_gfxdecode; + required_device m_palette; + + uint8_t m_nmi_mask = 0U; + + void brkthru_1803_w(uint8_t data); + void darwin_0803_w(uint8_t data); + void bgram_w(offs_t offset, uint8_t data); + void fgram_w(offs_t offset, uint8_t data); + void _1800_w(offs_t offset, uint8_t data); + TILE_GET_INFO_MEMBER(get_bg_tile_info); + TILE_GET_INFO_MEMBER(get_fg_tile_info); + void palette(palette_device &palette) const; + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + DECLARE_WRITE_LINE_MEMBER(vblank_irq); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int prio); + + void brkthru_main_map(address_map &map); + void darwin_main_map(address_map &map); + void sound_map(address_map &map); +}; + + +// video + + +/*************************************************************************** + + Convert the color PROMs into a more useable format. + + Break Thru has one 256x8 and one 256x4 palette PROMs. + I don't know for sure how the palette PROMs are connected to the RGB + output, but it's probably the usual: + + bit 7 -- 220 ohm resistor -- GREEN + -- 470 ohm resistor -- GREEN + -- 1 kohm resistor -- GREEN + -- 2.2kohm resistor -- GREEN + -- 220 ohm resistor -- RED + -- 470 ohm resistor -- RED + -- 1 kohm resistor -- RED + bit 0 -- 2.2kohm resistor -- RED + + bit 3 -- 220 ohm resistor -- BLUE + -- 470 ohm resistor -- BLUE + -- 1 kohm resistor -- BLUE + bit 0 -- 2.2kohm resistor -- BLUE + +***************************************************************************/ + +void brkthru_state::palette(palette_device &palette) const +{ + uint8_t const *color_prom = memregion("proms")->base(); + + for (int i = 0; i < palette.entries(); i++) + { + int bit0 = (color_prom[0] >> 0) & 0x01; + int bit1 = (color_prom[0] >> 1) & 0x01; + int bit2 = (color_prom[0] >> 2) & 0x01; + int bit3 = (color_prom[0] >> 3) & 0x01; + int const r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; + bit0 = (color_prom[0] >> 4) & 0x01; + bit1 = (color_prom[0] >> 5) & 0x01; + bit2 = (color_prom[0] >> 6) & 0x01; + bit3 = (color_prom[0] >> 7) & 0x01; + int const g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; + bit0 = (color_prom[palette.entries()] >> 0) & 0x01; + bit1 = (color_prom[palette.entries()] >> 1) & 0x01; + bit2 = (color_prom[palette.entries()] >> 2) & 0x01; + bit3 = (color_prom[palette.entries()] >> 3) & 0x01; + int const b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; + + palette.set_pen_color(i, rgb_t(r, g, b)); + + color_prom++; + } +} + + + +/*************************************************************************** + + Start the video hardware emulation. + +***************************************************************************/ + +TILE_GET_INFO_MEMBER(brkthru_state::get_bg_tile_info) +{ + /* BG RAM format + 0 1 + ---- -c-- ---- ---- = Color + ---- --xx xxxx xxxx = Code + */ + + int code = (m_videoram[tile_index * 2] | ((m_videoram[tile_index * 2 + 1]) << 8)) & 0x3ff; + int region = 1 + (code >> 7); + int colour = m_bgbasecolor + ((m_videoram[tile_index * 2 + 1] & 0x04) >> 2); + + tileinfo.set(region, code & 0x7f, colour,0); +} + +void brkthru_state::bgram_w(offs_t offset, uint8_t data) +{ + m_videoram[offset] = data; + m_bg_tilemap->mark_tile_dirty(offset / 2); +} + + +TILE_GET_INFO_MEMBER(brkthru_state::get_fg_tile_info) +{ + uint8_t code = m_fg_videoram[tile_index]; + tileinfo.set(0, code, 0, 0); +} + +void brkthru_state::fgram_w(offs_t offset, uint8_t data) +{ + m_fg_videoram[offset] = data; + m_fg_tilemap->mark_tile_dirty(offset); +} + +void brkthru_state::video_start() +{ + m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(brkthru_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(brkthru_state::get_bg_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 32, 16); + + m_fg_tilemap->set_transparent_pen(0); + m_bg_tilemap->set_transparent_pen(0); +} + + +void brkthru_state::_1800_w(offs_t offset, uint8_t data) +{ + if (offset == 0) // low 8 bits of scroll + m_bgscroll = (m_bgscroll & 0x100) | data; + else if (offset == 1) + { + // bit 0-2 = ROM bank select + m_mainbank->set_entry(data & 0x07); + + // bit 3-5 = background tiles color code + if (((data & 0x38) >> 2) != m_bgbasecolor) + { + m_bgbasecolor = (data & 0x38) >> 2; + m_bg_tilemap->mark_all_dirty(); + } + + // bit 6 = screen flip + if (m_flipscreen != (data & 0x40)) + { + m_flipscreen = data & 0x40; + m_bg_tilemap->set_flip(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + m_fg_tilemap->set_flip(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); + + } + + // bit 7 = high bit of scroll + m_bgscroll = (m_bgscroll & 0xff) | ((data & 0x80) << 1); + } +} + +void brkthru_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect, int prio) +{ + // Draw the sprites. Note that it is important to draw them exactly in this order, to have the correct priorities. + + /* Sprite RAM format + 0 1 2 3 + ccc- ---- ---- ---- ---- ---- ---- ---- = Color + ---d ---- ---- ---- ---- ---- ---- ---- = Double Size + ---- p--- ---- ---- ---- ---- ---- ---- = Priority + ---- -bb- ---- ---- ---- ---- ---- ---- = Bank + ---- ---e ---- ---- ---- ---- ---- ---- = Enable/Disable + ---- ---- ssss ssss ---- ---- ---- ---- = Sprite code + ---- ---- ---- ---- yyyy yyyy ---- ---- = Y position + ---- ---- ---- ---- ---- ---- xxxx xxxx = X position + */ + + for (int offs = 0; offs < m_spriteram.bytes(); offs += 4) + { + if ((m_spriteram[offs] & 0x09) == prio) // Enable && Low Priority + { + int sx = 240 - m_spriteram[offs + 3]; + if (sx < -7) + sx += 256; + + int sy = 240 - m_spriteram[offs + 2]; + int code = m_spriteram[offs + 1] + 128 * (m_spriteram[offs] & 0x06); + int color = (m_spriteram[offs] & 0xe0) >> 5; + if (m_flipscreen) + { + sx = 240 - sx; + sy = 240 - sy; + } + + if (m_spriteram[offs] & 0x10) // double height + { + m_gfxdecode->gfx(9)->transpen(bitmap, cliprect, code & ~1, color, m_flipscreen, m_flipscreen, sx, m_flipscreen ? sy + 16 : sy - 16, 0); + m_gfxdecode->gfx(9)->transpen(bitmap, cliprect, code | 1, color, m_flipscreen, m_flipscreen, sx, sy, 0); + + // redraw with wraparound + m_gfxdecode->gfx(9)->transpen(bitmap, cliprect, code & ~1, color, m_flipscreen, m_flipscreen, sx,(m_flipscreen ? sy + 16 : sy - 16) + 256, 0); + m_gfxdecode->gfx(9)->transpen(bitmap, cliprect, code | 1, color, m_flipscreen, m_flipscreen, sx, sy + 256, 0); + } + else + { + m_gfxdecode->gfx(9)->transpen(bitmap, cliprect, code, color, m_flipscreen, m_flipscreen, sx, sy, 0); + + // redraw with wraparound + m_gfxdecode->gfx(9)->transpen(bitmap, cliprect, code, color, m_flipscreen, m_flipscreen, sx, sy + 256, 0); + } + } + } +} + +uint32_t brkthru_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + m_bg_tilemap->set_scrollx(0, m_bgscroll); + m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); + // low priority sprites + draw_sprites(bitmap, cliprect, 0x01); -#define MASTER_CLOCK XTAL(12'000'000) + // draw background over low priority sprites + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + // high priority sprites + draw_sprites(bitmap, cliprect, 0x09); + + // fg layer + m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + + return 0; +} + + +// machine /************************************* * @@ -162,31 +442,31 @@ buttons down after the game has started then pressing F3 to reset the game. void brkthru_state::brkthru_1803_w(uint8_t data) { - /* bit 0 = NMI enable */ + // bit 0 = NMI enable m_nmi_mask = ~data & 1; - if(data & 2) + if (data & 2) m_maincpu->set_input_line(0, CLEAR_LINE); - /* bit 1 = ? maybe IRQ acknowledge */ + // bit 1 = ? maybe IRQ acknowledge } void brkthru_state::darwin_0803_w(uint8_t data) { - /* bit 0 = NMI enable */ + // bit 0 = NMI enable m_nmi_mask = data & 1; - logerror("0803 %02X\n",data); + logerror("0803 %02X\n", data); - if(data & 2) + if (data & 2) m_maincpu->set_input_line(0, CLEAR_LINE); - /* bit 1 = ? maybe IRQ acknowledge */ + // bit 1 = ? maybe IRQ acknowledge } INPUT_CHANGED_MEMBER(brkthru_state::coin_inserted) { - /* coin insertion causes an IRQ */ + // coin insertion causes an IRQ if (oldval) m_maincpu->set_input_line(0, ASSERT_LINE); } @@ -198,40 +478,40 @@ INPUT_CHANGED_MEMBER(brkthru_state::coin_inserted) * *************************************/ -void brkthru_state::brkthru_map(address_map &map) +void brkthru_state::brkthru_main_map(address_map &map) { - map(0x0000, 0x03ff).ram().w(FUNC(brkthru_state::brkthru_fgram_w)).share("fg_videoram"); + map(0x0000, 0x03ff).ram().w(FUNC(brkthru_state::fgram_w)).share(m_fg_videoram); map(0x0400, 0x0bff).ram(); - map(0x0c00, 0x0fff).ram().w(FUNC(brkthru_state::brkthru_bgram_w)).share("videoram"); - map(0x1000, 0x10ff).ram().share("spriteram"); + map(0x0c00, 0x0fff).ram().w(FUNC(brkthru_state::bgram_w)).share(m_videoram); + map(0x1000, 0x10ff).ram().share(m_spriteram); map(0x1100, 0x17ff).ram(); map(0x1800, 0x1800).portr("P1"); map(0x1801, 0x1801).portr("P2"); map(0x1802, 0x1802).portr("DSW1"); map(0x1803, 0x1803).portr("DSW2_COIN"); - map(0x1800, 0x1801).w(FUNC(brkthru_state::brkthru_1800_w)); /* bg scroll and color, ROM bank selection, flip screen */ - map(0x1802, 0x1802).w(m_soundlatch, FUNC(generic_latch_8_device::write)); - map(0x1803, 0x1803).w(FUNC(brkthru_state::brkthru_1803_w)); /* NMI enable, + ? */ - map(0x2000, 0x3fff).bankr("bank1"); + map(0x1800, 0x1801).w(FUNC(brkthru_state::_1800_w)); // bg scroll and color, ROM bank selection, flip screen + map(0x1802, 0x1802).w("soundlatch", FUNC(generic_latch_8_device::write)); + map(0x1803, 0x1803).w(FUNC(brkthru_state::brkthru_1803_w)); // NMI enable, + ? + map(0x2000, 0x3fff).bankr(m_mainbank); map(0x4000, 0xffff).rom(); } -/* same as brktrhu, but xor 0x1000 below 8k */ -void brkthru_state::darwin_map(address_map &map) +// same as brktrhu, but XOR 0x1000 below 8k +void brkthru_state::darwin_main_map(address_map &map) { - map(0x1000, 0x13ff).ram().w(FUNC(brkthru_state::brkthru_fgram_w)).share("fg_videoram"); + map(0x1000, 0x13ff).ram().w(FUNC(brkthru_state::fgram_w)).share(m_fg_videoram); map(0x1400, 0x1bff).ram(); - map(0x1c00, 0x1fff).ram().w(FUNC(brkthru_state::brkthru_bgram_w)).share("videoram"); - map(0x0000, 0x00ff).ram().share("spriteram"); - map(0x0100, 0x01ff).nopw(); /*tidyup, nothing really here?*/ + map(0x1c00, 0x1fff).ram().w(FUNC(brkthru_state::bgram_w)).share(m_videoram); + map(0x0000, 0x00ff).ram().share(m_spriteram); + map(0x0100, 0x01ff).nopw(); // tidy up, nothing really here? map(0x0800, 0x0800).portr("P1"); map(0x0801, 0x0801).portr("P2"); map(0x0802, 0x0802).portr("DSW1"); map(0x0803, 0x0803).portr("DSW2_COIN"); - map(0x0800, 0x0801).w(FUNC(brkthru_state::brkthru_1800_w)); /* bg scroll and color, ROM bank selection, flip screen */ - map(0x0802, 0x0802).w(m_soundlatch, FUNC(generic_latch_8_device::write)); - map(0x0803, 0x0803).w(FUNC(brkthru_state::darwin_0803_w)); /* NMI enable, + ? */ - map(0x2000, 0x3fff).bankr("bank1"); + map(0x0800, 0x0801).w(FUNC(brkthru_state::_1800_w)); // bg scroll and color, ROM bank selection, flip screen + map(0x0802, 0x0802).w("soundlatch", FUNC(generic_latch_8_device::write)); + map(0x0803, 0x0803).w(FUNC(brkthru_state::darwin_0803_w)); // NMI enable, + ? + map(0x2000, 0x3fff).bankr(m_mainbank); map(0x4000, 0xffff).rom(); } @@ -240,7 +520,7 @@ void brkthru_state::sound_map(address_map &map) { map(0x0000, 0x1fff).ram(); map(0x2000, 0x2001).w("ym2", FUNC(ym3526_device::write)); - map(0x4000, 0x4000).r(m_soundlatch, FUNC(generic_latch_8_device::read)); + map(0x4000, 0x4000).r("soundlatch", FUNC(generic_latch_8_device::read)); map(0x6000, 0x6001).rw("ym1", FUNC(ym2203_device::read), FUNC(ym2203_device::write)); map(0x8000, 0xffff).rom(); } @@ -271,7 +551,7 @@ static INPUT_PORTS_START( brkthru ) PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_COCKTAIL PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_COCKTAIL PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") /* used only by the self test */ + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") // used only by the self test PORT_START("DSW1") PORT_DIPNAME( 0x03, 0x03, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW1:1,2") @@ -308,17 +588,17 @@ static INPUT_PORTS_START( brkthru ) PORT_DIPSETTING( 0x04, "10000/20000 Points" ) PORT_DIPSETTING( 0x0c, "20000/30000 Points" ) PORT_DIPSETTING( 0x08, "20000/40000 Points" ) - PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:5") /* Manual says ALWAYS OFF */ + PORT_DIPNAME( 0x10, 0x10, DEF_STR( Allow_Continue ) ) PORT_DIPLOCATION("SW2:5") // Manual says ALWAYS OFF PORT_DIPSETTING( 0x00, DEF_STR( No ) ) PORT_DIPSETTING( 0x10, DEF_STR( Yes ) ) - /* According to the manual, bit 5 should control Flip Screen */ + // According to the manual, bit 5 should control Flip Screen // PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:6") // PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) // PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - /* SW2:7,8 ALWAYS OFF according to the manual */ - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, brkthru_state,coin_inserted, 0) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED_MEMBER(DEVICE_SELF, brkthru_state,coin_inserted, 0) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, brkthru_state,coin_inserted, 0) + // SW2:7,8 ALWAYS OFF according to the manual + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, brkthru_state, coin_inserted, 0) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED_MEMBER(DEVICE_SELF, brkthru_state, coin_inserted, 0) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, brkthru_state, coin_inserted, 0) INPUT_PORTS_END static INPUT_PORTS_START( brkthruj ) @@ -332,16 +612,16 @@ static INPUT_PORTS_START( darwin ) PORT_INCLUDE( brkthru ) PORT_MODIFY("DSW1") - PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW1:5" ) /* Manual says must be OFF */ + PORT_DIPUNKNOWN_DIPLOC( 0x10, 0x10, "SW1:5" ) // Manual says must be OFF PORT_DIPNAME( 0x20, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW1:6") PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) PORT_DIPSETTING( 0x20, DEF_STR( Cocktail ) ) PORT_DIPNAME( 0x40, 0x40, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW1:7") PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) PORT_DIPSETTING( 0x40, DEF_STR( On ) ) - PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW1:8" ) /* Manual says must be OFF */ + PORT_DIPUNKNOWN_DIPLOC( 0x80, 0x80, "SW1:8" ) // Manual says must be OFF - PORT_MODIFY("DSW2_COIN") /* modified by Shingo Suzuki 1999/11/02 */ + PORT_MODIFY("DSW2_COIN") // modified by Shingo Suzuki 1999/11/02 PORT_DIPNAME( 0x01, 0x01, DEF_STR( Lives ) ) PORT_DIPLOCATION("SW2:1") PORT_DIPSETTING( 0x01, "3" ) PORT_DIPSETTING( 0x00, "5" ) @@ -353,14 +633,14 @@ static INPUT_PORTS_START( darwin ) PORT_DIPSETTING( 0x08, DEF_STR( Medium ) ) PORT_DIPSETTING( 0x04, DEF_STR( Hard ) ) PORT_DIPSETTING( 0x00, DEF_STR( Hardest ) ) - /* According to the manual, bit 5 should control Flip Screen */ + // According to the manual, bit 5 should control Flip Screen // PORT_DIPNAME( 0x20, 0x20, DEF_STR( Flip_Screen ) ) PORT_DIPLOCATION("SW2:6") // PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) // PORT_DIPSETTING( 0x00, DEF_STR( On ) ) - /* SW2:5,7,8 ALWAYS OFF according to the manual */ - PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, brkthru_state,coin_inserted, 0) - PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED_MEMBER(DEVICE_SELF, brkthru_state,coin_inserted, 0) - PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, brkthru_state,coin_inserted, 0) + // SW2:5,7,8 ALWAYS OFF according to the manual + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, brkthru_state, coin_inserted, 0) + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_CHANGED_MEMBER(DEVICE_SELF, brkthru_state, coin_inserted, 0) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE1 ) PORT_CHANGED_MEMBER(DEVICE_SELF, brkthru_state, coin_inserted, 0) INPUT_PORTS_END @@ -372,65 +652,65 @@ INPUT_PORTS_END static const gfx_layout charlayout = { - 8,8, /* 8*8 chars */ - 256, /* 256 characters */ - 3, /* 3 bits per pixel */ - { 512*8*8+4, 0, 4 }, /* plane offset */ + 8,8, // 8*8 chars + 256, // 256 characters + 3, // 3 bits per pixel + { 512*8*8+4, 0, 4 }, // plane offset { 256*8*8+0, 256*8*8+1, 256*8*8+2, 256*8*8+3, 0, 1, 2, 3 }, { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, - 8*8 /* every char takes 8 consecutive bytes */ + 8*8 // every char takes 8 consecutive bytes }; static const gfx_layout tilelayout1 = { - 16,16, /* 16*16 tiles */ - 128, /* 128 tiles */ - 3, /* 3 bits per pixel */ - { 0x4000*8+4, 0, 4 }, /* plane offset */ + 16,16, // 16*16 tiles + 128, // 128 tiles + 3, // 3 bits per pixel + { 0x4000*8+4, 0, 4 }, // plane offset { 0, 1, 2, 3, 1024*8*8+0, 1024*8*8+1, 1024*8*8+2, 1024*8*8+3, 16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+1024*8*8+0, 16*8+1024*8*8+1, 16*8+1024*8*8+2, 16*8+1024*8*8+3 }, { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }, - 32*8 /* every tile takes 32 consecutive bytes */ + 32*8 // every tile takes 32 consecutive bytes }; static const gfx_layout tilelayout2 = { - 16,16, /* 16*16 tiles */ - 128, /* 128 tiles */ - 3, /* 3 bits per pixel */ - { 0x3000*8+0, 0, 4 }, /* plane offset */ + 16,16, // 16*16 tiles + 128, // 128 tiles + 3, // 3 bits per pixel + { 0x3000*8+0, 0, 4 }, // plane offset { 0, 1, 2, 3, 1024*8*8+0, 1024*8*8+1, 1024*8*8+2, 1024*8*8+3, 16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+1024*8*8+0, 16*8+1024*8*8+1, 16*8+1024*8*8+2, 16*8+1024*8*8+3 }, { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }, - 32*8 /* every tile takes 32 consecutive bytes */ + 32*8 // every tile takes 32 consecutive bytes }; static const gfx_layout spritelayout = { - 16,16, /* 16*16 sprites */ - 1024, /* 1024 sprites */ - 3, /* 3 bits per pixel */ - { 2*1024*32*8, 1024*32*8, 0 }, /* plane offset */ + 16,16, // 16*16 sprites + 1024, // 1024 sprites + 3, // 3 bits per pixel + { 2*1024*32*8, 1024*32*8, 0 }, // plane offset { 16*8+0, 16*8+1, 16*8+2, 16*8+3, 16*8+4, 16*8+5, 16*8+6, 16*8+7, 0, 1, 2, 3, 4, 5, 6, 7 }, { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8, 8*8, 9*8, 10*8, 11*8, 12*8, 13*8, 14*8, 15*8 }, - 32*8 /* every sprite takes 32 consecutive bytes */ + 32*8 // every sprite takes 32 consecutive bytes }; static GFXDECODE_START( gfx_brkthru ) - GFXDECODE_ENTRY( "gfx1", 0x00000, charlayout, 0x00, 1 ) /* use colors 0x00-0x07 */ - GFXDECODE_ENTRY( "gfx2", 0x00000, tilelayout1, 0x80, 16 ) /* use colors 0x80-0xff */ - GFXDECODE_ENTRY( "gfx2", 0x01000, tilelayout2, 0x80, 16 ) - GFXDECODE_ENTRY( "gfx2", 0x08000, tilelayout1, 0x80, 16 ) - GFXDECODE_ENTRY( "gfx2", 0x09000, tilelayout2, 0x80, 16 ) - GFXDECODE_ENTRY( "gfx2", 0x10000, tilelayout1, 0x80, 16 ) - GFXDECODE_ENTRY( "gfx2", 0x11000, tilelayout2, 0x80, 16 ) - GFXDECODE_ENTRY( "gfx2", 0x18000, tilelayout1, 0x80, 16 ) - GFXDECODE_ENTRY( "gfx2", 0x19000, tilelayout2, 0x80, 16 ) - GFXDECODE_ENTRY( "gfx3", 0x00000, spritelayout, 0x40, 8 ) /* use colors 0x40-0x7f */ + GFXDECODE_ENTRY( "chars", 0x00000, charlayout, 0x00, 1 ) // use colors 0x00-0x07 + GFXDECODE_ENTRY( "tiles", 0x00000, tilelayout1, 0x80, 16 ) // use colors 0x80-0xff + GFXDECODE_ENTRY( "tiles", 0x01000, tilelayout2, 0x80, 16 ) + GFXDECODE_ENTRY( "tiles", 0x08000, tilelayout1, 0x80, 16 ) + GFXDECODE_ENTRY( "tiles", 0x09000, tilelayout2, 0x80, 16 ) + GFXDECODE_ENTRY( "tiles", 0x10000, tilelayout1, 0x80, 16 ) + GFXDECODE_ENTRY( "tiles", 0x11000, tilelayout2, 0x80, 16 ) + GFXDECODE_ENTRY( "tiles", 0x18000, tilelayout1, 0x80, 16 ) + GFXDECODE_ENTRY( "tiles", 0x19000, tilelayout2, 0x80, 16 ) + GFXDECODE_ENTRY( "sprites", 0x00000, spritelayout, 0x40, 8 ) // use colors 0x40-0x7f GFXDECODE_END @@ -443,6 +723,9 @@ GFXDECODE_END void brkthru_state::machine_start() { + uint8_t *rom = memregion("maincpu")->base(); + m_mainbank->configure_entries(0, 8, &rom[0x10000], 0x2000); + save_item(NAME(m_bgscroll)); save_item(NAME(m_bgbasecolor)); save_item(NAME(m_flipscreen)); @@ -465,57 +748,21 @@ WRITE_LINE_MEMBER(brkthru_state::vblank_irq) void brkthru_state::brkthru(machine_config &config) { - /* basic machine hardware */ - MC6809E(config, m_maincpu, MASTER_CLOCK/8); /* 1.5 MHz ? */ - m_maincpu->set_addrmap(AS_PROGRAM, &brkthru_state::brkthru_map); - - MC6809(config, m_audiocpu, MASTER_CLOCK/2); /* 1.5 MHz ? */ - m_audiocpu->set_addrmap(AS_PROGRAM, &brkthru_state::sound_map); + static constexpr XTAL MASTER_CLOCK = XTAL(12'000'000); - /* video hardware */ - GFXDECODE(config, m_gfxdecode, m_palette, gfx_brkthru); - PALETTE(config, m_palette, FUNC(brkthru_state::brkthru_palette), 256); - - /* not sure; assuming to be the same as darwin */ - screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_raw(MASTER_CLOCK/2, 384, 8, 248, 272, 8, 248); - screen.set_screen_update(FUNC(brkthru_state::screen_update_brkthru)); - screen.set_palette(m_palette); - screen.screen_vblank().set(FUNC(brkthru_state::vblank_irq)); - - /* sound hardware */ - SPEAKER(config, "mono").front_center(); - - GENERIC_LATCH_8(config, m_soundlatch); - m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); - - ym2203_device &ym1(YM2203(config, "ym1", MASTER_CLOCK/8)); - ym1.add_route(0, "mono", 0.10); - ym1.add_route(1, "mono", 0.10); - ym1.add_route(2, "mono", 0.10); - ym1.add_route(3, "mono", 0.50); - - ym3526_device &ym2(YM3526(config, "ym2", MASTER_CLOCK/4)); - ym2.irq_handler().set_inputline(m_audiocpu, M6809_IRQ_LINE); - ym2.add_route(ALL_OUTPUTS, "mono", 1.0); -} + // basic machine hardware + MC6809E(config, m_maincpu, MASTER_CLOCK / 8); // 1.5 MHz ? + m_maincpu->set_addrmap(AS_PROGRAM, &brkthru_state::brkthru_main_map); -void brkthru_state::darwin(machine_config &config) -{ - /* basic machine hardware */ - MC6809E(config, m_maincpu, MASTER_CLOCK/8); /* 1.5 MHz ? */ - m_maincpu->set_addrmap(AS_PROGRAM, &brkthru_state::darwin_map); - - MC6809(config, m_audiocpu, MASTER_CLOCK/2); /* 1.5 MHz ? */ + MC6809(config, m_audiocpu, MASTER_CLOCK / 2); // 1.5 MHz ? m_audiocpu->set_addrmap(AS_PROGRAM, &brkthru_state::sound_map); - /* video hardware */ + // video hardware GFXDECODE(config, m_gfxdecode, m_palette, gfx_brkthru); - - PALETTE(config, m_palette, FUNC(brkthru_state::brkthru_palette), 256); + PALETTE(config, m_palette, FUNC(brkthru_state::palette), 256); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_raw(MASTER_CLOCK/2, 384, 8, 248, 272, 8, 248); + screen.set_raw(MASTER_CLOCK / 2, 384, 8, 248, 272, 8, 248); // verified for darwin, not 100% sure it's the same for brkthru /* frames per second, vblank duration Horizontal video frequency: HSync = Dot Clock / Horizontal Frame Length @@ -528,27 +775,33 @@ void brkthru_state::darwin(machine_config &config) = 15.625kHz / (240 + 32) = 57.444855Hz tuned by Shingo SUZUKI(VSyncMAME Project) 2000/10/19 */ - screen.set_screen_update(FUNC(brkthru_state::screen_update_brkthru)); + screen.set_screen_update(FUNC(brkthru_state::screen_update)); screen.set_palette(m_palette); screen.screen_vblank().set(FUNC(brkthru_state::vblank_irq)); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); - GENERIC_LATCH_8(config, m_soundlatch); - m_soundlatch->data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); + GENERIC_LATCH_8(config, "soundlatch").data_pending_callback().set_inputline(m_audiocpu, INPUT_LINE_NMI); - ym2203_device &ym1(YM2203(config, "ym1", MASTER_CLOCK/8)); + ym2203_device &ym1(YM2203(config, "ym1", MASTER_CLOCK / 8)); ym1.add_route(0, "mono", 0.10); ym1.add_route(1, "mono", 0.10); ym1.add_route(2, "mono", 0.10); ym1.add_route(3, "mono", 0.50); - ym3526_device &ym2(YM3526(config, "ym2", MASTER_CLOCK/4)); + ym3526_device &ym2(YM3526(config, "ym2", MASTER_CLOCK / 4)); ym2.irq_handler().set_inputline(m_audiocpu, M6809_IRQ_LINE); ym2.add_route(ALL_OUTPUTS, "mono", 1.0); } +void brkthru_state::darwin(machine_config &config) +{ + brkthru(config); + + m_maincpu->set_addrmap(AS_PROGRAM, &brkthru_state::darwin_main_map); +} + /************************************* @@ -558,80 +811,78 @@ void brkthru_state::darwin(machine_config &config) *************************************/ ROM_START( brkthru ) - ROM_REGION( 0x20000, "maincpu", 0 ) /* 64k for main CPU + 64k for banked ROMs */ + ROM_REGION( 0x20000, "maincpu", 0 ) ROM_LOAD( "brkthru.1", 0x04000, 0x4000, CRC(cfb4265f) SHA1(4cd748fa06fd2727de1694196912d605672d4883) ) ROM_LOAD( "brkthru.2", 0x08000, 0x8000, CRC(fa8246d9) SHA1(d6da03b2a3d8a83411191351ee110b89352a3ead) ) ROM_LOAD( "brkthru.4", 0x10000, 0x8000, CRC(8cabf252) SHA1(45e8847b2e6b278989f67e0b27b827a9b3b92581) ) ROM_LOAD( "brkthru.3", 0x18000, 0x8000, CRC(2f2c40c2) SHA1(fcb78941453520a3a07f272127dae7c2cc1999ea) ) - ROM_REGION( 0x02000, "gfx1", 0 ) - ROM_LOAD( "brkthru.12", 0x00000, 0x2000, CRC(58c0b29b) SHA1(9dc075f8afae7e8fe164a9fe325e9948cdc7e4bb) ) /* characters */ - - ROM_REGION( 0x20000, "gfx2", 0 ) - /* background */ - /* we do a lot of scatter loading here, to place the data in a format */ - /* which can be decoded by MAME's standard functions */ - ROM_LOAD( "brkthru.7", 0x00000, 0x4000, CRC(920cc56a) SHA1(c75806691073f1f3bd54dcaca4c14155ecf4471d) ) /* bitplanes 1,2 for bank 1,2 */ - ROM_CONTINUE( 0x08000, 0x4000 ) /* bitplanes 1,2 for bank 3,4 */ - ROM_LOAD( "brkthru.6", 0x10000, 0x4000, CRC(fd3cee40) SHA1(3308b96bb69e0fa6dffbdff296273fafa16d5e70) ) /* bitplanes 1,2 for bank 5,6 */ - ROM_CONTINUE( 0x18000, 0x4000 ) /* bitplanes 1,2 for bank 7,8 */ - ROM_LOAD( "brkthru.8", 0x04000, 0x1000, CRC(f67ee64e) SHA1(75634bd481ae44b8aa02acb4f9b4d7ff973a4c71) ) /* bitplane 3 for bank 1,2 */ + ROM_REGION( 0x02000, "chars", 0 ) + ROM_LOAD( "brkthru.12", 0x00000, 0x2000, CRC(58c0b29b) SHA1(9dc075f8afae7e8fe164a9fe325e9948cdc7e4bb) ) + + ROM_REGION( 0x20000, "tiles", 0 ) + // background + // we do a lot of scatter loading here, to place the data in a format which can be decoded by MAME's standard functions + ROM_LOAD( "brkthru.7", 0x00000, 0x4000, CRC(920cc56a) SHA1(c75806691073f1f3bd54dcaca4c14155ecf4471d) ) // bitplanes 1,2 for bank 1,2 + ROM_CONTINUE( 0x08000, 0x4000 ) // bitplanes 1,2 for bank 3,4 + ROM_LOAD( "brkthru.6", 0x10000, 0x4000, CRC(fd3cee40) SHA1(3308b96bb69e0fa6dffbdff296273fafa16d5e70) ) // bitplanes 1,2 for bank 5,6 + ROM_CONTINUE( 0x18000, 0x4000 ) // bitplanes 1,2 for bank 7,8 + ROM_LOAD( "brkthru.8", 0x04000, 0x1000, CRC(f67ee64e) SHA1(75634bd481ae44b8aa02acb4f9b4d7ff973a4c71) ) // bitplane 3 for bank 1,2 ROM_CONTINUE( 0x06000, 0x1000 ) - ROM_CONTINUE( 0x0c000, 0x1000 ) /* bitplane 3 for bank 3,4 */ + ROM_CONTINUE( 0x0c000, 0x1000 ) // bitplane 3 for bank 3,4 ROM_CONTINUE( 0x0e000, 0x1000 ) - ROM_CONTINUE( 0x14000, 0x1000 ) /* bitplane 3 for bank 5,6 */ + ROM_CONTINUE( 0x14000, 0x1000 ) // bitplane 3 for bank 5,6 ROM_CONTINUE( 0x16000, 0x1000 ) - ROM_CONTINUE( 0x1c000, 0x1000 ) /* bitplane 3 for bank 7,8 */ + ROM_CONTINUE( 0x1c000, 0x1000 ) // bitplane 3 for bank 7,8 ROM_CONTINUE( 0x1e000, 0x1000 ) - ROM_REGION( 0x18000, "gfx3", 0 ) - ROM_LOAD( "brkthru.9", 0x00000, 0x8000, CRC(f54e50a7) SHA1(eccf4d859c26944271ec6586644b4730a72851fd) ) /* sprites */ + ROM_REGION( 0x18000, "sprites", 0 ) + ROM_LOAD( "brkthru.9", 0x00000, 0x8000, CRC(f54e50a7) SHA1(eccf4d859c26944271ec6586644b4730a72851fd) ) ROM_LOAD( "brkthru.10", 0x08000, 0x8000, CRC(fd156945) SHA1(a0575a4164217e63317886176ab7e59d255fc771) ) ROM_LOAD( "brkthru.11", 0x10000, 0x8000, CRC(c152a99b) SHA1(f96133aa01219eda357b9e906bd9577dbfe359c0) ) ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "brkthru.13", 0x0000, 0x0100, CRC(aae44269) SHA1(7c66aeb93577104109d264ee8b848254256c81eb) ) /* red and green component */ - ROM_LOAD( "brkthru.14", 0x0100, 0x0100, CRC(f2d4822a) SHA1(f535e91b87ff01f2a73662856fd3f72907ca62e9) ) /* blue component */ + ROM_LOAD( "brkthru.13", 0x0000, 0x0100, CRC(aae44269) SHA1(7c66aeb93577104109d264ee8b848254256c81eb) ) // red and green component + ROM_LOAD( "brkthru.14", 0x0100, 0x0100, CRC(f2d4822a) SHA1(f535e91b87ff01f2a73662856fd3f72907ca62e9) ) // blue component ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "brkthru.5", 0x8000, 0x8000, CRC(c309435f) SHA1(82914004c2b169a7c31aa49af83a699ebbc7b33f) ) ROM_END ROM_START( brkthruj ) - ROM_REGION( 0x20000, "maincpu", 0 ) /* 64k for main CPU + 64k for banked ROMs */ + ROM_REGION( 0x20000, "maincpu", 0 ) ROM_LOAD( "1", 0x04000, 0x4000, CRC(09bd60ee) SHA1(9591a4c89bb69d5615a5d6b29c47e6b17350c007) ) ROM_LOAD( "2", 0x08000, 0x8000, CRC(f2b2cd1c) SHA1(dafccc74310876bc1c88de7f3c86f93ed8a0eb62) ) ROM_LOAD( "4", 0x10000, 0x8000, CRC(b42b3359) SHA1(c1da550e0f7cc52721802c7c0f2770ef0087e28b) ) ROM_LOAD( "brkthru.3", 0x18000, 0x8000, CRC(2f2c40c2) SHA1(fcb78941453520a3a07f272127dae7c2cc1999ea) ) - ROM_REGION( 0x02000, "gfx1", 0 ) - ROM_LOAD( "12", 0x00000, 0x2000, CRC(3d9a7003) SHA1(2e5de982eb75ac75312fb29bb4cb2ed12ec0fd56) ) /* characters */ - - ROM_REGION( 0x20000, "gfx2", 0 ) - /* background */ - /* we do a lot of scatter loading here, to place the data in a format */ - /* which can be decoded by MAME's standard functions */ - ROM_LOAD( "brkthru.7", 0x00000, 0x4000, CRC(920cc56a) SHA1(c75806691073f1f3bd54dcaca4c14155ecf4471d) ) /* bitplanes 1,2 for bank 1,2 */ - ROM_CONTINUE( 0x08000, 0x4000 ) /* bitplanes 1,2 for bank 3,4 */ - ROM_LOAD( "6", 0x10000, 0x4000, CRC(cb47b395) SHA1(bf5459d696e863644f13c8b0786b8f45caf6ceb6) ) /* bitplanes 1,2 for bank 5,6 */ - ROM_CONTINUE( 0x18000, 0x4000 ) /* bitplanes 1,2 for bank 7,8 */ - ROM_LOAD( "8", 0x04000, 0x1000, CRC(5e5a2cd7) SHA1(f1782d67b924b4b89bcb6602e970c28fbeaab522) ) /* bitplane 3 for bank 1,2 */ + ROM_REGION( 0x02000, "chars", 0 ) + ROM_LOAD( "12", 0x00000, 0x2000, CRC(3d9a7003) SHA1(2e5de982eb75ac75312fb29bb4cb2ed12ec0fd56) ) + + ROM_REGION( 0x20000, "tiles", 0 ) + // background + // we do a lot of scatter loading here, to place the data in a format which can be decoded by MAME's standard functions + ROM_LOAD( "brkthru.7", 0x00000, 0x4000, CRC(920cc56a) SHA1(c75806691073f1f3bd54dcaca4c14155ecf4471d) ) // bitplanes 1,2 for bank 1,2 + ROM_CONTINUE( 0x08000, 0x4000 ) // bitplanes 1,2 for bank 3,4 + ROM_LOAD( "6", 0x10000, 0x4000, CRC(cb47b395) SHA1(bf5459d696e863644f13c8b0786b8f45caf6ceb6) ) // bitplanes 1,2 for bank 5,6 + ROM_CONTINUE( 0x18000, 0x4000 ) // bitplanes 1,2 for bank 7,8 + ROM_LOAD( "8", 0x04000, 0x1000, CRC(5e5a2cd7) SHA1(f1782d67b924b4b89bcb6602e970c28fbeaab522) ) // bitplane 3 for bank 1,2 ROM_CONTINUE( 0x06000, 0x1000 ) - ROM_CONTINUE( 0x0c000, 0x1000 ) /* bitplane 3 for bank 3,4 */ + ROM_CONTINUE( 0x0c000, 0x1000 ) // bitplane 3 for bank 3,4 ROM_CONTINUE( 0x0e000, 0x1000 ) - ROM_CONTINUE( 0x14000, 0x1000 ) /* bitplane 3 for bank 5,6 */ + ROM_CONTINUE( 0x14000, 0x1000 ) // bitplane 3 for bank 5,6 ROM_CONTINUE( 0x16000, 0x1000 ) - ROM_CONTINUE( 0x1c000, 0x1000 ) /* bitplane 3 for bank 7,8 */ + ROM_CONTINUE( 0x1c000, 0x1000 ) // bitplane 3 for bank 7,8 ROM_CONTINUE( 0x1e000, 0x1000 ) - ROM_REGION( 0x18000, "gfx3", 0 ) - ROM_LOAD( "brkthru.9", 0x00000, 0x8000, CRC(f54e50a7) SHA1(eccf4d859c26944271ec6586644b4730a72851fd) ) /* sprites */ + ROM_REGION( 0x18000, "sprites", 0 ) + ROM_LOAD( "brkthru.9", 0x00000, 0x8000, CRC(f54e50a7) SHA1(eccf4d859c26944271ec6586644b4730a72851fd) ) ROM_LOAD( "brkthru.10", 0x08000, 0x8000, CRC(fd156945) SHA1(a0575a4164217e63317886176ab7e59d255fc771) ) ROM_LOAD( "brkthru.11", 0x10000, 0x8000, CRC(c152a99b) SHA1(f96133aa01219eda357b9e906bd9577dbfe359c0) ) ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "brkthru.13", 0x0000, 0x0100, CRC(aae44269) SHA1(7c66aeb93577104109d264ee8b848254256c81eb) ) /* red and green component */ - ROM_LOAD( "brkthru.14", 0x0100, 0x0100, CRC(f2d4822a) SHA1(f535e91b87ff01f2a73662856fd3f72907ca62e9) ) /* blue component */ + ROM_LOAD( "brkthru.13", 0x0000, 0x0100, CRC(aae44269) SHA1(7c66aeb93577104109d264ee8b848254256c81eb) ) // red and green component + ROM_LOAD( "brkthru.14", 0x0100, 0x0100, CRC(f2d4822a) SHA1(f535e91b87ff01f2a73662856fd3f72907ca62e9) ) // blue component ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "brkthru.5", 0x8000, 0x8000, CRC(c309435f) SHA1(82914004c2b169a7c31aa49af83a699ebbc7b33f) ) @@ -639,16 +890,16 @@ ROM_END // Tecfri PCB with Data East license (DE-0230-2 / DE-0231-2). ROM_START( brkthrut ) - ROM_REGION( 0x20000, "maincpu", 0 ) // 64k for main CPU + 64k for banked ROMs + ROM_REGION( 0x20000, "maincpu", 0 ) ROM_LOAD( "5_de-0230-2_27128.f9", 0x04000, 0x4000, CRC(158e660a) SHA1(608082e8b49d3c5595c25be8c19b80402310406a) ) ROM_LOAD( "6_de-0230-2_27256.f11", 0x08000, 0x8000, CRC(62dbe49e) SHA1(f0510cf0144d75c208f0ced342d3a726325a70d4) ) ROM_LOAD( "8_de-0230-2_27256.f13", 0x10000, 0x8000, CRC(8cabf252) SHA1(45e8847b2e6b278989f67e0b27b827a9b3b92581) ) // Same as parent ROM_LOAD( "7_de-0230-2_27256.f12", 0x18000, 0x8000, CRC(2f2c40c2) SHA1(fcb78941453520a3a07f272127dae7c2cc1999ea) ) // Same as parent - ROM_REGION( 0x02000, "gfx1", 0 ) - ROM_LOAD( "9_de-0231-2_2764.c8", 0x00000, 0x2000, CRC(58c0b29b) SHA1(9dc075f8afae7e8fe164a9fe325e9948cdc7e4bb) ) // Characters, same as parent + ROM_REGION( 0x02000, "chars", 0 ) + ROM_LOAD( "9_de-0231-2_2764.c8", 0x00000, 0x2000, CRC(58c0b29b) SHA1(9dc075f8afae7e8fe164a9fe325e9948cdc7e4bb) ) // same as parent - ROM_REGION( 0x20000, "gfx2", 0 ) + ROM_REGION( 0x20000, "tiles", 0 ) // Background // We do a lot of scatter loading here, to place the data in a format // which can be decoded by MAME's standard functions @@ -665,8 +916,8 @@ ROM_START( brkthrut ) ROM_CONTINUE( 0x1c000, 0x1000 ) // Bitplane 3 for bank 7,8 ROM_CONTINUE( 0x1e000, 0x1000 ) - ROM_REGION( 0x18000, "gfx3", 0 ) - ROM_LOAD( "10_de-0231-2_27156.h2", 0x00000, 0x8000, CRC(f54e50a7) SHA1(eccf4d859c26944271ec6586644b4730a72851fd) ) // Sprites, same as parent + ROM_REGION( 0x18000, "sprites", 0 ) + ROM_LOAD( "10_de-0231-2_27156.h2", 0x00000, 0x8000, CRC(f54e50a7) SHA1(eccf4d859c26944271ec6586644b4730a72851fd) ) // Same as parent ROM_LOAD( "11_de-0231-2_27156.h4", 0x08000, 0x8000, CRC(fd156945) SHA1(a0575a4164217e63317886176ab7e59d255fc771) ) // Same as parent ROM_LOAD( "12_de-0231-2_27156.h5", 0x10000, 0x8000, CRC(c152a99b) SHA1(f96133aa01219eda357b9e906bd9577dbfe359c0) ) // Same as parent @@ -698,10 +949,10 @@ ROM_START( brkthrubl ) // 3002A + 3002B PCBs. Everything's the same as the origi ROM_LOAD( "1", 0x10000, 0x8000, CRC(209484c2) SHA1(da7311768b675b833066a7403fd507969d74699e) ) ROM_LOAD( "2", 0x18000, 0x8000, CRC(2f2c40c2) SHA1(fcb78941453520a3a07f272127dae7c2cc1999ea) ) - ROM_REGION( 0x02000, "gfx1", 0 ) - ROM_LOAD( "12", 0x00000, 0x2000, CRC(58c0b29b) SHA1(9dc075f8afae7e8fe164a9fe325e9948cdc7e4bb) ) // characters + ROM_REGION( 0x02000, "chars", 0 ) + ROM_LOAD( "12", 0x00000, 0x2000, CRC(58c0b29b) SHA1(9dc075f8afae7e8fe164a9fe325e9948cdc7e4bb) ) - ROM_REGION( 0x20000, "gfx2", 0 ) // background + ROM_REGION( 0x20000, "tiles", 0 ) // background ROM_LOAD( "7", 0x00000, 0x4000, CRC(920cc56a) SHA1(c75806691073f1f3bd54dcaca4c14155ecf4471d) ) // bitplanes 1,2 for bank 1,2 ROM_CONTINUE( 0x08000, 0x4000 ) // bitplanes 1,2 for bank 3,4 ROM_LOAD( "6", 0x10000, 0x4000, CRC(fd3cee40) SHA1(3308b96bb69e0fa6dffbdff296273fafa16d5e70) ) // bitplanes 1,2 for bank 5,6 @@ -715,8 +966,8 @@ ROM_START( brkthrubl ) // 3002A + 3002B PCBs. Everything's the same as the origi ROM_CONTINUE( 0x1c000, 0x1000 ) // bitplane 3 for bank 7,8 ROM_CONTINUE( 0x1e000, 0x1000 ) - ROM_REGION( 0x18000, "gfx3", 0 ) - ROM_LOAD( "9", 0x00000, 0x8000, CRC(f54e50a7) SHA1(eccf4d859c26944271ec6586644b4730a72851fd) ) // sprites + ROM_REGION( 0x18000, "sprites", 0 ) + ROM_LOAD( "9", 0x00000, 0x8000, CRC(f54e50a7) SHA1(eccf4d859c26944271ec6586644b4730a72851fd) ) ROM_LOAD( "10", 0x08000, 0x8000, CRC(fd156945) SHA1(a0575a4164217e63317886176ab7e59d255fc771) ) ROM_LOAD( "11", 0x10000, 0x8000, CRC(c152a99b) SHA1(f96133aa01219eda357b9e906bd9577dbfe359c0) ) @@ -728,84 +979,82 @@ ROM_START( brkthrubl ) // 3002A + 3002B PCBs. Everything's the same as the origi ROM_LOAD( "5", 0x8000, 0x8000, CRC(c309435f) SHA1(82914004c2b169a7c31aa49af83a699ebbc7b33f) ) ROM_END -/* bootleg, changed prg rom fails test, probably just the japanese version modified to have english title */ +// bootleg, changed prg ROM fails test, probably just the Japanese version modified to have English title ROM_START( forcebrk ) - ROM_REGION( 0x20000, "maincpu", 0 ) /* 64k for main CPU + 64k for banked ROMs */ + ROM_REGION( 0x20000, "maincpu", 0 ) ROM_LOAD( "1", 0x04000, 0x4000, CRC(09bd60ee) SHA1(9591a4c89bb69d5615a5d6b29c47e6b17350c007) ) ROM_LOAD( "2", 0x08000, 0x8000, CRC(f2b2cd1c) SHA1(dafccc74310876bc1c88de7f3c86f93ed8a0eb62) ) ROM_LOAD( "forcebrk4", 0x10000, 0x8000, CRC(b4838c19) SHA1(b32f183ee042872a6eb6689aab219108d37829e4) ) ROM_LOAD( "brkthru.3", 0x18000, 0x8000, CRC(2f2c40c2) SHA1(fcb78941453520a3a07f272127dae7c2cc1999ea) ) - ROM_REGION( 0x02000, "gfx1", 0 ) - ROM_LOAD( "12", 0x00000, 0x2000, CRC(3d9a7003) SHA1(2e5de982eb75ac75312fb29bb4cb2ed12ec0fd56) ) /* characters */ - - ROM_REGION( 0x20000, "gfx2", 0 ) - /* background */ - /* we do a lot of scatter loading here, to place the data in a format */ - /* which can be decoded by MAME's standard functions */ - ROM_LOAD( "brkthru.7", 0x00000, 0x4000, CRC(920cc56a) SHA1(c75806691073f1f3bd54dcaca4c14155ecf4471d) ) /* bitplanes 1,2 for bank 1,2 */ - ROM_CONTINUE( 0x08000, 0x4000 ) /* bitplanes 1,2 for bank 3,4 */ - ROM_LOAD( "forcebrk6", 0x10000, 0x4000, CRC(08bca16a) SHA1(d5dcf5cf68a5090f467c076abb1b9cf0baffe272) ) /* bitplanes 1,2 for bank 5,6 */ - ROM_CONTINUE( 0x18000, 0x4000 ) /* bitplanes 1,2 for bank 7,8 */ - ROM_LOAD( "forcebrk8", 0x04000, 0x1000, CRC(a3a1131e) SHA1(e0b73c8b2c8ea6b31418bc642830875c5985f800) ) /* bitplane 3 for bank 1,2 */ + ROM_REGION( 0x02000, "chars", 0 ) + ROM_LOAD( "12", 0x00000, 0x2000, CRC(3d9a7003) SHA1(2e5de982eb75ac75312fb29bb4cb2ed12ec0fd56) ) + + ROM_REGION( 0x20000, "tiles", 0 ) + // background + // we do a lot of scatter loading here, to place the data in a format which can be decoded by MAME's standard functions + ROM_LOAD( "brkthru.7", 0x00000, 0x4000, CRC(920cc56a) SHA1(c75806691073f1f3bd54dcaca4c14155ecf4471d) ) // bitplanes 1,2 for bank 1,2 + ROM_CONTINUE( 0x08000, 0x4000 ) // bitplanes 1,2 for bank 3,4 + ROM_LOAD( "forcebrk6", 0x10000, 0x4000, CRC(08bca16a) SHA1(d5dcf5cf68a5090f467c076abb1b9cf0baffe272) ) // bitplanes 1,2 for bank 5,6 + ROM_CONTINUE( 0x18000, 0x4000 ) // bitplanes 1,2 for bank 7,8 + ROM_LOAD( "forcebrk8", 0x04000, 0x1000, CRC(a3a1131e) SHA1(e0b73c8b2c8ea6b31418bc642830875c5985f800) ) // bitplane 3 for bank 1,2 ROM_CONTINUE( 0x06000, 0x1000 ) - ROM_CONTINUE( 0x0c000, 0x1000 ) /* bitplane 3 for bank 3,4 */ + ROM_CONTINUE( 0x0c000, 0x1000 ) // bitplane 3 for bank 3,4 ROM_CONTINUE( 0x0e000, 0x1000 ) - ROM_CONTINUE( 0x14000, 0x1000 ) /* bitplane 3 for bank 5,6 */ + ROM_CONTINUE( 0x14000, 0x1000 ) // bitplane 3 for bank 5,6 ROM_CONTINUE( 0x16000, 0x1000 ) - ROM_CONTINUE( 0x1c000, 0x1000 ) /* bitplane 3 for bank 7,8 */ + ROM_CONTINUE( 0x1c000, 0x1000 ) // bitplane 3 for bank 7,8 ROM_CONTINUE( 0x1e000, 0x1000 ) - ROM_REGION( 0x18000, "gfx3", 0 ) - ROM_LOAD( "brkthru.9", 0x00000, 0x8000, CRC(f54e50a7) SHA1(eccf4d859c26944271ec6586644b4730a72851fd) ) /* sprites */ + ROM_REGION( 0x18000, "sprites", 0 ) + ROM_LOAD( "brkthru.9", 0x00000, 0x8000, CRC(f54e50a7) SHA1(eccf4d859c26944271ec6586644b4730a72851fd) ) ROM_LOAD( "brkthru.10", 0x08000, 0x8000, CRC(fd156945) SHA1(a0575a4164217e63317886176ab7e59d255fc771) ) ROM_LOAD( "brkthru.11", 0x10000, 0x8000, CRC(c152a99b) SHA1(f96133aa01219eda357b9e906bd9577dbfe359c0) ) ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "brkthru.13", 0x0000, 0x0100, CRC(aae44269) SHA1(7c66aeb93577104109d264ee8b848254256c81eb) ) /* red and green component */ - ROM_LOAD( "brkthru.14", 0x0100, 0x0100, CRC(f2d4822a) SHA1(f535e91b87ff01f2a73662856fd3f72907ca62e9) ) /* blue component */ + ROM_LOAD( "brkthru.13", 0x0000, 0x0100, CRC(aae44269) SHA1(7c66aeb93577104109d264ee8b848254256c81eb) ) // red and green component + ROM_LOAD( "brkthru.14", 0x0100, 0x0100, CRC(f2d4822a) SHA1(f535e91b87ff01f2a73662856fd3f72907ca62e9) ) // blue component ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "brkthru.5", 0x8000, 0x8000, CRC(c309435f) SHA1(82914004c2b169a7c31aa49af83a699ebbc7b33f) ) ROM_END ROM_START( darwin ) - ROM_REGION( 0x20000, "maincpu", 0 ) /* 64k for main CPU + 64k for banked ROMs */ + ROM_REGION( 0x20000, "maincpu", 0 ) ROM_LOAD( "darw_04.rom", 0x04000, 0x4000, CRC(0eabf21c) SHA1(ccad6b30fe9361e8a21b8aaf8116aa85f9e6bb19) ) ROM_LOAD( "darw_05.rom", 0x08000, 0x8000, CRC(e771f864) SHA1(8ba9f97c6abf035ceaf9f5505495708506f1b0c5) ) ROM_LOAD( "darw_07.rom", 0x10000, 0x8000, CRC(97ac052c) SHA1(8baa117472d46b99e5946f095b869de9b5c48f9a) ) ROM_LOAD( "darw_06.rom", 0x18000, 0x8000, CRC(2a9fb208) SHA1(f04a5502600e49e2494a87ec65a44a2843441d37) ) - ROM_REGION( 0x02000, "gfx1", 0 ) - ROM_LOAD( "darw_09.rom", 0x00000, 0x2000, CRC(067b4cf5) SHA1(fc752bb72e4850b71565afd1df0cbb4f732f131c) ) /* characters */ - - ROM_REGION( 0x20000, "gfx2", 0 ) - /* background */ - /* we do a lot of scatter loading here, to place the data in a format */ - /* which can be decoded by MAME's standard functions */ - ROM_LOAD( "darw_03.rom", 0x00000, 0x4000, CRC(57d0350d) SHA1(6f904047485e669afb5f4b590818743111f010c6) ) /* bitplanes 1,2 for bank 1,2 */ - ROM_CONTINUE( 0x08000, 0x4000 ) /* bitplanes 1,2 for bank 3,4 */ - ROM_LOAD( "darw_02.rom", 0x10000, 0x4000, CRC(559a71ab) SHA1(a28de25e89e0d68332f4095b988827a9cb72c675) ) /* bitplanes 1,2 for bank 5,6 */ - ROM_CONTINUE( 0x18000, 0x4000 ) /* bitplanes 1,2 for bank 7,8 */ - ROM_LOAD( "darw_01.rom", 0x04000, 0x1000, CRC(15a16973) SHA1(5eb978a32be88176936e5d37b6ec18820d9720d8) ) /* bitplane 3 for bank 1,2 */ + ROM_REGION( 0x02000, "chars", 0 ) + ROM_LOAD( "darw_09.rom", 0x00000, 0x2000, CRC(067b4cf5) SHA1(fc752bb72e4850b71565afd1df0cbb4f732f131c) ) + + ROM_REGION( 0x20000, "tiles", 0 ) + // background + // we do a lot of scatter loading here, to place the data in a format which can be decoded by MAME's standard functions + ROM_LOAD( "darw_03.rom", 0x00000, 0x4000, CRC(57d0350d) SHA1(6f904047485e669afb5f4b590818743111f010c6) ) // bitplanes 1,2 for bank 1,2 + ROM_CONTINUE( 0x08000, 0x4000 ) // bitplanes 1,2 for bank 3,4 + ROM_LOAD( "darw_02.rom", 0x10000, 0x4000, CRC(559a71ab) SHA1(a28de25e89e0d68332f4095b988827a9cb72c675) ) // bitplanes 1,2 for bank 5,6 + ROM_CONTINUE( 0x18000, 0x4000 ) // bitplanes 1,2 for bank 7,8 + ROM_LOAD( "darw_01.rom", 0x04000, 0x1000, CRC(15a16973) SHA1(5eb978a32be88176936e5d37b6ec18820d9720d8) ) // bitplane 3 for bank 1,2 ROM_CONTINUE( 0x06000, 0x1000 ) - ROM_CONTINUE( 0x0c000, 0x1000 ) /* bitplane 3 for bank 3,4 */ + ROM_CONTINUE( 0x0c000, 0x1000 ) // bitplane 3 for bank 3,4 ROM_CONTINUE( 0x0e000, 0x1000 ) - ROM_CONTINUE( 0x14000, 0x1000 ) /* bitplane 3 for bank 5,6 */ + ROM_CONTINUE( 0x14000, 0x1000 ) // bitplane 3 for bank 5,6 ROM_CONTINUE( 0x16000, 0x1000 ) - ROM_CONTINUE( 0x1c000, 0x1000 ) /* bitplane 3 for bank 7,8 */ + ROM_CONTINUE( 0x1c000, 0x1000 ) // bitplane 3 for bank 7,8 ROM_CONTINUE( 0x1e000, 0x1000 ) - ROM_REGION( 0x18000, "gfx3", 0 ) - ROM_LOAD( "darw_10.rom", 0x00000, 0x8000, CRC(487a014c) SHA1(c9543df8115088b02019e76a6473ecc5f645a836) ) /* sprites */ + ROM_REGION( 0x18000, "sprites", 0 ) + ROM_LOAD( "darw_10.rom", 0x00000, 0x8000, CRC(487a014c) SHA1(c9543df8115088b02019e76a6473ecc5f645a836) ) ROM_LOAD( "darw_11.rom", 0x08000, 0x8000, CRC(548ce2d1) SHA1(3b1757c70346ab4ee19ec85e7ae5137f8ccf446f) ) ROM_LOAD( "darw_12.rom", 0x10000, 0x8000, CRC(faba5fef) SHA1(848da4d4888f0218b737f1dc9b62944f68349a43) ) // A PCB has been found with the first PROM substituted with a TBP28S42 (4b56a744) SHA1(5fdc336d90c8a289c146c66f241dd217fc11bf35), see brkthrut ROM loading for how they did it. // With that in mind, there's a one byte difference at 0x55 (0xf0 instead of 0x70). It is unknown if it's bitrot or if it's intended. ROM_REGION( 0x0200, "proms", 0 ) - ROM_LOAD( "df.12", 0x0000, 0x0100, CRC(89b952ef) SHA1(77dc4020a2e25f81fae1182d58993cf09d13af00) ) /* red and green component */ - ROM_LOAD( "df.13", 0x0100, 0x0100, CRC(d595e91d) SHA1(5e9793f6602455c79afdc855cd13183a7f48ab1e) ) /* blue component */ + ROM_LOAD( "df.12", 0x0000, 0x0100, CRC(89b952ef) SHA1(77dc4020a2e25f81fae1182d58993cf09d13af00) ) // red and green component + ROM_LOAD( "df.13", 0x0100, 0x0100, CRC(d595e91d) SHA1(5e9793f6602455c79afdc855cd13183a7f48ab1e) ) // blue component ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "darw_08.rom", 0x8000, 0x8000, CRC(6b580d58) SHA1(a70aebc6b4a291b4adddbb41d092b2682fc2d421) ) @@ -816,18 +1065,8 @@ ROM_START( darwin ) ROM_LOAD( "3-pal16r4pc.bin", 0x400, 0x104, CRC(b3e980a0) SHA1(b1dbf01621d1053e641570fcac6618562d0721b4) ) ROM_END +} // anonymous namespace -/************************************* - * - * Driver initialization - * - *************************************/ - -void brkthru_state::init_brkthru() -{ - uint8_t *ROM = memregion("maincpu")->base(); - membank("bank1")->configure_entries(0, 8, &ROM[0x10000], 0x2000); -} /************************************* * @@ -835,9 +1074,9 @@ void brkthru_state::init_brkthru() * *************************************/ -GAME( 1986, brkthru, 0, brkthru, brkthru, brkthru_state, init_brkthru, ROT0, "Data East USA", "Break Thru (US)", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, brkthruj, brkthru, brkthru, brkthruj, brkthru_state, init_brkthru, ROT0, "Data East Corporation", "Kyohkoh-Toppa (Japan)", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, brkthrut, brkthru, brkthru, brkthruj, brkthru_state, init_brkthru, ROT0, "Data East Corporation (Tecfri license)", "Break Thru (Tecfri license)", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, forcebrk, brkthru, brkthru, brkthruj, brkthru_state, init_brkthru, ROT0, "bootleg", "Force Break (bootleg)", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, brkthrubl, brkthru, brkthru, brkthruj, brkthru_state, init_brkthru, ROT0, "bootleg", "Break Thru (bootleg)", MACHINE_SUPPORTS_SAVE ) -GAME( 1986, darwin, 0, darwin, darwin, brkthru_state, init_brkthru, ROT270, "Data East Corporation", "Darwin 4078 (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, brkthru, 0, brkthru, brkthru, brkthru_state, empty_init, ROT0, "Data East USA", "Break Thru (US)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, brkthruj, brkthru, brkthru, brkthruj, brkthru_state, empty_init, ROT0, "Data East Corporation", "Kyohkoh-Toppa (Japan)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, brkthrut, brkthru, brkthru, brkthruj, brkthru_state, empty_init, ROT0, "Data East Corporation (Tecfri license)", "Break Thru (Tecfri license)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, forcebrk, brkthru, brkthru, brkthruj, brkthru_state, empty_init, ROT0, "bootleg", "Force Break (bootleg)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, brkthrubl, brkthru, brkthru, brkthruj, brkthru_state, empty_init, ROT0, "bootleg", "Break Thru (bootleg)", MACHINE_SUPPORTS_SAVE ) +GAME( 1986, darwin, 0, darwin, darwin, brkthru_state, empty_init, ROT270, "Data East Corporation", "Darwin 4078 (Japan)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/drivers/gunsmoke.cpp b/src/mame/drivers/gunsmoke.cpp index a7985a71f47..c935af82fcc 100644 --- a/src/mame/drivers/gunsmoke.cpp +++ b/src/mame/drivers/gunsmoke.cpp @@ -4,6 +4,7 @@ Gun.Smoke Capcom + 85113-A-1 main PCB + 85113-B-3 video PCB driver by Paul Leaman @@ -77,18 +78,270 @@ Stephh's notes (based on the games Z80 code and some tests) : // The DMA copies sprites to a video and halts the CPU for ~131us #include "emu.h" -#include "includes/gunsmoke.h" #include "cpu/z80/z80.h" #include "machine/gen_latch.h" #include "sound/ymopn.h" + +#include "emupal.h" #include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class gunsmoke_state : public driver_device +{ +public: + gunsmoke_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_videoram(*this, "videoram"), + m_colorram(*this, "colorram"), + m_scrollx(*this, "scrollx"), + m_scrolly(*this, "scrolly"), + m_spriteram(*this, "spriteram"), + m_mainbank(*this, "mainbank"), + m_maincpu(*this, "maincpu"), + m_gfxdecode(*this, "gfxdecode"), + m_palette(*this, "palette") + { } + + void gunsmoke(machine_config &config); + +protected: + virtual void machine_start() override; + virtual void machine_reset() override; + virtual void video_start() override; + +private: + // memory pointers + required_shared_ptr m_videoram; + required_shared_ptr m_colorram; + required_shared_ptr m_scrollx; + required_shared_ptr m_scrolly; + required_shared_ptr m_spriteram; + required_memory_bank m_mainbank; + + // devices + required_device m_maincpu; + required_device m_gfxdecode; + required_device m_palette; + + // video-related + tilemap_t *m_bg_tilemap = nullptr; + tilemap_t *m_fg_tilemap = nullptr; + uint8_t m_chon = 0U; + uint8_t m_objon = 0U; + uint8_t m_bgon = 0U; + uint8_t m_sprite3bank = 0U; + + uint8_t protection_r(offs_t offset); + void videoram_w(offs_t offset, uint8_t data); + void colorram_w(offs_t offset, uint8_t data); + void c804_w(uint8_t data); + void d806_w(uint8_t data); + TILE_GET_INFO_MEMBER(get_bg_tile_info); + TILE_GET_INFO_MEMBER(get_fg_tile_info); + void palette(palette_device &palette) const; + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + + void main_map(address_map &map); + void sound_map(address_map &map); +}; + + +// video + +/*************************************************************************** + + Convert the color PROMs into a more useable format. + + Gunsmoke has three 256x4 palette PROMs (one per gun) and a lot of + 256x4 lookup table PROMs. + The palette PROMs are connected to the RGB output this way: + + bit 3 -- 220 ohm resistor -- RED/GREEN/BLUE + -- 470 ohm resistor -- RED/GREEN/BLUE + -- 1 kohm resistor -- RED/GREEN/BLUE + bit 0 -- 2.2kohm resistor -- RED/GREEN/BLUE + +***************************************************************************/ + +void gunsmoke_state::palette(palette_device &palette) const +{ + const uint8_t *color_prom = memregion("proms")->base(); + + // create a lookup table for the palette + for (int i = 0; i < 0x100; i++) + { + int const r = pal4bit(color_prom[i + 0x000]); + int const g = pal4bit(color_prom[i + 0x100]); + int const b = pal4bit(color_prom[i + 0x200]); + + palette.set_indirect_color(i, rgb_t(r, g, b)); + } + + // color_prom now points to the beginning of the lookup table + color_prom += 0x300; + + // characters use colors 0x40-0x4f + for (int i = 0; i < 0x80; i++) + { + uint8_t const ctabentry = color_prom[i] | 0x40; + palette.set_pen_indirect(i, ctabentry); + } + + // background tiles use colors 0-0x3f + for (int i = 0x100; i < 0x200; i++) + { + uint8_t const ctabentry = color_prom[i] | ((color_prom[i + 0x100] & 0x03) << 4); + palette.set_pen_indirect(i - 0x80, ctabentry); + } + + // sprites use colors 0x80-0xff + for (int i = 0x300; i < 0x400; i++) + { + uint8_t const ctabentry = color_prom[i] | ((color_prom[i + 0x100] & 0x07) << 4) | 0x80; + palette.set_pen_indirect(i - 0x180, ctabentry); + } +} + +void gunsmoke_state::videoram_w(offs_t offset, uint8_t data) +{ + m_videoram[offset] = data; + m_fg_tilemap->mark_tile_dirty(offset); +} + +void gunsmoke_state::colorram_w(offs_t offset, uint8_t data) +{ + m_colorram[offset] = data; + m_fg_tilemap->mark_tile_dirty(offset); +} + +void gunsmoke_state::c804_w(uint8_t data) +{ + // bits 0 and 1 are for coin counters + machine().bookkeeping().coin_counter_w(1, data & 0x01); + machine().bookkeeping().coin_counter_w(0, data & 0x02); + + // bits 2 and 3 select the ROM bank + m_mainbank->set_entry((data & 0x0c) >> 2); + + // bit 5 resets the sound CPU? - we ignore it + + // bit 6 flips screen + flip_screen_set(data & 0x40); + + // bit 7 enables characters? + m_chon = data & 0x80; +} + +void gunsmoke_state::d806_w(uint8_t data) +{ + // bits 0-2 select the sprite 3 bank + m_sprite3bank = data & 0x07; + + // bit 4 enables bg 1? + m_bgon = data & 0x10; + + // bit 5 enables sprites? + m_objon = data & 0x20; +} + +TILE_GET_INFO_MEMBER(gunsmoke_state::get_bg_tile_info) +{ + uint8_t *tilerom = memregion("bgtiles")->base(); + + int offs = tile_index * 2; + int attr = tilerom[offs + 1]; + int code = tilerom[offs] + ((attr & 0x01) << 8); + int color = (attr & 0x3c) >> 2; + int flags = TILE_FLIPYX((attr & 0xc0) >> 6); + + tileinfo.set(1, code, color, flags); +} + +TILE_GET_INFO_MEMBER(gunsmoke_state::get_fg_tile_info) +{ + int attr = m_colorram[tile_index]; + int code = m_videoram[tile_index] + ((attr & 0xe0) << 2); + int color = attr & 0x1f; + + tileinfo.group = color; + + tileinfo.set(0, code, color, 0); +} + +void gunsmoke_state::video_start() +{ + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(gunsmoke_state::get_bg_tile_info)), TILEMAP_SCAN_COLS, 32, 32, 2048, 8); + m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(gunsmoke_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); + m_bg_tilemap->set_scrolldx(128, 128); + m_bg_tilemap->set_scrolldy( 6, 6); + m_fg_tilemap->set_scrolldx(128, 128); + m_fg_tilemap->set_scrolldy( 6, 6); -/* Read/Write Handlers */ + m_fg_tilemap->configure_groups(*m_gfxdecode->gfx(0), 0x4f); +} + +void gunsmoke_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + for (int offs = m_spriteram.bytes() - 32; offs >= 0; offs -= 32) + { + int attr = m_spriteram[offs + 1]; + int bank = (attr & 0xc0) >> 6; + int code = m_spriteram[offs]; + int color = attr & 0x0f; + int flipx = 0; + int flipy = attr & 0x10; + int sx = m_spriteram[offs + 3] - ((attr & 0x20) << 3); + int sy = m_spriteram[offs + 2]; + + if (bank == 3) + bank += m_sprite3bank; + + code += 256 * bank; + + if (flip_screen()) + { + sx = 240 - sx; + sy = 240 - sy; + flipx = !flipx; + flipy = !flipy; + } + + m_gfxdecode->gfx(2)->transpen(bitmap, cliprect, code, color, flipx, flipy, sx + 128, sy + 6, 0); + } +} + +uint32_t gunsmoke_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + m_bg_tilemap->set_scrollx(0, m_scrollx[0] + 256 * m_scrollx[1]); + m_bg_tilemap->set_scrolly(0, m_scrolly[0]); + + if (m_bgon) + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + else + bitmap.fill(m_palette->black_pen(), cliprect); + + if (m_objon) + draw_sprites(bitmap, cliprect); -uint8_t gunsmoke_state::gunsmoke_protection_r(offs_t offset) + if (m_chon) + m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + + return 0; +} + + +// machine + +// Read/Write Handlers + +uint8_t gunsmoke_state::protection_r(offs_t offset) { /* The routine at 0x0e69 tries to read data starting at 0xc4c9. @@ -105,32 +358,32 @@ uint8_t gunsmoke_state::gunsmoke_protection_r(offs_t offset) arcade game. It's hard to tell without pulling the code apart. */ - static const uint8_t gunsmoke_fixed_data[] = { 0xff, 0x00, 0x00 }; - return gunsmoke_fixed_data[offset]; + static const uint8_t fixed_data[] = { 0xff, 0x00, 0x00 }; + return fixed_data[offset]; } -/* Memory Maps */ +// Memory Maps -void gunsmoke_state::gunsmoke_map(address_map &map) +void gunsmoke_state::main_map(address_map &map) { map(0x0000, 0x7fff).rom(); - map(0x8000, 0xbfff).bankr("bank1"); + map(0x8000, 0xbfff).bankr(m_mainbank); map(0xc000, 0xc000).portr("SYSTEM"); map(0xc001, 0xc001).portr("P1"); map(0xc002, 0xc002).portr("P2"); map(0xc003, 0xc003).portr("DSW1"); map(0xc004, 0xc004).portr("DSW2"); - map(0xc4c9, 0xc4cb).r(FUNC(gunsmoke_state::gunsmoke_protection_r)); + map(0xc4c9, 0xc4cb).r(FUNC(gunsmoke_state::protection_r)); map(0xc800, 0xc800).w("soundlatch", FUNC(generic_latch_8_device::write)); - map(0xc804, 0xc804).w(FUNC(gunsmoke_state::gunsmoke_c804_w)); // ROM bank switch, screen flip + map(0xc804, 0xc804).w(FUNC(gunsmoke_state::c804_w)); // ROM bank switch, screen flip // 0xc806 DMA trigger (not emulated) - map(0xd000, 0xd3ff).ram().w(FUNC(gunsmoke_state::gunsmoke_videoram_w)).share("videoram"); - map(0xd400, 0xd7ff).ram().w(FUNC(gunsmoke_state::gunsmoke_colorram_w)).share("colorram"); - map(0xd800, 0xd801).ram().share("scrollx"); - map(0xd802, 0xd802).ram().share("scrolly"); - map(0xd806, 0xd806).w(FUNC(gunsmoke_state::gunsmoke_d806_w)); // sprites and bg enable + map(0xd000, 0xd3ff).ram().w(FUNC(gunsmoke_state::videoram_w)).share(m_videoram); + map(0xd400, 0xd7ff).ram().w(FUNC(gunsmoke_state::colorram_w)).share(m_colorram); + map(0xd800, 0xd801).ram().share(m_scrollx); + map(0xd802, 0xd802).ram().share(m_scrolly); + map(0xd806, 0xd806).w(FUNC(gunsmoke_state::d806_w)); // sprites and bg enable map(0xe000, 0xefff).ram(); - map(0xf000, 0xffff).ram().share("spriteram"); + map(0xf000, 0xffff).ram().share(m_spriteram); } void gunsmoke_state::sound_map(address_map &map) @@ -142,7 +395,7 @@ void gunsmoke_state::sound_map(address_map &map) map(0xe002, 0xe003).w("ym2", FUNC(ym2203_device::write)); } -/* Input Ports */ +// Input Ports static INPUT_PORTS_START( gunsmoke ) PORT_START("SYSTEM") @@ -234,24 +487,24 @@ static INPUT_PORTS_START( gunsmokeu ) PORT_DIPSETTING( 0x00, "5" ) INPUT_PORTS_END -/* Graphics Layouts */ +// Graphics Layouts static const gfx_layout charlayout = { - 8,8, /* 8*8 characters */ - 1024, /* 1024 characters */ - 2, /* 2 bits per pixel */ + 8,8, // 8*8 characters + 1024, // 1024 characters + 2, // 2 bits per pixel { 4, 0 }, { 8+3, 8+2, 8+1, 8+0, 3, 2, 1, 0 }, { 7*16, 6*16, 5*16, 4*16, 3*16, 2*16, 1*16, 0*16 }, - 16*8 /* every char takes 16 consecutive bytes */ + 16*8 // every char takes 16 consecutive bytes }; static const gfx_layout tilelayout = { - 32,32, /* 32*32 tiles */ - 512, /* 512 tiles */ - 4, /* 4 bits per pixel */ + 32,32, // 32*32 tiles + 512, // 512 tiles + 4, // 4 bits per pixel { 512*256*8+4, 512*256*8+0, 4, 0 }, { 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3, 64*8+0, 64*8+1, 64*8+2, 64*8+3, 65*8+0, 65*8+1, 65*8+2, 65*8+3, @@ -261,37 +514,37 @@ static const gfx_layout tilelayout = 8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16, 16*16, 17*16, 18*16, 19*16, 20*16, 21*16, 22*16, 23*16, 24*16, 25*16, 26*16, 27*16, 28*16, 29*16, 30*16, 31*16 }, - 256*8 /* every tile takes 256 consecutive bytes */ + 256*8 // every tile takes 256 consecutive bytes }; static const gfx_layout spritelayout = { - 16,16, /* 16*16 sprites */ - 2048, /* 2048 sprites */ - 4, /* 4 bits per pixel */ + 16,16, // 16*16 sprites + 2048, // 2048 sprites + 4, // 4 bits per pixel { 2048*64*8+4, 2048*64*8+0, 4, 0 }, { 0, 1, 2, 3, 8+0, 8+1, 8+2, 8+3, 32*8+0, 32*8+1, 32*8+2, 32*8+3, 33*8+0, 33*8+1, 33*8+2, 33*8+3 }, { 0*16, 1*16, 2*16, 3*16, 4*16, 5*16, 6*16, 7*16, 8*16, 9*16, 10*16, 11*16, 12*16, 13*16, 14*16, 15*16 }, - 64*8 /* every sprite takes 64 consecutive bytes */ + 64*8 // every sprite takes 64 consecutive bytes }; -/* Graphics Decode Info */ +// Graphics Decode Info static GFXDECODE_START( gfx_gunsmoke ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0, 32 ) - GFXDECODE_ENTRY( "gfx2", 0, tilelayout, 32*4, 16 ) - GFXDECODE_ENTRY( "gfx3", 0, spritelayout, 32*4+16*16, 16 ) + GFXDECODE_ENTRY( "chars", 0, charlayout, 0, 32 ) + GFXDECODE_ENTRY( "tiles", 0, tilelayout, 32*4, 16 ) + GFXDECODE_ENTRY( "sprites", 0, spritelayout, 32*4+16*16, 16 ) GFXDECODE_END -/* Machine Driver */ +// Machine Driver void gunsmoke_state::machine_start() { uint8_t *rombase = memregion("maincpu")->base(); - membank("bank1")->configure_entries(0, 4, &rombase[0x10000], 0x4000); + m_mainbank->configure_entries(0, 4, &rombase[0x8000], 0x4000); save_item(NAME(m_chon)); save_item(NAME(m_objon)); @@ -309,350 +562,350 @@ void gunsmoke_state::machine_reset() void gunsmoke_state::gunsmoke(machine_config &config) { - /* basic machine hardware */ - Z80(config, m_maincpu, 3000000); // 3 MHz Verified on PCB by jotego - m_maincpu->set_addrmap(AS_PROGRAM, &gunsmoke_state::gunsmoke_map); + // basic machine hardware + Z80(config, m_maincpu, 12_MHz_XTAL / 4); // 3 MHz Verified on PCB by jotego + m_maincpu->set_addrmap(AS_PROGRAM, &gunsmoke_state::main_map); m_maincpu->set_vblank_int("screen", FUNC(gunsmoke_state::irq0_line_hold)); - z80_device &audiocpu(Z80(config, "audiocpu", 3000000)); // 3 MHz + z80_device &audiocpu(Z80(config, "audiocpu", 12_MHz_XTAL / 4)); // 3 MHz, actually inside a 85H001 CAPCOM custom audiocpu.set_addrmap(AS_PROGRAM, &gunsmoke_state::sound_map); - audiocpu.set_periodic_int(FUNC(gunsmoke_state::irq0_line_hold), attotime::from_ticks(384*262/4, 6000000)); + audiocpu.set_periodic_int(FUNC(gunsmoke_state::irq0_line_hold), attotime::from_ticks(384*262/4, 12_MHz_XTAL / 2)); - /* video hardware */ + // video hardware screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); - screen.set_raw(6000000, 384, 128, 0, 262, 22, 246); // hsync is 50..77, vsync is 257..259 - screen.set_screen_update(FUNC(gunsmoke_state::screen_update_gunsmoke)); + screen.set_raw(12_MHz_XTAL / 2, 384, 128, 0, 262, 22, 246); // hsync is 50..77, vsync is 257..259 + screen.set_screen_update(FUNC(gunsmoke_state::screen_update)); screen.set_palette(m_palette); GFXDECODE(config, m_gfxdecode, m_palette, gfx_gunsmoke); - PALETTE(config, m_palette, FUNC(gunsmoke_state::gunsmoke_palette), 32*4 + 16*16 + 16*16, 256); + PALETTE(config, m_palette, FUNC(gunsmoke_state::palette), 32*4 + 16*16 + 16*16, 256); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); GENERIC_LATCH_8(config, "soundlatch"); - ym2203_device &ym1(YM2203(config, "ym1", 1500000)); + ym2203_device &ym1(YM2203(config, "ym1", 12_MHz_XTAL / 8)); ym1.add_route(0, "mono", 0.22); ym1.add_route(1, "mono", 0.22); ym1.add_route(2, "mono", 0.22); ym1.add_route(3, "mono", 0.14); - ym2203_device &ym2(YM2203(config, "ym2", 1500000)); + ym2203_device &ym2(YM2203(config, "ym2", 12_MHz_XTAL / 8)); ym2.add_route(0, "mono", 0.22); ym2.add_route(1, "mono", 0.22); ym2.add_route(2, "mono", 0.22); ym2.add_route(3, "mono", 0.14); } -/* ROMs */ +// ROMs ROM_START( gunsmoke ) - ROM_REGION( 0x20000, "maincpu", 0 ) - ROM_LOAD( "gs03.09n", 0x00000, 0x8000, CRC(40a06cef) SHA1(3e2a52d476298b7252f0adaefdb42090351e921c) ) /* Code 0000-7fff */ // gse_03 ? - ROM_LOAD( "gs04.10n", 0x10000, 0x8000, CRC(8d4b423f) SHA1(149274c2ed1526ca1f419fdf8a24059ff138f7f2) ) /* Paged code */ - ROM_LOAD( "gs05.12n", 0x18000, 0x8000, CRC(2b5667fb) SHA1(5b689bca1e76d803b4cae22feaa7744fa528e93f) ) /* Paged code */ + ROM_REGION( 0x18000, "maincpu", 0 ) + ROM_LOAD( "gs03.09n", 0x00000, 0x8000, CRC(40a06cef) SHA1(3e2a52d476298b7252f0adaefdb42090351e921c) ) // Code 0000-7fff // gse_03 + ROM_LOAD( "gs04.10n", 0x08000, 0x8000, CRC(8d4b423f) SHA1(149274c2ed1526ca1f419fdf8a24059ff138f7f2) ) // Paged code + ROM_LOAD( "gs05.12n", 0x10000, 0x8000, CRC(2b5667fb) SHA1(5b689bca1e76d803b4cae22feaa7744fa528e93f) ) // Paged code ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "gs02.14h", 0x00000, 0x8000, CRC(cd7a2c38) SHA1(c76c471f694b76015370f0eacf5350e652f526ff) ) - ROM_REGION( 0x04000, "gfx1", 0 ) - ROM_LOAD( "gs01.11f", 0x00000, 0x4000, CRC(b61ece9b) SHA1(eb3fc62644cc5b5a2b9cbe67c393d4a0e2a59ca9) ) /* Characters */ + ROM_REGION( 0x04000, "chars", 0 ) + ROM_LOAD( "gs01.11f", 0x00000, 0x4000, CRC(b61ece9b) SHA1(eb3fc62644cc5b5a2b9cbe67c393d4a0e2a59ca9) ) - ROM_REGION( 0x40000, "gfx2", 0 ) - ROM_LOAD( "gs13.06c", 0x00000, 0x8000, CRC(f6769fc5) SHA1(d192ec176425327ca4b7e25fc8432fc47837ba29) ) /* 32x32 tiles planes 2-3 */ + ROM_REGION( 0x40000, "tiles", 0 ) + ROM_LOAD( "gs13.06c", 0x00000, 0x8000, CRC(f6769fc5) SHA1(d192ec176425327ca4b7e25fc8432fc47837ba29) ) // 32x32 tiles planes 2-3 ROM_LOAD( "gs12.05c", 0x08000, 0x8000, CRC(d997b78c) SHA1(3b4a9b6f9e57ecfb4ab9734379bd0ee765fd6daa) ) ROM_LOAD( "gs11.04c", 0x10000, 0x8000, CRC(125ba58e) SHA1(cf6931653cebd051564bed8121ab8713a55095c5) ) ROM_LOAD( "gs10.02c", 0x18000, 0x8000, CRC(f469c13c) SHA1(54eda52d6fce58771c0adfe2c88292a41d5a9b99) ) - ROM_LOAD( "gs09.06a", 0x20000, 0x8000, CRC(539f182d) SHA1(4190c0adbecc57b92f4d002e121acb77e8c5d8d8) ) /* 32x32 tiles planes 0-1 */ + ROM_LOAD( "gs09.06a", 0x20000, 0x8000, CRC(539f182d) SHA1(4190c0adbecc57b92f4d002e121acb77e8c5d8d8) ) // 32x32 tiles planes 0-1 ROM_LOAD( "gs08.05a", 0x28000, 0x8000, CRC(e87e526d) SHA1(d10068addf30322424a85bbc6382cb762ae3fbe2) ) ROM_LOAD( "gs07.04a", 0x30000, 0x8000, CRC(4382c0d2) SHA1(8615e62bc57b40d082f6ca211d64f22185bed1fd) ) ROM_LOAD( "gs06.02a", 0x38000, 0x8000, CRC(4cafe7a6) SHA1(fe501f3a5e9ce9e82e9708f1cd297f4c94ef0f81) ) - ROM_REGION( 0x40000, "gfx3", 0 ) - ROM_LOAD( "gs22.06n", 0x00000, 0x8000, CRC(dc9c508c) SHA1(920505dd4c63b177918feb4e54cca8a7948ec9d9) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs21.04n", 0x08000, 0x8000, CRC(68883749) SHA1(c7bf2bf49c53feddf8f30b4001dc2d59b52b1c28) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs20.03n", 0x10000, 0x8000, CRC(0be932ed) SHA1(1c5af5884a23112dbc36579515d1cb497992da2f) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs19.01n", 0x18000, 0x8000, CRC(63072f93) SHA1(cb3a2729782cf2855558d081fe92d28366228b8e) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs18.06l", 0x20000, 0x8000, CRC(f69a3c7c) SHA1(e9eb9dfa7d53aa7b728150f91d05bfc3bf6f1e75) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs17.04l", 0x28000, 0x8000, CRC(4e98562a) SHA1(0341b8a79be1d71a57d0d76ed890e15f9f92259e) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs16.03l", 0x30000, 0x8000, CRC(0d99c3b3) SHA1(436c566b76f632242448671e3b6319f7d9f65322) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs15.01l", 0x38000, 0x8000, CRC(7f14270e) SHA1(dd06c333c2ea097e25185a1423cd61e1b7afc42b) ) /* Sprites planes 0-1 */ - - ROM_REGION( 0x8000, "gfx4", 0 ) /* background tilemaps */ + ROM_REGION( 0x40000, "sprites", 0 ) + ROM_LOAD( "gs22.06n", 0x00000, 0x8000, CRC(dc9c508c) SHA1(920505dd4c63b177918feb4e54cca8a7948ec9d9) ) // Sprites planes 2-3 + ROM_LOAD( "gs21.04n", 0x08000, 0x8000, CRC(68883749) SHA1(c7bf2bf49c53feddf8f30b4001dc2d59b52b1c28) ) // Sprites planes 2-3 + ROM_LOAD( "gs20.03n", 0x10000, 0x8000, CRC(0be932ed) SHA1(1c5af5884a23112dbc36579515d1cb497992da2f) ) // Sprites planes 2-3 + ROM_LOAD( "gs19.01n", 0x18000, 0x8000, CRC(63072f93) SHA1(cb3a2729782cf2855558d081fe92d28366228b8e) ) // Sprites planes 2-3 + ROM_LOAD( "gs18.06l", 0x20000, 0x8000, CRC(f69a3c7c) SHA1(e9eb9dfa7d53aa7b728150f91d05bfc3bf6f1e75) ) // Sprites planes 0-1 + ROM_LOAD( "gs17.04l", 0x28000, 0x8000, CRC(4e98562a) SHA1(0341b8a79be1d71a57d0d76ed890e15f9f92259e) ) // Sprites planes 0-1 + ROM_LOAD( "gs16.03l", 0x30000, 0x8000, CRC(0d99c3b3) SHA1(436c566b76f632242448671e3b6319f7d9f65322) ) // Sprites planes 0-1 + ROM_LOAD( "gs15.01l", 0x38000, 0x8000, CRC(7f14270e) SHA1(dd06c333c2ea097e25185a1423cd61e1b7afc42b) ) // Sprites planes 0-1 + + ROM_REGION( 0x8000, "bgtiles", 0 ) ROM_LOAD( "gs14.11c", 0x00000, 0x8000, CRC(0af4f7eb) SHA1(24a98fdeedeeaf1035b4af52d5a8dd5e47a5e62d) ) ROM_REGION( 0x0a00, "proms", 0 ) - ROM_LOAD( "g-01.03b", 0x0000, 0x0100, CRC(02f55589) SHA1(8a3f98304aedf3aba1c08b615bf457752a480edc) ) /* red component */ - ROM_LOAD( "g-02.04b", 0x0100, 0x0100, CRC(e1e36dd9) SHA1(5bd88a35898a2d973045bdde8311aac3a12826de) ) /* green component */ - ROM_LOAD( "g-03.05b", 0x0200, 0x0100, CRC(989399c0) SHA1(e408e391f49ed0c7b9e16479fea44b809440fefc) ) /* blue component */ - ROM_LOAD( "g-04.09d", 0x0300, 0x0100, CRC(906612b5) SHA1(7b727a6200c088538180758320ede84aa7e5b96d) ) /* char lookup table */ - ROM_LOAD( "g-06.14a", 0x0400, 0x0100, CRC(4a9da18b) SHA1(fed3b81b56aab2ed0a21ed1fcebe3f1ae095a13b) ) /* tile lookup table */ - ROM_LOAD( "g-07.15a", 0x0500, 0x0100, CRC(cb9394fc) SHA1(8ad0fde6a8ef8326d2da4b6dbf3b51f5f6c668c8) ) /* tile palette bank */ - ROM_LOAD( "g-09.09f", 0x0600, 0x0100, CRC(3cee181e) SHA1(3f95bdb12391cb9b3673191bda8d09c84b36b4d3) ) /* sprite lookup table */ - ROM_LOAD( "g-08.08f", 0x0700, 0x0100, CRC(ef91cdd2) SHA1(90b9191c9f10a153d64055a4238eb6e15b8c12bc) ) /* sprite palette bank */ - ROM_LOAD( "g-10.02j", 0x0800, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* video timing (not used) */ - ROM_LOAD( "g-05.01f", 0x0900, 0x0100, CRC(25c90c2a) SHA1(42893572bab757ec01e181fc418cb911638d37e0) ) /* priority? (not used) */ + ROM_LOAD( "g-01.03b", 0x0000, 0x0100, CRC(02f55589) SHA1(8a3f98304aedf3aba1c08b615bf457752a480edc) ) // red component + ROM_LOAD( "g-02.04b", 0x0100, 0x0100, CRC(e1e36dd9) SHA1(5bd88a35898a2d973045bdde8311aac3a12826de) ) // green component + ROM_LOAD( "g-03.05b", 0x0200, 0x0100, CRC(989399c0) SHA1(e408e391f49ed0c7b9e16479fea44b809440fefc) ) // blue component + ROM_LOAD( "g-04.09d", 0x0300, 0x0100, CRC(906612b5) SHA1(7b727a6200c088538180758320ede84aa7e5b96d) ) // char lookup table + ROM_LOAD( "g-06.14a", 0x0400, 0x0100, CRC(4a9da18b) SHA1(fed3b81b56aab2ed0a21ed1fcebe3f1ae095a13b) ) // tile lookup table + ROM_LOAD( "g-07.15a", 0x0500, 0x0100, CRC(cb9394fc) SHA1(8ad0fde6a8ef8326d2da4b6dbf3b51f5f6c668c8) ) // tile palette bank + ROM_LOAD( "g-09.09f", 0x0600, 0x0100, CRC(3cee181e) SHA1(3f95bdb12391cb9b3673191bda8d09c84b36b4d3) ) // sprite lookup table + ROM_LOAD( "g-08.08f", 0x0700, 0x0100, CRC(ef91cdd2) SHA1(90b9191c9f10a153d64055a4238eb6e15b8c12bc) ) // sprite palette bank + ROM_LOAD( "g-10.02j", 0x0800, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // video timing (not used) + ROM_LOAD( "g-05.01f", 0x0900, 0x0100, CRC(25c90c2a) SHA1(42893572bab757ec01e181fc418cb911638d37e0) ) // priority? (not used) ROM_END ROM_START( gunsmokeb ) - ROM_REGION( 0x20000, "maincpu", 0 ) - ROM_LOAD( "3.ic85", 0x00000, 0x8000, CRC(ae6f4b75) SHA1(f4ee4f7a7d507ceaef9ce8165704fd80c8c1e8ba) ) /* Code 0000-7fff */ - ROM_LOAD( "4.ic86", 0x10000, 0x8000, CRC(8d4b423f) SHA1(149274c2ed1526ca1f419fdf8a24059ff138f7f2) ) /* Paged code */ - ROM_LOAD( "5.ic87", 0x18000, 0x8000, CRC(2b5667fb) SHA1(5b689bca1e76d803b4cae22feaa7744fa528e93f) ) /* Paged code */ + ROM_REGION( 0x18000, "maincpu", 0 ) + ROM_LOAD( "3.ic85", 0x00000, 0x8000, CRC(ae6f4b75) SHA1(f4ee4f7a7d507ceaef9ce8165704fd80c8c1e8ba) ) // Code 0000-7fff + ROM_LOAD( "4.ic86", 0x08000, 0x8000, CRC(8d4b423f) SHA1(149274c2ed1526ca1f419fdf8a24059ff138f7f2) ) // Paged code + ROM_LOAD( "5.ic87", 0x10000, 0x8000, CRC(2b5667fb) SHA1(5b689bca1e76d803b4cae22feaa7744fa528e93f) ) // Paged code ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "2.ic41", 0x00000, 0x8000, CRC(cd7a2c38) SHA1(c76c471f694b76015370f0eacf5350e652f526ff) ) - ROM_REGION( 0x04000, "gfx1", 0 ) - ROM_LOAD( "1.ic39", 0x00000, 0x4000, CRC(b61ece9b) SHA1(eb3fc62644cc5b5a2b9cbe67c393d4a0e2a59ca9) ) /* Characters */ + ROM_REGION( 0x04000, "chars", 0 ) + ROM_LOAD( "1.ic39", 0x00000, 0x4000, CRC(b61ece9b) SHA1(eb3fc62644cc5b5a2b9cbe67c393d4a0e2a59ca9) ) - ROM_REGION( 0x40000, "gfx2", 0 ) - ROM_LOAD( "13.ic21", 0x00000, 0x8000, CRC(f6769fc5) SHA1(d192ec176425327ca4b7e25fc8432fc47837ba29) ) /* 32x32 tiles planes 2-3 */ + ROM_REGION( 0x40000, "tiles", 0 ) + ROM_LOAD( "13.ic21", 0x00000, 0x8000, CRC(f6769fc5) SHA1(d192ec176425327ca4b7e25fc8432fc47837ba29) ) // 32x32 tiles planes 2-3 ROM_LOAD( "12.ic20", 0x08000, 0x8000, CRC(d997b78c) SHA1(3b4a9b6f9e57ecfb4ab9734379bd0ee765fd6daa) ) ROM_LOAD( "11.ic19", 0x10000, 0x8000, CRC(125ba58e) SHA1(cf6931653cebd051564bed8121ab8713a55095c5) ) ROM_LOAD( "10.ic18", 0x18000, 0x8000, CRC(f469c13c) SHA1(54eda52d6fce58771c0adfe2c88292a41d5a9b99) ) - ROM_LOAD( "9.ic04", 0x20000, 0x8000, CRC(539f182d) SHA1(4190c0adbecc57b92f4d002e121acb77e8c5d8d8) ) /* 32x32 tiles planes 0-1 */ - ROM_LOAD( "8.ic03", 0x28000, 0x8000, CRC(e87e526d) SHA1(d10068addf30322424a85bbc6382cb762ae3fbe2) ) - ROM_LOAD( "7.ic02", 0x30000, 0x8000, CRC(4382c0d2) SHA1(8615e62bc57b40d082f6ca211d64f22185bed1fd) ) - ROM_LOAD( "6.ic01", 0x38000, 0x8000, CRC(4cafe7a6) SHA1(fe501f3a5e9ce9e82e9708f1cd297f4c94ef0f81) ) - - ROM_REGION( 0x40000, "gfx3", 0 ) - ROM_LOAD( "22.ic134", 0x00000, 0x8000, CRC(dc9c508c) SHA1(920505dd4c63b177918feb4e54cca8a7948ec9d9) ) /* Sprites planes 2-3 */ - ROM_LOAD( "21.ic133", 0x08000, 0x8000, CRC(68883749) SHA1(c7bf2bf49c53feddf8f30b4001dc2d59b52b1c28) ) /* Sprites planes 2-3 */ - ROM_LOAD( "20.ic132", 0x10000, 0x8000, CRC(0be932ed) SHA1(1c5af5884a23112dbc36579515d1cb497992da2f) ) /* Sprites planes 2-3 */ - ROM_LOAD( "19.ic131", 0x18000, 0x8000, CRC(63072f93) SHA1(cb3a2729782cf2855558d081fe92d28366228b8e) ) /* Sprites planes 2-3 */ - ROM_LOAD( "18.ic115", 0x20000, 0x8000, CRC(f69a3c7c) SHA1(e9eb9dfa7d53aa7b728150f91d05bfc3bf6f1e75) ) /* Sprites planes 0-1 */ - ROM_LOAD( "17.ic114", 0x28000, 0x8000, CRC(4e98562a) SHA1(0341b8a79be1d71a57d0d76ed890e15f9f92259e) ) /* Sprites planes 0-1 */ - ROM_LOAD( "16.ic113", 0x30000, 0x8000, CRC(0d99c3b3) SHA1(436c566b76f632242448671e3b6319f7d9f65322) ) /* Sprites planes 0-1 */ - ROM_LOAD( "15.ic112", 0x38000, 0x8000, CRC(7f14270e) SHA1(dd06c333c2ea097e25185a1423cd61e1b7afc42b) ) /* Sprites planes 0-1 */ - - ROM_REGION( 0x8000, "gfx4", 0 ) /* background tilemaps */ + ROM_LOAD( "9.ic04", 0x20000, 0x8000, CRC(539f182d) SHA1(4190c0adbecc57b92f4d002e121acb77e8c5d8d8) ) // 32x32 tiles planes 0-1 + ROM_LOAD( "8.ic03", 0x28000, 0x8000, CRC(e87e526d) SHA1(d10068addf30322424a85bbc6382cb762ae3fbe2) ) + ROM_LOAD( "7.ic02", 0x30000, 0x8000, CRC(4382c0d2) SHA1(8615e62bc57b40d082f6ca211d64f22185bed1fd) ) + ROM_LOAD( "6.ic01", 0x38000, 0x8000, CRC(4cafe7a6) SHA1(fe501f3a5e9ce9e82e9708f1cd297f4c94ef0f81) ) + + ROM_REGION( 0x40000, "sprites", 0 ) + ROM_LOAD( "22.ic134", 0x00000, 0x8000, CRC(dc9c508c) SHA1(920505dd4c63b177918feb4e54cca8a7948ec9d9) ) // Sprites planes 2-3 + ROM_LOAD( "21.ic133", 0x08000, 0x8000, CRC(68883749) SHA1(c7bf2bf49c53feddf8f30b4001dc2d59b52b1c28) ) // Sprites planes 2-3 + ROM_LOAD( "20.ic132", 0x10000, 0x8000, CRC(0be932ed) SHA1(1c5af5884a23112dbc36579515d1cb497992da2f) ) // Sprites planes 2-3 + ROM_LOAD( "19.ic131", 0x18000, 0x8000, CRC(63072f93) SHA1(cb3a2729782cf2855558d081fe92d28366228b8e) ) // Sprites planes 2-3 + ROM_LOAD( "18.ic115", 0x20000, 0x8000, CRC(f69a3c7c) SHA1(e9eb9dfa7d53aa7b728150f91d05bfc3bf6f1e75) ) // Sprites planes 0-1 + ROM_LOAD( "17.ic114", 0x28000, 0x8000, CRC(4e98562a) SHA1(0341b8a79be1d71a57d0d76ed890e15f9f92259e) ) // Sprites planes 0-1 + ROM_LOAD( "16.ic113", 0x30000, 0x8000, CRC(0d99c3b3) SHA1(436c566b76f632242448671e3b6319f7d9f65322) ) // Sprites planes 0-1 + ROM_LOAD( "15.ic112", 0x38000, 0x8000, CRC(7f14270e) SHA1(dd06c333c2ea097e25185a1423cd61e1b7afc42b) ) // Sprites planes 0-1 + + ROM_REGION( 0x8000, "bgtiles", 0 ) ROM_LOAD( "14.ic25", 0x00000, 0x8000, CRC(0af4f7eb) SHA1(24a98fdeedeeaf1035b4af52d5a8dd5e47a5e62d) ) - /* The names of the proms starting with "g-" do not yet reflect their position in the pcb layout of this bootleg. - As the ICs are not socketed, but directly soldered to the pcb, it is harder to identify which is which. + /* The names of the PROMs starting with "g-" do not yet reflect their position in the PCB layout of this bootleg. + As the ICs are not socketed, but directly soldered to the PCB, it is harder to identify which is which. But it would be good to figure this out at some point, for the sake of documenting this specific board layout. */ ROM_REGION( 0x0a00, "proms", 0 ) - ROM_LOAD( "prom.ic3", 0x0000, 0x0100, CRC(02f55589) SHA1(8a3f98304aedf3aba1c08b615bf457752a480edc) ) /* red component */ - ROM_LOAD( "prom.ic4", 0x0100, 0x0100, CRC(e1e36dd9) SHA1(5bd88a35898a2d973045bdde8311aac3a12826de) ) /* green component */ - ROM_LOAD( "prom.ic5", 0x0200, 0x0100, CRC(989399c0) SHA1(e408e391f49ed0c7b9e16479fea44b809440fefc) ) /* blue component */ - ROM_LOAD( "g-04.09d", 0x0300, 0x0100, CRC(906612b5) SHA1(7b727a6200c088538180758320ede84aa7e5b96d) ) /* char lookup table */ - ROM_LOAD( "g-06.14a", 0x0400, 0x0100, CRC(4a9da18b) SHA1(fed3b81b56aab2ed0a21ed1fcebe3f1ae095a13b) ) /* tile lookup table */ - ROM_LOAD( "g-07.15a", 0x0500, 0x0100, CRC(cb9394fc) SHA1(8ad0fde6a8ef8326d2da4b6dbf3b51f5f6c668c8) ) /* tile palette bank */ - ROM_LOAD( "g-09.09f", 0x0600, 0x0100, CRC(3cee181e) SHA1(3f95bdb12391cb9b3673191bda8d09c84b36b4d3) ) /* sprite lookup table */ - ROM_LOAD( "g-08.08f", 0x0700, 0x0100, CRC(ef91cdd2) SHA1(90b9191c9f10a153d64055a4238eb6e15b8c12bc) ) /* sprite palette bank */ - ROM_LOAD( "g-10.02j", 0x0800, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* video timing (not used) */ - ROM_LOAD( "g-05.01f", 0x0900, 0x0100, CRC(25c90c2a) SHA1(42893572bab757ec01e181fc418cb911638d37e0) ) /* priority? (not used) */ + ROM_LOAD( "prom.ic3", 0x0000, 0x0100, CRC(02f55589) SHA1(8a3f98304aedf3aba1c08b615bf457752a480edc) ) // red component + ROM_LOAD( "prom.ic4", 0x0100, 0x0100, CRC(e1e36dd9) SHA1(5bd88a35898a2d973045bdde8311aac3a12826de) ) // green component + ROM_LOAD( "prom.ic5", 0x0200, 0x0100, CRC(989399c0) SHA1(e408e391f49ed0c7b9e16479fea44b809440fefc) ) // blue component + ROM_LOAD( "g-04.09d", 0x0300, 0x0100, CRC(906612b5) SHA1(7b727a6200c088538180758320ede84aa7e5b96d) ) // char lookup table + ROM_LOAD( "g-06.14a", 0x0400, 0x0100, CRC(4a9da18b) SHA1(fed3b81b56aab2ed0a21ed1fcebe3f1ae095a13b) ) // tile lookup table + ROM_LOAD( "g-07.15a", 0x0500, 0x0100, CRC(cb9394fc) SHA1(8ad0fde6a8ef8326d2da4b6dbf3b51f5f6c668c8) ) // tile palette bank + ROM_LOAD( "g-09.09f", 0x0600, 0x0100, CRC(3cee181e) SHA1(3f95bdb12391cb9b3673191bda8d09c84b36b4d3) ) // sprite lookup table + ROM_LOAD( "g-08.08f", 0x0700, 0x0100, CRC(ef91cdd2) SHA1(90b9191c9f10a153d64055a4238eb6e15b8c12bc) ) // sprite palette bank + ROM_LOAD( "g-10.02j", 0x0800, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // video timing (not used) + ROM_LOAD( "g-05.01f", 0x0900, 0x0100, CRC(25c90c2a) SHA1(42893572bab757ec01e181fc418cb911638d37e0) ) // priority? (not used) ROM_END ROM_START( gunsmokej ) - ROM_REGION( 0x20000, "maincpu", 0 ) - ROM_LOAD( "gsj_03.09n", 0x00000, 0x8000, CRC(b56b5df6) SHA1(0295a3ef491b6b8ee9c198fd08dddc29d88bbef6) ) /* Code 0000-7fff */ - ROM_LOAD( "gs04.10n", 0x10000, 0x8000, CRC(8d4b423f) SHA1(149274c2ed1526ca1f419fdf8a24059ff138f7f2) ) /* Paged code */ - ROM_LOAD( "gs05.12n", 0x18000, 0x8000, CRC(2b5667fb) SHA1(5b689bca1e76d803b4cae22feaa7744fa528e93f) ) /* Paged code */ + ROM_REGION( 0x18000, "maincpu", 0 ) + ROM_LOAD( "gsj_03.09n", 0x00000, 0x8000, CRC(b56b5df6) SHA1(0295a3ef491b6b8ee9c198fd08dddc29d88bbef6) ) // Code 0000-7fff + ROM_LOAD( "gs04.10n", 0x08000, 0x8000, CRC(8d4b423f) SHA1(149274c2ed1526ca1f419fdf8a24059ff138f7f2) ) // Paged code + ROM_LOAD( "gs05.12n", 0x10000, 0x8000, CRC(2b5667fb) SHA1(5b689bca1e76d803b4cae22feaa7744fa528e93f) ) // Paged code ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "gs02.14h", 0x00000, 0x8000, CRC(cd7a2c38) SHA1(c76c471f694b76015370f0eacf5350e652f526ff) ) - ROM_REGION( 0x04000, "gfx1", 0 ) - ROM_LOAD( "gs01.11f", 0x00000, 0x4000, CRC(b61ece9b) SHA1(eb3fc62644cc5b5a2b9cbe67c393d4a0e2a59ca9) ) /* Characters */ + ROM_REGION( 0x04000, "chars", 0 ) + ROM_LOAD( "gs01.11f", 0x00000, 0x4000, CRC(b61ece9b) SHA1(eb3fc62644cc5b5a2b9cbe67c393d4a0e2a59ca9) ) - ROM_REGION( 0x40000, "gfx2", 0 ) - ROM_LOAD( "gs13.06c", 0x00000, 0x8000, CRC(f6769fc5) SHA1(d192ec176425327ca4b7e25fc8432fc47837ba29) ) /* 32x32 tiles planes 2-3 */ + ROM_REGION( 0x40000, "tiles", 0 ) + ROM_LOAD( "gs13.06c", 0x00000, 0x8000, CRC(f6769fc5) SHA1(d192ec176425327ca4b7e25fc8432fc47837ba29) ) // 32x32 tiles planes 2-3 ROM_LOAD( "gs12.05c", 0x08000, 0x8000, CRC(d997b78c) SHA1(3b4a9b6f9e57ecfb4ab9734379bd0ee765fd6daa) ) ROM_LOAD( "gs11.04c", 0x10000, 0x8000, CRC(125ba58e) SHA1(cf6931653cebd051564bed8121ab8713a55095c5) ) ROM_LOAD( "gs10.02c", 0x18000, 0x8000, CRC(f469c13c) SHA1(54eda52d6fce58771c0adfe2c88292a41d5a9b99) ) - ROM_LOAD( "gs09.06a", 0x20000, 0x8000, CRC(539f182d) SHA1(4190c0adbecc57b92f4d002e121acb77e8c5d8d8) ) /* 32x32 tiles planes 0-1 */ + ROM_LOAD( "gs09.06a", 0x20000, 0x8000, CRC(539f182d) SHA1(4190c0adbecc57b92f4d002e121acb77e8c5d8d8) ) // 32x32 tiles planes 0-1 ROM_LOAD( "gs08.05a", 0x28000, 0x8000, CRC(e87e526d) SHA1(d10068addf30322424a85bbc6382cb762ae3fbe2) ) ROM_LOAD( "gs07.04a", 0x30000, 0x8000, CRC(4382c0d2) SHA1(8615e62bc57b40d082f6ca211d64f22185bed1fd) ) ROM_LOAD( "gs06.02a", 0x38000, 0x8000, CRC(4cafe7a6) SHA1(fe501f3a5e9ce9e82e9708f1cd297f4c94ef0f81) ) - ROM_REGION( 0x40000, "gfx3", 0 ) - ROM_LOAD( "gs22.06n", 0x00000, 0x8000, CRC(dc9c508c) SHA1(920505dd4c63b177918feb4e54cca8a7948ec9d9) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs21.04n", 0x08000, 0x8000, CRC(68883749) SHA1(c7bf2bf49c53feddf8f30b4001dc2d59b52b1c28) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs20.03n", 0x10000, 0x8000, CRC(0be932ed) SHA1(1c5af5884a23112dbc36579515d1cb497992da2f) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs19.01n", 0x18000, 0x8000, CRC(63072f93) SHA1(cb3a2729782cf2855558d081fe92d28366228b8e) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs18.06l", 0x20000, 0x8000, CRC(f69a3c7c) SHA1(e9eb9dfa7d53aa7b728150f91d05bfc3bf6f1e75) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs17.04l", 0x28000, 0x8000, CRC(4e98562a) SHA1(0341b8a79be1d71a57d0d76ed890e15f9f92259e) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs16.03l", 0x30000, 0x8000, CRC(0d99c3b3) SHA1(436c566b76f632242448671e3b6319f7d9f65322) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs15.01l", 0x38000, 0x8000, CRC(7f14270e) SHA1(dd06c333c2ea097e25185a1423cd61e1b7afc42b) ) /* Sprites planes 0-1 */ - - ROM_REGION( 0x8000, "gfx4", 0 ) /* background tilemaps */ + ROM_REGION( 0x40000, "sprites", 0 ) + ROM_LOAD( "gs22.06n", 0x00000, 0x8000, CRC(dc9c508c) SHA1(920505dd4c63b177918feb4e54cca8a7948ec9d9) ) // Sprites planes 2-3 + ROM_LOAD( "gs21.04n", 0x08000, 0x8000, CRC(68883749) SHA1(c7bf2bf49c53feddf8f30b4001dc2d59b52b1c28) ) // Sprites planes 2-3 + ROM_LOAD( "gs20.03n", 0x10000, 0x8000, CRC(0be932ed) SHA1(1c5af5884a23112dbc36579515d1cb497992da2f) ) // Sprites planes 2-3 + ROM_LOAD( "gs19.01n", 0x18000, 0x8000, CRC(63072f93) SHA1(cb3a2729782cf2855558d081fe92d28366228b8e) ) // Sprites planes 2-3 + ROM_LOAD( "gs18.06l", 0x20000, 0x8000, CRC(f69a3c7c) SHA1(e9eb9dfa7d53aa7b728150f91d05bfc3bf6f1e75) ) // Sprites planes 0-1 + ROM_LOAD( "gs17.04l", 0x28000, 0x8000, CRC(4e98562a) SHA1(0341b8a79be1d71a57d0d76ed890e15f9f92259e) ) // Sprites planes 0-1 + ROM_LOAD( "gs16.03l", 0x30000, 0x8000, CRC(0d99c3b3) SHA1(436c566b76f632242448671e3b6319f7d9f65322) ) // Sprites planes 0-1 + ROM_LOAD( "gs15.01l", 0x38000, 0x8000, CRC(7f14270e) SHA1(dd06c333c2ea097e25185a1423cd61e1b7afc42b) ) // Sprites planes 0-1 + + ROM_REGION( 0x8000, "bgtiles", 0 ) ROM_LOAD( "gs14.11c", 0x00000, 0x8000, CRC(0af4f7eb) SHA1(24a98fdeedeeaf1035b4af52d5a8dd5e47a5e62d) ) ROM_REGION( 0x0a00, "proms", 0 ) - ROM_LOAD( "g-01.03b", 0x0000, 0x0100, CRC(02f55589) SHA1(8a3f98304aedf3aba1c08b615bf457752a480edc) ) /* red component */ - ROM_LOAD( "g-02.04b", 0x0100, 0x0100, CRC(e1e36dd9) SHA1(5bd88a35898a2d973045bdde8311aac3a12826de) ) /* green component */ - ROM_LOAD( "g-03.05b", 0x0200, 0x0100, CRC(989399c0) SHA1(e408e391f49ed0c7b9e16479fea44b809440fefc) ) /* blue component */ - ROM_LOAD( "g-04.09d", 0x0300, 0x0100, CRC(906612b5) SHA1(7b727a6200c088538180758320ede84aa7e5b96d) ) /* char lookup table */ - ROM_LOAD( "g-06.14a", 0x0400, 0x0100, CRC(4a9da18b) SHA1(fed3b81b56aab2ed0a21ed1fcebe3f1ae095a13b) ) /* tile lookup table */ - ROM_LOAD( "g-07.15a", 0x0500, 0x0100, CRC(cb9394fc) SHA1(8ad0fde6a8ef8326d2da4b6dbf3b51f5f6c668c8) ) /* tile palette bank */ - ROM_LOAD( "g-09.09f", 0x0600, 0x0100, CRC(3cee181e) SHA1(3f95bdb12391cb9b3673191bda8d09c84b36b4d3) ) /* sprite lookup table */ - ROM_LOAD( "g-08.08f", 0x0700, 0x0100, CRC(ef91cdd2) SHA1(90b9191c9f10a153d64055a4238eb6e15b8c12bc) ) /* sprite palette bank */ - ROM_LOAD( "g-10.02j", 0x0800, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* video timing (not used) */ - ROM_LOAD( "g-05.01f", 0x0900, 0x0100, CRC(25c90c2a) SHA1(42893572bab757ec01e181fc418cb911638d37e0) ) /* priority? (not used) */ + ROM_LOAD( "g-01.03b", 0x0000, 0x0100, CRC(02f55589) SHA1(8a3f98304aedf3aba1c08b615bf457752a480edc) ) // red component + ROM_LOAD( "g-02.04b", 0x0100, 0x0100, CRC(e1e36dd9) SHA1(5bd88a35898a2d973045bdde8311aac3a12826de) ) // green component + ROM_LOAD( "g-03.05b", 0x0200, 0x0100, CRC(989399c0) SHA1(e408e391f49ed0c7b9e16479fea44b809440fefc) ) // blue component + ROM_LOAD( "g-04.09d", 0x0300, 0x0100, CRC(906612b5) SHA1(7b727a6200c088538180758320ede84aa7e5b96d) ) // char lookup table + ROM_LOAD( "g-06.14a", 0x0400, 0x0100, CRC(4a9da18b) SHA1(fed3b81b56aab2ed0a21ed1fcebe3f1ae095a13b) ) // tile lookup table + ROM_LOAD( "g-07.15a", 0x0500, 0x0100, CRC(cb9394fc) SHA1(8ad0fde6a8ef8326d2da4b6dbf3b51f5f6c668c8) ) // tile palette bank + ROM_LOAD( "g-09.09f", 0x0600, 0x0100, CRC(3cee181e) SHA1(3f95bdb12391cb9b3673191bda8d09c84b36b4d3) ) // sprite lookup table + ROM_LOAD( "g-08.08f", 0x0700, 0x0100, CRC(ef91cdd2) SHA1(90b9191c9f10a153d64055a4238eb6e15b8c12bc) ) // sprite palette bank + ROM_LOAD( "g-10.02j", 0x0800, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // video timing (not used) + ROM_LOAD( "g-05.01f", 0x0900, 0x0100, CRC(25c90c2a) SHA1(42893572bab757ec01e181fc418cb911638d37e0) ) // priority? (not used) ROM_END ROM_START( gunsmokeu ) - ROM_REGION( 0x20000, "maincpu", 0 ) - ROM_LOAD( "gsa_03.9n", 0x00000, 0x8000, CRC(51dc3f76) SHA1(2a188fee73c3662b665b56a825eb908b7b42dcd0) ) /* Code 0000-7fff */ - ROM_LOAD( "gs04.10n", 0x10000, 0x8000, CRC(5ecf31b8) SHA1(34ec9727330821a45b497c78c970a1a4f14ff4ee) ) /* Paged code */ - ROM_LOAD( "gs05.12n", 0x18000, 0x8000, CRC(1c9aca13) SHA1(eb92c373d2241aea4c59248e1b82717733105ac0) ) /* Paged code */ + ROM_REGION( 0x18000, "maincpu", 0 ) + ROM_LOAD( "gsa_03.9n", 0x00000, 0x8000, CRC(51dc3f76) SHA1(2a188fee73c3662b665b56a825eb908b7b42dcd0) ) // Code 0000-7fff + ROM_LOAD( "gs04.10n", 0x08000, 0x8000, CRC(5ecf31b8) SHA1(34ec9727330821a45b497c78c970a1a4f14ff4ee) ) // Paged code + ROM_LOAD( "gs05.12n", 0x10000, 0x8000, CRC(1c9aca13) SHA1(eb92c373d2241aea4c59248e1b82717733105ac0) ) // Paged code ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "gs02.14h", 0x00000, 0x8000, CRC(cd7a2c38) SHA1(c76c471f694b76015370f0eacf5350e652f526ff) ) - ROM_REGION( 0x04000, "gfx1", 0 ) - ROM_LOAD( "gs01.11f", 0x00000, 0x4000, CRC(b61ece9b) SHA1(eb3fc62644cc5b5a2b9cbe67c393d4a0e2a59ca9) ) /* Characters */ + ROM_REGION( 0x04000, "chars", 0 ) + ROM_LOAD( "gs01.11f", 0x00000, 0x4000, CRC(b61ece9b) SHA1(eb3fc62644cc5b5a2b9cbe67c393d4a0e2a59ca9) ) - ROM_REGION( 0x40000, "gfx2", 0 ) - ROM_LOAD( "gs13.06c", 0x00000, 0x8000, CRC(f6769fc5) SHA1(d192ec176425327ca4b7e25fc8432fc47837ba29) ) /* 32x32 tiles planes 2-3 */ + ROM_REGION( 0x40000, "tiles", 0 ) + ROM_LOAD( "gs13.06c", 0x00000, 0x8000, CRC(f6769fc5) SHA1(d192ec176425327ca4b7e25fc8432fc47837ba29) ) // 32x32 tiles planes 2-3 ROM_LOAD( "gs12.05c", 0x08000, 0x8000, CRC(d997b78c) SHA1(3b4a9b6f9e57ecfb4ab9734379bd0ee765fd6daa) ) ROM_LOAD( "gs11.04c", 0x10000, 0x8000, CRC(125ba58e) SHA1(cf6931653cebd051564bed8121ab8713a55095c5) ) ROM_LOAD( "gs10.02c", 0x18000, 0x8000, CRC(f469c13c) SHA1(54eda52d6fce58771c0adfe2c88292a41d5a9b99) ) - ROM_LOAD( "gs09.06a", 0x20000, 0x8000, CRC(539f182d) SHA1(4190c0adbecc57b92f4d002e121acb77e8c5d8d8) ) /* 32x32 tiles planes 0-1 */ + ROM_LOAD( "gs09.06a", 0x20000, 0x8000, CRC(539f182d) SHA1(4190c0adbecc57b92f4d002e121acb77e8c5d8d8) ) // 32x32 tiles planes 0-1 ROM_LOAD( "gs08.05a", 0x28000, 0x8000, CRC(e87e526d) SHA1(d10068addf30322424a85bbc6382cb762ae3fbe2) ) ROM_LOAD( "gs07.04a", 0x30000, 0x8000, CRC(4382c0d2) SHA1(8615e62bc57b40d082f6ca211d64f22185bed1fd) ) ROM_LOAD( "gs06.02a", 0x38000, 0x8000, CRC(4cafe7a6) SHA1(fe501f3a5e9ce9e82e9708f1cd297f4c94ef0f81) ) - ROM_REGION( 0x40000, "gfx3", 0 ) - ROM_LOAD( "gs22.06n", 0x00000, 0x8000, CRC(dc9c508c) SHA1(920505dd4c63b177918feb4e54cca8a7948ec9d9) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs21.04n", 0x08000, 0x8000, CRC(68883749) SHA1(c7bf2bf49c53feddf8f30b4001dc2d59b52b1c28) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs20.03n", 0x10000, 0x8000, CRC(0be932ed) SHA1(1c5af5884a23112dbc36579515d1cb497992da2f) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs19.01n", 0x18000, 0x8000, CRC(63072f93) SHA1(cb3a2729782cf2855558d081fe92d28366228b8e) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs18.06l", 0x20000, 0x8000, CRC(f69a3c7c) SHA1(e9eb9dfa7d53aa7b728150f91d05bfc3bf6f1e75) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs17.04l", 0x28000, 0x8000, CRC(4e98562a) SHA1(0341b8a79be1d71a57d0d76ed890e15f9f92259e) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs16.03l", 0x30000, 0x8000, CRC(0d99c3b3) SHA1(436c566b76f632242448671e3b6319f7d9f65322) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs15.01l", 0x38000, 0x8000, CRC(7f14270e) SHA1(dd06c333c2ea097e25185a1423cd61e1b7afc42b) ) /* Sprites planes 0-1 */ - - ROM_REGION( 0x8000, "gfx4", 0 ) /* background tilemaps */ + ROM_REGION( 0x40000, "sprites", 0 ) + ROM_LOAD( "gs22.06n", 0x00000, 0x8000, CRC(dc9c508c) SHA1(920505dd4c63b177918feb4e54cca8a7948ec9d9) ) // Sprites planes 2-3 + ROM_LOAD( "gs21.04n", 0x08000, 0x8000, CRC(68883749) SHA1(c7bf2bf49c53feddf8f30b4001dc2d59b52b1c28) ) // Sprites planes 2-3 + ROM_LOAD( "gs20.03n", 0x10000, 0x8000, CRC(0be932ed) SHA1(1c5af5884a23112dbc36579515d1cb497992da2f) ) // Sprites planes 2-3 + ROM_LOAD( "gs19.01n", 0x18000, 0x8000, CRC(63072f93) SHA1(cb3a2729782cf2855558d081fe92d28366228b8e) ) // Sprites planes 2-3 + ROM_LOAD( "gs18.06l", 0x20000, 0x8000, CRC(f69a3c7c) SHA1(e9eb9dfa7d53aa7b728150f91d05bfc3bf6f1e75) ) // Sprites planes 0-1 + ROM_LOAD( "gs17.04l", 0x28000, 0x8000, CRC(4e98562a) SHA1(0341b8a79be1d71a57d0d76ed890e15f9f92259e) ) // Sprites planes 0-1 + ROM_LOAD( "gs16.03l", 0x30000, 0x8000, CRC(0d99c3b3) SHA1(436c566b76f632242448671e3b6319f7d9f65322) ) // Sprites planes 0-1 + ROM_LOAD( "gs15.01l", 0x38000, 0x8000, CRC(7f14270e) SHA1(dd06c333c2ea097e25185a1423cd61e1b7afc42b) ) // Sprites planes 0-1 + + ROM_REGION( 0x8000, "bgtiles", 0 ) ROM_LOAD( "gs14.11c", 0x00000, 0x8000, CRC(0af4f7eb) SHA1(24a98fdeedeeaf1035b4af52d5a8dd5e47a5e62d) ) ROM_REGION( 0x0a00, "proms", 0 ) - ROM_LOAD( "g-01.03b", 0x0000, 0x0100, CRC(02f55589) SHA1(8a3f98304aedf3aba1c08b615bf457752a480edc) ) /* red component */ - ROM_LOAD( "g-02.04b", 0x0100, 0x0100, CRC(e1e36dd9) SHA1(5bd88a35898a2d973045bdde8311aac3a12826de) ) /* green component */ - ROM_LOAD( "g-03.05b", 0x0200, 0x0100, CRC(989399c0) SHA1(e408e391f49ed0c7b9e16479fea44b809440fefc) ) /* blue component */ - ROM_LOAD( "g-04.09d", 0x0300, 0x0100, CRC(906612b5) SHA1(7b727a6200c088538180758320ede84aa7e5b96d) ) /* char lookup table */ - ROM_LOAD( "g-06.14a", 0x0400, 0x0100, CRC(4a9da18b) SHA1(fed3b81b56aab2ed0a21ed1fcebe3f1ae095a13b) ) /* tile lookup table */ - ROM_LOAD( "g-07.15a", 0x0500, 0x0100, CRC(cb9394fc) SHA1(8ad0fde6a8ef8326d2da4b6dbf3b51f5f6c668c8) ) /* tile palette bank */ - ROM_LOAD( "g-09.09f", 0x0600, 0x0100, CRC(3cee181e) SHA1(3f95bdb12391cb9b3673191bda8d09c84b36b4d3) ) /* sprite lookup table */ - ROM_LOAD( "g-08.08f", 0x0700, 0x0100, CRC(ef91cdd2) SHA1(90b9191c9f10a153d64055a4238eb6e15b8c12bc) ) /* sprite palette bank */ - ROM_LOAD( "g-10.02j", 0x0800, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* video timing (not used) */ - ROM_LOAD( "g-05.01f", 0x0900, 0x0100, CRC(25c90c2a) SHA1(42893572bab757ec01e181fc418cb911638d37e0) ) /* priority? (not used) */ + ROM_LOAD( "g-01.03b", 0x0000, 0x0100, CRC(02f55589) SHA1(8a3f98304aedf3aba1c08b615bf457752a480edc) ) // red component + ROM_LOAD( "g-02.04b", 0x0100, 0x0100, CRC(e1e36dd9) SHA1(5bd88a35898a2d973045bdde8311aac3a12826de) ) // green component + ROM_LOAD( "g-03.05b", 0x0200, 0x0100, CRC(989399c0) SHA1(e408e391f49ed0c7b9e16479fea44b809440fefc) ) // blue component + ROM_LOAD( "g-04.09d", 0x0300, 0x0100, CRC(906612b5) SHA1(7b727a6200c088538180758320ede84aa7e5b96d) ) // char lookup table + ROM_LOAD( "g-06.14a", 0x0400, 0x0100, CRC(4a9da18b) SHA1(fed3b81b56aab2ed0a21ed1fcebe3f1ae095a13b) ) // tile lookup table + ROM_LOAD( "g-07.15a", 0x0500, 0x0100, CRC(cb9394fc) SHA1(8ad0fde6a8ef8326d2da4b6dbf3b51f5f6c668c8) ) // tile palette bank + ROM_LOAD( "g-09.09f", 0x0600, 0x0100, CRC(3cee181e) SHA1(3f95bdb12391cb9b3673191bda8d09c84b36b4d3) ) // sprite lookup table + ROM_LOAD( "g-08.08f", 0x0700, 0x0100, CRC(ef91cdd2) SHA1(90b9191c9f10a153d64055a4238eb6e15b8c12bc) ) // sprite palette bank + ROM_LOAD( "g-10.02j", 0x0800, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // video timing (not used) + ROM_LOAD( "g-05.01f", 0x0900, 0x0100, CRC(25c90c2a) SHA1(42893572bab757ec01e181fc418cb911638d37e0) ) // priority? (not used) ROM_END ROM_START( gunsmokeua ) - ROM_REGION( 0x20000, "maincpu", 0 ) // has a small extra piece of code at 0x2f00 and a jump to it at 0x297b, otherwise the same as gunsmokeub including the datecode, chip had an 'A' stamped on it, bugfix? - ROM_LOAD( "gsr_03a.9n", 0x00000, 0x8000, CRC(2f6e6ad7) SHA1(e9e4a367c240a35a1ba2eeaec9458996f7926f16) ) /* Code 0000-7fff */ - ROM_LOAD( "gs04.10n", 0x10000, 0x8000, CRC(8d4b423f) SHA1(149274c2ed1526ca1f419fdf8a24059ff138f7f2) ) /* Paged code */ - ROM_LOAD( "gs05.12n", 0x18000, 0x8000, CRC(2b5667fb) SHA1(5b689bca1e76d803b4cae22feaa7744fa528e93f) ) /* Paged code */ + ROM_REGION( 0x18000, "maincpu", 0 ) // has a small extra piece of code at 0x2f00 and a jump to it at 0x297b, otherwise the same as gunsmokeub including the datecode, chip had an 'A' stamped on it, bugfix? + ROM_LOAD( "gsr_03a.9n", 0x00000, 0x8000, CRC(2f6e6ad7) SHA1(e9e4a367c240a35a1ba2eeaec9458996f7926f16) ) // Code 0000-7fff + ROM_LOAD( "gs04.10n", 0x08000, 0x8000, CRC(8d4b423f) SHA1(149274c2ed1526ca1f419fdf8a24059ff138f7f2) ) // Paged code + ROM_LOAD( "gs05.12n", 0x10000, 0x8000, CRC(2b5667fb) SHA1(5b689bca1e76d803b4cae22feaa7744fa528e93f) ) // Paged code ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "gs02.14h", 0x00000, 0x8000, CRC(cd7a2c38) SHA1(c76c471f694b76015370f0eacf5350e652f526ff) ) - ROM_REGION( 0x04000, "gfx1", 0 ) - ROM_LOAD( "gs01.11f", 0x00000, 0x4000, CRC(b61ece9b) SHA1(eb3fc62644cc5b5a2b9cbe67c393d4a0e2a59ca9) ) /* Characters */ + ROM_REGION( 0x04000, "chars", 0 ) + ROM_LOAD( "gs01.11f", 0x00000, 0x4000, CRC(b61ece9b) SHA1(eb3fc62644cc5b5a2b9cbe67c393d4a0e2a59ca9) ) - ROM_REGION( 0x40000, "gfx2", 0 ) - ROM_LOAD( "gs13.06c", 0x00000, 0x8000, CRC(f6769fc5) SHA1(d192ec176425327ca4b7e25fc8432fc47837ba29) ) /* 32x32 tiles planes 2-3 */ + ROM_REGION( 0x40000, "tiles", 0 ) + ROM_LOAD( "gs13.06c", 0x00000, 0x8000, CRC(f6769fc5) SHA1(d192ec176425327ca4b7e25fc8432fc47837ba29) ) // 32x32 tiles planes 2-3 ROM_LOAD( "gs12.05c", 0x08000, 0x8000, CRC(d997b78c) SHA1(3b4a9b6f9e57ecfb4ab9734379bd0ee765fd6daa) ) ROM_LOAD( "gs11.04c", 0x10000, 0x8000, CRC(125ba58e) SHA1(cf6931653cebd051564bed8121ab8713a55095c5) ) ROM_LOAD( "gs10.02c", 0x18000, 0x8000, CRC(f469c13c) SHA1(54eda52d6fce58771c0adfe2c88292a41d5a9b99) ) - ROM_LOAD( "gs09.06a", 0x20000, 0x8000, CRC(539f182d) SHA1(4190c0adbecc57b92f4d002e121acb77e8c5d8d8) ) /* 32x32 tiles planes 0-1 */ + ROM_LOAD( "gs09.06a", 0x20000, 0x8000, CRC(539f182d) SHA1(4190c0adbecc57b92f4d002e121acb77e8c5d8d8) ) // 32x32 tiles planes 0-1 ROM_LOAD( "gs08.05a", 0x28000, 0x8000, CRC(e87e526d) SHA1(d10068addf30322424a85bbc6382cb762ae3fbe2) ) ROM_LOAD( "gs07.04a", 0x30000, 0x8000, CRC(4382c0d2) SHA1(8615e62bc57b40d082f6ca211d64f22185bed1fd) ) ROM_LOAD( "gs06.02a", 0x38000, 0x8000, CRC(4cafe7a6) SHA1(fe501f3a5e9ce9e82e9708f1cd297f4c94ef0f81) ) - ROM_REGION( 0x40000, "gfx3", 0 ) - ROM_LOAD( "gs22.06n", 0x00000, 0x8000, CRC(dc9c508c) SHA1(920505dd4c63b177918feb4e54cca8a7948ec9d9) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs21.04n", 0x08000, 0x8000, CRC(68883749) SHA1(c7bf2bf49c53feddf8f30b4001dc2d59b52b1c28) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs20.03n", 0x10000, 0x8000, CRC(0be932ed) SHA1(1c5af5884a23112dbc36579515d1cb497992da2f) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs19.01n", 0x18000, 0x8000, CRC(63072f93) SHA1(cb3a2729782cf2855558d081fe92d28366228b8e) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs18.06l", 0x20000, 0x8000, CRC(f69a3c7c) SHA1(e9eb9dfa7d53aa7b728150f91d05bfc3bf6f1e75) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs17.04l", 0x28000, 0x8000, CRC(4e98562a) SHA1(0341b8a79be1d71a57d0d76ed890e15f9f92259e) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs16.03l", 0x30000, 0x8000, CRC(0d99c3b3) SHA1(436c566b76f632242448671e3b6319f7d9f65322) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs15.01l", 0x38000, 0x8000, CRC(7f14270e) SHA1(dd06c333c2ea097e25185a1423cd61e1b7afc42b) ) /* Sprites planes 0-1 */ - - ROM_REGION( 0x8000, "gfx4", 0 ) /* background tilemaps */ + ROM_REGION( 0x40000, "sprites", 0 ) + ROM_LOAD( "gs22.06n", 0x00000, 0x8000, CRC(dc9c508c) SHA1(920505dd4c63b177918feb4e54cca8a7948ec9d9) ) // Sprites planes 2-3 + ROM_LOAD( "gs21.04n", 0x08000, 0x8000, CRC(68883749) SHA1(c7bf2bf49c53feddf8f30b4001dc2d59b52b1c28) ) // Sprites planes 2-3 + ROM_LOAD( "gs20.03n", 0x10000, 0x8000, CRC(0be932ed) SHA1(1c5af5884a23112dbc36579515d1cb497992da2f) ) // Sprites planes 2-3 + ROM_LOAD( "gs19.01n", 0x18000, 0x8000, CRC(63072f93) SHA1(cb3a2729782cf2855558d081fe92d28366228b8e) ) // Sprites planes 2-3 + ROM_LOAD( "gs18.06l", 0x20000, 0x8000, CRC(f69a3c7c) SHA1(e9eb9dfa7d53aa7b728150f91d05bfc3bf6f1e75) ) // Sprites planes 0-1 + ROM_LOAD( "gs17.04l", 0x28000, 0x8000, CRC(4e98562a) SHA1(0341b8a79be1d71a57d0d76ed890e15f9f92259e) ) // Sprites planes 0-1 + ROM_LOAD( "gs16.03l", 0x30000, 0x8000, CRC(0d99c3b3) SHA1(436c566b76f632242448671e3b6319f7d9f65322) ) // Sprites planes 0-1 + ROM_LOAD( "gs15.01l", 0x38000, 0x8000, CRC(7f14270e) SHA1(dd06c333c2ea097e25185a1423cd61e1b7afc42b) ) // Sprites planes 0-1 + + ROM_REGION( 0x8000, "bgtiles", 0 ) ROM_LOAD( "gs14.11c", 0x00000, 0x8000, CRC(0af4f7eb) SHA1(24a98fdeedeeaf1035b4af52d5a8dd5e47a5e62d) ) ROM_REGION( 0x0a00, "proms", 0 ) - ROM_LOAD( "g-01.03b", 0x0000, 0x0100, CRC(02f55589) SHA1(8a3f98304aedf3aba1c08b615bf457752a480edc) ) /* red component */ - ROM_LOAD( "g-02.04b", 0x0100, 0x0100, CRC(e1e36dd9) SHA1(5bd88a35898a2d973045bdde8311aac3a12826de) ) /* green component */ - ROM_LOAD( "g-03.05b", 0x0200, 0x0100, CRC(989399c0) SHA1(e408e391f49ed0c7b9e16479fea44b809440fefc) ) /* blue component */ - ROM_LOAD( "g-04.09d", 0x0300, 0x0100, CRC(906612b5) SHA1(7b727a6200c088538180758320ede84aa7e5b96d) ) /* char lookup table */ - ROM_LOAD( "g-06.14a", 0x0400, 0x0100, CRC(4a9da18b) SHA1(fed3b81b56aab2ed0a21ed1fcebe3f1ae095a13b) ) /* tile lookup table */ - ROM_LOAD( "g-07.15a", 0x0500, 0x0100, CRC(cb9394fc) SHA1(8ad0fde6a8ef8326d2da4b6dbf3b51f5f6c668c8) ) /* tile palette bank */ - ROM_LOAD( "g-09.09f", 0x0600, 0x0100, CRC(3cee181e) SHA1(3f95bdb12391cb9b3673191bda8d09c84b36b4d3) ) /* sprite lookup table */ - ROM_LOAD( "g-08.08f", 0x0700, 0x0100, CRC(ef91cdd2) SHA1(90b9191c9f10a153d64055a4238eb6e15b8c12bc) ) /* sprite palette bank */ - ROM_LOAD( "g-10.02j", 0x0800, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* video timing (not used) */ - ROM_LOAD( "g-05.01f", 0x0900, 0x0100, CRC(25c90c2a) SHA1(42893572bab757ec01e181fc418cb911638d37e0) ) /* priority? (not used) */ + ROM_LOAD( "g-01.03b", 0x0000, 0x0100, CRC(02f55589) SHA1(8a3f98304aedf3aba1c08b615bf457752a480edc) ) // red component + ROM_LOAD( "g-02.04b", 0x0100, 0x0100, CRC(e1e36dd9) SHA1(5bd88a35898a2d973045bdde8311aac3a12826de) ) // green component + ROM_LOAD( "g-03.05b", 0x0200, 0x0100, CRC(989399c0) SHA1(e408e391f49ed0c7b9e16479fea44b809440fefc) ) // blue component + ROM_LOAD( "g-04.09d", 0x0300, 0x0100, CRC(906612b5) SHA1(7b727a6200c088538180758320ede84aa7e5b96d) ) // char lookup table + ROM_LOAD( "g-06.14a", 0x0400, 0x0100, CRC(4a9da18b) SHA1(fed3b81b56aab2ed0a21ed1fcebe3f1ae095a13b) ) // tile lookup table + ROM_LOAD( "g-07.15a", 0x0500, 0x0100, CRC(cb9394fc) SHA1(8ad0fde6a8ef8326d2da4b6dbf3b51f5f6c668c8) ) // tile palette bank + ROM_LOAD( "g-09.09f", 0x0600, 0x0100, CRC(3cee181e) SHA1(3f95bdb12391cb9b3673191bda8d09c84b36b4d3) ) // sprite lookup table + ROM_LOAD( "g-08.08f", 0x0700, 0x0100, CRC(ef91cdd2) SHA1(90b9191c9f10a153d64055a4238eb6e15b8c12bc) ) // sprite palette bank + ROM_LOAD( "g-10.02j", 0x0800, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // video timing (not used) + ROM_LOAD( "g-05.01f", 0x0900, 0x0100, CRC(25c90c2a) SHA1(42893572bab757ec01e181fc418cb911638d37e0) ) // priority? (not used) ROM_END ROM_START( gunsmokeub ) - ROM_REGION( 0x20000, "maincpu", 0 ) - ROM_LOAD( "gsr_03.9n", 0x00000, 0x8000, CRC(592f211b) SHA1(8de44b3cafa3d2ce9aba515cf3ec4bac0bcdeb5b) ) /* Code 0000-7fff */ - ROM_LOAD( "gs04.10n", 0x10000, 0x8000, CRC(8d4b423f) SHA1(149274c2ed1526ca1f419fdf8a24059ff138f7f2) ) /* Paged code */ - ROM_LOAD( "gs05.12n", 0x18000, 0x8000, CRC(2b5667fb) SHA1(5b689bca1e76d803b4cae22feaa7744fa528e93f) ) /* Paged code */ + ROM_REGION( 0x18000, "maincpu", 0 ) + ROM_LOAD( "gsr_03.9n", 0x00000, 0x8000, CRC(592f211b) SHA1(8de44b3cafa3d2ce9aba515cf3ec4bac0bcdeb5b) ) // Code 0000-7fff + ROM_LOAD( "gs04.10n", 0x08000, 0x8000, CRC(8d4b423f) SHA1(149274c2ed1526ca1f419fdf8a24059ff138f7f2) ) // Paged code + ROM_LOAD( "gs05.12n", 0x10000, 0x8000, CRC(2b5667fb) SHA1(5b689bca1e76d803b4cae22feaa7744fa528e93f) ) // Paged code ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "gs02.14h", 0x00000, 0x8000, CRC(cd7a2c38) SHA1(c76c471f694b76015370f0eacf5350e652f526ff) ) - ROM_REGION( 0x04000, "gfx1", 0 ) - ROM_LOAD( "gs01.11f", 0x00000, 0x4000, CRC(b61ece9b) SHA1(eb3fc62644cc5b5a2b9cbe67c393d4a0e2a59ca9) ) /* Characters */ + ROM_REGION( 0x04000, "chars", 0 ) + ROM_LOAD( "gs01.11f", 0x00000, 0x4000, CRC(b61ece9b) SHA1(eb3fc62644cc5b5a2b9cbe67c393d4a0e2a59ca9) ) - ROM_REGION( 0x40000, "gfx2", 0 ) - ROM_LOAD( "gs13.06c", 0x00000, 0x8000, CRC(f6769fc5) SHA1(d192ec176425327ca4b7e25fc8432fc47837ba29) ) /* 32x32 tiles planes 2-3 */ + ROM_REGION( 0x40000, "tiles", 0 ) + ROM_LOAD( "gs13.06c", 0x00000, 0x8000, CRC(f6769fc5) SHA1(d192ec176425327ca4b7e25fc8432fc47837ba29) ) // 32x32 tiles planes 2-3 ROM_LOAD( "gs12.05c", 0x08000, 0x8000, CRC(d997b78c) SHA1(3b4a9b6f9e57ecfb4ab9734379bd0ee765fd6daa) ) ROM_LOAD( "gs11.04c", 0x10000, 0x8000, CRC(125ba58e) SHA1(cf6931653cebd051564bed8121ab8713a55095c5) ) ROM_LOAD( "gs10.02c", 0x18000, 0x8000, CRC(f469c13c) SHA1(54eda52d6fce58771c0adfe2c88292a41d5a9b99) ) - ROM_LOAD( "gs09.06a", 0x20000, 0x8000, CRC(539f182d) SHA1(4190c0adbecc57b92f4d002e121acb77e8c5d8d8) ) /* 32x32 tiles planes 0-1 */ + ROM_LOAD( "gs09.06a", 0x20000, 0x8000, CRC(539f182d) SHA1(4190c0adbecc57b92f4d002e121acb77e8c5d8d8) ) // 32x32 tiles planes 0-1 ROM_LOAD( "gs08.05a", 0x28000, 0x8000, CRC(e87e526d) SHA1(d10068addf30322424a85bbc6382cb762ae3fbe2) ) ROM_LOAD( "gs07.04a", 0x30000, 0x8000, CRC(4382c0d2) SHA1(8615e62bc57b40d082f6ca211d64f22185bed1fd) ) ROM_LOAD( "gs06.02a", 0x38000, 0x8000, CRC(4cafe7a6) SHA1(fe501f3a5e9ce9e82e9708f1cd297f4c94ef0f81) ) - ROM_REGION( 0x40000, "gfx3", 0 ) - ROM_LOAD( "gs22.06n", 0x00000, 0x8000, CRC(dc9c508c) SHA1(920505dd4c63b177918feb4e54cca8a7948ec9d9) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs21.04n", 0x08000, 0x8000, CRC(68883749) SHA1(c7bf2bf49c53feddf8f30b4001dc2d59b52b1c28) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs20.03n", 0x10000, 0x8000, CRC(0be932ed) SHA1(1c5af5884a23112dbc36579515d1cb497992da2f) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs19.01n", 0x18000, 0x8000, CRC(63072f93) SHA1(cb3a2729782cf2855558d081fe92d28366228b8e) ) /* Sprites planes 2-3 */ - ROM_LOAD( "gs18.06l", 0x20000, 0x8000, CRC(f69a3c7c) SHA1(e9eb9dfa7d53aa7b728150f91d05bfc3bf6f1e75) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs17.04l", 0x28000, 0x8000, CRC(4e98562a) SHA1(0341b8a79be1d71a57d0d76ed890e15f9f92259e) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs16.03l", 0x30000, 0x8000, CRC(0d99c3b3) SHA1(436c566b76f632242448671e3b6319f7d9f65322) ) /* Sprites planes 0-1 */ - ROM_LOAD( "gs15.01l", 0x38000, 0x8000, CRC(7f14270e) SHA1(dd06c333c2ea097e25185a1423cd61e1b7afc42b) ) /* Sprites planes 0-1 */ - - ROM_REGION( 0x8000, "gfx4", 0 ) /* background tilemaps */ + ROM_REGION( 0x40000, "sprites", 0 ) + ROM_LOAD( "gs22.06n", 0x00000, 0x8000, CRC(dc9c508c) SHA1(920505dd4c63b177918feb4e54cca8a7948ec9d9) ) // Sprites planes 2-3 + ROM_LOAD( "gs21.04n", 0x08000, 0x8000, CRC(68883749) SHA1(c7bf2bf49c53feddf8f30b4001dc2d59b52b1c28) ) // Sprites planes 2-3 + ROM_LOAD( "gs20.03n", 0x10000, 0x8000, CRC(0be932ed) SHA1(1c5af5884a23112dbc36579515d1cb497992da2f) ) // Sprites planes 2-3 + ROM_LOAD( "gs19.01n", 0x18000, 0x8000, CRC(63072f93) SHA1(cb3a2729782cf2855558d081fe92d28366228b8e) ) // Sprites planes 2-3 + ROM_LOAD( "gs18.06l", 0x20000, 0x8000, CRC(f69a3c7c) SHA1(e9eb9dfa7d53aa7b728150f91d05bfc3bf6f1e75) ) // Sprites planes 0-1 + ROM_LOAD( "gs17.04l", 0x28000, 0x8000, CRC(4e98562a) SHA1(0341b8a79be1d71a57d0d76ed890e15f9f92259e) ) // Sprites planes 0-1 + ROM_LOAD( "gs16.03l", 0x30000, 0x8000, CRC(0d99c3b3) SHA1(436c566b76f632242448671e3b6319f7d9f65322) ) // Sprites planes 0-1 + ROM_LOAD( "gs15.01l", 0x38000, 0x8000, CRC(7f14270e) SHA1(dd06c333c2ea097e25185a1423cd61e1b7afc42b) ) // Sprites planes 0-1 + + ROM_REGION( 0x8000, "bgtiles", 0 ) ROM_LOAD( "gs14.11c", 0x00000, 0x8000, CRC(0af4f7eb) SHA1(24a98fdeedeeaf1035b4af52d5a8dd5e47a5e62d) ) ROM_REGION( 0x0a00, "proms", 0 ) - ROM_LOAD( "g-01.03b", 0x0000, 0x0100, CRC(02f55589) SHA1(8a3f98304aedf3aba1c08b615bf457752a480edc) ) /* red component */ - ROM_LOAD( "g-02.04b", 0x0100, 0x0100, CRC(e1e36dd9) SHA1(5bd88a35898a2d973045bdde8311aac3a12826de) ) /* green component */ - ROM_LOAD( "g-03.05b", 0x0200, 0x0100, CRC(989399c0) SHA1(e408e391f49ed0c7b9e16479fea44b809440fefc) ) /* blue component */ - ROM_LOAD( "g-04.09d", 0x0300, 0x0100, CRC(906612b5) SHA1(7b727a6200c088538180758320ede84aa7e5b96d) ) /* char lookup table */ - ROM_LOAD( "g-06.14a", 0x0400, 0x0100, CRC(4a9da18b) SHA1(fed3b81b56aab2ed0a21ed1fcebe3f1ae095a13b) ) /* tile lookup table */ - ROM_LOAD( "g-07.15a", 0x0500, 0x0100, CRC(cb9394fc) SHA1(8ad0fde6a8ef8326d2da4b6dbf3b51f5f6c668c8) ) /* tile palette bank */ - ROM_LOAD( "g-09.09f", 0x0600, 0x0100, CRC(3cee181e) SHA1(3f95bdb12391cb9b3673191bda8d09c84b36b4d3) ) /* sprite lookup table */ - ROM_LOAD( "g-08.08f", 0x0700, 0x0100, CRC(ef91cdd2) SHA1(90b9191c9f10a153d64055a4238eb6e15b8c12bc) ) /* sprite palette bank */ - ROM_LOAD( "g-10.02j", 0x0800, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) /* video timing (not used) */ - ROM_LOAD( "g-05.01f", 0x0900, 0x0100, CRC(25c90c2a) SHA1(42893572bab757ec01e181fc418cb911638d37e0) ) /* priority? (not used) */ + ROM_LOAD( "g-01.03b", 0x0000, 0x0100, CRC(02f55589) SHA1(8a3f98304aedf3aba1c08b615bf457752a480edc) ) // red component + ROM_LOAD( "g-02.04b", 0x0100, 0x0100, CRC(e1e36dd9) SHA1(5bd88a35898a2d973045bdde8311aac3a12826de) ) // green component + ROM_LOAD( "g-03.05b", 0x0200, 0x0100, CRC(989399c0) SHA1(e408e391f49ed0c7b9e16479fea44b809440fefc) ) // blue component + ROM_LOAD( "g-04.09d", 0x0300, 0x0100, CRC(906612b5) SHA1(7b727a6200c088538180758320ede84aa7e5b96d) ) // char lookup table + ROM_LOAD( "g-06.14a", 0x0400, 0x0100, CRC(4a9da18b) SHA1(fed3b81b56aab2ed0a21ed1fcebe3f1ae095a13b) ) // tile lookup table + ROM_LOAD( "g-07.15a", 0x0500, 0x0100, CRC(cb9394fc) SHA1(8ad0fde6a8ef8326d2da4b6dbf3b51f5f6c668c8) ) // tile palette bank + ROM_LOAD( "g-09.09f", 0x0600, 0x0100, CRC(3cee181e) SHA1(3f95bdb12391cb9b3673191bda8d09c84b36b4d3) ) // sprite lookup table + ROM_LOAD( "g-08.08f", 0x0700, 0x0100, CRC(ef91cdd2) SHA1(90b9191c9f10a153d64055a4238eb6e15b8c12bc) ) // sprite palette bank + ROM_LOAD( "g-10.02j", 0x0800, 0x0100, CRC(0eaf5158) SHA1(bafd4108708f66cd7b280e47152b108f3e254fc9) ) // video timing (not used) + ROM_LOAD( "g-05.01f", 0x0900, 0x0100, CRC(25c90c2a) SHA1(42893572bab757ec01e181fc418cb911638d37e0) ) // priority? (not used) ROM_END ROM_START( gunsmokeg ) - ROM_REGION( 0x20000, "maincpu", 0 ) + ROM_REGION( 0x18000, "maincpu", 0 ) ROM_LOAD( "gsg03.09n", 0x00000, 0x8000, CRC(8ad2754e) SHA1(221309d4d76e49f9b80849630b2846fc2e3d72a1) ) // Code 0000-7fff - ROM_LOAD( "gs04.10n", 0x10000, 0x8000, CRC(8d4b423f) SHA1(149274c2ed1526ca1f419fdf8a24059ff138f7f2) ) // Paged code - ROM_LOAD( "gs05.12n", 0x18000, 0x8000, CRC(2b5667fb) SHA1(5b689bca1e76d803b4cae22feaa7744fa528e93f) ) // Paged code + ROM_LOAD( "gs04.10n", 0x08000, 0x8000, CRC(8d4b423f) SHA1(149274c2ed1526ca1f419fdf8a24059ff138f7f2) ) // Paged code + ROM_LOAD( "gs05.12n", 0x10000, 0x8000, CRC(2b5667fb) SHA1(5b689bca1e76d803b4cae22feaa7744fa528e93f) ) // Paged code ROM_REGION( 0x10000, "audiocpu", 0 ) ROM_LOAD( "gs02.14h", 0x00000, 0x8000, CRC(cd7a2c38) SHA1(c76c471f694b76015370f0eacf5350e652f526ff) ) - ROM_REGION( 0x04000, "gfx1", 0 ) + ROM_REGION( 0x04000, "chars", 0 ) ROM_LOAD( "gs01.11f", 0x00000, 0x4000, CRC(b61ece9b) SHA1(eb3fc62644cc5b5a2b9cbe67c393d4a0e2a59ca9) ) // Characters - ROM_REGION( 0x40000, "gfx2", 0 ) + ROM_REGION( 0x40000, "tiles", 0 ) ROM_LOAD( "gs13.06c", 0x00000, 0x8000, CRC(f6769fc5) SHA1(d192ec176425327ca4b7e25fc8432fc47837ba29) ) // 32x32 tiles planes 2-3 ROM_LOAD( "gs12.05c", 0x08000, 0x8000, CRC(d997b78c) SHA1(3b4a9b6f9e57ecfb4ab9734379bd0ee765fd6daa) ) ROM_LOAD( "gs11.04c", 0x10000, 0x8000, CRC(125ba58e) SHA1(cf6931653cebd051564bed8121ab8713a55095c5) ) @@ -663,7 +916,7 @@ ROM_START( gunsmokeg ) ROM_LOAD( "gs07.04a", 0x30000, 0x8000, CRC(4382c0d2) SHA1(8615e62bc57b40d082f6ca211d64f22185bed1fd) ) ROM_LOAD( "gsg06.02a", 0x38000, 0x8000, CRC(5cb850a7) SHA1(5b4fec3fae4d1947778c832c41f757414652f34a) ) - ROM_REGION( 0x40000, "gfx3", 0 ) + ROM_REGION( 0x40000, "sprites", 0 ) ROM_LOAD( "gsg22.06n", 0x00000, 0x8000, CRC(96779c38) SHA1(83f5811b7674e39fac6d127bcf2741a5ba111ec1) ) // Sprites planes 2-3 ROM_LOAD( "gsg21.04n", 0x08000, 0x8000, CRC(6e8a02c7) SHA1(8db5792ded8c6360e5a07f96b7799eae7591d719) ) // Sprites planes 2-3 ROM_LOAD( "gsg20.03n", 0x10000, 0x8000, CRC(139bf927) SHA1(f58bf8cffbc4e9e1a48c905d341f92a22df6cf37) ) // Sprites planes 2-3 @@ -673,7 +926,7 @@ ROM_START( gunsmokeg ) ROM_LOAD( "gsg16.03l", 0x30000, 0x8000, CRC(6620103b) SHA1(ef1260c05c958c115f54ddaffa213d320508ff11) ) // Sprites planes 0-1 ROM_LOAD( "gsg15.01l", 0x38000, 0x8000, CRC(ccc1c1b6) SHA1(feb480195bc4157d7be385b055bdd47505de6bc6) ) // Sprites planes 0-1 - ROM_REGION( 0x8000, "gfx4", 0 ) // Background tilemaps + ROM_REGION( 0x8000, "bgtiles", 0 ) ROM_LOAD( "gs14.11c", 0x00000, 0x8000, CRC(0af4f7eb) SHA1(24a98fdeedeeaf1035b4af52d5a8dd5e47a5e62d) ) ROM_REGION( 0x0a00, "proms", 0 ) @@ -689,16 +942,19 @@ ROM_START( gunsmokeg ) ROM_LOAD( "g-05.01f", 0x0900, 0x0100, CRC(25c90c2a) SHA1(42893572bab757ec01e181fc418cb911638d37e0) ) // Priority? (not used) ROM_END +} // anonymous namespace + + /* Game Drivers */ -// at 0x7E50 in the first rom is 85113 (project ident code?) and the project codename 'Gunman' both stored as ASCII. +// at 0x7E50 in the first ROM is 85113 (project ident code) and the project codename 'Gunman' both stored as ASCII. // Following that at (stored as raw data) is the build date in yyyymmdd format. After that a ROM identification string(?) which I've // left in the comment after each set. // this information is not displayed onscreen GAME( 1985, gunsmoke, 0, gunsmoke, gunsmoke, gunsmoke_state, empty_init, ROT270, "Capcom", "Gun.Smoke (World, 851115)", MACHINE_SUPPORTS_SAVE ) // GSE_03 -GAME( 1985, gunsmokeb, gunsmoke, gunsmoke, gunsmoke, gunsmoke_state, empty_init, ROT270, "bootleg", "Gun.Smoke (World, 851115) (bootleg)", MACHINE_SUPPORTS_SAVE ) // based on above version, warning message patched out +GAME( 1985, gunsmokeb, gunsmoke, gunsmoke, gunsmoke, gunsmoke_state, empty_init, ROT270, "bootleg", "Gun.Smoke (World, 851115) (bootleg)", MACHINE_SUPPORTS_SAVE ) // based on above version, warning message patched out GAME( 1985, gunsmokej, gunsmoke, gunsmoke, gunsmoke, gunsmoke_state, empty_init, ROT270, "Capcom", "Gun.Smoke (Japan, 851115)", MACHINE_SUPPORTS_SAVE ) // GSJ_03 GAME( 1986, gunsmokeu, gunsmoke, gunsmoke, gunsmokeu, gunsmoke_state, empty_init, ROT270, "Capcom (Romstar license)", "Gun.Smoke (US, 860408)", MACHINE_SUPPORTS_SAVE ) // GSA_03 GAME( 1985, gunsmokeua, gunsmoke, gunsmoke, gunsmoke, gunsmoke_state, empty_init, ROT270, "Capcom (Romstar license)", "Gun.Smoke (US, 851115, set 1)", MACHINE_SUPPORTS_SAVE ) // GSR_03 (03A on the chip) diff --git a/src/mame/includes/brkthru.h b/src/mame/includes/brkthru.h deleted file mode 100644 index 3a71938852a..00000000000 --- a/src/mame/includes/brkthru.h +++ /dev/null @@ -1,77 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Phil Stroffolino -/*************************************************************************** - - Break Thru - -***************************************************************************/ -#ifndef MAME_INCLUDES_BRKTRHU_H -#define MAME_INCLUDES_BRKTRHU_H - -#pragma once - -#include "machine/gen_latch.h" -#include "emupal.h" -#include "tilemap.h" - -class brkthru_state : public driver_device -{ -public: - brkthru_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_fg_videoram(*this, "fg_videoram"), - m_videoram(*this, "videoram"), - m_spriteram(*this, "spriteram"), - m_maincpu(*this, "maincpu"), - m_audiocpu(*this, "audiocpu"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette"), - m_soundlatch(*this, "soundlatch") - { } - - void brkthru(machine_config &config); - void darwin(machine_config &config); - DECLARE_INPUT_CHANGED_MEMBER(coin_inserted); - void init_brkthru(); - -private: - /* memory pointers */ - required_shared_ptr m_fg_videoram; - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - - /* video-related */ - tilemap_t *m_fg_tilemap = nullptr; - tilemap_t *m_bg_tilemap = nullptr; - int m_bgscroll = 0; - int m_bgbasecolor = 0; - int m_flipscreen = 0; - - /* devices */ - required_device m_maincpu; - required_device m_audiocpu; - required_device m_gfxdecode; - required_device m_palette; - required_device m_soundlatch; - - uint8_t m_nmi_mask = 0U; - void brkthru_1803_w(uint8_t data); - void darwin_0803_w(uint8_t data); - void brkthru_bgram_w(offs_t offset, uint8_t data); - void brkthru_fgram_w(offs_t offset, uint8_t data); - void brkthru_1800_w(offs_t offset, uint8_t data); - TILE_GET_INFO_MEMBER(get_bg_tile_info); - TILE_GET_INFO_MEMBER(get_fg_tile_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - void brkthru_palette(palette_device &palette) const; - uint32_t screen_update_brkthru(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - DECLARE_WRITE_LINE_MEMBER(vblank_irq); - void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int prio ); - void brkthru_map(address_map &map); - void darwin_map(address_map &map); - void sound_map(address_map &map); -}; - -#endif // MAME_INCLUDES_BRKTRHU_H diff --git a/src/mame/includes/gunsmoke.h b/src/mame/includes/gunsmoke.h deleted file mode 100644 index 2286814eee1..00000000000 --- a/src/mame/includes/gunsmoke.h +++ /dev/null @@ -1,68 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Paul Leaman -/************************************************************************* - - Gun.Smoke - -*************************************************************************/ -#ifndef MAME_INCLUDES_GUNSMOKE_H -#define MAME_INCLUDES_GUNSMOKE_H - -#pragma once - -#include "emupal.h" -#include "tilemap.h" - -class gunsmoke_state : public driver_device -{ -public: - gunsmoke_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_videoram(*this, "videoram"), - m_colorram(*this, "colorram"), - m_scrollx(*this, "scrollx"), - m_scrolly(*this, "scrolly"), - m_spriteram(*this, "spriteram"), - m_maincpu(*this, "maincpu"), - m_gfxdecode(*this, "gfxdecode"), - m_palette(*this, "palette") - { } - - void gunsmoke(machine_config &config); - -private: - /* memory pointers */ - required_shared_ptr m_videoram; - required_shared_ptr m_colorram; - required_shared_ptr m_scrollx; - required_shared_ptr m_scrolly; - required_shared_ptr m_spriteram; - - /* video-related */ - tilemap_t *m_bg_tilemap = nullptr; - tilemap_t *m_fg_tilemap = nullptr; - uint8_t m_chon = 0U; - uint8_t m_objon = 0U; - uint8_t m_bgon = 0U; - uint8_t m_sprite3bank = 0U; - uint8_t gunsmoke_protection_r(offs_t offset); - void gunsmoke_videoram_w(offs_t offset, uint8_t data); - void gunsmoke_colorram_w(offs_t offset, uint8_t data); - void gunsmoke_c804_w(uint8_t data); - void gunsmoke_d806_w(uint8_t data); - TILE_GET_INFO_MEMBER(get_bg_tile_info); - TILE_GET_INFO_MEMBER(get_fg_tile_info); - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - void gunsmoke_palette(palette_device &palette) const; - uint32_t screen_update_gunsmoke(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ); - required_device m_maincpu; - required_device m_gfxdecode; - required_device m_palette; - void gunsmoke_map(address_map &map); - void sound_map(address_map &map); -}; - -#endif // MAME_INCLUDES_GUNSMOKE_H diff --git a/src/mame/video/bfm_adr2.cpp b/src/mame/video/bfm_adr2.cpp index fbe1333bdff..43784a6baf2 100644 --- a/src/mame/video/bfm_adr2.cpp +++ b/src/mame/video/bfm_adr2.cpp @@ -34,7 +34,7 @@ A000-BFFF |R/W| D D D D D D D D | ?window into character RAM/ROM? -----------+---+-----------------+----------------------------------------- C000-DFFF |?/W| D D D D D D D D | I/O registers C000 | W | ? ? ? ? ? ? D D | program ROM page select - controls what portion of the eprom is + controls what portion of the EPROM is mapped at 0000 - 7FFFF ______________________________________ @@ -93,124 +93,80 @@ E000-FFFF | R | D D D D D D D D | 8K ROM ***************************************************************************/ #include "emu.h" + #include "video/bfm_adr2.h" #include "cpu/m6809/m6809.h" #include "machine/bfm_bd1.h" // vfd + #include "emupal.h" #include "screen.h" -#ifdef MAME_DEBUG -#define VERBOSE 1 -#else -#define VERBOSE 0 -#endif - -#define LOG_CTRL(x) do { if (VERBOSE) logerror x; } while (0) - -// local vars ///////////////////////////////////////////////////////////// +// configurable logging +#define LOG_CTRL (1U << 1) +#define LOG_C001 (1U << 2) +#define LOG_SERIAL (1U << 3) -#define SL_DISPLAY 0x02 // displayed Adder screen, 1=screen1 0=screen0 -#define SL_ACCESS 0x01 // accessable Adder screen, 1=screen1 0=screen0 +//#define VERBOSE (LOG_GENERAL | LOG_CTRL | LOG_C001 | LOG_SERIAL) -#define ADDER_CLOCK (XTAL(8'000'000)) +#include "logmacro.h" +#define LOGCTRL(...) LOGMASKED(LOG_CTRL, __VA_ARGS__) +#define LOGC001(...) LOGMASKED(LOG_C001, __VA_ARGS__) +#define LOGSERIAL(...) LOGMASKED(LOG_SERIAL, __VA_ARGS__) -static const gfx_layout charlayout = -{ - 8,8, // 8 * 8 characters - 8192, // 8192 characters - 4, // 4 bits per pixel - { 0,1,2,3 }, - { 0*4, 1*4, 2*4, 3*4, 4*4, 5*4, 6*4, 7*4 }, - { 0*8*4, 1*8*4, 2*8*4, 3*8*4, 4*8*4, 5*8*4, 6*8*4, 7*8*4 }, - 8*8*4 -}; - // this is a strange beast !!!! // // characters are grouped by 64 (512 pixels) // there are max 128 of these groups -static GFXDECODE_START( gfx_adder2 ) - GFXDECODE_ENTRY( ":gfx1", 0, charlayout, 0, 16 ) +GFXDECODE_MEMBER( bfm_adder2_device::gfxinfo ) + GFXDECODE_DEVICE( "tiles", 0, gfx_8x8x4_packed_msb, 0, 16 ) GFXDECODE_END DEFINE_DEVICE_TYPE(BFM_ADDER2, bfm_adder2_device, "bfm_adder2", "BFM ADDER2") bfm_adder2_device::bfm_adder2_device( const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock ) : device_t(mconfig, BFM_ADDER2, tag, owner, clock) - , device_gfx_interface(mconfig, *this, gfx_adder2, "palette") - , m_cpu(*this, "adder2") + , device_gfx_interface(mconfig, *this, gfxinfo, "palette") + , m_cpu(*this, "cpu") + , m_screen_ram(*this, "screen_ram%u", 0U) + , m_screen_ram_view(*this, "screen_ram_view") + , m_rombank(*this, "rombank") { } -/////////////////////////////////////////////////////////////////////////// - -TILE_GET_INFO_MEMBER( bfm_adder2_device::get_tile0_info ) -{ - short data; - int code, color, flags,x,y; - - y = tile_index / 50; - x = tile_index - (y*50); - - tile_index = y * 128 + (x * 2); - - data = m_screen_ram[0][tile_index ]<<8; - data |= m_screen_ram[0][tile_index + 1]; - - code = data & 0x1FFF; - color = 0; - flags = ((data & 0x4000)?TILE_FLIPY:0) | - ((data & 0x2000)?TILE_FLIPX:0); - - tileinfo.set(0, code, color, flags); -} - -/////////////////////////////////////////////////////////////////////////// -TILE_GET_INFO_MEMBER( bfm_adder2_device::get_tile1_info ) +template +TILE_GET_INFO_MEMBER(bfm_adder2_device::get_tile_info) { - short data; - int code, color, flags,x,y; - - y = tile_index / 50; - x = tile_index - (y*50); + int y = tile_index / 50; + int x = tile_index - (y * 50); tile_index = y * 128 + (x * 2); - data = m_screen_ram[1][tile_index ]<<8; - data |= m_screen_ram[1][tile_index + 1]; + short data = m_screen_ram[Which][tile_index] << 8; + data |= m_screen_ram[Which][tile_index + 1]; - code = data & 0x1FFF; - color = 0; - flags = ((data & 0x4000)?TILE_FLIPY:0) | - ((data & 0x2000)?TILE_FLIPX:0); + int code = data & 0x1fff; + int color = 0; + int flags = ((data & 0x4000) ? TILE_FLIPY : 0) | ((data & 0x2000) ? TILE_FLIPX : 0); tileinfo.set(0, code, color, flags); } -// video initialisation /////////////////////////////////////////////////// void bfm_adder2_device::device_reset() { - m_screen_page_reg = 0; - m_c101 = 0; - m_rx = 0; - m_vbl_triggered = false; - m_acia_triggered = false; - m_data_from_sc2 = 0; - m_data_to_sc2 = 0; - - { - uint8_t *rom = machine().root_device().memregion("adder2")->base(); - - membank("bank2")->configure_entries(0, 4, &rom[0x00000], 0x08000); - - membank("bank2")->set_entry(0&0x03); - } + m_screen_page_reg = 0; + m_c101 = 0; + m_vbl_triggered = false; + m_acia_triggered = false; + m_data_from_sc2 = 0; + m_data_to_sc2 = 0; + + m_rombank->configure_entries(0, 4, memregion("cpu")->base(), 0x08000); } void bfm_adder2_device::device_start() @@ -218,58 +174,52 @@ void bfm_adder2_device::device_start() if (!palette().device().started()) throw device_missing_dependencies(); - adder2_decode_char_roms(); + m_screen_ram_view.select(0); + + decode_char_roms(); save_item(NAME(m_screen_page_reg)); save_item(NAME(m_c101)); - save_item(NAME(m_rx)); save_item(NAME(m_vbl_triggered)); save_item(NAME(m_acia_triggered)); save_item(NAME(m_data_from_sc2)); save_item(NAME(m_data_to_sc2)); - save_item(NAME(m_adder_ram)); - save_item(NAME(m_screen_ram)); - - m_tilemap0 = &machine().tilemap().create(*this, tilemap_get_info_delegate(*this, FUNC(bfm_adder2_device::get_tile0_info)), TILEMAP_SCAN_ROWS, 8, 8, 50, 35); - - m_tilemap1 = &machine().tilemap().create(*this, tilemap_get_info_delegate(*this, FUNC(bfm_adder2_device::get_tile1_info)), TILEMAP_SCAN_ROWS, 8, 8, 50, 35); - - palette().set_pen_color(0,rgb_t(0x00,0x00,0x00)); - palette().set_pen_color(1,rgb_t(0x00,0x00,0xFF)); - palette().set_pen_color(2,rgb_t(0x00,0xFF,0x00)); - palette().set_pen_color(3,rgb_t(0x00,0xFF,0xFF)); - palette().set_pen_color(4,rgb_t(0xFF,0x00,0x00)); - palette().set_pen_color(5,rgb_t(0xFF,0x00,0xFF)); - palette().set_pen_color(6,rgb_t(0xFF,0xFF,0x00)); - palette().set_pen_color(7,rgb_t(0xFF,0xFF,0xFF)); - palette().set_pen_color(8,rgb_t(0x80,0x80,0x80)); - palette().set_pen_color(9,rgb_t(0x00,0x00,0x80)); - palette().set_pen_color(10,rgb_t(0x00,0x80,0x00)); - palette().set_pen_color(11,rgb_t(0x00,0x80,0x80)); - palette().set_pen_color(12,rgb_t(0x80,0x00,0x00)); - palette().set_pen_color(13,rgb_t(0x80,0x00,0x80)); - palette().set_pen_color(14,rgb_t(0x80,0x80,0x00)); - palette().set_pen_color(15,rgb_t(0x80,0x80,0x80)); + m_tilemap[0] = &machine().tilemap().create(*this, tilemap_get_info_delegate(*this, FUNC(bfm_adder2_device::get_tile_info<0>)), TILEMAP_SCAN_ROWS, 8, 8, 50, 35); + + m_tilemap[1] = &machine().tilemap().create(*this, tilemap_get_info_delegate(*this, FUNC(bfm_adder2_device::get_tile_info<1>)), TILEMAP_SCAN_ROWS, 8, 8, 50, 35); + + palette().set_pen_color(0, rgb_t(0x00, 0x00, 0x00)); + palette().set_pen_color(1, rgb_t(0x00, 0x00, 0xff)); + palette().set_pen_color(2, rgb_t(0x00, 0xff, 0x00)); + palette().set_pen_color(3, rgb_t(0x00, 0xff, 0xff)); + palette().set_pen_color(4, rgb_t(0xff, 0x00, 0x00)); + palette().set_pen_color(5, rgb_t(0xff, 0x00, 0xff)); + palette().set_pen_color(6, rgb_t(0xff, 0xff, 0x00)); + palette().set_pen_color(7, rgb_t(0xff, 0xff, 0xff)); + palette().set_pen_color(8, rgb_t(0x80, 0x80, 0x80)); + palette().set_pen_color(9, rgb_t(0x00, 0x00, 0x80)); + palette().set_pen_color(10 ,rgb_t(0x00, 0x80, 0x00)); + palette().set_pen_color(11, rgb_t(0x00, 0x80, 0x80)); + palette().set_pen_color(12, rgb_t(0x80, 0x00, 0x00)); + palette().set_pen_color(13, rgb_t(0x80, 0x00, 0x80)); + palette().set_pen_color(14, rgb_t(0x80, 0x80, 0x00)); + palette().set_pen_color(15, rgb_t(0x80, 0x80, 0x80)); } -// video update /////////////////////////////////////////////////////////// -uint32_t bfm_adder2_device::update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) + +uint32_t bfm_adder2_device::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - const rectangle visible1(0, 400-1, 0, 280-1); //minx,maxx, miny,maxy + const rectangle visible1(0, 400 - 1, 0, 280 - 1); //minx, maxx, miny, maxy - if (m_screen_page_reg & SL_DISPLAY) - m_tilemap1->draw(screen, bitmap, visible1, 0, 0); - else - m_tilemap0->draw(screen, bitmap, visible1, 0, 0); + m_tilemap[BIT(m_screen_page_reg, 1)]->draw(screen, bitmap, visible1, 0, 0); return 0; } -/////////////////////////////////////////////////////////////////////////// -WRITE_LINE_MEMBER(bfm_adder2_device::adder2_vbl_w) +WRITE_LINE_MEMBER(bfm_adder2_device::vbl_w) { if (state && BIT(m_c101, 0)) { @@ -278,147 +228,105 @@ WRITE_LINE_MEMBER(bfm_adder2_device::adder2_vbl_w) } } -/////////////////////////////////////////////////////////////////////////// - -uint8_t bfm_adder2_device::screen_ram_r(offs_t offset) -{ - return m_screen_page_reg & SL_ACCESS ? m_screen_ram[1][offset]:m_screen_ram[0][offset]; -} - -/////////////////////////////////////////////////////////////////////////// +template void bfm_adder2_device::screen_ram_w(offs_t offset, uint8_t data) { - int dirty_off = (offset>>7)*50 + ((offset & 0x7F)>>1); - - if ( offset > 102 && offset < 102+1+16 ) - { // format xxxrrggb //////////////////////////////////////////////////// - int pal; - uint8_t r,g,b; + int dirty_off = (offset >> 7) * 50 + ((offset & 0x7f) >> 1); - pal = offset-102-1; + if (offset > 102 && offset < 102 + 1 + 16) + { // format xxxrrggb + int pal = offset - 102 - 1; - r = ((data & 0x18)>>3) * 85; // 00011000b = 0x18 - g = ((data & 0x06)>>1) * 85; // 00000110b = 0x06 - b = ((data & 0x01) ) * 255; - palette().set_pen_color(pal, rgb_t(r,g,b)); - } - - if (m_screen_page_reg & SL_ACCESS) - { - m_screen_ram[1][offset] = data; - m_tilemap1->mark_tile_dirty(dirty_off); + uint8_t r = ((data & 0x18) >> 3) * 85; // 00011000b = 0x18 + uint8_t g = ((data & 0x06) >> 1) * 85; // 00000110b = 0x06 + uint8_t b = (data & 0x01) * 255; + palette().set_pen_color(pal, rgb_t(r, g, b)); } - else - { - m_screen_ram[0][offset] = data; - m_tilemap0->mark_tile_dirty(dirty_off); - } + m_screen_ram[Which][offset] = data; + m_tilemap[Which]->mark_tile_dirty(dirty_off); } -/////////////////////////////////////////////////////////////////////////// -uint8_t bfm_adder2_device::normal_ram_r(offs_t offset) +void bfm_adder2_device::rom_page_w(uint8_t data) { - return m_adder_ram[offset]; + m_rombank->set_entry(data & 0x03); } -/////////////////////////////////////////////////////////////////////////// -void bfm_adder2_device::normal_ram_w(offs_t offset, uint8_t data) +void bfm_adder2_device::c001_w(uint8_t data) { - m_adder_ram[offset] = data; -} - -/////////////////////////////////////////////////////////////////////////// - -void bfm_adder2_device::adder2_rom_page_w(uint8_t data) -{ - membank("bank2")->set_entry(data&0x03); -} - -/////////////////////////////////////////////////////////////////////////// - -void bfm_adder2_device::adder2_c001_w(uint8_t data) -{ - logerror("c101 = %02X\n",data); + LOGC001("c001 = %02X\n", data); //m_screen_page_reg = 0; } -/////////////////////////////////////////////////////////////////////////// -void bfm_adder2_device::adder2_screen_page_w(uint8_t data) +void bfm_adder2_device::screen_page_w(uint8_t data) { m_screen_page_reg = data; + m_screen_ram_view.select(BIT(m_screen_page_reg, 0)); } -/////////////////////////////////////////////////////////////////////////// -uint8_t bfm_adder2_device::adder2_vbl_ctrl_r() +uint8_t bfm_adder2_device::vbl_ctrl_r() { m_vbl_triggered = false; // clear VBL start IRQ return m_c101; } -/////////////////////////////////////////////////////////////////////////// -void bfm_adder2_device::adder2_vbl_ctrl_w(uint8_t data) +void bfm_adder2_device::vbl_ctrl_w(uint8_t data) { m_c101 = data; } -/////////////////////////////////////////////////////////////////////////// -uint8_t bfm_adder2_device::adder2_uart_ctrl_r() +uint8_t bfm_adder2_device::uart_ctrl_r() { int status = 0; if (m_data_from_sc2) status |= 0x01; // receive buffer full - if (!m_data_to_sc2 ) status |= 0x02; // transmit buffer empty + if (!m_data_to_sc2) status |= 0x02; // transmit buffer empty return status; } -/////////////////////////////////////////////////////////////////////////// -void bfm_adder2_device::adder2_uart_ctrl_w(uint8_t data) +void bfm_adder2_device::uart_ctrl_w(uint8_t data) { m_data_from_sc2 = false; // data available for adder from sc2 - m_sc2data = 0; // data - m_data_to_sc2 = false; // data available for sc2 from adder - m_adder2_data = 0; // data + m_sc2data = 0; // data + m_data_to_sc2 = false; // data available for sc2 from adder + m_data = 0; // data - LOG_CTRL(("adder2 uart ctrl:%02X\n", data)); + LOGCTRL("adder2 uart ctrl: %02X\n", data); } -/////////////////////////////////////////////////////////////////////////// -uint8_t bfm_adder2_device::adder2_uart_rx_r() +uint8_t bfm_adder2_device::uart_rx_r() { int data = m_sc2data; m_data_from_sc2 = false; // clr flag, data from scorpion2 board available - LOG_CTRL(("rsc2:%02X (%c)\n",data, data )); + LOGCTRL("rsc2: %02X (%c)\n", data, data); return data; } -/////////////////////////////////////////////////////////////////////////// -void bfm_adder2_device::adder2_uart_tx_w(uint8_t data) +void bfm_adder2_device::uart_tx_w(uint8_t data) { m_data_to_sc2 = true; // set flag, data from adder available - m_adder2_data = data; // store data + m_data = data; // store data - LOG_CTRL(("ssc2 %02X(%c)\n",data, data )); + LOGCTRL("ssc2: %02X (%c)\n", data, data); } -/////////////////////////////////////////////////////////////////////////// -uint8_t bfm_adder2_device::adder2_irq_r() +uint8_t bfm_adder2_device::irq_r() { int status = 0; @@ -429,86 +337,73 @@ uint8_t bfm_adder2_device::adder2_irq_r() } -/////////////////////////////////////////////////////////////////////////// - void bfm_adder2_device::vid_uart_tx_w(uint8_t data) { - m_data_from_sc2 = true; // set flag, data from scorpion2 board available - m_sc2data = data; // store data + m_data_from_sc2 = true; // set flag, data from scorpion2 board available + m_sc2data = data; // store data m_acia_triggered = true; // set flag, acia IRQ triggered - m_cpu->set_input_line(M6809_IRQ_LINE, HOLD_LINE ); + m_cpu->set_input_line(M6809_IRQ_LINE, HOLD_LINE); - //LOG_SERIAL(("sadder %02X (%c)\n",data, data )); + LOGSERIAL("sadder: %02X (%c)\n", data, data); } -/////////////////////////////////////////////////////////////////////////// void bfm_adder2_device::vid_uart_ctrl_w(uint8_t data) { } -/////////////////////////////////////////////////////////////////////////// uint8_t bfm_adder2_device::vid_uart_rx_r() { - uint8_t data = m_adder2_data; + uint8_t data = m_data; m_data_to_sc2 = false; // clr flag, data from adder available - //LOG_SERIAL(("radder: %02X(%c)\n",data, data )); + LOGSERIAL("radder: %02X (%c)\n", data, data); return data; } -/////////////////////////////////////////////////////////////////////////// uint8_t bfm_adder2_device::vid_uart_ctrl_r() { int status = 0; - if (m_data_to_sc2 ) status |= 0x01; // receive buffer full + if (m_data_to_sc2) status |= 0x01; // receive buffer full if (!m_data_from_sc2) status |= 0x02; // transmit buffer empty return status; } -//////////////////////////////////////////////////////////////////// -// // -// decode character data to a format which can be decoded by MAME // -// // -//////////////////////////////////////////////////////////////////// - -void bfm_adder2_device::adder2_decode_char_roms() +void bfm_adder2_device::decode_char_roms() // decode character data to a format which can be decoded by MAME { - uint8_t *p = machine().root_device().memregion("gfx1")->base(); + uint8_t *p = memregion("tiles")->base(); - if ( p ) + if (p) { - std::vector s( 0x40000 ); + std::vector s(0x40000); { - int x, y; - memcpy(&s[0], p, 0x40000); - y = 0; + int y = 0; - while ( y < 128 ) + while (y < 128) { - x = 0; - while ( x < 64 ) + int x = 0; + while (x < 64) { - uint8_t *src = &s[(y*256*8)+(x*4)]; - - *p++ = src[0*256+0];*p++ = src[0*256+1];*p++ = src[0*256+2];*p++ = src[0*256+3]; - *p++ = src[1*256+0];*p++ = src[1*256+1];*p++ = src[1*256+2];*p++ = src[1*256+3]; - *p++ = src[2*256+0];*p++ = src[2*256+1];*p++ = src[2*256+2];*p++ = src[2*256+3]; - *p++ = src[3*256+0];*p++ = src[3*256+1];*p++ = src[3*256+2];*p++ = src[3*256+3]; - *p++ = src[4*256+0];*p++ = src[4*256+1];*p++ = src[4*256+2];*p++ = src[4*256+3]; - *p++ = src[5*256+0];*p++ = src[5*256+1];*p++ = src[5*256+2];*p++ = src[5*256+3]; - *p++ = src[6*256+0];*p++ = src[6*256+1];*p++ = src[6*256+2];*p++ = src[6*256+3]; - *p++ = src[7*256+0];*p++ = src[7*256+1];*p++ = src[7*256+2];*p++ = src[7*256+3]; + uint8_t *src = &s[(y * 256 * 8) + (x * 4)]; + + *p++ = src[0 * 256 + 0]; *p++ = src[0 * 256 + 1]; *p++ = src[0 * 256 + 2]; *p++ = src[0 * 256 + 3]; + *p++ = src[1 * 256 + 0]; *p++ = src[1 * 256 + 1]; *p++ = src[1 * 256 + 2]; *p++ = src[1 * 256 + 3]; + *p++ = src[2 * 256 + 0]; *p++ = src[2 * 256 + 1]; *p++ = src[2 * 256 + 2]; *p++ = src[2 * 256 + 3]; + *p++ = src[3 * 256 + 0]; *p++ = src[3 * 256 + 1]; *p++ = src[3 * 256 + 2]; *p++ = src[3 * 256 + 3]; + *p++ = src[4 * 256 + 0]; *p++ = src[4 * 256 + 1]; *p++ = src[4 * 256 + 2]; *p++ = src[4 * 256 + 3]; + *p++ = src[5 * 256 + 0]; *p++ = src[5 * 256 + 1]; *p++ = src[5 * 256 + 2]; *p++ = src[5 * 256 + 3]; + *p++ = src[6 * 256 + 0]; *p++ = src[6 * 256 + 1]; *p++ = src[6 * 256 + 2]; *p++ = src[6 * 256 + 3]; + *p++ = src[7 * 256 + 0]; *p++ = src[7 * 256 + 1]; *p++ = src[7 * 256 + 2]; *p++ = src[7 * 256 + 3]; x++; } y++; @@ -517,30 +412,24 @@ void bfm_adder2_device::adder2_decode_char_roms() } } -/////////////////////////////////////////////////////////////////////////// -// adder2 board memorymap ///////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////// -void bfm_adder2_device::adder2_memmap(address_map &map) +void bfm_adder2_device::prg_map(address_map &map) { - map(0x0000, 0x0000).w(FUNC(bfm_adder2_device::adder2_screen_page_w)); // screen access/display select - map(0x0000, 0x7FFF).bankr("bank2"); // 8k paged ROM (4 pages) - map(0x8000, 0x917F).rw(FUNC(bfm_adder2_device::screen_ram_r), FUNC(bfm_adder2_device::screen_ram_w)); - map(0x9180, 0x9FFF).rw(FUNC(bfm_adder2_device::normal_ram_r), FUNC(bfm_adder2_device::normal_ram_w)); - - map(0xC000, 0xC000).w(FUNC(bfm_adder2_device::adder2_rom_page_w)); // ROM page select - map(0xC001, 0xC001).w(FUNC(bfm_adder2_device::adder2_c001_w)); // ?? - - map(0xC101, 0xC101).rw(FUNC(bfm_adder2_device::adder2_vbl_ctrl_r), FUNC(bfm_adder2_device::adder2_vbl_ctrl_w)); - map(0xC103, 0xC103).r(FUNC(bfm_adder2_device::adder2_irq_r)); // IRQ latch read - - // MC6850 compatible uart connected to main (scorpion2) board /////////////////////////////////////// - - map(0xC200, 0xC200).rw(FUNC(bfm_adder2_device::adder2_uart_ctrl_r), FUNC(bfm_adder2_device::adder2_uart_ctrl_w)); // 6850 compatible uart control reg - map(0xC201, 0xC201).rw(FUNC(bfm_adder2_device::adder2_uart_rx_r), FUNC(bfm_adder2_device::adder2_uart_tx_w)); // 6850 compatible uart data reg - - map(0xE000, 0xFFFF).rom().region(":adder2", 0xE000); // 8k ROM + map(0x0000, 0x0000).w(FUNC(bfm_adder2_device::screen_page_w)); // screen access/display select + map(0x0000, 0x7fff).bankr(m_rombank); // 8k paged ROM (4 pages) + map(0x8000, 0x917f).view(m_screen_ram_view); + m_screen_ram_view[0](0x8000, 0x917f).ram().w(FUNC(bfm_adder2_device::screen_ram_w<0>)).share(m_screen_ram[0]); + m_screen_ram_view[1](0x8000, 0x917f).ram().w(FUNC(bfm_adder2_device::screen_ram_w<1>)).share(m_screen_ram[1]); + map(0x9180, 0x9fff).ram(); + map(0xc000, 0xc000).w(FUNC(bfm_adder2_device::rom_page_w)); + map(0xc001, 0xc001).w(FUNC(bfm_adder2_device::c001_w)); // ?? + map(0xc101, 0xc101).rw(FUNC(bfm_adder2_device::vbl_ctrl_r), FUNC(bfm_adder2_device::vbl_ctrl_w)); + map(0xc103, 0xc103).r(FUNC(bfm_adder2_device::irq_r)); + // MC6850 compatible uart connected to main (scorpion2) board + map(0xc200, 0xc200).rw(FUNC(bfm_adder2_device::uart_ctrl_r), FUNC(bfm_adder2_device::uart_ctrl_w)); // 6850 compatible uart control reg + map(0xc201, 0xc201).rw(FUNC(bfm_adder2_device::uart_rx_r), FUNC(bfm_adder2_device::uart_tx_w)); // 6850 compatible uart data reg + map(0xe000, 0xffff).rom().region("cpu", 0xe000); } @@ -550,16 +439,16 @@ void bfm_adder2_device::adder2_memmap(address_map &map) void bfm_adder2_device::device_add_mconfig(machine_config &config) { - M6809(config, m_cpu, ADDER_CLOCK/4); // adder2 board 6809 CPU at 2 Mhz - m_cpu->set_addrmap(AS_PROGRAM, &bfm_adder2_device::adder2_memmap); // setup adder2 board memorymap + M6809(config, m_cpu, 8_MHz_XTAL / 4); // 2 MHz + m_cpu->set_addrmap(AS_PROGRAM, &bfm_adder2_device::prg_map); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_size(400, 280); - screen.set_visarea(0, 400-1, 0, 280-1); + screen.set_visarea_full(); screen.set_refresh_hz(50); screen.set_palette("palette"); - screen.set_screen_update(FUNC(bfm_adder2_device::update_screen)); - screen.screen_vblank().set(FUNC(bfm_adder2_device::adder2_vbl_w)); // board has a VBL IRQ + screen.set_screen_update(FUNC(bfm_adder2_device::screen_update)); + screen.screen_vblank().set(FUNC(bfm_adder2_device::vbl_w)); PALETTE(config, "palette").set_entries(16); } diff --git a/src/mame/video/bfm_adr2.h b/src/mame/video/bfm_adr2.h index c213af179f9..21cfaa67d96 100644 --- a/src/mame/video/bfm_adr2.h +++ b/src/mame/video/bfm_adr2.h @@ -14,32 +14,11 @@ public: // construction/destruction bfm_adder2_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); - TILE_GET_INFO_MEMBER( get_tile0_info ); - TILE_GET_INFO_MEMBER( get_tile1_info ); - - uint8_t screen_ram_r(offs_t offset); - void screen_ram_w(offs_t offset, uint8_t data); - uint8_t normal_ram_r(offs_t offset); - void normal_ram_w(offs_t offset, uint8_t data); - void adder2_rom_page_w(uint8_t data); - void adder2_c001_w(uint8_t data); - void adder2_screen_page_w(uint8_t data); - uint8_t adder2_vbl_ctrl_r(); - void adder2_vbl_ctrl_w(uint8_t data); - uint8_t adder2_uart_ctrl_r(); - void adder2_uart_ctrl_w(uint8_t data); - uint8_t adder2_uart_rx_r(); - void adder2_uart_tx_w(uint8_t data); - uint8_t adder2_irq_r(); - void vid_uart_tx_w(uint8_t data); void vid_uart_ctrl_w(uint8_t data); uint8_t vid_uart_rx_r(); uint8_t vid_uart_ctrl_r(); - void adder2_decode_char_roms(); - - void adder2_memmap(address_map &map); protected: // device-level overrides virtual void device_start() override; @@ -47,28 +26,45 @@ protected: virtual void device_add_mconfig(machine_config &config) override; private: - int m_screen_page_reg = 0; // access/display select - int m_c101 = 0; - int m_rx = 0; + required_device m_cpu; + required_shared_ptr_array m_screen_ram; // paged display RAM + memory_view m_screen_ram_view; + required_memory_bank m_rombank; + + uint8_t m_screen_page_reg = 0; // access/display select + uint8_t m_c101 = 0; bool m_vbl_triggered = 0; // flag, VBL IRQ triggered bool m_acia_triggered = 0; // flag, ACIA receive IRQ - uint8_t m_adder_ram[0xE80]{}; // normal RAM - uint8_t m_screen_ram[2][0x1180]{}; // paged display RAM - - tilemap_t *m_tilemap0 = nullptr; // tilemap screen0 - tilemap_t *m_tilemap1 = nullptr; // tilemap screen1 + tilemap_t *m_tilemap[2]{}; bool m_data_from_sc2 = false; bool m_data_to_sc2 = false; - uint8_t m_adder2_data = 0; + uint8_t m_data = 0; uint8_t m_sc2data = 0; - optional_device m_cpu; + DECLARE_GFXDECODE_MEMBER(gfxinfo); + template TILE_GET_INFO_MEMBER(get_tile_info); + + template void screen_ram_w(offs_t offset, uint8_t data); + void rom_page_w(uint8_t data); + void c001_w(uint8_t data); + void screen_page_w(uint8_t data); + uint8_t vbl_ctrl_r(); + void vbl_ctrl_w(uint8_t data); + uint8_t uart_ctrl_r(); + void uart_ctrl_w(uint8_t data); + uint8_t uart_rx_r(); + void uart_tx_w(uint8_t data); + uint8_t irq_r(); + + void decode_char_roms(); + + void prg_map(address_map &map); - uint32_t update_screen(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - DECLARE_WRITE_LINE_MEMBER(adder2_vbl_w); + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + DECLARE_WRITE_LINE_MEMBER(vbl_w); }; // device type definition diff --git a/src/mame/video/brkthru.cpp b/src/mame/video/brkthru.cpp deleted file mode 100644 index 63d4215f1c5..00000000000 --- a/src/mame/video/brkthru.cpp +++ /dev/null @@ -1,264 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Phil Stroffolino -/*************************************************************************** - - video/brkthru.c - -***************************************************************************/ - -#include "emu.h" -#include "includes/brkthru.h" - - -/*************************************************************************** - - Convert the color PROMs into a more useable format. - - Break Thru has one 256x8 and one 256x4 palette PROMs. - I don't know for sure how the palette PROMs are connected to the RGB - output, but it's probably the usual: - - bit 7 -- 220 ohm resistor -- GREEN - -- 470 ohm resistor -- GREEN - -- 1 kohm resistor -- GREEN - -- 2.2kohm resistor -- GREEN - -- 220 ohm resistor -- RED - -- 470 ohm resistor -- RED - -- 1 kohm resistor -- RED - bit 0 -- 2.2kohm resistor -- RED - - bit 3 -- 220 ohm resistor -- BLUE - -- 470 ohm resistor -- BLUE - -- 1 kohm resistor -- BLUE - bit 0 -- 2.2kohm resistor -- BLUE - -***************************************************************************/ - -void brkthru_state::brkthru_palette(palette_device &palette) const -{ - uint8_t const *color_prom = memregion("proms")->base(); - - for (int i = 0; i < palette.entries(); i++) - { - int bit0, bit1, bit2, bit3; - - bit0 = (color_prom[0] >> 0) & 0x01; - bit1 = (color_prom[0] >> 1) & 0x01; - bit2 = (color_prom[0] >> 2) & 0x01; - bit3 = (color_prom[0] >> 3) & 0x01; - int const r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - bit0 = (color_prom[0] >> 4) & 0x01; - bit1 = (color_prom[0] >> 5) & 0x01; - bit2 = (color_prom[0] >> 6) & 0x01; - bit3 = (color_prom[0] >> 7) & 0x01; - int const g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - bit0 = (color_prom[palette.entries()] >> 0) & 0x01; - bit1 = (color_prom[palette.entries()] >> 1) & 0x01; - bit2 = (color_prom[palette.entries()] >> 2) & 0x01; - bit3 = (color_prom[palette.entries()] >> 3) & 0x01; - int const b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - - palette.set_pen_color(i, rgb_t(r,g,b)); - - color_prom++; - } -} - - - -/*************************************************************************** - - Start the video hardware emulation. - -***************************************************************************/ - -TILE_GET_INFO_MEMBER(brkthru_state::get_bg_tile_info) -{ - /* BG RAM format - 0 1 - ---- -c-- ---- ---- = Color - ---- --xx xxxx xxxx = Code - */ - - int code = (m_videoram[tile_index * 2] | ((m_videoram[tile_index * 2 + 1]) << 8)) & 0x3ff; - int region = 1 + (code >> 7); - int colour = m_bgbasecolor + ((m_videoram[tile_index * 2 + 1] & 0x04) >> 2); - - tileinfo.set(region, code & 0x7f, colour,0); -} - -void brkthru_state::brkthru_bgram_w(offs_t offset, uint8_t data) -{ - m_videoram[offset] = data; - m_bg_tilemap->mark_tile_dirty(offset / 2); -} - - -TILE_GET_INFO_MEMBER(brkthru_state::get_fg_tile_info) -{ - uint8_t code = m_fg_videoram[tile_index]; - tileinfo.set(0, code, 0, 0); -} - -void brkthru_state::brkthru_fgram_w(offs_t offset, uint8_t data) -{ - m_fg_videoram[offset] = data; - m_fg_tilemap->mark_tile_dirty(offset); -} - -void brkthru_state::video_start() -{ - m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(brkthru_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(brkthru_state::get_bg_tile_info)), TILEMAP_SCAN_COLS, 16, 16, 32, 16); - - m_fg_tilemap->set_transparent_pen(0); - m_bg_tilemap->set_transparent_pen(0); -} - - -void brkthru_state::brkthru_1800_w(offs_t offset, uint8_t data) -{ - if (offset == 0) /* low 8 bits of scroll */ - m_bgscroll = (m_bgscroll & 0x100) | data; - else if (offset == 1) - { - /* bit 0-2 = ROM bank select */ - membank("bank1")->set_entry(data & 0x07); - - /* bit 3-5 = background tiles color code */ - if (((data & 0x38) >> 2) != m_bgbasecolor) - { - m_bgbasecolor = (data & 0x38) >> 2; - m_bg_tilemap->mark_all_dirty(); - } - - /* bit 6 = screen flip */ - if (m_flipscreen != (data & 0x40)) - { - m_flipscreen = data & 0x40; - m_bg_tilemap->set_flip(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); - m_fg_tilemap->set_flip(m_flipscreen ? (TILEMAP_FLIPY | TILEMAP_FLIPX) : 0); - - } - - /* bit 7 = high bit of scroll */ - m_bgscroll = (m_bgscroll & 0xff) | ((data & 0x80) << 1); - } -} - - -#if 0 -void brkthru_state::show_register( bitmap_ind16 &bitmap, int x, int y, uint32_t data ) -{ - char buf[5]; - - sprintf(buf, "%04X", data); - ui_draw_text(y, x, buf); -} -#endif - - -void brkthru_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, int prio ) -{ - int offs; - /* Draw the sprites. Note that it is important to draw them exactly in this */ - /* order, to have the correct priorities. */ - - /* Sprite RAM format - 0 1 2 3 - ccc- ---- ---- ---- ---- ---- ---- ---- = Color - ---d ---- ---- ---- ---- ---- ---- ---- = Double Size - ---- p--- ---- ---- ---- ---- ---- ---- = Priority - ---- -bb- ---- ---- ---- ---- ---- ---- = Bank - ---- ---e ---- ---- ---- ---- ---- ---- = Enable/Disable - ---- ---- ssss ssss ---- ---- ---- ---- = Sprite code - ---- ---- ---- ---- yyyy yyyy ---- ---- = Y position - ---- ---- ---- ---- ---- ---- xxxx xxxx = X position - */ - - for (offs = 0;offs < m_spriteram.bytes(); offs += 4) - { - if ((m_spriteram[offs] & 0x09) == prio) /* Enable && Low Priority */ - { - int sx, sy, code, color; - - sx = 240 - m_spriteram[offs + 3]; - if (sx < -7) - sx += 256; - - sy = 240 - m_spriteram[offs + 2]; - code = m_spriteram[offs + 1] + 128 * (m_spriteram[offs] & 0x06); - color = (m_spriteram[offs] & 0xe0) >> 5; - if (m_flipscreen) - { - sx = 240 - sx; - sy = 240 - sy; - } - - if (m_spriteram[offs] & 0x10) /* double height */ - { - m_gfxdecode->gfx(9)->transpen(bitmap,cliprect, - code & ~1, - color, - m_flipscreen, m_flipscreen, - sx, m_flipscreen ? sy + 16 : sy - 16,0); - m_gfxdecode->gfx(9)->transpen(bitmap,cliprect, - code | 1, - color, - m_flipscreen, m_flipscreen, - sx,sy,0); - - /* redraw with wraparound */ - m_gfxdecode->gfx(9)->transpen(bitmap,cliprect, - code & ~1, - color, - m_flipscreen, m_flipscreen, - sx,(m_flipscreen ? sy + 16 : sy - 16) + 256,0); - m_gfxdecode->gfx(9)->transpen(bitmap,cliprect, - code | 1, - color, - m_flipscreen, m_flipscreen, - sx,sy + 256,0); - - } - else - { - m_gfxdecode->gfx(9)->transpen(bitmap,cliprect, - code, - color, - m_flipscreen, m_flipscreen, - sx,sy,0); - - /* redraw with wraparound */ - m_gfxdecode->gfx(9)->transpen(bitmap,cliprect, - code, - color, - m_flipscreen, m_flipscreen, - sx,sy + 256,0); - - } - } - } -} - -uint32_t brkthru_state::screen_update_brkthru(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - m_bg_tilemap->set_scrollx(0, m_bgscroll); - m_bg_tilemap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0); - - /* low priority sprites */ - draw_sprites(bitmap, cliprect, 0x01); - - /* draw background over low priority sprites */ - m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - - /* high priority sprites */ - draw_sprites(bitmap, cliprect, 0x09); - - /* fg layer */ - m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - -/* show_register(bitmap, 8, 8, (uint32_t)m_flipscreen); */ - - return 0; -} diff --git a/src/mame/video/gunsmoke.cpp b/src/mame/video/gunsmoke.cpp deleted file mode 100644 index 036afa552c0..00000000000 --- a/src/mame/video/gunsmoke.cpp +++ /dev/null @@ -1,189 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Paul Leaman -#include "emu.h" -#include "includes/gunsmoke.h" - -/*************************************************************************** - - Convert the color PROMs into a more useable format. - - Gunsmoke has three 256x4 palette PROMs (one per gun) and a lot ;-) of - 256x4 lookup table PROMs. - The palette PROMs are connected to the RGB output this way: - - bit 3 -- 220 ohm resistor -- RED/GREEN/BLUE - -- 470 ohm resistor -- RED/GREEN/BLUE - -- 1 kohm resistor -- RED/GREEN/BLUE - bit 0 -- 2.2kohm resistor -- RED/GREEN/BLUE - -***************************************************************************/ - -void gunsmoke_state::gunsmoke_palette(palette_device &palette) const -{ - const uint8_t *color_prom = memregion("proms")->base(); - - // create a lookup table for the palette - for (int i = 0; i < 0x100; i++) - { - int const r = pal4bit(color_prom[i + 0x000]); - int const g = pal4bit(color_prom[i + 0x100]); - int const b = pal4bit(color_prom[i + 0x200]); - - palette.set_indirect_color(i, rgb_t(r, g, b)); - } - - // color_prom now points to the beginning of the lookup table - color_prom += 0x300; - - // characters use colors 0x40-0x4f - for (int i = 0; i < 0x80; i++) - { - uint8_t const ctabentry = color_prom[i] | 0x40; - palette.set_pen_indirect(i, ctabentry); - } - - // background tiles use colors 0-0x3f - for (int i = 0x100; i < 0x200; i++) - { - uint8_t const ctabentry = color_prom[i] | ((color_prom[i + 0x100] & 0x03) << 4); - palette.set_pen_indirect(i - 0x80, ctabentry); - } - - // sprites use colors 0x80-0xff - for (int i = 0x300; i < 0x400; i++) - { - uint8_t const ctabentry = color_prom[i] | ((color_prom[i + 0x100] & 0x07) << 4) | 0x80; - palette.set_pen_indirect(i - 0x180, ctabentry); - } -} - -void gunsmoke_state::gunsmoke_videoram_w(offs_t offset, uint8_t data) -{ - m_videoram[offset] = data; - m_fg_tilemap->mark_tile_dirty(offset); -} - -void gunsmoke_state::gunsmoke_colorram_w(offs_t offset, uint8_t data) -{ - m_colorram[offset] = data; - m_fg_tilemap->mark_tile_dirty(offset); -} - -void gunsmoke_state::gunsmoke_c804_w(uint8_t data) -{ - /* bits 0 and 1 are for coin counters */ - machine().bookkeeping().coin_counter_w(1, data & 0x01); - machine().bookkeeping().coin_counter_w(0, data & 0x02); - - /* bits 2 and 3 select the ROM bank */ - membank("bank1")->set_entry((data & 0x0c) >> 2); - - /* bit 5 resets the sound CPU? - we ignore it */ - - /* bit 6 flips screen */ - flip_screen_set(data & 0x40); - - /* bit 7 enables characters? */ - m_chon = data & 0x80; -} - -void gunsmoke_state::gunsmoke_d806_w(uint8_t data) -{ - /* bits 0-2 select the sprite 3 bank */ - m_sprite3bank = data & 0x07; - - /* bit 4 enables bg 1? */ - m_bgon = data & 0x10; - - /* bit 5 enables sprites? */ - m_objon = data & 0x20; -} - -TILE_GET_INFO_MEMBER(gunsmoke_state::get_bg_tile_info) -{ - uint8_t *tilerom = memregion("gfx4")->base(); - - int offs = tile_index * 2; - int attr = tilerom[offs + 1]; - int code = tilerom[offs] + ((attr & 0x01) << 8); - int color = (attr & 0x3c) >> 2; - int flags = TILE_FLIPYX((attr & 0xc0) >> 6); - - tileinfo.set(1, code, color, flags); -} - -TILE_GET_INFO_MEMBER(gunsmoke_state::get_fg_tile_info) -{ - int attr = m_colorram[tile_index]; - int code = m_videoram[tile_index] + ((attr & 0xe0) << 2); - int color = attr & 0x1f; - - tileinfo.group = color; - - tileinfo.set(0, code, color, 0); -} - -void gunsmoke_state::video_start() -{ - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(gunsmoke_state::get_bg_tile_info)), TILEMAP_SCAN_COLS, 32, 32, 2048, 8); - m_fg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(gunsmoke_state::get_fg_tile_info)), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); - - m_bg_tilemap->set_scrolldx(128, 128); - m_bg_tilemap->set_scrolldy( 6, 6); - m_fg_tilemap->set_scrolldx(128, 128); - m_fg_tilemap->set_scrolldy( 6, 6); - - m_fg_tilemap->configure_groups(*m_gfxdecode->gfx(0), 0x4f); -} - -void gunsmoke_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) -{ - uint8_t *spriteram = m_spriteram; - int offs; - - for (offs = m_spriteram.bytes() - 32; offs >= 0; offs -= 32) - { - int attr = spriteram[offs + 1]; - int bank = (attr & 0xc0) >> 6; - int code = spriteram[offs]; - int color = attr & 0x0f; - int flipx = 0; - int flipy = attr & 0x10; - int sx = spriteram[offs + 3] - ((attr & 0x20) << 3); - int sy = spriteram[offs + 2]; - - if (bank == 3) - bank += m_sprite3bank; - - code += 256 * bank; - - if (flip_screen()) - { - sx = 240 - sx; - sy = 240 - sy; - flipx = !flipx; - flipy = !flipy; - } - - m_gfxdecode->gfx(2)->transpen(bitmap,cliprect, code, color, flipx, flipy, sx+128, sy+6, 0); - } -} - -uint32_t gunsmoke_state::screen_update_gunsmoke(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - m_bg_tilemap->set_scrollx(0, m_scrollx[0] + 256 * m_scrollx[1]); - m_bg_tilemap->set_scrolly(0, m_scrolly[0]); - - if (m_bgon) - m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - else - bitmap.fill(m_palette->black_pen(), cliprect); - - if (m_objon) - draw_sprites(bitmap, cliprect); - - if (m_chon) - m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - - return 0; -} -- cgit v1.2.3