pvr: don't use op list to mark block if tile pointer is null

Naomi Doom sets the opaque list block to null in the tile, but op size
in TA_ALLOC_CTRL is non-zero. So use the TR list in this case.

Issue #682
This commit is contained in:
Flyinghead 2022-10-23 15:49:23 +02:00
parent d1e48c657e
commit e3c260f4ca
3 changed files with 14 additions and 3 deletions

View File

@ -467,10 +467,20 @@ static u32 opbSize(int n)
static void markObjectListBlocks()
{
u32 addr = TA_OL_BASE;
u32 addr;
u32 tile_size;
getRegionTileAddrAndSize(addr, tile_size);
// Read the opaque pointer of the first tile and check that it's non-null (Naomi doom)
u32 opbAddr = pvr_read32p<u32>(addr + 4);
bool emptyOpaqueList = (opbAddr & 0x80000000) != 0;
addr = TA_OL_BASE;
// opaque
u32 opBlockSize = opbSize(TA_ALLOC_CTRL & 3);
if (opBlockSize == 0)
if (emptyOpaqueList)
addr += opBlockSize * (TA_GLOB_TILE_CLIP.tile_y_num + 1) * (TA_GLOB_TILE_CLIP.tile_x_num + 1);
if (opBlockSize == 0 || emptyOpaqueList)
{
// skip modvols OPBs
addr += opbSize((TA_ALLOC_CTRL >> 4) & 3) * (TA_GLOB_TILE_CLIP.tile_y_num + 1) * (TA_GLOB_TILE_CLIP.tile_x_num + 1);

View File

@ -415,6 +415,7 @@ void ta_set_tileclip(u32 tileclip);
u32 ta_get_list_type();
void ta_set_list_type(u32 listType);
void ta_parse_reset();
void getRegionTileAddrAndSize(u32& address, u32& size);
class TAParserException : public FlycastException
{

View File

@ -1767,7 +1767,7 @@ void FillBGP(TA_context* ctx)
cv[3].v = max_v;
}
static void getRegionTileAddrAndSize(u32& address, u32& size)
void getRegionTileAddrAndSize(u32& address, u32& size)
{
address = REGION_BASE;
const bool type1_tile = ((FPU_PARAM_CFG >> 21) & 1) == 0;