Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pret
GitHub Repository: pret/pokered
Path: blob/master/engine/movie/oak_speech/init_player_data.asm
1271 views
1
InitPlayerData:
2
InitPlayerData2:
3
4
call Random
5
ldh a, [hRandomSub]
6
ld [wPlayerID], a
7
8
call Random
9
ldh a, [hRandomAdd]
10
ld [wPlayerID + 1], a
11
12
ld a, $ff
13
ld [wUnusedPlayerDataByte], a
14
15
ld hl, wPartyCount
16
call InitializeEmptyList
17
ld hl, wBoxCount
18
call InitializeEmptyList
19
ld hl, wNumBagItems
20
call InitializeEmptyList
21
ld hl, wNumBoxItems
22
call InitializeEmptyList
23
24
DEF START_MONEY EQU $3000
25
ld hl, wPlayerMoney + 1
26
ld a, HIGH(START_MONEY)
27
ld [hld], a
28
xor a ; LOW(START_MONEY)
29
ld [hli], a
30
inc hl
31
ld [hl], a
32
33
ld [wMonDataLocation], a
34
35
ld hl, wObtainedBadges
36
ld [hli], a
37
ASSERT wObtainedBadges + 1 == wUnusedObtainedBadges
38
ld [hl], a
39
40
ld hl, wPlayerCoins
41
ld [hli], a
42
ld [hl], a
43
44
ld hl, wGameProgressFlags
45
ld bc, wGameProgressFlagsEnd - wGameProgressFlags
46
call FillMemory ; clear all game progress flags
47
48
jp InitializeMissableObjectsFlags
49
50
InitializeEmptyList:
51
xor a ; count
52
ld [hli], a
53
dec a ; terminator
54
ld [hl], a
55
ret
56
57