diff options
author | YamaArashi <shadow962@live.com> | 2016-12-31 17:23:54 -0800 |
---|---|---|
committer | YamaArashi <shadow962@live.com> | 2016-12-31 17:23:54 -0800 |
commit | bf67f7174d8e3f1348c786618ee5a3a076d1eff8 (patch) | |
tree | 41dfcd420ce30d4b077d2055e096ea40e4a229a5 /engine/init_player_data.asm | |
parent | 10289bf7ddac46d0188da06f2714dbce0dece59c (diff) |
split code out of main.asm
Diffstat (limited to 'engine/init_player_data.asm')
-rw-r--r-- | engine/init_player_data.asm | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/engine/init_player_data.asm b/engine/init_player_data.asm new file mode 100644 index 00000000..c576e65a --- /dev/null +++ b/engine/init_player_data.asm @@ -0,0 +1,55 @@ +InitPlayerData: +InitPlayerData2: + + call Random + ld a, [hRandomSub] + ld [wPlayerID], a + + call Random + ld a, [hRandomAdd] + ld [wPlayerID + 1], a + + ld a, $ff + ld [wUnusedD71B], a + + ld hl, wPartyCount + call InitializeEmptyList + ld hl, wNumInBox + call InitializeEmptyList + ld hl, wNumBagItems + call InitializeEmptyList + ld hl, wNumBoxItems + call InitializeEmptyList + +START_MONEY EQU $3000 + ld hl, wPlayerMoney + 1 + ld a, START_MONEY / $100 + ld [hld], a + xor a + ld [hli], a + inc hl + ld [hl], a + + ld [wMonDataLocation], a + + ld hl, wObtainedBadges + ld [hli], a + + ld [hl], a + + ld hl, wPlayerCoins + ld [hli], a + ld [hl], a + + ld hl, wGameProgressFlags + ld bc, wGameProgressFlagsEnd - wGameProgressFlags + call FillMemory ; clear all game progress flags + + jp InitializeMissableObjectsFlags + +InitializeEmptyList: + xor a ; count + ld [hli], a + dec a ; terminator + ld [hl], a + ret |