From 61e62eab5d6ce0c3213d0380b5d41a45139a0bcb Mon Sep 17 00:00:00 2001 From: angelosa Date: Tue, 28 May 2024 01:15:51 +0200 Subject: konami/konamigx.cpp: fix PSAC4 color offset and gfxdecode bitplanes, honor cliprect --- src/mame/konami/konamigx.cpp | 13 +++++++------ src/mame/konami/konamigx_v.cpp | 44 +++++++++++++++++++++++++++--------------- 2 files changed, 35 insertions(+), 22 deletions(-) diff --git a/src/mame/konami/konamigx.cpp b/src/mame/konami/konamigx.cpp index e5a5b75ca95..62156b5833b 100644 --- a/src/mame/konami/konamigx.cpp +++ b/src/mame/konami/konamigx.cpp @@ -1602,7 +1602,7 @@ static const gfx_layout t1_charlayout6 = 16, 16, RGN_FRAC(1,1), 6, - { 20, 16, 12, 8, 4, 0 }, + { 16, 20, 8, 12, 0, 4 }, { 0, 12*8, 12*8*2, 12*8*3, 12*8*4, 12*8*5, 12*8*6, 12*8*7, 12*8*8, 12*8*9, 12*8*10, 12*8*11, 12*8*12, 12*8*13, 12*8*14, 12*8*15 }, { 3, 2, 1, 0, 27, 26, 25, 24, 51, 50, 49, 48, 75, 74, 73, 72 }, @@ -1614,7 +1614,7 @@ static const gfx_layout t1_charlayout8 = 16, 16, RGN_FRAC(1,1), 8, - { 28, 24, 20, 16, 12, 8, 4, 0 }, + { 24, 28, 16, 20, 8, 12, 0, 4 }, { 0, 16*8, 16*8*2, 16*8*3, 16*8*4, 16*8*5, 16*8*6, 16*8*7, 16*8*8, 16*8*9, 16*8*10, 16*8*11, 16*8*12, 16*8*13, 16*8*14, 16*8*15 }, { 3, 2, 1, 0, 35, 34, 33, 32, 67, 66, 65, 64, 99, 98, 97, 96 }, @@ -1622,14 +1622,15 @@ static const gfx_layout t1_charlayout8 = }; /* type 1 (opengolf + racinfrc) use 6 and 8 bpp planar layouts for the 53936 */ +// TODO: pinpoint color size static GFXDECODE_START( gfx_opengolf ) - GFXDECODE_ENTRY( "gfx3", 0, t1_charlayout8, 0x0000, 8 ) - GFXDECODE_ENTRY( "gfx4", 0, t1_charlayout6, 0x0000, 8 ) + GFXDECODE_ENTRY( "gfx3", 0, t1_charlayout8, 0x0000, 32 ) + GFXDECODE_ENTRY( "gfx4", 0, t1_charlayout6, 0x0000, 128 ) GFXDECODE_END static GFXDECODE_START( gfx_racinfrc ) - GFXDECODE_ENTRY( "gfx3", 0, t1_charlayout6, 0x0000, 8 ) - GFXDECODE_ENTRY( "gfx4", 0, t1_charlayout6, 0x0000, 8 ) + GFXDECODE_ENTRY( "gfx3", 0, t1_charlayout6, 0x0000, 128 ) + GFXDECODE_ENTRY( "gfx4", 0, t1_charlayout6, 0x0000, 128 ) GFXDECODE_END /* type 3 & 4 games use a simple 8bpp decode for the 53936 */ diff --git a/src/mame/konami/konamigx_v.cpp b/src/mame/konami/konamigx_v.cpp index 34ac7efc7ef..880a634a6b7 100644 --- a/src/mame/konami/konamigx_v.cpp +++ b/src/mame/konami/konamigx_v.cpp @@ -992,14 +992,26 @@ TILE_GET_INFO_MEMBER(konamigx_state::get_gx_psac3_alt_tile_info) } -/* PSAC4 */ +/* + * PSAC4 + * + * racinfrc title screen prints this watermark in ROZ at origin 0,0: + * SYSTEM NWK250^tm + * -THE HI-SPEED PSAC4 DRIVER + * \tWITH SKIPPING+DROPPING REDUCED + * -SCREEN SYSTEM + * \t2^16x2^16 IMAGINALLY AREA (sic) + * -CHARACTER SYSTEM + * + * (c)KONAMI 1993 + * + */ /* these tilemaps are weird in both format and content, one of them doesn't really look like it should be displayed? - it's height data */ TILE_GET_INFO_MEMBER(konamigx_state::get_gx_psac1a_tile_info) { int tileno, colour, flipx,flipy; - int flip; - flip=0; + int flip = 0; colour = 0; tileno = (m_psacram[tile_index*2] & 0x00003fff)>>0; @@ -1020,18 +1032,20 @@ TILE_GET_INFO_MEMBER(konamigx_state::get_gx_psac1a_tile_info) TILE_GET_INFO_MEMBER(konamigx_state::get_gx_psac1b_tile_info) { int tileno, colour, flipx,flipy; - int flip; - flip=0; + int flip = 0; - colour = 0; - tileno = (m_psacram[tile_index*2+1] & 0x00003fff)>>0; + // FIXME: has at least 32 entries of valid colors + // (from z-value as color depth effect?) + colour = (m_psacram[tile_index*2 + 1] & 0x000c'0000) >> 18; + // TODO: 0x7fff mask for opengolf + tileno = (m_psacram[tile_index*2 + 1] & 0x0000'3fff) >> 0; // scanrows - //flipx = (m_psacram[tile_index*2+1] & 0x00800000)>>23; - //flipy = (m_psacram[tile_index*2+1] & 0x00400000)>>22; + //flipx = (m_psacram[tile_index*2 + 1] & 0x0080'0000) >> 23; + //flipy = (m_psacram[tile_index*2 + 1] & 0x0040'0000) >> 22; // scancols - flipy = (m_psacram[tile_index*2+1] & 0x00200000)>>21; - flipx = (m_psacram[tile_index*2+1] & 0x00100000)>>20; + flipy = (m_psacram[tile_index*2 + 1] & 0x0020'0000) >> 21; + flipx = (m_psacram[tile_index*2 + 1] & 0x0010'0000) >> 20; if (flipx) flip |= TILE_FLIPX; if (flipy) flip |= TILE_FLIPY; @@ -1454,9 +1468,7 @@ uint32_t konamigx_state::screen_update_konamigx(screen_device &screen, bitmap_rg konamigx_mixer(screen, bitmap, cliprect, nullptr, 0, nullptr, 0, 0, nullptr, m_gx_rushingheroes_hack); } - - - /* Hack! draw type-1 roz layer here for testing purposes only */ + // HACK: draw type-1 roz layer here for testing purposes only if (m_gx_specialrozenable == 1) { pen_t const *const paldata = m_palette->pens(); @@ -1467,7 +1479,7 @@ uint32_t konamigx_state::screen_update_konamigx(screen_device &screen, bitmap_rg // make it flicker, to compare positioning //if (screen.frame_number() & 1) { - for (int y=0;y<256;y++) + for (int y = cliprect.min_y; y <= cliprect.max_y; y++) { //uint32_t *const dst = &bitmap.pix(y); // ths K053936 rendering should probably just be flipped @@ -1477,7 +1489,7 @@ uint32_t konamigx_state::screen_update_konamigx(screen_device &screen, bitmap_rg uint32_t *const dst = &bitmap.pix((256+16)-y); - for (int x=0;x<512;x++) + for (int x = cliprect.min_x; x <= cliprect.max_x;x++) { uint16_t const dat = src[x]; dst[x] = paldata[dat]; -- cgit v1.2.3