GetForestTreeFrame is not technically a bug or glitch, but it's exceptional

This commit is contained in:
Remy Oukaour 2017-12-12 21:16:15 -05:00
parent 370839cad7
commit 7748b20c27

View File

@ -687,3 +687,46 @@ ClearWRAM:: ; 25a
```
**Fix:** Change `jr nc, .bank_loop` to `jr c, .bank_loop`.
## `GetForestTreeFrame` works, but it's still bad
[tilesets/animations.asm](tilesets/animations.asm):
```
GetForestTreeFrame: ; fc54c
; Return 0 if a is even, or 2 if odd.
and a
jr z, .even
cp 1
jr z, .odd
cp 2
jr z, .even
cp 3
jr z, .odd
cp 4
jr z, .even
cp 5
jr z, .odd
cp 6
jr z, .even
.odd
ld a, 2
scf
ret
.even
xor a
ret
; fc56d
```
**Fix:**
```
GetForestTreeFrame: ; fc54c
; Return 0 if a is even, or 2 if odd.
and 1
add a
ret
; fc56d
```