summaryrefslogtreecommitdiff
path: root/home/items.asm
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2018-06-05 22:55:55 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2018-06-05 22:55:55 -0400
commit779eb6750d08504c9667eb10cd7c68f0e2e8498d (patch)
tree2736ac858597395ddfb7d66c66e650aeef6405de /home/items.asm
parent30f2d056f933fa8dda5ba751ea6645d1d634142a (diff)
parentd4a65343dada6f15a56818fdf6ddb000fb381a55 (diff)
Merge branch 'master' into rtc_fade
Diffstat (limited to 'home/items.asm')
-rwxr-xr-xhome/items.asm94
1 files changed, 1 insertions, 93 deletions
diff --git a/home/items.asm b/home/items.asm
index 0edd72b..498edc6 100755
--- a/home/items.asm
+++ b/home/items.asm
@@ -40,7 +40,7 @@ GiveItem::
; and copy the item's name to wcf4b.
; Return carry on success.
ld a, b
- ld [wce37], a
+ ld [wNamedObjectIndexBuffer], a
ld [wCurItem], a
ld a, c
ld [wItemQuantity], a
@@ -51,95 +51,3 @@ GiveItem::
call CopyStringToCD31
scf
ret
-
-if DEBUG
-SECTION "GetItemName", ROM0[$376F]
-else
-SECTION "GetItemName", ROM0[$3733]
-endc
-
-GetItemName:: ; 376F
-; given an item ID at [wce37], store the name of the item into a string
-; starting at wcd26
- push hl
- push bc
- ld a, [wce37]
- cp ITEM_HM01_RED
- jr nc, .machine
-
- ld [wcb5b], a
- ld a, ITEM_NAME
- ld [wNameCategory], a
- call GetName
- jr .finish
-
-.machine
- call GetMachineName
-.finish
- ld de, wcd26 ; pointer to where item name is stored in RAM
- pop bc
- pop hl
- ret
-
-if DEBUG
-SECTION "GetMachineName", ROM0[$378E]
-else
-SECTION "GetMachineName", ROM0[$3752]
-endc
-
-GetMachineName::
-; copies the name of the TM/HM in [wce37] to wcd26
- push hl
- push de
- push bc
- ld a, [wce37]
- push af
- cp ITEM_TM01_RED
- jr nc, .WriteTM
-; if HM, then write "HM" and add 5 to the item ID, so we can reuse the
-; TM printing code
- add 5
- ld [wce37], a
- ld hl, HiddenPrefix
- ld bc, 6
- jr .WriteMachinePrefix
-.WriteTM
- ld hl, TechnicalPrefix
- ld bc, 5
-.WriteMachinePrefix
- ld de, wcd26
- call CopyBytes
-; now get the machine number and convert it to text
- ld a, [wce37]
- sub ITEM_TM01_RED - 1
- ld b, "0"
-.FirstDigit
- sub 10
- jr c, .SecondDigit
- inc b
- jr .FirstDigit
-.SecondDigit
- add 10
- push af
- ld a, b
- ld [de], a
- inc de
- pop af
- ld b, "0"
- add b
- ld [de], a
- inc de
- ld a, "@"
- ld [de], a
- pop af
- ld [wce37], a
- pop bc
- pop de
- pop hl
- ret
-
-TechnicalPrefix:
- db "わざマシン@"
-
-HiddenPrefix:
- db "ひでんマシン@"