sovereignx/asm/new_game.s

143 lines
2.4 KiB
ArmAsm
Raw Normal View History

2016-11-01 17:08:48 +00:00
.include "asm/macros.inc"
.include "constants/constants.inc"
.syntax unified
.text
thumb_func_start NewGameInitData
@ void NewGameInitData()
NewGameInitData: @ 80844A0
push {r4,r5,lr}
2017-09-03 21:50:17 +01:00
ldr r0, =gSaveFileStatus
2016-11-01 17:08:48 +00:00
ldrh r0, [r0]
cmp r0, 0
beq _080844AE
cmp r0, 0x2
bne _080844B2
_080844AE:
2017-09-02 22:28:44 +01:00
bl RtcReset
2016-11-01 17:08:48 +00:00
_080844B2:
2017-09-03 21:50:17 +01:00
ldr r1, =gDifferentSaveFile
2016-11-01 17:08:48 +00:00
movs r0, 0x1
strb r0, [r1]
2017-01-14 19:53:20 +00:00
ldr r4, =gSaveBlock2Ptr
2016-11-01 17:08:48 +00:00
ldr r0, [r4]
adds r0, 0xAC
movs r5, 0
str r5, [r0]
2017-09-03 21:50:17 +01:00
bl ZeroPlayerPartyMons
bl ZeroEnemyPartyMons
bl ResetPokedex
2016-11-01 17:08:48 +00:00
bl sub_8084400
2017-09-03 21:50:17 +01:00
bl ClearSav1
bl ClearMailData
2016-11-01 17:08:48 +00:00
ldr r0, [r4]
strb r5, [r0, 0x9]
ldr r0, [r4]
adds r0, 0xA8
str r5, [r0]
2017-09-03 21:50:17 +01:00
bl InitPlayerTrainerId
2017-08-31 15:48:24 +01:00
bl PlayTimeCounter_Reset
2017-09-03 21:50:17 +01:00
bl ClearPokedexFlags
2017-09-02 20:43:53 +01:00
bl InitEventData
2017-09-03 21:50:17 +01:00
bl ClearTVShowData
bl ResetGabbyAndTy
bl ResetSecretBases
bl ClearBerryTrees
2017-01-14 19:53:20 +00:00
ldr r4, =gSaveBlock1Ptr
2016-11-01 17:08:48 +00:00
ldr r0, [r4]
movs r1, 0x92
lsls r1, 3
adds r0, r1
ldr r1, =0x00000bb8
2017-09-03 21:50:17 +01:00
bl SetMoney
2016-11-01 17:08:48 +00:00
movs r0, 0
bl SetCoins
2017-09-03 21:50:17 +01:00
bl ResetLinkContestBoolean
bl ResetGameStats
bl ClearAllContestWinnerPics
bl InitLinkBattleRecords
bl InitSeedotSizeRecord
bl InitLotadSizeRecord
ldr r0, =gPlayerPartyCount
2016-11-01 17:08:48 +00:00
strb r5, [r0]
2017-09-03 21:50:17 +01:00
bl ZeroPlayerPartyMons
bl ResetPokemonStorageSystem
bl ClearRoamerData
bl ClearRoamerLocationData
2016-11-01 17:08:48 +00:00
ldr r0, [r4]
ldr r1, =0x00000496
adds r0, r1
strh r5, [r0]
2017-09-03 21:50:17 +01:00
bl ClearBag
bl NewGameInitPCItems
bl ClearPokeblocks
bl ClearDecorationInventories
bl InitEasyChatPhrases
bl SetMauvilleOldMan
bl InitDewfordTrend
bl ResetFanClub
bl ResetLotteryCorner
bl WarpToTruck
2016-11-01 17:08:48 +00:00
ldr r0, =gUnknown_082715DE
2017-09-03 21:50:17 +01:00
bl ScriptContext2_RunNewScript
bl ResetMiniGamesResults
2016-11-01 17:08:48 +00:00
bl copy_strings_to_sav1
2017-09-03 21:50:17 +01:00
bl SetLilycoveLady
2016-11-01 17:08:48 +00:00
bl sub_819FAA0
bl sub_81A4B14
bl sub_8195E10
bl sub_801AFD8
bl sub_800E5AC
bl sub_81D54BC
2017-09-03 21:50:17 +01:00
bl ResetContestLinkResults
2016-11-01 17:08:48 +00:00
pop {r4,r5}
pop {r0}
bx r0
.pool
thumb_func_end NewGameInitData
2017-09-03 21:50:17 +01:00
thumb_func_start ResetMiniGamesResults
ResetMiniGamesResults: @ 80845CC
2016-11-01 17:08:48 +00:00
push {r4-r6,lr}
sub sp, 0x4
mov r0, sp
movs r5, 0
strh r5, [r0]
2017-01-14 19:53:20 +00:00
ldr r4, =gSaveBlock2Ptr
2016-11-01 17:08:48 +00:00
ldr r1, [r4]
movs r0, 0xF6
lsls r0, 1
adds r1, r0
ldr r6, =0x01000008
mov r0, sp
adds r2, r6, 0
bl CpuSet
ldr r0, [r4]
movs r1, 0xFA
lsls r1, 1
adds r0, r1
movs r1, 0
2017-09-03 21:50:17 +01:00
bl SetBerryPowder
bl ResetPokeJumpResults
2016-11-01 17:08:48 +00:00
mov r0, sp
adds r0, 0x2
strh r5, [r0]
ldr r1, [r4]
movs r2, 0x83
lsls r2, 2
adds r1, r2
adds r2, r6, 0
bl CpuSet
add sp, 0x4
pop {r4-r6}
pop {r0}
bx r0
.pool
2017-09-03 21:50:17 +01:00
thumb_func_end ResetMiniGamesResults
2016-11-01 17:08:48 +00:00
.align 2, 0 @ Don't pad with nop.