Skip to content

Commit

Permalink
Move code out of data/
Browse files Browse the repository at this point in the history
  • Loading branch information
roukaour committed Jan 12, 2018
1 parent bdc9559 commit 0e1148f
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 33 deletions.
33 changes: 0 additions & 33 deletions data/items/descriptions.asm
Original file line number Diff line number Diff line change
@@ -1,36 +1,3 @@
PrintItemDescription: ; 0x1c8955
; Print the description for item [CurSpecies] at de.

ld a, [CurSpecies]
cp TM01
jr c, .not_a_tm

ld [CurItem], a
push de
farcall GetTMHMItemMove
pop hl
ld a, [wd265]
ld [CurSpecies], a
predef PrintMoveDesc
ret

.not_a_tm
push de
ld hl, ItemDescriptions
ld a, [CurSpecies]
dec a
ld c, a
ld b, 0
add hl, bc
add hl, bc
ld e, [hl]
inc hl
ld d, [hl]
pop hl
jp PlaceString
; 0x1c8987


ItemDescriptions:
dw MasterBallDesc
dw UltraBallDesc
Expand Down
31 changes: 31 additions & 0 deletions engine/routines/printitemdescription.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
PrintItemDescription: ; 0x1c8955
; Print the description for item [CurSpecies] at de.

ld a, [CurSpecies]
cp TM01
jr c, .not_a_tm

ld [CurItem], a
push de
farcall GetTMHMItemMove
pop hl
ld a, [wd265]
ld [CurSpecies], a
predef PrintMoveDesc
ret

.not_a_tm
push de
ld hl, ItemDescriptions
ld a, [CurSpecies]
dec a
ld c, a
ld b, 0
add hl, bc
add hl, bc
ld e, [hl]
inc hl
ld d, [hl]
pop hl
jp PlaceString
; 0x1c8987
1 change: 1 addition & 0 deletions main.asm
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@ INCLUDE "data/phone/text/trainers1.asm"
SECTION "Miscellaneous Text", ROMX

INCLUDE "data/items/names.asm"
INCLUDE "engine/routines/printitemdescription.asm"
INCLUDE "data/items/descriptions.asm"
INCLUDE "data/moves/names.asm"
INCLUDE "engine/landmarks.asm"
Expand Down

0 comments on commit 0e1148f

Please sign in to comment.