summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xengine/link/init_list.asm55
-rw-r--r--main.asm4
-rw-r--r--wram.asm7
3 files changed, 60 insertions, 6 deletions
diff --git a/engine/link/init_list.asm b/engine/link/init_list.asm
new file mode 100755
index 00000000..b85cf001
--- /dev/null
+++ b/engine/link/init_list.asm
@@ -0,0 +1,55 @@
+InitList:
+; This entire function is useless.
+ ld a, [wInitListType]
+
+ cp INIT_ENEMYOT_LIST
+ jr nz, .check_party_ot_name
+ ld hl, wOTPartyCount
+ ld de, wOTPartyMonOT
+ ld a, ENEMY_OT_NAME
+ jr .done
+
+.check_party_ot_name
+ cp INIT_PLAYEROT_LIST
+ jr nz, .check_mon_name
+ ld hl, wPartyCount
+ ld de, wPartyMonOT
+ ld a, PARTY_OT_NAME
+ jr .done
+
+.check_mon_name
+ cp INIT_MON_LIST
+ jr nz, .check_item_name
+ ld hl, wCurMart
+ ld de, PokemonNames
+ ld a, MON_NAME
+ jr .done
+
+.check_item_name
+ cp INIT_BAG_ITEM_LIST
+ jr nz, .check_ob_item_name
+ ld hl, wNumItems
+ ld de, ItemNames
+ ld a, ITEM_NAME
+ jr .done
+
+.check_ob_item_name
+ ld hl, wCurMart
+ ld de, ItemNames
+ ld a, ITEM_NAME
+.done
+ ld [wNamedObjectTypeBuffer], a
+ ld a, l
+ ld [wListPointer], a
+ ld a, h
+ ld [wListPointer + 1], a
+ ld a, e
+ ld [wUnusedCFFE], a
+ ld a, d
+ ld [wUnusedCFFE + 1], a
+ ld bc, ItemAttributes
+ ld a, c
+ ld [wItemAttributesPtr], a
+ ld a, b
+ ld [wItemAttributesPtr + 1], a
+ ret
diff --git a/main.asm b/main.asm
index 892ae42c..ca1a95ea 100644
--- a/main.asm
+++ b/main.asm
@@ -369,13 +369,13 @@ INCLUDE "engine/pokemon/tempmon.asm"
INCLUDE "engine/pokemon/types.asm"
INCLUDE "engine/battle/unreferenced_getgen1trainerclassname.asm"
INCLUDE "engine/pokemon/mon_stats.asm"
+INCLUDE "engine/link/init_list.asm"
-InitList::
- dr $514c2, $51524
CalcLevel::
dr $51524, $51550
CalcExpAtLevel::
dr $51550, $5161b
+
_SwitchPartyMons::
dr $5161b, $51749
diff --git a/wram.asm b/wram.asm
index c2b23477..949d0425 100644
--- a/wram.asm
+++ b/wram.asm
@@ -1583,15 +1583,14 @@ wMailboxItems:: ds MAILBOX_CAPACITY
wMailboxEnd::
ENDU ; cffc
-wcffc:: ds 1 ; cffc
-wcffd:: ds 1 ; cffd
+wListPointer:: dw ; cffc
wUnusedCFFE:: dw ; cffe
SECTION "WRAM 1", WRAMX
-wd000:: ds 1 ; d000
-wd001:: ds 1 ; d001
+wItemAttributesPtr:: dw ; d000
+
wCurItem:: db ; d002
wCurItemQuantity:: ; d003
wMartItemID::