From 2e5a0c183f4bd006bb81aec7d21ade270ec84776 Mon Sep 17 00:00:00 2001 From: hap Date: Fri, 11 Nov 2022 16:19:04 +0100 Subject: [PATCH] tilemap.get_info_debug: don't access invalid gfxnum --- src/emu/tilemap.cpp | 10 +++++++--- src/mame/namco/namcos22.cpp | 5 +++-- src/mame/thepit/thepit_v.cpp | 4 ++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/emu/tilemap.cpp b/src/emu/tilemap.cpp index 5757f35341f..21752dcd1f4 100644 --- a/src/emu/tilemap.cpp +++ b/src/emu/tilemap.cpp @@ -1559,10 +1559,14 @@ void tilemap_t::get_info_debug(u32 col, u32 row, u8 &gfxnum, u32 &code, u32 &col // get the GFX number and code gfxnum = m_tileinfo.gfxnum; code = m_tileinfo.code; + color = m_tileinfo.palette_base; - // work back from the palette base to get the color - const gfx_element &gfx = *m_tileinfo.decoder->gfx(gfxnum); - color = (m_tileinfo.palette_base - gfx.colorbase()) / gfx.granularity(); + if (gfxnum != 0xff) + { + // work back from the palette base to get the color + const gfx_element &gfx = *m_tileinfo.decoder->gfx(gfxnum); + color = (color - gfx.colorbase()) / gfx.granularity(); + } } diff --git a/src/mame/namco/namcos22.cpp b/src/mame/namco/namcos22.cpp index 2ddb2cf05db..08c0a80e433 100644 --- a/src/mame/namco/namcos22.cpp +++ b/src/mame/namco/namcos22.cpp @@ -30,8 +30,8 @@ TODO: + ridgerac waving flag shadowing + cybrcomm enemies should flash white when you shoot them, probably lighting related + timecris helicopter, car, grenade boxes should flash white when you shoot them (similar to cybrcomm) -- improve ss22 spot, used in dirtdash, alpinesa, testmode, not understood well: - + does not work at all on alpinesa highscore entry +- improve ss22 spot, used in dirtdash, alpinesa, testmode - not understood well: + + does not work at all on alpinesa highscore entry (maybe not spotram related?) + should be done before global fade, see dirtdash when starting at jungle level + should not apply to some of the sprites in dirtdash jungle level (eg. time/position) + how is it enabled exactly? the enable bit in spotram is set in tokyowar too(which doesn't use spot) @@ -41,6 +41,7 @@ TODO: - PDP command 0xfff9, used in alpinr2b to modify titlescreen logo animation in pointram (should show a snow melting effect) - support for text layer video partial updates after posirq, alpinesa does raster effects on it - alpha blended sprite/poly with priority over alpha blended text doesn't work right +- alpinesa sprites on selection screen should not be fully alpha blended, only the drop shadow should - ss22 poly translucency is probably more limited than currently emulated, not supporting stacked layers - there's a sprite limit per scanline, eg. timecris submarine explosion smoke partially erases sprites on real hardware - cybrcycc speed dial needle polygon is missing diff --git a/src/mame/thepit/thepit_v.cpp b/src/mame/thepit/thepit_v.cpp index ffbd557f91d..24cdc76f678 100644 --- a/src/mame/thepit/thepit_v.cpp +++ b/src/mame/thepit/thepit_v.cpp @@ -135,8 +135,6 @@ void thepit_state::video_start() m_dummy_tile = make_unique_clear(8*8); - m_graphics_bank = 0; /* only used in intrepid */ - m_vsync_timer = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(thepit_state::vsync_callback), this)); save_item(NAME(m_graphics_bank)); @@ -319,5 +317,7 @@ uint32_t thepit_state::screen_update_desertdan(screen_device &screen, bitmap_ind m_graphics_bank = 1; draw_sprites(bitmap, m_flip_y ? spritevisibleareaflipx : spritevisiblearea, 1); + m_graphics_bank = 0; + return 0; }