diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2019-01-23 07:22:27 -0500 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2019-01-23 07:22:27 -0500 |
commit | 3b7ff3b2b0e34c659ed1c1633fdb8dc673c06b7a (patch) | |
tree | 9368554ee7a98773f6e67b85b8b98612a00d73b2 | |
parent | 0e08e548553b41155fcbe58580e6102f120cc40c (diff) |
WRAM
-rw-r--r-- | Allow-tiles-to-have-different-attributes-in-different-blocks-(including-X-and-Y-flip).md | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/Allow-tiles-to-have-different-attributes-in-different-blocks-(including-X-and-Y-flip).md b/Allow-tiles-to-have-different-attributes-in-different-blocks-(including-X-and-Y-flip).md index 449615e..3e61eb6 100644 --- a/Allow-tiles-to-have-different-attributes-in-different-blocks-(including-X-and-Y-flip).md +++ b/Allow-tiles-to-have-different-attributes-in-different-blocks-(including-X-and-Y-flip).md @@ -379,26 +379,12 @@ Edit [wram.asm](../blob/master/wram.asm) again: ``` ```diff - wTileset:: - wTilesetBank:: db ; d1d9 - wTilesetAddress:: dw ; d1da - wTilesetBlocksBank:: db ; d1dc - wTilesetBlocksAddress:: dw ; d1dd - wTilesetCollisionBank:: db ; d1df - wTilesetCollisionAddress:: dw ; d1e0 - wTilesetAttributesBank:: db - wTilesetAttributesAddress:: dw - wTilesetAnim:: dw ; bank 3f ; d1e2 - wTilesetEnd:: -+ -+wTilesetDataAddress:: dw -``` - -```diff - ds 3 -+ ds 2 ++wTilesetDataAddress:: dw wLinkBattleRNs:: ds 10 ; d1fa + + ... ``` ```diff @@ -426,6 +412,8 @@ And edit [pokecrystal.link](../blob/master/pokecrystal.link): As we'll see next, `wSurroundingTiles` stores the tile IDs of all the blocks surrounding the player on-screen. (It gets updated when the player moves, of course.) The screen is 20x18 tiles, so 6x5 blocks are needed to cover it; each block has 4x4 tiles, so that's 480 bytes of tile data. Now that each of those tiles can have its own attributes, we need to introduce `wSurroundingAttributes` to play a similar role for attribute data. However, there's not enough free space in WRAM0 for both `wSurroundingTiles` and `wSurroundingAttributes`, so we have to put `wSurroundingAttributes` in a different bank, and for convenience we move `wSurroundingTiles` to the same bank. WRAMX 4 happens to be unused, so that's where they go. +(We also introduce `wTilesetDataAddress`, which will store either `wTilesetBlocksAddress` when writing to `wSurroundingTiles`, or `wTilesetAttributesAddress` when writing to `wSurroundingAttributes`.) + ## 7. Continue changing how tile attributes are loaded |