mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-09-09 09:51:34 -07:00
Convert code samples in design_flaws.md to diffs
This commit is contained in:
parent
6130fc5cd6
commit
62439a95a1
@ -151,21 +151,22 @@ Don't enforce `org $4000` in pokecrystal.link.
|
||||
|
||||
Modify `GetFrontpicPointer`:
|
||||
|
||||
```asm
|
||||
```diff
|
||||
ld a, [wCurPartySpecies]
|
||||
cp UNOWN
|
||||
jr z, .unown
|
||||
ld a, [wCurPartySpecies]
|
||||
ld hl, PokemonPicPointers
|
||||
+ ld hl, PokemonPicPointers
|
||||
ld d, BANK(PokemonPicPointers)
|
||||
jr .ok
|
||||
|
||||
.unown
|
||||
ld a, [wUnownLetter]
|
||||
ld hl, UnownPicPointers
|
||||
+ ld hl, UnownPicPointers
|
||||
ld d, BANK(UnownPicPointers)
|
||||
|
||||
.ok
|
||||
- ld hl, PokemonPicPointers ; UnownPicPointers
|
||||
dec a
|
||||
ld bc, 6
|
||||
call AddNTimes
|
||||
@ -174,13 +175,15 @@ Modify `GetFrontpicPointer`:
|
||||
And `GetMonBackpic`:
|
||||
|
||||
```asm
|
||||
- ; These are assumed to be at the same address in their respective banks.
|
||||
- ld hl, PokemonPicPointers ; UnownPicPointers
|
||||
ld a, b
|
||||
ld hl, PokemonPicPointers
|
||||
+ ld hl, PokemonPicPointers
|
||||
ld d, BANK(PokemonPicPointers)
|
||||
cp UNOWN
|
||||
jr nz, .ok
|
||||
ld a, c
|
||||
ld hl, UnownPicPointers
|
||||
+ ld hl, UnownPicPointers
|
||||
ld d, BANK(UnownPicPointers)
|
||||
.ok
|
||||
dec a
|
||||
@ -267,11 +270,25 @@ INCBIN "gfx/footprints/wartortle.1bpp"
|
||||
|
||||
Modify `Pokedex_LoadAnyFootprint`:
|
||||
|
||||
```asm
|
||||
```diff
|
||||
- push hl
|
||||
- ld e, l
|
||||
- ld d, h
|
||||
- ld hl, vTiles2 tile $62
|
||||
- lb bc, BANK(Footprints), 2
|
||||
- call Request1bpp
|
||||
- pop hl
|
||||
-
|
||||
- ; Whoever was editing footprints forgot to fix their
|
||||
- ; tile editor. Now each bottom half is 8 tiles off.
|
||||
- ld de, 8 tiles
|
||||
- add hl, de
|
||||
-
|
||||
ld e, l
|
||||
ld d, h
|
||||
ld hl, vTiles2 tile $62
|
||||
lb bc, BANK(Footprints), 4
|
||||
ld hl, vTiles2 tile $64
|
||||
- lb bc, BANK(Footprints), 2
|
||||
+ lb bc, BANK(Footprints), 4
|
||||
call Request1bpp
|
||||
```
|
||||
|
||||
@ -340,10 +357,19 @@ Move `ITEM_C3` and `ITEM_DC` above all the TMs in every table of item data.
|
||||
|
||||
Modify engine/items/items.asm:
|
||||
|
||||
```asm
|
||||
```diff
|
||||
GetTMHMNumber:: ; d407
|
||||
; Return the number of a TM/HM by item id c.
|
||||
ld a, c
|
||||
-; Skip any dummy items.
|
||||
- cp ITEM_C3 ; TM04-05
|
||||
- jr c, .done
|
||||
- cp ITEM_DC ; TM28-29
|
||||
- jr c, .skip
|
||||
- dec a
|
||||
-.skip
|
||||
- dec a
|
||||
-.done
|
||||
sub TM01
|
||||
inc a
|
||||
ld c, a
|
||||
@ -352,6 +378,16 @@ GetTMHMNumber:: ; d407
|
||||
GetNumberedTMHM: ; d417
|
||||
; Return the item id of a TM/HM by number c.
|
||||
ld a, c
|
||||
-; Skip any gaps.
|
||||
- cp ITEM_C3 - (TM01 - 1)
|
||||
- jr c, .done
|
||||
- cp ITEM_DC - (TM01 - 1) - 1
|
||||
- jr c, .skip_one
|
||||
-.skip_two
|
||||
- inc a
|
||||
-.skip_one
|
||||
- inc a
|
||||
-.done
|
||||
add TM01
|
||||
dec a
|
||||
ld c, a
|
||||
|
Loading…
Reference in New Issue
Block a user