Skip to content

Commit

Permalink
Debugger: GBA - Tilemap viewer - Fixed incorrect data in row 32 and c…
Browse files Browse the repository at this point in the history
…olumn 32
  • Loading branch information
SourMesen committed May 10, 2024
1 parent 202b8f3 commit bb034e6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Core/GBA/Debugger/GbaPpuTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,10 @@ DebugTilemapInfo GbaPpuTools::GetTilemap(GetTilemapOptions options, BaseState& b
vramAddr = layer.TilemapAddr + row * result.ColumnCount + column;
} else {
vramAddr = layer.TilemapAddr + (((row & 0x1F) * 32 + (column & 0x1F)) * 2);
if(column > 32) {
if(column >= 32) {
vramAddr += 0x800;
}
if(row > 32) {
if(row >= 32) {
vramAddr += layer.DoubleWidth ? 0x1000 : 0x800;
}
}
Expand Down Expand Up @@ -297,10 +297,10 @@ DebugTilemapTileInfo GbaPpuTools::GetTilemapTileInfo(uint32_t x, uint32_t y, uin
tilemapAddr = offset + row * columnCount + column;
} else {
tilemapAddr = offset + (((row & 0x1F) << 5) + column) * 2;
if(column > 32) {
if(column >= 32) {
tilemapAddr += 0x800;
}
if(row > 32) {
if(row >= 32) {
tilemapAddr += size.Width > 256 ? 0x1000 : 0x800;
}
}
Expand Down

0 comments on commit bb034e6

Please sign in to comment.