From 7cacfb12d86c20cfb4162c55dd52e730e1d68171 Mon Sep 17 00:00:00 2001 From: David Haywood <28625134+DavidHaywood@users.noreply.github.com> Date: Sat, 25 Apr 2020 18:57:30 +0100 Subject: [PATCH] drgnmst.cpp : mastfury - improve background rendering (nw) + cps1.cpp : actually mark Gulun.Pa! as working (nw) (#6593) * drnmst.cpp : mastfury - improve background rendering (nw) * also promote Gulun.Pa!, remove old comment about bad ROM, add new comment about suspect one, and mark as a prototype - it has been functional since the first ROM redump, credits are unhchanged from before (nw) --- src/mame/drivers/cps1.cpp | 11 ++++-- src/mame/includes/drgnmst.h | 17 +++++--- src/mame/video/drgnmst.cpp | 77 +++++++++++++++++++++++++++++-------- 3 files changed, 80 insertions(+), 25 deletions(-) diff --git a/src/mame/drivers/cps1.cpp b/src/mame/drivers/cps1.cpp index c9717611446..697a7fbcb32 100644 --- a/src/mame/drivers/cps1.cpp +++ b/src/mame/drivers/cps1.cpp @@ -13261,7 +13261,7 @@ ROM_START( pokonyan ) */ ROM_END -ROM_START( gulunpa ) +ROM_START( gulunpa ) // ROMs could do with 2nd pass dump verification ROM_REGION( CODE_SIZE, "maincpu", 0 ) /* 68000 code */ ROM_LOAD16_BYTE( "26", 0x00000, 0x020000, CRC(f30ffa29) SHA1(9e70daf4229485dc5700b074dba55839c7357351) ) ROM_LOAD16_BYTE( "30", 0x00001, 0x020000, CRC(5d35f737) SHA1(47b6bfa6eaa512684e12c23162243d1a21cb1a7a) ) @@ -13274,15 +13274,18 @@ ROM_START( gulunpa ) ROM_LOAD64_WORD( "1", 0x000000, 0x080000, CRC(b55e648f) SHA1(e22eec707b3b1ad8fb93c0f2df41ccf72cd03440) ) ROM_LOAD64_WORD( "2", 0x000002, 0x080000, CRC(ad033bce) SHA1(b37b1d341e61502aa4213b049b14974fab8a0445) ) ROM_LOAD64_WORD( "3", 0x000004, 0x080000, CRC(36c3951a) SHA1(74edaca2c78dd6a304ea702091a9f0b7f6036e41) ) - ROM_LOAD64_WORD( "4", 0x000006, 0x080000, CRC(ff0cb826) SHA1(fec7833652e6789e886a1ec7b4680a608ddbbe20) ) + ROM_LOAD64_WORD( "4", 0x000006, 0x080000, BAD_DUMP CRC(ff0cb826) SHA1(fec7833652e6789e886a1ec7b4680a608ddbbe20) ) + ROM_FILL(0x000006, 1, 0xff) // patch first byte of ROM 4 pending redump (corrupt top line of 0 character, 8x8 tile data should match between ROM pairs) // ROM_COPY( "gfx", 0x000000, 0x200000, 0x200000 ) ROM_REGION( 0x40000, "oki", ROMREGION_ERASEFF ) /* Samples */ ROM_LOAD( "18", 0x00000, 0x20000, CRC(9997a34f) SHA1(8e107d6413836c48fc57e4a9b89ae99a9e381e8b) ) ROM_LOAD( "19", 0x20000, 0x20000, CRC(e95270ac) SHA1(dc684abfa1ea276a00ec541ab8f3f9f131375faa) ) + + // TODO: plds etc. ROM_END -/* Home 'CPS Changer' Unit - For MESS */ +/* Home 'CPS Changer' Unit */ /* B-Board 91635B-2 */ ROM_START( wofch ) @@ -13948,7 +13951,7 @@ GAME( 1993, slammastu, slammast, qsound, slammast, cps_state, init_slammas GAME( 1993, mbomberj, slammast, qsound, slammast, cps_state, init_slammast, ROT0, "Capcom", "Muscle Bomber: The Body Explosion (Japan 930713)", MACHINE_SUPPORTS_SAVE ) GAME( 1993, mbombrd, 0, qsound, slammast, cps_state, init_slammast, ROT0, "Capcom", "Muscle Bomber Duo: Ultimate Team Battle (World 931206)", MACHINE_SUPPORTS_SAVE ) // "ETC" GAME( 1993, mbombrdj, mbombrd, qsound, slammast, cps_state, init_slammast, ROT0, "Capcom", "Muscle Bomber Duo: Heat Up Warriors (Japan 931206)", MACHINE_SUPPORTS_SAVE ) -GAME( 1993, gulunpa, 0, cps1_10MHz, gulunpa, cps_state, init_cps1, ROT0, "Capcom", "Gulun.Pa! (Japan 931220 L)", MACHINE_SUPPORTS_SAVE | MACHINE_NOT_WORKING | MACHINE_IMPERFECT_GRAPHICS ) // has bad gfx rom, assume Capcom from logo in gfx bank, unknown board origin +GAME( 1993, gulunpa, 0, cps1_10MHz, gulunpa, cps_state, init_cps1, ROT0, "Capcom", "Gulun.Pa! (Japan 931220 L) (prototype)", MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_GRAPHICS ) // assume Capcom from logo in gfx bank, unknown board origin GAME( 1994, pnickj, 0, cps1_12MHz, pnickj, cps_state, init_cps1, ROT0, "Capcom", "Pnickies (Japan 940608)", MACHINE_SUPPORTS_SAVE ) // Puyo Puyo puzzlegame concept licensed from Compile, this game is by Capcom GAME( 1995, qtono2j, 0, cps1_12MHz, qtono2j, cps_state, init_cps1, ROT0, "Capcom", "Quiz Tonosama no Yabou 2: Zenkoku-ban (Japan 950123)", MACHINE_SUPPORTS_SAVE ) GAME( 1995, megaman, 0, cps1_12MHz, megaman, cps_state, init_cps1, ROT0, "Capcom", "Mega Man: The Power Battle (CPS1, USA 951006)", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/includes/drgnmst.h b/src/mame/includes/drgnmst.h index 6da75cde549..f1ae69b0617 100644 --- a/src/mame/includes/drgnmst.h +++ b/src/mame/includes/drgnmst.h @@ -19,6 +19,7 @@ public: drgnmst_base_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), + m_alt_scrolling(false), m_vidregs(*this, "vidregs"), m_fg_videoram(*this, "fg_videoram"), m_bg_videoram(*this, "bg_videoram"), @@ -40,6 +41,13 @@ protected: void drgnmst_main_map(address_map &map); required_device m_maincpu; + /* video-related */ + tilemap_t *m_bg_tilemap; + tilemap_t *m_fg_tilemap; + tilemap_t *m_md_tilemap; + + bool m_alt_scrolling; + private: /* memory pointers */ required_shared_ptr m_vidregs; @@ -50,12 +58,6 @@ private: required_shared_ptr m_vidregs2; required_shared_ptr m_spriteram; - - /* video-related */ - tilemap_t *m_bg_tilemap; - tilemap_t *m_fg_tilemap; - tilemap_t *m_md_tilemap; - /* devices */ DECLARE_WRITE16_MEMBER(coin_w); DECLARE_WRITE16_MEMBER(fg_videoram_w); @@ -133,6 +135,9 @@ public: void drgnmst_ym(machine_config& config); +protected: + virtual void video_start() override; + private: required_device m_oki; diff --git a/src/mame/video/drgnmst.cpp b/src/mame/video/drgnmst.cpp index 45b29e14d31..393931284df 100644 --- a/src/mame/video/drgnmst.cpp +++ b/src/mame/video/drgnmst.cpp @@ -27,12 +27,21 @@ rgb_t drgnmst_base_state::drgnmst_IIIIRRRRGGGGBBBB(uint32_t raw) TILE_GET_INFO_MEMBER(drgnmst_base_state::get_fg_tile_info) { + // 8x8 tile layer int tileno, colour, flipyx; tileno = m_fg_videoram[tile_index * 2] & 0xfff; colour = m_fg_videoram[tile_index * 2 + 1] & 0x1f; flipyx = (m_fg_videoram[tile_index * 2 + 1] & 0x60)>>5; + + if ((m_fg_videoram[tile_index * 2] & 0x4000)) + tileno |= 0x10000; - tileno |= (BIT(tile_index, 5)) << 15; // 8x8 tile bank seems like cps1 (not on mastfury? or because bad dump) + if ((m_fg_videoram[tile_index * 2] & 0x8000)) + tileno |= 0x8000; + + tileno ^= 0x18000; + +// tileno |= (BIT(tile_index, 5)) << 15; // 8x8 tile bank seems like cps1 (not on mastfury at least) tileinfo.set(1, tileno, colour, TILE_FLIPYX(flipyx)); } @@ -44,11 +53,17 @@ WRITE16_MEMBER(drgnmst_base_state::fg_videoram_w) TILE_GET_INFO_MEMBER(drgnmst_base_state::get_bg_tile_info) { + // 32x32 tile layer int tileno, colour, flipyx; - tileno = (m_bg_videoram[tile_index * 2]& 0x1fff) + 0x800; + tileno = (m_bg_videoram[tile_index * 2] & 0x3ff) + 0xc00; colour = m_bg_videoram[tile_index * 2 + 1] & 0x1f; flipyx = (m_bg_videoram[tile_index * 2 + 1] & 0x60) >> 5; + if ((m_bg_videoram[tile_index * 2] & 0x1000)) + tileno |= 0x1000; + + tileno ^= 0x1000; + tileinfo.set(3, tileno, colour, TILE_FLIPYX(flipyx)); } @@ -60,11 +75,17 @@ WRITE16_MEMBER(drgnmst_base_state::bg_videoram_w) TILE_GET_INFO_MEMBER(drgnmst_base_state::get_md_tile_info) { + // 16x16 tile layer int tileno, colour, flipyx; - tileno = (m_md_videoram[tile_index * 2] & 0x7fff) - 0x2000; + tileno = (m_md_videoram[tile_index * 2] & 0x3fff) - 0x2000; colour = m_md_videoram[tile_index * 2 + 1] & 0x1f; flipyx = (m_md_videoram[tile_index * 2 + 1] & 0x60) >> 5; + if ((m_md_videoram[tile_index * 2] & 0x4000)) + tileno |= 0x4000; + + tileno ^= 0x4000; + tileinfo.set(2, tileno, colour, TILE_FLIPYX(flipyx)); } @@ -113,7 +134,7 @@ void drgnmst_base_state::draw_sprites( bitmap_ind16 &bitmap,const rectangle &cli realy = ypos + incy * y; realnumber = number + x + y * 16; - gfx->transpen(bitmap,cliprect, realnumber, colr, flipx, flipy, realx, realy, 15); + gfx->transpen(bitmap,cliprect, realnumber, colr, flipx, flipy, realx, realy, 15); } } source += 4; @@ -151,23 +172,46 @@ void drgnmst_base_state::video_start() m_md_tilemap->set_scroll_rows(1024); } +void drgnmst_ym_state::video_start() +{ + drgnmst_base_state::video_start(); + m_alt_scrolling = true; +} + uint32_t drgnmst_base_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) { - int y, rowscroll_bank; + m_fg_tilemap->set_scrollx(0, m_vidregs[0x6] - 18); // verify (test mode colour test needs it) + m_fg_tilemap->set_scrolly(0, m_vidregs[0x7]); // verify - m_bg_tilemap->set_scrollx(0, m_vidregs[10] - 18); // verify - m_bg_tilemap->set_scrolly(0, m_vidregs[11]); // verify + int rowscroll_bank = (m_vidregs[4] & 0x30) >> 4; -// m_md_tilemap->set_scrollx(0, m_vidregs[8] - 16); // rowscrolled - m_md_tilemap->set_scrolly(0, m_vidregs[9]); // verify + if (!m_alt_scrolling) + { + m_bg_tilemap->set_scrollx(0, m_vidregs[0xa] - 18); // verify + m_bg_tilemap->set_scrolly(0, m_vidregs[0xb]); // verify - m_fg_tilemap->set_scrollx(0, m_vidregs[6] - 18); // verify (test mode colour test needs it) - m_fg_tilemap->set_scrolly(0, m_vidregs[7]); // verify + // m_md_tilemap->set_scrollx(0, m_vidregs[0x8] - 16); // rowscrolled + m_md_tilemap->set_scrolly(0, m_vidregs[0x9]); // verify - rowscroll_bank = (m_vidregs[4] & 0x30) >> 4; + for (int y = 0; y < 1024; y++) + m_md_tilemap->set_scrollx(y, m_vidregs[0x8] - 16 + m_rowscrollram[y + 0x800 * rowscroll_bank]); + + m_bg_tilemap->set_scrollx(0, m_vidregs[0xa] - 18); // verify + m_bg_tilemap->set_scrolly(0, m_vidregs[0xb]); // verify + } + else + { + // m_md_tilemap->set_scrollx(0, m_vidregs[0x9] - 16); // rowscrolled + m_md_tilemap->set_scrolly(0, m_vidregs[0x8]); // verify + + for (int y = 0; y < 1024; y++) + m_md_tilemap->set_scrollx(y, m_vidregs[0x9] - 16 + m_rowscrollram[y + 0x800 * rowscroll_bank]); + + m_bg_tilemap->set_scrollx(0, m_vidregs[0xa] - 18); // verify + m_bg_tilemap->set_scrolly(0, m_vidregs[0xb] -0x400); // verify + + } - for (y = 0; y < 1024; y++) - m_md_tilemap->set_scrollx(y, m_vidregs[8] - 16 + m_rowscrollram[y + 0x800 * rowscroll_bank]); // todo: figure out which bits relate to the order switch (m_vidregs2[0]) @@ -208,7 +252,10 @@ uint32_t drgnmst_base_state::screen_update(screen_device &screen, bitmap_ind16 & draw_sprites(bitmap,cliprect); // popmessage ("x %04x x %04x x %04x x %04x x %04x", m_vidregs2[0], m_vidregs[12], m_vidregs[13], m_vidregs[14], m_vidregs[15]); -// popmessage ("x %04x x %04x y %04x y %04x z %04x z %04x",m_vidregs[0],m_vidregs[1],m_vidregs[2],m_vidregs[3],m_vidregs[4],m_vidregs[5]); + + //popmessage ("x objbase: %04x scr0base %04x scr1base %04x scr2base %04x otherbase %04x palbase %04x",m_vidregs[0],m_vidregs[1],m_vidregs[2],m_vidregs[3],m_vidregs[4],m_vidregs[5]); + //popmessage ("x fgx: %04x fgy: %04x 16x: %04x 16y: %04x 32x: %04x 32y: %04x",m_vidregs[0x6],m_vidregs[0x7],m_vidregs[0x8],m_vidregs[0x9],m_vidregs[0xa],m_vidregs[0xb]); return 0; } +