From 4ebd61dd5249896f1e65d1e76fceafc469591493 Mon Sep 17 00:00:00 2001 From: Ivan Vangelista Date: Mon, 18 Dec 2023 09:06:56 +0100 Subject: New systems marked not working ------------------------------ Medal Get Hammer (V100JP) [buffi] - ice/chexx: fixed ROM loading for recently added Digitalker ROMs [Devin Acker] - seibu/mustache.cpp: consolidated driver in single file --- src/mame/ice/chexx.cpp | 4 +- src/mame/igs/igs_m036.cpp | 79 ++++++++----- src/mame/mame.lst | 1 + src/mame/seibu/mustache.cpp | 254 ++++++++++++++++++++++++++++++++++-------- src/mame/seibu/mustache.h | 64 ----------- src/mame/seibu/mustache_v.cpp | 111 ------------------ 6 files changed, 264 insertions(+), 249 deletions(-) delete mode 100644 src/mame/seibu/mustache.h delete mode 100644 src/mame/seibu/mustache_v.cpp diff --git a/src/mame/ice/chexx.cpp b/src/mame/ice/chexx.cpp index 0cfcf13559d..c3f33a2d80f 100644 --- a/src/mame/ice/chexx.cpp +++ b/src/mame/ice/chexx.cpp @@ -481,8 +481,8 @@ ROM_START( chexx83 ) ROM_LOAD( "sjlf.u16", 0x6000, 0x2000, CRC(156c91e0) SHA1(6017d4b5609b214a6e66dcd76493a7d1442c04d4) ) ROM_LOAD( "sjlg.u15", 0x8000, 0x2000, CRC(19904604) SHA1(633c211a9a822cdf597a6f3c221ae9c8d6482e82) ) ROM_LOAD( "sjlh.u14", 0xa000, 0x2000, CRC(c3386d51) SHA1(7882e88db55ba914be81075e4b2d76e246c34d3b) ) - ROM_LOAD( "sjlj.u13", 0xa000, 0x2000, CRC(cc3473b5) SHA1(325d16b64a0d09091768d0bfae16517505b00d03) ) - ROM_LOAD( "sjlk.u12", 0xa000, 0x2000, CRC(f8ff29df) SHA1(681501d5692fcb741af7bf830fa18907d2fa283f) ) + ROM_LOAD( "sjlj.u13", 0xc000, 0x2000, CRC(cc3473b5) SHA1(325d16b64a0d09091768d0bfae16517505b00d03) ) + ROM_LOAD( "sjlk.u12", 0xe000, 0x2000, CRC(f8ff29df) SHA1(681501d5692fcb741af7bf830fa18907d2fa283f) ) ROM_END // Same PCB as 'chexx83' diff --git a/src/mame/igs/igs_m036.cpp b/src/mame/igs/igs_m036.cpp index a33c27879e1..c931242dbe2 100644 --- a/src/mame/igs/igs_m036.cpp +++ b/src/mame/igs/igs_m036.cpp @@ -102,7 +102,7 @@ uint32_t igs_m036_state::screen_update_igs_m036(screen_device &screen, bitmap_in void igs_m036_state::igs_m036_map(address_map &map) { - map(0x00000000, 0x00003fff).rom(); /* Internal ROM */ + map(0x00000000, 0x00003fff).rom(); // Internal ROM map(0x08000000, 0x081fffff).rom().region("user1", 0); // not 100% sure it maps here. } @@ -114,7 +114,7 @@ INPUT_PORTS_END ROM_START( cjdh2 ) ROM_REGION( 0x04000, "maincpu", 0 ) - /* Internal rom of IGS027A ARM based MCU */ + // Internal ROM of IGS027A ARM based MCU ROM_LOAD( "chaohen2_igs036", 0x00000, 0x4000, NO_DUMP ) // there is also a square socketed chip like the one on Haunted House (igs_m027) probably in need of dumping @@ -132,7 +132,7 @@ ROM_END ROM_START( cjdh2a ) ROM_REGION( 0x04000, "maincpu", 0 ) - /* Internal rom of IGS027A ARM based MCU */ + // Internal ROM of IGS027A ARM based MCU ROM_LOAD( "chaohen2_igs036", 0x00000, 0x4000, NO_DUMP ) // there is also a square socketed chip like the one on Haunted House (igs_m027) probably in need of dumping @@ -150,7 +150,7 @@ ROM_END ROM_START( cjdh2b ) ROM_REGION( 0x04000, "maincpu", 0 ) - /* Internal rom of IGS027A ARM based MCU */ + // Internal ROM of IGS027A ARM based MCU ROM_LOAD( "chaohen2_igs036", 0x00000, 0x4000, NO_DUMP ) // there is also a square socketed chip like the one on Haunted House (igs_m027) probably in need of dumping @@ -168,7 +168,7 @@ ROM_END ROM_START( cjdh2c ) ROM_REGION( 0x04000, "maincpu", 0 ) - /* Internal rom of IGS027A ARM based MCU */ + // Internal ROM of IGS027A ARM based MCU ROM_LOAD( "chaohen2_igs036", 0x00000, 0x4000, NO_DUMP ) // there is also a square socketed chip like the one on Haunted House (igs_m027) probably in need of dumping @@ -187,7 +187,7 @@ ROM_END ROM_START( cjddzsp ) ROM_REGION( 0x04000, "maincpu", 0 ) - /* Internal rom of IGS027A ARM based MCU */ + // Internal ROM of IGS027A ARM based MCU ROM_LOAD( "cjddzsp_igs036", 0x00000, 0x4000, NO_DUMP ) ROM_REGION32_LE( 0x200000, "user1", 0 ) // external ARM data / prg @@ -223,7 +223,7 @@ ROM_END ROM_START( lhzb3in1 ) ROM_REGION( 0x04000, "maincpu", 0 ) - /* Internal rom of IGS036 ARM based MCU */ + // Internal ROM of IGS036 ARM based MCU ROM_LOAD( "lhzb3in1_igs036", 0x00000, 0x4000, NO_DUMP ) ROM_REGION32_LE( 0x200000, "user1", 0 ) // external ARM data / prg @@ -243,7 +243,7 @@ ROM_END ROM_START( igsm312 ) ROM_REGION( 0x04000, "maincpu", 0 ) - /* Internal rom of IGS027A ARM based MCU */ + // Internal ROM of IGS027A ARM based MCU ROM_LOAD( "igsunk_igs036", 0x00000, 0x4000, NO_DUMP ) ROM_REGION32_LE( 0x200000, "user1", 0 ) // external ARM data / prg @@ -256,19 +256,46 @@ ROM_START( igsm312 ) ROM_END +// PCB-0999-00-KO main with PCB-0634-02-IN riser board for GFX ROMs + PCB-0998-01-KO-C for I/O +ROM_START( mghammer ) + ROM_REGION( 0x04000, "maincpu", 0 ) + // Internal ROM of IGS036E ARM based MCU (1119 0T7643 IGS036E) + ROM_LOAD( "mghammer_igs036e", 0x00000, 0x4000, NO_DUMP ) + + ROM_REGION32_LE( 0x200000, "user1", 0 ) // external ARM data / prg + ROM_LOAD( "v_100jp.u26", 0x000000, 0x200000, CRC(d78a4dbb) SHA1(149e68c1294b31f4b039d2cd36d36f17873c247e) ) + + ROM_REGION( 0x1000000, "oki", ROMREGION_ERASE00 ) // TT5665 samples + ROM_LOAD( "sp_u17.u17", 0x000000, 0x800000, CRC(dd9b43b6) SHA1(5fa3191a2ebb0ea7fb737e44b1f651987c6c1bbb) ) + ROM_LOAD( "sp_u18.u18", 0x800000, 0x800000, CRC(0998e0c6) SHA1(bfa2b42248dc52f83682bbdec7bb7aaa53b4ac29) ) + + ROM_REGION( 0x4000400, "gfx", 0 ) + ROM_LOAD( "cg_v_100jp.u1", 0x0000000, 0x1000100, CRC(6800418e) SHA1(81eb23f8d5c6d4eeac6bf7b06897d88d744b9681) ) + ROM_LOAD( "cg_v_100jp.u2", 0x1000100, 0x1000100, CRC(decffe69) SHA1(6161208eb399a8f418244c19e0236b4db79d0300) ) + ROM_LOAD( "cg_v_100jp.u3", 0x2000200, 0x1000100, CRC(6b6df061) SHA1(ba1e020626ce50a7fc5859f41ec717b0b39229cb) ) + ROM_LOAD( "cg_v_100jp.u4", 0x3000300, 0x1000100, CRC(5813401d) SHA1(7675a691ce0f6b99fa15a7c0004a733121772c3c) ) + + ROM_REGION( 0x04000, "iocpu", 0 ) + // Internal ROM of IGS036E ARM based MCU (1119 0T7643 IGS036E), on I/O board (yes, same IGS036 code as main) + ROM_LOAD( "mghammer_igs036e", 0x00000, 0x4000, NO_DUMP ) + + ROM_REGION32_LE( 0x200000, "io", 0 ) // external ARM data / prg + ROM_LOAD( "io_v_100jp.u1", 0x000000, 0x200000, CRC(cf6c7440) SHA1(53d7b8240b153045569cac72683670df45c6ed32) ) +ROM_END + + void igs_m036_state::pgm_create_dummy_internal_arm_region(void) { uint16_t *temp16 = (uint16_t *)memregion("maincpu")->base(); - int i; - for (i=0;i<0x4000/2;i+=2) + for (int i = 0; i < 0x4000 / 2; i += 2) { - temp16[i] = 0xFFFE; - temp16[i+1] = 0xEAFF; + temp16[i] = 0xfffe; + temp16[i + 1] = 0xeaff; } int base = 0; - // jump straight to where we've mapped the external rom for testing (should really set up a fake stack etc. too) + // jump straight to where we've mapped the external ROM for testing (should really set up a fake stack etc. too) temp16[(base) / 2] = 0x0004; base += 2; @@ -296,7 +323,7 @@ void igs_m036_state::pgm_create_dummy_internal_arm_region(void) void igs_m036_state::igs_m036(machine_config &config) { - IGS036_CPU(config, m_maincpu, 20000000); + IGS036_CPU(config, m_maincpu, 20'000'000); m_maincpu->set_addrmap(AS_PROGRAM, &igs_m036_state::igs_m036_map); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -308,13 +335,13 @@ void igs_m036_state::igs_m036(machine_config &config) screen.set_palette("palette"); PALETTE(config, "palette").set_entries(0x200); - /* sound hardware (OKI) */ + // sound hardware (OKI) } void igs_m036_state::igs_m036_tt(machine_config &config) { - IGS036_CPU(config, m_maincpu, 20000000); + IGS036_CPU(config, m_maincpu, 20'000'000); m_maincpu->set_addrmap(AS_PROGRAM, &igs_m036_state::igs_m036_map); screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); @@ -326,7 +353,7 @@ void igs_m036_state::igs_m036_tt(machine_config &config) screen.set_palette("palette"); PALETTE(config, "palette").set_entries(0x200); - /* sound hardware (TT5665) */ + // sound hardware (TT5665) } @@ -369,15 +396,17 @@ void igs_m036_state::init_igsm312() ***************************************************************************/ -GAME( 200?, cjdh2, 0, igs_m036, igs_m036, igs_m036_state, init_cjdh2, ROT0, "IGS", "Chao Ji Da Heng 2 (V311CN)", MACHINE_IS_SKELETON ) -GAME( 200?, cjdh2a, cjdh2, igs_m036, igs_m036, igs_m036_state, init_cjdh2, ROT0, "IGS", "Chao Ji Da Heng 2 (V311CNA)", MACHINE_IS_SKELETON ) -GAME( 200?, cjdh2b, cjdh2, igs_m036, igs_m036, igs_m036_state, init_cjdh2, ROT0, "IGS", "Chao Ji Da Heng 2 (V311CNB)", MACHINE_IS_SKELETON ) -GAME( 200?, cjdh2c, cjdh2, igs_m036, igs_m036, igs_m036_state, init_cjdh2, ROT0, "IGS", "Chao Ji Da Heng 2 (V215CN)", MACHINE_IS_SKELETON ) +GAME( 200?, cjdh2, 0, igs_m036, igs_m036, igs_m036_state, init_cjdh2, ROT0, "IGS", "Chao Ji Da Heng 2 (V311CN)", MACHINE_IS_SKELETON ) +GAME( 200?, cjdh2a, cjdh2, igs_m036, igs_m036, igs_m036_state, init_cjdh2, ROT0, "IGS", "Chao Ji Da Heng 2 (V311CNA)", MACHINE_IS_SKELETON ) +GAME( 200?, cjdh2b, cjdh2, igs_m036, igs_m036, igs_m036_state, init_cjdh2, ROT0, "IGS", "Chao Ji Da Heng 2 (V311CNB)", MACHINE_IS_SKELETON ) +GAME( 200?, cjdh2c, cjdh2, igs_m036, igs_m036, igs_m036_state, init_cjdh2, ROT0, "IGS", "Chao Ji Da Heng 2 (V215CN)", MACHINE_IS_SKELETON ) + +GAME( 200?, cjddzsp, 0, igs_m036_tt, igs_m036, igs_m036_state, init_cjddzsp, ROT0, "IGS", "Super Dou Di Zhu Special (V122CN)", MACHINE_IS_SKELETON ) -GAME( 200?, cjddzsp, 0, igs_m036_tt, igs_m036, igs_m036_state, init_cjddzsp, ROT0, "IGS", "Super Dou Di Zhu Special (V122CN)", MACHINE_IS_SKELETON ) +GAME( 200?, lhtb, 0, igs_m036_tt, igs_m036, igs_m036_state, init_cjddzsp, ROT0, "IGS", "Long Hu Tebie Ban (V101CN)", MACHINE_IS_SKELETON ) // 龍虎特別版 - Lónghǔ tèbié bǎn -GAME( 200?, lhtb, 0, igs_m036_tt, igs_m036, igs_m036_state, init_cjddzsp, ROT0, "IGS", "Long Hu Tebie Ban (V101CN)", MACHINE_IS_SKELETON ) // 龍虎特別版 - Lónghǔ tèbié bǎn +GAME( 200?, lhzb3in1, 0, igs_m036_tt, igs_m036, igs_m036_state, init_cjddzsp, ROT0, "IGS", "Long Hu Zhengba San He Yi (V100CN)", MACHINE_IS_SKELETON ) // 龙虎争霸三合一 -GAME( 200?, lhzb3in1,0, igs_m036_tt, igs_m036, igs_m036_state, init_cjddzsp, ROT0, "IGS", "Long Hu Zhengba San He Yi (V100CN)", MACHINE_IS_SKELETON ) // 龙虎争霸三合一 +GAME( 200?, igsm312, 0, igs_m036_tt, igs_m036, igs_m036_state, init_igsm312, ROT0, "IGS", "unknown 'IGS 6POKER2' game (V312CN)", MACHINE_IS_SKELETON ) // there's very little code and no gfx ROMs, might be a 'set/clear' chip for a gambling game. -GAME( 200?, igsm312, 0, igs_m036_tt, igs_m036, igs_m036_state, init_igsm312, ROT0, "IGS", "unknown 'IGS 6POKER2' game (V312CN)", MACHINE_IS_SKELETON ) // there's very little code and no gfx roms, might be a 'set/clear' chip for a gambling game. +GAME( 2015, mghammer, 0, igs_m036_tt, igs_m036, igs_m036_state, init_igsm312, ROT0, "IGS / Enheart", "Medal Get Hammer (V100JP)", MACHINE_IS_SKELETON ) diff --git a/src/mame/mame.lst b/src/mame/mame.lst index f3d4b7b2c3f..c6b90bc77ef 100644 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -19942,6 +19942,7 @@ haunthig // (c) 200? klxyj // (c) 200? lhzb3 // (c) 200? lhzb4 // (c) 200? +mghammer // (c) 2015 mgfx // (c) 200? qlgs // (c) 1999 sddz // (c) 200? diff --git a/src/mame/seibu/mustache.cpp b/src/mame/seibu/mustache.cpp index 8c185b45167..af323522a0e 100644 --- a/src/mame/seibu/mustache.cpp +++ b/src/mame/seibu/mustache.cpp @@ -1,5 +1,6 @@ // license:BSD-3-Clause -// copyright-holders:Tomasz Slanina +// copyright-holders: Tomasz Slanina + /*************************************************************************** Mustache Boy @@ -9,7 +10,7 @@ driver by Tomasz Slanina - The hardware similar to Knuckle Joe. + The hardware is similar to Knuckle Joe. Oscillators: . OSC1 - 14.318180 Mhz @@ -31,18 +32,175 @@ YM2151: ***************************************************************************/ #include "emu.h" -#include "mustache.h" + +#include "seibusound.h" // for seibu_sound_decrypt on the MAIN cpu (not sound) #include "t5182.h" #include "cpu/z80/z80.h" + +#include "emupal.h" +#include "screen.h" #include "speaker.h" +#include "tilemap.h" + + +namespace { + +class mustache_state : public driver_device +{ +public: + mustache_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), + m_maincpu(*this, "maincpu"), + m_gfxdecode(*this, "gfxdecode"), + m_screen(*this, "screen"), + m_palette(*this, "palette"), + m_videoram(*this, "videoram"), + m_spriteram(*this, "spriteram"), + m_dswb(*this, "DSWB") + { } + + void mustache(machine_config &config); + + void init_mustache(); + +protected: + virtual void video_start() override; + +private: + required_device m_maincpu; + required_device m_gfxdecode; + required_device m_screen; + required_device m_palette; + + required_shared_ptr m_videoram; + required_shared_ptr m_spriteram; + + required_ioport m_dswb; + + tilemap_t *m_bg_tilemap = nullptr; + uint8_t m_control_byte = 0; + void videoram_w(offs_t offset, uint8_t data); + void video_control_w(uint8_t data); + void scroll_w(uint8_t data); + + TILE_GET_INFO_MEMBER(get_bg_tile_info); + + uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + + void decrypted_opcodes_map(address_map &map); + void memmap(address_map &map); +}; + + +// video + +void mustache_state::videoram_w(offs_t offset, uint8_t data) +{ + m_videoram[offset] = data; + m_bg_tilemap->mark_tile_dirty(offset / 2); +} + +void mustache_state::video_control_w(uint8_t data) +{ + /* It is assumed that screen flipping is controlled by both + hardware (via a DIP switch, labeled "Hard SW" on the + operator's sheet) and software, as in some Irem games */ + flip_screen_set((data & 0x01) ^ BIT(~m_dswb->read(), 7)); + + // tile bank + if ((m_control_byte ^ data) & 0x08) + { + m_control_byte = data; + machine().tilemap().mark_all_dirty(); + } +} + +void mustache_state::scroll_w(uint8_t data) +{ + m_bg_tilemap->set_scrollx(0, 0x100 - data); + m_bg_tilemap->set_scrollx(1, 0x100 - data); + m_bg_tilemap->set_scrollx(2, 0x100 - data); + m_bg_tilemap->set_scrollx(3, 0x100); +} + +TILE_GET_INFO_MEMBER(mustache_state::get_bg_tile_info) +{ + int const attr = m_videoram[2 * tile_index + 1]; + int const code = m_videoram[2 * tile_index] + ((attr & 0x60) << 3) + ((m_control_byte & 0x08) << 7); + int const color = attr & 0x0f; + + tileinfo.set(0, code, color, ((attr & 0x10) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0)); + + +} + +void mustache_state::video_start() +{ + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(mustache_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS_FLIP_X, 8, 8, 64, 32); + + m_bg_tilemap->set_scroll_rows(4); + + save_item(NAME(m_control_byte)); +} + +void mustache_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + rectangle clip = cliprect; + gfx_element *gfx = m_gfxdecode->gfx(1); + const rectangle &visarea = m_screen->visible_area(); + + for (int offs = 0;offs < m_spriteram.bytes();offs += 4) + { + int sy = 240 - m_spriteram[offs]; + int sx = 240 - m_spriteram[offs + 3]; + int code = m_spriteram[offs + 2]; + int const attr = m_spriteram[offs + 1]; + int const color = (attr & 0xe0)>>5; + + if (sy == 240) continue; + + code += (attr & 0x0c) << 6; + + if ((m_control_byte & 0xa)) + clip.max_y = visarea.max_y; + else + if (flip_screen()) + clip.min_y = visarea.min_y + 56; + else + clip.max_y = visarea.max_y - 56; + + if (flip_screen()) + { + sx = 240 - sx; + sy = 232 - sy; + } + + gfx->transpen(bitmap, clip, + code, + color, + flip_screen(), flip_screen(), + sx, sy, 0); + } +} + +uint32_t mustache_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + draw_sprites(bitmap, cliprect); + return 0; +} + + +// machine void mustache_state::memmap(address_map &map) { map(0x0000, 0x7fff).r("sei80bu", FUNC(sei80bu_device::data_r)); map(0x8000, 0xbfff).rom(); - map(0xc000, 0xcfff).ram().w(FUNC(mustache_state::videoram_w)).share("videoram"); + map(0xc000, 0xcfff).ram().w(FUNC(mustache_state::videoram_w)).share(m_videoram); map(0xd000, 0xd000).w("t5182", FUNC(t5182_device::sound_irq_w)); map(0xd001, 0xd001).r("t5182", FUNC(t5182_device::sharedram_semaphore_snd_r)); map(0xd002, 0xd002).w("t5182", FUNC(t5182_device::sharedram_semaphore_main_acquire_w)); @@ -55,7 +213,7 @@ void mustache_state::memmap(address_map &map) map(0xd804, 0xd804).portr("DSWB"); map(0xd806, 0xd806).w(FUNC(mustache_state::scroll_w)); map(0xd807, 0xd807).w(FUNC(mustache_state::video_control_w)); - map(0xe800, 0xefff).writeonly().share("spriteram"); + map(0xe800, 0xefff).writeonly().share(m_spriteram); map(0xf000, 0xffff).ram(); } @@ -155,16 +313,16 @@ static const gfx_layout spritelayout = }; static GFXDECODE_START( gfx_mustache ) - GFXDECODE_ENTRY( "gfx1", 0, charlayout, 0x00, 16 ) - GFXDECODE_ENTRY( "gfx2", 0, spritelayout, 0x80, 8 ) + GFXDECODE_ENTRY( "tiles", 0, charlayout, 0x00, 16 ) + GFXDECODE_ENTRY( "sprites", 0, spritelayout, 0x80, 8 ) GFXDECODE_END void mustache_state::mustache(machine_config &config) { - /* basic machine hardware */ - Z80(config, m_maincpu, 12_MHz_XTAL/2); + // basic machine hardware + Z80(config, m_maincpu, 12_MHz_XTAL / 2); m_maincpu->set_addrmap(AS_PROGRAM, &mustache_state::memmap); m_maincpu->set_addrmap(AS_OPCODES, &mustache_state::decrypted_opcodes_map); @@ -172,7 +330,7 @@ void mustache_state::mustache(machine_config &config) T5182(config, "t5182", 0); - /* video hardware */ + // video hardware SCREEN(config, m_screen, SCREEN_TYPE_RASTER); m_screen->set_refresh_hz(56.747); m_screen->set_vblank_time(ATTOSECONDS_IN_USEC(2500)); @@ -185,10 +343,10 @@ void mustache_state::mustache(machine_config &config) GFXDECODE(config, m_gfxdecode, m_palette, gfx_mustache); PALETTE(config, m_palette, palette_device::RGB_444_PROMS, "proms", 256); - /* sound hardware */ + // sound hardware SPEAKER(config, "mono").front_center(); - ym2151_device &ymsnd(YM2151(config, "ymsnd", 14.318181_MHz_XTAL/4)); + ym2151_device &ymsnd(YM2151(config, "ymsnd", 14.318181_MHz_XTAL / 4)); ymsnd.irq_handler().set("t5182", FUNC(t5182_device::ym2151_irq_handler)); ymsnd.add_route(0, "mono", 0.5); ymsnd.add_route(1, "mono", 0.5); @@ -199,26 +357,26 @@ ROM_START( mustache ) ROM_LOAD( "mustache.h18", 0x0000, 0x8000, CRC(123bd9b8) SHA1(33a7cba5c3a54b0b1a15dd1e24d298b6f7274321) ) ROM_LOAD( "mustache.h16", 0x8000, 0x4000, CRC(62552beb) SHA1(ee10991d7de0596608fa1db48805781cbfbbdb9f) ) - ROM_REGION( 0x8000, "t5182_z80", 0 ) /* Toshiba T5182 external ROM */ + ROM_REGION( 0x8000, "t5182_z80", 0 ) // Toshiba T5182 external ROM ROM_LOAD( "mustache.e5", 0x0000, 0x8000, CRC(efbb1943) SHA1(3320e9eaeb776d09ed63f7dedc79e720674e6718) ) - ROM_REGION( 0x0c000, "gfx1",0) /* BG tiles */ + ROM_REGION( 0x0c000, "tiles",0) ROM_LOAD( "mustache.a13", 0x0000, 0x4000, CRC(9baee4a7) SHA1(31bcec838789462e67e54ebe7256db9fc4e51b69) ) ROM_LOAD( "mustache.a14", 0x4000, 0x4000, CRC(8155387d) SHA1(5f0a394c7671442519a831b0eeeaba4eecd5a406) ) ROM_LOAD( "mustache.a16", 0x8000, 0x4000, CRC(4db4448d) SHA1(50a94fd65c263d95fd24b4009dbb87707929fdcb) ) - ROM_REGION( 0x20000, "gfx2",0 ) /* sprites */ + ROM_REGION( 0x20000, "sprites",0 ) ROM_LOAD( "mustache.a4", 0x00000, 0x8000, CRC(d5c3bbbf) SHA1(914e3feea54246476701f492c31bd094ad9cea10) ) ROM_LOAD( "mustache.a7", 0x08000, 0x8000, CRC(e2a6012d) SHA1(4e4cd1a186870c8a88924d5bff917c6889da953d) ) ROM_LOAD( "mustache.a5", 0x10000, 0x8000, CRC(c975fb06) SHA1(4d166bd79e19c7cae422673de3e095ad8101e013) ) ROM_LOAD( "mustache.a8", 0x18000, 0x8000, CRC(2e180ee4) SHA1(a5684a25c337aeb4effeda7982164d35bc190af9) ) - ROM_REGION( 0x1300, "proms",0 ) /* proms */ + ROM_REGION( 0x1300, "proms",0 ) ROM_LOAD( "mustache.c3",0x0000, 0x0100, CRC(68575300) SHA1(bc93a38df91ad8c2f335f9bccc98b52376f9b483) ) ROM_LOAD( "mustache.c2",0x0100, 0x0100, CRC(eb008d62) SHA1(a370fbd1affaa489210ea36eb9e365263fb4e232) ) ROM_LOAD( "mustache.c1",0x0200, 0x0100, CRC(65da3604) SHA1(e4874d4152a57944d4e47306250833ea5cd0d89b) ) - ROM_LOAD( "mustache.b6",0x0300, 0x1000, CRC(5f83fa35) SHA1(cb13e63577762d818e5dcbb52b8a53f66e284e8f) ) /* 63S281N near SEI0070BU */ + ROM_LOAD( "mustache.b6",0x0300, 0x1000, CRC(5f83fa35) SHA1(cb13e63577762d818e5dcbb52b8a53f66e284e8f) ) // 63S281N near SEI0070BU ROM_END ROM_START( mustachei ) @@ -226,67 +384,69 @@ ROM_START( mustachei ) ROM_LOAD( "1.h18", 0x0000, 0x8000, CRC(22893fbc) SHA1(724ea50642aec9be10547bd86fae5e1ebfe54685) ) ROM_LOAD( "2.h16", 0x8000, 0x4000, CRC(ec70cfd3) SHA1(0476eab03b907778ea488c802b79da99bf376eb6) ) - ROM_REGION( 0x8000, "t5182_z80", 0 ) /* Toshiba T5182 external ROM */ + ROM_REGION( 0x8000, "t5182_z80", 0 ) // Toshiba T5182 external ROM ROM_LOAD( "10.e5", 0x0000, 0x8000, CRC(efbb1943) SHA1(3320e9eaeb776d09ed63f7dedc79e720674e6718) ) - ROM_REGION( 0x0c000, "gfx1",0) /* BG tiles */ + ROM_REGION( 0x0c000, "tiles",0) ROM_LOAD( "5.a13", 0x0000, 0x4000, CRC(9baee4a7) SHA1(31bcec838789462e67e54ebe7256db9fc4e51b69) ) ROM_LOAD( "4.a15", 0x4000, 0x4000, CRC(8155387d) SHA1(5f0a394c7671442519a831b0eeeaba4eecd5a406) ) ROM_LOAD( "3.a16", 0x8000, 0x4000, CRC(4db4448d) SHA1(50a94fd65c263d95fd24b4009dbb87707929fdcb) ) - ROM_REGION( 0x20000, "gfx2",0 ) /* sprites */ + ROM_REGION( 0x20000, "sprites",0 ) ROM_LOAD( "6.a4", 0x00000, 0x8000, CRC(4a95a89c) SHA1(b34ebbda9b0e591876988e42bd36fd505452f38c) ) ROM_LOAD( "8.a7", 0x08000, 0x8000, CRC(3e6be0fb) SHA1(319ea59107e37953c31f59f5f635fc520682b09f) ) ROM_LOAD( "7.a5", 0x10000, 0x8000, CRC(8ad38884) SHA1(e11f1e1db6d5d119afedbe6604d10a6fd6049f12) ) ROM_LOAD( "9.a8", 0x18000, 0x8000, CRC(3568c158) SHA1(c3a2120086befe396a112bd62f032638011cb47a) ) - ROM_REGION( 0x1300, "proms",0 ) /* proms */ + ROM_REGION( 0x1300, "proms",0 ) ROM_LOAD( "d.c3",0x0000, 0x0100, CRC(68575300) SHA1(bc93a38df91ad8c2f335f9bccc98b52376f9b483) ) ROM_LOAD( "c.c2",0x0100, 0x0100, CRC(eb008d62) SHA1(a370fbd1affaa489210ea36eb9e365263fb4e232) ) ROM_LOAD( "b.c1",0x0200, 0x0100, CRC(65da3604) SHA1(e4874d4152a57944d4e47306250833ea5cd0d89b) ) - ROM_LOAD( "a.b6",0x0300, 0x1000, CRC(5f83fa35) SHA1(cb13e63577762d818e5dcbb52b8a53f66e284e8f) ) /* 63S281N near SEI0070BU */ + ROM_LOAD( "a.b6",0x0300, 0x1000, CRC(5f83fa35) SHA1(cb13e63577762d818e5dcbb52b8a53f66e284e8f) ) // 63S281N near SEI0070BU ROM_END void mustache_state::init_mustache() { - int G1 = memregion("gfx1")->bytes()/3; - int G2 = memregion("gfx2")->bytes()/2; - uint8_t *gfx1 = memregion("gfx1")->base(); - uint8_t *gfx2 = memregion("gfx2")->base(); - std::vector buf(G2*2); - - /* BG data lines */ - for (int i = 0; i < G1; i++) + int g1 = memregion("tiles")->bytes() / 3; + int g2 = memregion("sprites")->bytes() / 2; + uint8_t *gfx1 = memregion("tiles")->base(); + uint8_t *gfx2 = memregion("sprites")->base(); + std::vector buf(g2 * 2); + + // BG data lines + for (int i = 0; i < g1; i++) { - buf[i] = bitswap<8>(gfx1[i], 0,5,2,6,4,1,7,3); + buf[i] = bitswap<8>(gfx1[i], 0, 5, 2, 6, 4, 1, 7, 3); - uint16_t w = (gfx1[i+G1] << 8) | gfx1[i+G1*2]; - w = bitswap<16>(w, 14,1,13,5,9,2,10,6, 3,8,4,15,0,11,12,7); + uint16_t w = (gfx1[i + g1] << 8) | gfx1[i + g1 * 2]; + w = bitswap<16>(w, 14, 1, 13, 5, 9, 2, 10, 6, 3, 8, 4, 15, 0, 11, 12, 7); - buf[i+G1] = w >> 8; - buf[i+G1*2] = w & 0xff; + buf[i + g1] = w >> 8; + buf[i + g1 * 2] = w & 0xff; } - /* BG address lines */ - for (int i = 0; i < 3*G1; i++) - gfx1[i] = buf[bitswap<16>(i,15,14,13,2,1,0,12,11,10,9,8,7,6,5,4,3)]; + // BG address lines + for (int i = 0; i < 3 * g1; i++) + gfx1[i] = buf[bitswap<16>(i, 15, 14, 13, 2, 1, 0, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3)]; - /* SPR data lines */ - for (int i = 0; i < G2; i++) + // SPR data lines + for (int i = 0; i < g2; i++) { - uint16_t w = (gfx2[i] << 8) | gfx2[i+G2]; - w = bitswap<16>(w, 5,7,11,4,15,10,3,14, 9,2,13,8,1,12,0,6 ); + uint16_t w = (gfx2[i] << 8) | gfx2[i + g2]; + w = bitswap<16>(w, 5, 7, 11, 4, 15, 10, 3, 14, 9, 2, 13, 8, 1, 12, 0, 6); - buf[i] = w >> 8; - buf[i+G2] = w & 0xff; + buf[i] = w >> 8; + buf[i + g2] = w & 0xff; } - /* SPR address lines */ - for (int i = 0; i < 2*G2; i++) - gfx2[i] = buf[bitswap<24>(i,23,22,21,20,19,18,17,16,15,12,11,10,9,8,7,6,5,4,13,14,3,2,1,0)]; + // SPR address lines + for (int i = 0; i < 2 * g2; i++) + gfx2[i] = buf[bitswap<24>(i,23, 22, 21, 20, 19, 18, 17, 16, 15, 12, 11, 10, 9, 8, 7, 6, 5, 4, 13, 14, 3, 2, 1, 0)]; } +} // anonymous namespace + GAME( 1987, mustache, 0, mustache, mustache, mustache_state, init_mustache, ROT90, "Seibu Kaihatsu (March license)", "Mustache Boy (Japan)", MACHINE_SUPPORTS_SAVE ) GAME( 1987, mustachei, mustache, mustache, mustache, mustache_state, init_mustache, ROT90, "Seibu Kaihatsu (IG SPA license)", "Mustache Boy (Italy)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/seibu/mustache.h b/src/mame/seibu/mustache.h deleted file mode 100644 index 48b39bf0552..00000000000 --- a/src/mame/seibu/mustache.h +++ /dev/null @@ -1,64 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Tomasz Slanina -#ifndef MAME_SEIBU_MUSTACHE_H -#define MAME_SEIBU_MUSTACHE_H - -#pragma once - -#include "seibusound.h" // for seibu_sound_decrypt on the MAIN cpu (not sound) - -#include "machine/timer.h" - -#include "emupal.h" -#include "screen.h" -#include "tilemap.h" - - -class mustache_state : public driver_device -{ -public: - mustache_state(const machine_config &mconfig, device_type type, const char *tag) : - driver_device(mconfig, type, tag), - m_maincpu(*this, "maincpu"), - m_gfxdecode(*this, "gfxdecode"), - m_screen(*this, "screen"), - m_palette(*this, "palette"), - m_videoram(*this, "videoram"), - m_spriteram(*this, "spriteram"), - m_dswb(*this, "DSWB") - { } - - void mustache(machine_config &config); - - void init_mustache(); - -private: - required_device m_maincpu; - required_device m_gfxdecode; - required_device m_screen; - required_device m_palette; - - required_shared_ptr m_videoram; - required_shared_ptr m_spriteram; - - required_ioport m_dswb; - - tilemap_t *m_bg_tilemap = nullptr; - int m_control_byte = 0; - - void videoram_w(offs_t offset, uint8_t data); - void video_control_w(uint8_t data); - void scroll_w(uint8_t data); - - TILE_GET_INFO_MEMBER(get_bg_tile_info); - - virtual void video_start() override; - - uint32_t screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ); - - void decrypted_opcodes_map(address_map &map); - void memmap(address_map &map); -}; - -#endif // MAME_SEIBU_MUSTACHE_H diff --git a/src/mame/seibu/mustache_v.cpp b/src/mame/seibu/mustache_v.cpp deleted file mode 100644 index d792286cf9b..00000000000 --- a/src/mame/seibu/mustache_v.cpp +++ /dev/null @@ -1,111 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Tomasz Slanina -/*************************************************************************** - - Mustache Boy - (c)1987 March Electronics - -***************************************************************************/ - - -#include "emu.h" -#include "mustache.h" - - -void mustache_state::videoram_w(offs_t offset, uint8_t data) -{ - m_videoram[offset] = data; - m_bg_tilemap->mark_tile_dirty(offset / 2); -} - -void mustache_state::video_control_w(uint8_t data) -{ - /* It is assumed that screen flipping is controlled by both - hardware (via a DIP switch, labeled "Hard SW" on the - operator's sheet) and software, as in some Irem games */ - flip_screen_set((data & 0x01) ^ BIT(~m_dswb->read(), 7)); - - /* tile bank */ - if ((m_control_byte ^ data) & 0x08) - { - m_control_byte = data; - machine().tilemap().mark_all_dirty(); - } -} - -void mustache_state::scroll_w(uint8_t data) -{ - m_bg_tilemap->set_scrollx(0, 0x100 - data); - m_bg_tilemap->set_scrollx(1, 0x100 - data); - m_bg_tilemap->set_scrollx(2, 0x100 - data); - m_bg_tilemap->set_scrollx(3, 0x100); -} - -TILE_GET_INFO_MEMBER(mustache_state::get_bg_tile_info) -{ - int attr = m_videoram[2 * tile_index + 1]; - int code = m_videoram[2 * tile_index] + ((attr & 0x60) << 3) + ((m_control_byte & 0x08) << 7); - int color = attr & 0x0f; - - tileinfo.set(0, code, color, ((attr & 0x10) ? TILE_FLIPX : 0) | ((attr & 0x80) ? TILE_FLIPY : 0) ); - - -} - -void mustache_state::video_start() -{ - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(mustache_state::get_bg_tile_info)), TILEMAP_SCAN_ROWS_FLIP_X, - 8, 8, 64, 32); - - m_bg_tilemap->set_scroll_rows(4); - - save_item(NAME(m_control_byte)); -} - -void mustache_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect ) -{ - rectangle clip = cliprect; - gfx_element *gfx = m_gfxdecode->gfx(1); - const rectangle &visarea = m_screen->visible_area(); - int offs; - - for (offs = 0;offs < m_spriteram.bytes();offs += 4) - { - int sy = 240-m_spriteram[offs]; - int sx = 240-m_spriteram[offs+3]; - int code = m_spriteram[offs+2]; - int attr = m_spriteram[offs+1]; - int color = (attr & 0xe0)>>5; - - if (sy == 240) continue; - - code+=(attr&0x0c)<<6; - - if ((m_control_byte & 0xa)) - clip.max_y = visarea.max_y; - else - if (flip_screen()) - clip.min_y = visarea.min_y + 56; - else - clip.max_y = visarea.max_y - 56; - - if (flip_screen()) - { - sx = 240 - sx; - sy = 232 - sy; - } - - gfx->transpen(bitmap,clip, - code, - color, - flip_screen(),flip_screen(), - sx,sy,0); - } -} - -uint32_t mustache_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - draw_sprites(bitmap, cliprect); - return 0; -} -- cgit v1.2.3