diff --git a/docs/design_flaws.md b/docs/design_flaws.md index aa7c1fa79..7a80698f5 100644 --- a/docs/design_flaws.md +++ b/docs/design_flaws.md @@ -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 diff --git a/engine/gfx/load_pics.asm b/engine/gfx/load_pics.asm index 23b0f606d..4e42db48d 100644 --- a/engine/gfx/load_pics.asm +++ b/engine/gfx/load_pics.asm @@ -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