Skip to content

Commit

Permalink
(TEMP) Fix crash when the camera gets too low (e.g. Music Plant Act 1…
Browse files Browse the repository at this point in the history
… crash)
  • Loading branch information
JaceCear committed Jan 14, 2025
1 parent 20dbc83 commit 706a685
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/background.c
Original file line number Diff line number Diff line change
Expand Up @@ -578,8 +578,16 @@ NONMATCH("asm/non_matching/engine/sub_8002B20.inc", bool32 sub_8002B20(void))
yPos *= bg->mapWidth;

{ // _0800355C
s32 metatileIndex = *(&bg->metatileMap[yPos] + sp24) * bg->xTiles * bg->yTiles;
s32 metatileIndex;
s32 otherVal;
s32 mtIndex = *(&bg->metatileMap[yPos] + sp24);
#if NON_MATCHING
// TEMP: Crash-Fix
if (mtIndex >= 1024) {
mtIndex = 0;
}
#endif
metatileIndex = mtIndex * bg->xTiles * bg->yTiles;

otherVal = new_r4 * bg->xTiles;
otherVal += sp28;
Expand Down

0 comments on commit 706a685

Please sign in to comment.