Add assert PokemonPicPointers == UnownPicPointers in GetFrontpicPointer

This commit is contained in:
Rangi 2021-10-06 17:44:34 -04:00
parent be7a5e09b5
commit bd45cfd5fd
2 changed files with 12 additions and 33 deletions

View File

@ -49,28 +49,7 @@ GLOBAL PICS_FIX
.PicsBanks:
db BANK("Pics 1") ; BANK("Pics 1") + 0
db BANK("Pics 2") ; BANK("Pics 1") + 1
db BANK("Pics 3") ; BANK("Pics 1") + 2
db BANK("Pics 4") ; BANK("Pics 1") + 3
db BANK("Pics 5") ; BANK("Pics 1") + 4
db BANK("Pics 6") ; BANK("Pics 1") + 5
db BANK("Pics 7") ; BANK("Pics 1") + 6
db BANK("Pics 8") ; BANK("Pics 1") + 7
db BANK("Pics 9") ; BANK("Pics 1") + 8
db BANK("Pics 10") ; BANK("Pics 1") + 9
db BANK("Pics 11") ; BANK("Pics 1") + 10
db BANK("Pics 12") ; BANK("Pics 1") + 11
db BANK("Pics 13") ; BANK("Pics 1") + 12
db BANK("Pics 14") ; BANK("Pics 1") + 13
db BANK("Pics 15") ; BANK("Pics 1") + 14
db BANK("Pics 16") ; BANK("Pics 1") + 15
db BANK("Pics 17") ; BANK("Pics 1") + 16
db BANK("Pics 18") ; BANK("Pics 1") + 17
db BANK("Pics 19") ; BANK("Pics 1") + 18
db BANK("Pics 20") ; BANK("Pics 1") + 19
db BANK("Pics 21") ; BANK("Pics 1") + 20
db BANK("Pics 22") ; BANK("Pics 1") + 21
db BANK("Pics 23") ; BANK("Pics 1") + 22
...
db BANK("Pics 24") ; BANK("Pics 1") + 23
```
@ -121,18 +100,18 @@ Edit `GetFrontpicPointer`:
ld a, [wCurPartySpecies]
cp UNOWN
jr z, .unown
ld a, [wCurPartySpecies]
+ ld hl, PokemonPicPointers
ld a, [wCurPartySpecies]
ld d, BANK(PokemonPicPointers)
jr .ok
.unown
ld a, [wUnownLetter]
+ ld hl, UnownPicPointers
ld a, [wUnownLetter]
ld d, BANK(UnownPicPointers)
.ok
- ld hl, PokemonPicPointers ; UnownPicPointers
- ; These are assumed to be at the same address in their respective banks.
- assert PokemonPicPointers == UnownPicPointers
- ld hl, PokemonPicPointers
dec a
ld bc, 6
call AddNTimes
@ -142,14 +121,14 @@ And `GetMonBackpic`:
```diff
- ; These are assumed to be at the same address in their respective banks.
- ld hl, PokemonPicPointers ; UnownPicPointers
- assert PokemonPicPointers == UnownPicPointers
ld hl, PokemonPicPointers
ld a, b
+ ld hl, PokemonPicPointers
ld d, BANK(PokemonPicPointers)
cp UNOWN
jr nz, .ok
ld a, c
+ ld hl, UnownPicPointers
ld a, c
ld d, BANK(UnownPicPointers)
.ok
dec a

View File

@ -109,13 +109,13 @@ GetFrontpicPointer:
ld a, [wCurPartySpecies]
ld d, BANK(PokemonPicPointers)
jr .ok
.unown
ld a, [wUnownLetter]
ld d, BANK(UnownPicPointers)
.ok
ld hl, PokemonPicPointers ; UnownPicPointers
; These are assumed to be at the same address in their respective banks.
assert PokemonPicPointers == UnownPicPointers
ld hl, PokemonPicPointers
dec a
ld bc, 6
call AddNTimes