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

Correct gDP.loadTile->loadHeight calculation again.

Fixed #2143 Yoshi's Story level backgrounds regression
which was broken by b261f34b0
This commit is contained in:
Sergey Lipskiy 2019-11-30 22:48:00 +07:00
parent 80f1d9d021
commit 028133bb5c

View File

@ -499,15 +499,12 @@ void gDPLoadTile(u32 tile, u32 uls, u32 ult, u32 lrs, u32 lrt)
if (gDP.loadTile->masks == 0)
gDP.loadTile->loadWidth = max(gDP.loadTile->loadWidth, info.width);
if (gDP.loadTile->maskt == 0 &&
gDP.loadTile->tmem % gDP.loadTile->line == 0) {
u32 idx = 0;
while (gDP.tiles[idx].tmem != gDP.loadTile->tmem)
++idx;
if (idx == gSP.texture.tile) {
if (gDP.loadTile->maskt == 0) {
if (gDP.otherMode.cycleType != G_CYC_2CYCLE && gDP.loadTile->tmem % gDP.loadTile->line == 0) {
u16 theight = info.height + gDP.loadTile->tmem / gDP.loadTile->line;
gDP.loadTile->loadHeight = max(gDP.loadTile->loadHeight, theight);
}
} else
gDP.loadTile->loadHeight = max(gDP.loadTile->loadHeight, info.height);
}
u32 address = gDP.textureImage.address + gDP.loadTile->ult * gDP.textureImage.bpl + (gDP.loadTile->uls << gDP.textureImage.size >> 1);