diff options
author | Sawakita <sawakitanoodles@gmail.com> | 2012-01-08 23:45:46 +0100 |
---|---|---|
committer | Sawakita <sawakitanoodles@gmail.com> | 2012-01-08 23:45:46 +0100 |
commit | cdaf8e3d9a8fe4c3e9c53269424aada468fdb6ab (patch) | |
tree | ef8fdf6a162ebcc825a525805b44eceed824c6e7 | |
parent | 4b11f36a0aff0751dedf2b536b40b5424b3b3871 (diff) |
Add function to get a monster's name from a given id (internal order).
hg-commit-id: 42e7deffd9b8
-rw-r--r-- | constants.asm | 6 | ||||
-rw-r--r-- | pokered.asm | 29 |
2 files changed, 33 insertions, 2 deletions
diff --git a/constants.asm b/constants.asm index 6275215c..9d4b4a7e 100644 --- a/constants.asm +++ b/constants.asm @@ -137,10 +137,16 @@ W_CURENEMYLVL EQU $D127 W_ISLINKBATTLE EQU $D12B +W_PRIZE1 EQU $D13D +W_PRIZE2 EQU $D13E +W_PRIZE3 EQU $D13F + W_PLAYERNAME EQU $D158 ; 11 characters, including null W_NUMINPARTY EQU $D163 +W_NUMBAGITEMS EQU $D31D + W_RIVALNAME EQU $D34A ; 11 characters, including null W_CURMAP EQU $D35E diff --git a/pokered.asm b/pokered.asm index 248dbb1e..497ea609 100644 --- a/pokered.asm +++ b/pokered.asm @@ -1003,7 +1003,32 @@ MartInventories: ; 2442 db $FE,7,ULTRA_BALL,GREAT_BALL,FULL_RESTORE,MAX_POTION,FULL_HEAL db REVIVE,MAX_REPEL,$FF -INCBIN "baserom.gbc",$24D6,$2FCF - $24D6 +INCBIN "baserom.gbc",$24D6,$2F9E - $24D6 +GetMonsterName: ; 2F9E + push hl + ld a,[$ffb8] + push af + ld a,BANK(MonsterNames) ; 07 + ld [$ffb8],a + ld [$2000],a + ld a,[$d11e] + dec a + ld hl,MonsterNames ; 421E + ld c,10 + ld b,0 + call AddNTimes + ld de,$cd6d + push de + ld bc,10 + call CopyData + ld hl,$cd77 + ld [hl],$50 + pop de + pop af + ld [$ffb8],a + ld [$2000],a + pop hl + ret GetItemName: ; 2FCF ; given an item ID at [$D11E], store the name of the item into a string @@ -1247,7 +1272,7 @@ GetName: ; 376B dec a jr nz,.otherEntries\@ ;1 = MON_NAMES - call $2f9e; GetMonName + call GetMonsterName ld hl,11 add hl,de ld e,l |