From 2437a88f225cb90fd6ecc41b69812bfdedb45d9a Mon Sep 17 00:00:00 2001 From: mooglyguy Date: Wed, 9 Jan 2019 01:02:27 +0100 Subject: [PATCH] Machines promoted to working -------- Fantastic Four (JAKKS Pacific TV Game) [David Haywood, Ryan Holtz] spg2xx: Fixed regression with Y-flipped tilemap tiles (nw) --- src/devices/machine/spg2xx.cpp | 33 +++++++++++++++++++++------------ src/mame/drivers/vii.cpp | 13 +++++++------ 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/src/devices/machine/spg2xx.cpp b/src/devices/machine/spg2xx.cpp index 95814ab145b..46bb3d83286 100644 --- a/src/devices/machine/spg2xx.cpp +++ b/src/devices/machine/spg2xx.cpp @@ -291,7 +291,7 @@ void spg2xx_device::blit(const rectangle &cliprect, uint32_t line, uint32_t xoff uint32_t palette_offset = (attr & 0x0f00) >> 4; if (m_debug_blit && SPG_DEBUG_VIDEO) { - printf("line:%d xy:%08x,%08x attr:%08x ctrl:%08x bitmap_addr:%08x tile:%04x\n", line, xoff, yoff, attr, ctrl, bitmap_addr, tile); + printf("s:%d line:%d xy:%08x,%08x attr:%08x ctrl:%08x bitmap_addr:%08x tile:%04x\n", cliprect.min_x, line, xoff, yoff, attr, ctrl, bitmap_addr, tile); printf("hw:%d,%d f:%d,%d fm:%d,%d ncols:%d pobs:%02x ", w, h, (attr & TILE_X_FLIP) ? 1 : 0, (attr & TILE_Y_FLIP) ? 1 : 0, xflipmask, yflipmask, nc, palette_offset); } palette_offset >>= nc; @@ -303,12 +303,12 @@ void spg2xx_device::blit(const rectangle &cliprect, uint32_t line, uint32_t xoff uint32_t bits_per_row = nc * w / 16; uint32_t words_per_tile = bits_per_row * h; - uint32_t m = bitmap_addr + words_per_tile * tile + bits_per_row * line; + uint32_t m = bitmap_addr + words_per_tile * tile + bits_per_row * (line ^ yflipmask); uint32_t bits = 0; uint32_t nbits = 0; uint32_t y = line; - int yy = (yoff + (y ^ yflipmask)) & 0x1ff; + int yy = (yoff + y) & 0x1ff; if (yy >= 0x01c0) yy -= 0x0200; @@ -402,7 +402,11 @@ void spg2xx_device::blit_page(const rectangle &cliprect, uint32_t scanline, int uint32_t y0 = bitmap_y / tile_h; uint32_t tile_scanline = bitmap_y % tile_h; uint32_t tile_address = tile_count_x * y0; + if (SPG_DEBUG_VIDEO && machine().input().code_pressed(KEYCODE_H)) + printf("s:%3d | baddr:%08x | yscr:%3d | bity:%3d | y0:%2d | ts:%2d\n", scanline, bitmap_addr, yscroll, bitmap_y, y0, tile_scanline); + if (SPG_DEBUG_VIDEO && machine().input().code_pressed(KEYCODE_EQUALS)) + m_debug_blit = true; for (uint32_t x0 = 0; x0 < tile_count_x; x0++, tile_address++) { uint32_t yy = ((tile_h * y0 - yscroll + 0x10) & 0xff) - 0x10; @@ -438,6 +442,8 @@ void spg2xx_device::blit_page(const rectangle &cliprect, uint32_t scanline, int blit(cliprect, tile_scanline, xx, yy, tileattr, tilectrl, bitmap_addr, tile); } + if (SPG_DEBUG_VIDEO && machine().input().code_pressed(KEYCODE_EQUALS)) + m_debug_blit = false; } void spg2xx_device::blit_sprite(const rectangle &cliprect, uint32_t scanline, int depth, uint32_t base_addr) @@ -472,13 +478,22 @@ void spg2xx_device::blit_sprite(const rectangle &cliprect, uint32_t scanline, in x &= 0x01ff; y &= 0x01ff; - if (y > scanline) - return; + static bool check_y = true; + + if (SPG_DEBUG_VIDEO && machine().input().code_pressed_once(KEYCODE_J)) + check_y = !check_y; uint32_t tile_line = ((scanline - y) + 0x200) % h; + int16_t test_y = (y + tile_line) & 0x1ff; + if (test_y >= 0x01c0) + test_y -= 0x0200; - if (tile_line >= h) + if (test_y > scanline && check_y) + { + if (SPG_DEBUG_VIDEO && machine().input().code_pressed(KEYCODE_L)) + printf("Rejecting because %d > %d\n", test_y, scanline); return; + } #if SPG_DEBUG_VIDEO if (m_debug_sprites && machine().input().code_pressed(KEYCODE_MINUS)) @@ -1607,12 +1622,6 @@ void spg2xx_device::system_timer_tick() uint16_t check_mask = 0x0040; IO_IRQ_STATUS |= 0x0040; - if (machine().input().code_pressed_once(KEYCODE_H)) - { - IO_IRQ_STATUS |= 0x4000; - check_irqs(0x4000); - } - m_2khz_divider++; if (m_2khz_divider == 2) { diff --git a/src/mame/drivers/vii.cpp b/src/mame/drivers/vii.cpp index c05d7da656a..7cafee905ad 100644 --- a/src/mame/drivers/vii.cpp +++ b/src/mame/drivers/vii.cpp @@ -5,9 +5,9 @@ Short Description: Systems which run on the SPG243 SoC - + ( die markings show "SunPlus QL8041" on JAKKS WWE / Fantastic 4 / Justice League, Dora the Explorer, Mattel Classic Sports ) - + Status: Mostly working @@ -361,7 +361,7 @@ static INPUT_PORTS_START( jak_gkr ) PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_BIT( 0x0040, IP_ACTIVE_HIGH, IPT_BUTTON3 ) PORT_BIT( 0x0080, IP_ACTIVE_HIGH, IPT_BUTTON4 ) - + PORT_START("C") PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_CUSTOM ) PORT_CUSTOM_MEMBER(DEVICE_SELF, spg2xx_game_state,i2c_r, nullptr) PORT_DIPNAME( 0x0002, 0x0002, DEF_STR( Unknown ) ) @@ -1230,9 +1230,10 @@ CONS( 2008, jak_wall, 0, 0, walle, walle, spg2xx_game_state, empty_init, "JAKKS // 'Game-Key-Ready' JAKKS games (these can also take per-game specific expansion cartridges, although not all games had them released) CONS( 2005, jak_wwe, 0, 0, jakks_gkr, jak_gkr,jakks_gkr_state, empty_init, "JAKKS Pacific Inc / HotGen Ltd", "WWE (JAKKS Pacific TV Game)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // WW (no game-keys released) -CONS( 2005, jak_fan4, 0, 0, jakks_gkr, jak_gkr,jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Digital Eclipse", "Fantastic Four (JAKKS Pacific TV Game)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // F4 (no game-keys released) +CONS( 2005, jak_fan4, 0, 0, jakks_gkr, jak_gkr,jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Digital Eclipse", "Fantastic Four (JAKKS Pacific TV Game)", MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // F4 (no game-keys released) CONS( 2005, jak_just, 0, 0, jakks_gkr, jak_gkr,jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Taniko", "Justice League (JAKKS Pacific TV Game)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // DC (no game-keys released) -CONS( 2005, jak_dora, 0, 0, jakks_gkr_nk, jak_gkr,jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Handheld Games", "Dora the Explorer (JAKKS Pacific TV Game)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses NK keys (same as Nicktoons & Spongebob) (3+ released) // Other Game-Key-Ready systems (not all releases of them?, only Sunplus SPG240 [Sunplus PAC300] versions?) +CONS( 2005, jak_dora, 0, 0, jakks_gkr_nk, jak_gkr,jakks_gkr_state, empty_init, "JAKKS Pacific Inc / Handheld Games", "Dora the Explorer (JAKKS Pacific TV Game)", MACHINE_NOT_WORKING | MACHINE_IMPERFECT_SOUND | MACHINE_IMPERFECT_GRAPHICS ) // uses NK keys (same as Nicktoons & Spongebob) (3+ released) +// Other Game-Key-Ready systems (not all releases of them?, only Sunplus SPG240 [Sunplus PAC300] versions?) // Nicktoons NK (3? keys available) (same keys as Dora the Explorer) // SpongeBob SquarePants: The Fry Cook Games NK (3? keys available) ^^ // Namco Ms. Pac-Man NM (3 keys available [Dig Dug, New Rally-X], [Rally-X, Pac-Man, Bosconian], [Pac-Man, Bosconian]) @@ -1258,7 +1259,7 @@ CONS( 2007, rad_fb2, 0, 0, rad_skat, rad_fb2, spg2xx_game_state, ini // Mattel games CONS( 2005, mattelcs, 0, 0, rad_skat, mattelcs, spg2xx_game_state, empty_init, "Mattel", "Mattel Classic Sports", MACHINE_IMPERFECT_SOUND | MACHINE_NOT_WORKING ) -// might not fit here. First 0x8000 bytes are blank (not too uncommon for these) then rest of rom looks like it's probably encrypted at least +// might not fit here. First 0x8000 bytes are blank (not too uncommon for these) then rest of rom looks like it's probably encrypted at least // could be later model VT based instead? even after decrypting (simple word xor) the vectors have a different format and are at a different location to the SunPlus titles CONS( 2009, zone40, 0, 0, non_spg_base, wirels60, spg2xx_game_state, empty_init, "Jungle Soft / Ultimate Products (HK) Ltd", "Zone 40", MACHINE_NO_SOUND | MACHINE_NOT_WORKING )