diff options
author | Remy Oukaour <remy.oukaour@gmail.com> | 2017-12-24 19:35:35 -0500 |
---|---|---|
committer | Remy Oukaour <remy.oukaour@gmail.com> | 2017-12-24 19:35:35 -0500 |
commit | 7d4486e6a34a5163575400f21e806471be496e3d (patch) | |
tree | c0cc5f242b92420325d12a9cdedd6c1a3bcc3a4f /engine/routines/initlist.asm | |
parent | 15f1fc7c6ce0444ebfd87b1edc22da0ffd61c667 (diff) |
Remove all code from main.asm (some labeled INCBINs, like out-of-context graphics, are still present)
engine/routines/ stores isolated out-of-context routines as individual files. It might be preferable later to append them to their related engine/ files in unique little SECTIONs, relying on the linkerscript to place them appropriately; or some other organization method. In the meantime, they're now easily findable apart from main.asm's other content.
Diffstat (limited to 'engine/routines/initlist.asm')
-rw-r--r-- | engine/routines/initlist.asm | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/engine/routines/initlist.asm b/engine/routines/initlist.asm new file mode 100644 index 000000000..e2b7235ab --- /dev/null +++ b/engine/routines/initlist.asm @@ -0,0 +1,54 @@ +InitList: ; 50db9 + ld a, [wInitListType] + + cp INIT_ENEMYOT_LIST + jr nz, .check_party_ot_name + ld hl, OTPartyCount + ld de, OTPartyMonOT + ld a, ENEMY_OT_NAME + jr .done + +.check_party_ot_name + cp INIT_PLAYEROT_LIST + jr nz, .check_mon_name + ld hl, PartyCount + ld de, PartyMonOT + ld a, PARTY_OT_NAME + jr .done + +.check_mon_name + cp INIT_MON_LIST + jr nz, .check_item_name + ld hl, CurMart + ld de, PokemonNames + ld a, PKMN_NAME + jr .done + +.check_item_name + cp INIT_BAG_ITEM_LIST + jr nz, .check_ob_item_name + ld hl, NumItems + ld de, ItemNames + ld a, ITEM_NAME + jr .done + +.check_ob_item_name + ld hl, CurMart + 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 [wUnusedD102], a + ld a, d + ld [wUnusedD102 + 1], a + ld bc, ItemAttributes + ld a, c + ld [wItemAttributesPtr], a + ld a, b + ld [wItemAttributesPtr + 1], a + ret |