diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-07-05 09:37:59 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-07-05 09:37:59 -0400 |
commit | 6cbeb0e3790c7a61a6362d0ea3b9e16d5b224d99 (patch) | |
tree | f58566996747f00c51081bce33b9bf5bd51dd459 | |
parent | 3d43d3348c64d797c93f7f37d6ac3fe654298449 (diff) |
Actually revert broken optimization
-rw-r--r-- | Allow-tiles-to-have-different-attributes-in-different-blocks-(including-X-and-Y-flip).md | 23 |
1 files changed, 14 insertions, 9 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 6f5119a..2b18ff7 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 @@ -432,15 +432,15 @@ Anyway, `LoadMapPart` calls `LoadMetatiles` to load certain data from the \*_met - ; This is buggy; it wraps around past 128 blocks. - ; To fix, uncomment the line below. - add a ; Comment or delete this line to fix the above bug. -- ld l, a -- ld h, 0 + ld l, a + ld h, 0 - ; add hl, hl -- add hl, hl -- add hl, hl -- add hl, hl -+ ld h, a ++ add hl, hl + add hl, hl + add hl, hl + add hl, hl ld a, [wTilesetBlocksAddress] -- add l + add l ld l, a ld a, [wTilesetBlocksAddress + 1] adc h @@ -494,7 +494,7 @@ Anyway, `LoadMapPart` calls `LoadMetatiles` to load certain data from the \*_met This routine copies data from \*_metatiles.bin (pointed to by `[wTilesetBlocksAddress]`) into `wSurroundingTiles`. We've made two small changes to it. -One, [the bug that only allowed 128 blocks](../blob/master/docs/bugs_and_glitches.md#loadmetatiles-wraps-around-past-128-blocks) is fixed (more efficiently than the suggested method), since you'll probably need 256 to take advantage of this block attribute system. +One, [the bug that only allowed 128 blocks](../blob/master/docs/bugs_and_glitches.md#loadmetatiles-wraps-around-past-128-blocks) is fixed, since you'll probably need 256 to take advantage of this block attribute system. Two, tile IDs in \*_metatiles.bin have their high bit masked out. That used to be done with `res 7` in `SwapTextboxPalettes` and `ScrollBGMapPalettes`, but we deleted those. @@ -534,8 +534,13 @@ Two, tile IDs in \*_metatiles.bin have their high bit masked out. That used to b + ld e, l + ld d, h + ; Set hl to the address of the current metatile attribute data ([wTilesetAttributesAddress] + (a) tiles). -+ ld h, a ++ ld l, a ++ ld h, 0 ++rept 4 ++ add hl, hl ++endr + ld a, [wTilesetAttributesAddress] ++ add l + ld l, a + ld a, [wTilesetAttributesAddress + 1] + adc h |