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

gDPLoadTile: check for frame buffer texture before check for RDRAM bound crossing.

Fixed Banjo-Tooie Framebuffer not working properly #651
This commit is contained in:
Sergey Lipskiy 2016-05-19 22:50:43 +06:00
parent 5d45a45282
commit 37cb9ef9b8

View File

@ -496,9 +496,6 @@ void gDPLoadTile(u32 tile, u32 uls, u32 ult, u32 lrs, u32 lrt)
return;
u32 address = gDP.textureImage.address + gDP.loadTile->ult * gDP.textureImage.bpl + (gDP.loadTile->uls << gDP.textureImage.size >> 1);
if ((address + height * gDP.textureImage.bpl) > RDRAMSize)
return;
const u32 bpl = gDP.loadTile->line << 3;
u32 bpl2 = bpl;
if (gDP.loadTile->lrs > gDP.textureImage.width)
@ -506,9 +503,13 @@ void gDPLoadTile(u32 tile, u32 uls, u32 ult, u32 lrs, u32 lrt)
u32 height2 = height;
if (gDP.loadTile->lrt > gDP.scissor.lry)
height2 = gDP.scissor.lry - gDP.loadTile->ult;
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 {