1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-02 09:03:37 +00:00

Do not reject tile loading when tile end address is out of RDRAM bound.

Try to load as much as possible instead.

Fixed Bust-A-Move 2 wrong 2D during intro #870
This commit is contained in:
Sergey Lipskiy 2018-09-07 21:07:48 +07:00
parent 22267831e0
commit fef718b8d2

View File

@ -466,20 +466,22 @@ void gDPLoadTile(u32 tile, u32 uls, u32 ult, u32 lrs, u32 lrt)
if (CheckForFrameBufferTexture(address, bpl2*height2))
return;
if ((address + height * gDP.textureImage.bpl) > RDRAMSize)
return;
if (gDP.loadTile->size == G_IM_SIZ_32b)
gDPLoadTile32b(gDP.loadTile->uls, gDP.loadTile->ult, gDP.loadTile->lrs, gDP.loadTile->lrt);
else {
u32 tmemAddr = gDP.loadTile->tmem;
const u32 line = gDP.loadTile->line;
for (u32 y = 0; y < height; ++y) {
UnswapCopyWrap(RDRAM, address, (u8*)TMEM, tmemAddr << 3, 0xFFF, bpl);
if (address + bpl > RDRAMSize)
UnswapCopyWrap(RDRAM, address, (u8*)TMEM, tmemAddr << 3, 0xFFF, RDRAMSize - address);
else
UnswapCopyWrap(RDRAM, address, (u8*)TMEM, tmemAddr << 3, 0xFFF, bpl);
if (y & 1)
DWordInterleaveWrap((u32*)TMEM, tmemAddr << 1, 0x3FF, line);
address += gDP.textureImage.bpl;
if (address >= RDRAMSize)
break;
tmemAddr += line;
}
}