funtech/supracan.cpp: rectify sprite ysizes == 9, skip blank sprites for drawing

This commit is contained in:
angelosa 2024-09-30 20:58:16 +02:00
parent f40c98743e
commit d08a7a0153
2 changed files with 9 additions and 5 deletions

View File

@ -80,7 +80,6 @@ Broken [video] during intro, uses bitmap mode with ROZ layer
<year>1995</year>
<publisher>AV Artisan</publisher>
<notes><![CDATA[
[video] title animation glitches some sprites.
[video] uses per-tile priority during gameplay.
[sound] noisy channels 13-15 when jump occurs (12 00 0f 79)
[sound] jump (1f 0f 0e a9) and attack (1f 00 0f 69) channels 11-12 keeps repeating
@ -205,7 +204,6 @@ Erratic gameplay speed, controls [irq 3] as FRC
[sound] BGM plays random tune on title (verify, two video refs plays different BGMs there wtf?)
[video] title screen doesn't cliprect properly against white
[video] title screen has priority issues with overlapping overlays (layer 1 + ROZ)
[video] garbage sprites in 1p vs. com gameplay, [DMA]s with invalid dest pointers.
[sound] main menu selection channel 14 keeps repeating (1f 15 0b dd)
]]></notes>
<info name="serial" value="F010" />

View File

@ -776,8 +776,10 @@ void supracan_state::draw_sprites(bitmap_ind16 &bitmap, bitmap_ind8 &maskmap, bi
// TODO: check on real HW
static const int ysizes_table[16] = {
1, 2, 3, 4, 5, 6, 7, 8, 9,
// 0x9: speedyd intro dash frame
11,
// 0x9: speedyd intro dash frame, speedyd bonus stages, boomzoo intro
// 11 would be more logical for former, except it will break latter and
// is confirmed to "cut" feet anyway.
10,
// 0xa: A'Can logo
12,
// 0xb/0xc: jttlaugh stage 1-3 (particularly on the web scrolling jump platforms)
@ -819,7 +821,7 @@ void supracan_state::draw_sprites(bitmap_ind16 &bitmap, bitmap_ind8 &maskmap, bi
if (y >= 0x180) y -= 0x200;
if (x >= 0x180) x -= 0x200;
if ((vram[i + 0] & 0x4000))
if ((vram[i + 0] & 0x4000) && sprite_ptr)
{
int xsize = 1 << (vram[i + 1] & 7);
int ysize = ysizes_table[(vram[i + 0] & 0x1e00) >> 9];
@ -853,6 +855,10 @@ void supracan_state::draw_sprites(bitmap_ind16 &bitmap, bitmap_ind8 &maskmap, bi
for (int xtile = 0; xtile < xsize; xtile++)
{
uint16_t data = vram[((sprite_ptr << 1) + ytile * xsize + xtile) & VRAM_MASK];
// magipool will draw garbage during gameplay if we don't skip empty entries.
// NOTE: sets up both main table pointer and sub entries
if (data == 0)
continue;
int tile = (bank * bank_size) + (data & 0x03ff);
int palette = (data & 0xf000) >> 12;