mirror of
https://github.com/pret/pokered.git
synced 2026-05-11 05:15:00 -05:00
56 lines
952 B
NASM
56 lines
952 B
NASM
InitPlayerData:
|
|
InitPlayerData2:
|
|
|
|
call Random
|
|
ldh a, [hRandomSub]
|
|
ld [wPlayerID], a
|
|
|
|
call Random
|
|
ldh a, [hRandomAdd]
|
|
ld [wPlayerID + 1], a
|
|
|
|
ld a, $ff
|
|
ld [wUnusedPlayerDataByte], a
|
|
|
|
ld hl, wPartyCount
|
|
call InitializeEmptyList
|
|
ld hl, wBoxCount
|
|
call InitializeEmptyList
|
|
ld hl, wNumBagItems
|
|
call InitializeEmptyList
|
|
ld hl, wNumBoxItems
|
|
call InitializeEmptyList
|
|
|
|
DEF START_MONEY EQU $3000
|
|
ld hl, wPlayerMoney + 1
|
|
ld a, HIGH(START_MONEY)
|
|
ld [hld], a
|
|
xor a ; LOW(START_MONEY)
|
|
ld [hli], a
|
|
inc hl
|
|
ld [hl], a
|
|
|
|
ld [wMonDataLocation], a
|
|
|
|
ld hl, wObtainedBadges
|
|
ld [hli], a
|
|
ASSERT wObtainedBadges + 1 == wUnusedObtainedBadges
|
|
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 InitializeToggleableObjectsFlags
|
|
|
|
InitializeEmptyList:
|
|
xor a ; count
|
|
ld [hli], a
|
|
dec a ; terminator
|
|
ld [hl], a
|
|
ret
|