diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-07-05 09:34:41 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2018-07-05 09:34:41 -0400 |
commit | 3d43d3348c64d797c93f7f37d6ac3fe654298449 (patch) | |
tree | 07e21d57d72bb658d6c19b6e7a631034b02b6165 | |
parent | feb15b39df647c377722fb7920dc662c929351d1 (diff) |
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, 9 insertions, 14 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 2b18ff7..6f5119a 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 - add hl, hl +- add hl, hl +- add hl, hl +- add hl, hl ++ ld h, a 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, 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 (more efficiently than the suggested method), 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,13 +534,8 @@ 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 l, a -+ ld h, 0 -+rept 4 -+ add hl, hl -+endr ++ ld h, a + ld a, [wTilesetAttributesAddress] -+ add l + ld l, a + ld a, [wTilesetAttributesAddress + 1] + adc h |