Add macros for metatile manipulation

This commit is contained in:
Phlosioneer
2019-02-22 03:08:48 -05:00
committed by huderlem
parent 9ed0f77528
commit 189d387f01
12 changed files with 70 additions and 61 deletions
+2 -2
View File
@@ -1056,7 +1056,7 @@ void WriteSequenceToBgTilemapBuffer(u8 bg, u16 firstTileNum, u8 x, u8 y, u8 widt
for (x16 = x; x16 < (x + width); x16++)
{
CopyTileMapEntry(&firstTileNum, &((u16*)sGpuBgConfigs2[bg].tilemap)[(u16)GetTileMapIndexFromCoords(x16, y16, attribute, mode, mode2)], paletteSlot, 0, 0);
firstTileNum = (firstTileNum & 0xFC00) + ((firstTileNum + tileNumDelta) & 0x3FF);
firstTileNum = (firstTileNum & 0xFC00) + ((firstTileNum + tileNumDelta) & MAP_METATILE_ID_MASK);
}
}
break;
@@ -1067,7 +1067,7 @@ void WriteSequenceToBgTilemapBuffer(u8 bg, u16 firstTileNum, u8 x, u8 y, u8 widt
for (x16 = x; x16 < (x + width); x16++)
{
((u8*)sGpuBgConfigs2[bg].tilemap)[(y16 * mode3) + x16] = firstTileNum;
firstTileNum = (firstTileNum & 0xFC00) + ((firstTileNum + tileNumDelta) & 0x3FF);
firstTileNum = (firstTileNum & 0xFC00) + ((firstTileNum + tileNumDelta) & MAP_METATILE_ID_MASK);
}
}
break;