summaryrefslogtreecommitdiff
path: root/engine/save.asm
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2018-02-03 18:21:53 -0500
committerRangi <remy.oukaour+rangi42@gmail.com>2018-02-03 19:42:56 -0500
commit32ed487a476e01759d3d9dbc818d8566ae2c9cb7 (patch)
tree669e90b56d36f17efff5f673235193f5298c0ceb /engine/save.asm
parent6ff2cb20e67db2054486fc5dc48eb9263298d4ad (diff)
parentb35eb72290b964b98844afbe741bb7ede34b9ef3 (diff)
Merge branch 'master' of https://github.com/pret/pokecrystal
# Conflicts: # audio/engine.asm # constants/gfx_constants.asm # constants/map_data_constants.asm # constants/pokemon_data_constants.asm # constants/sprite_constants.asm # constants/wram_constants.asm # data/maps/data.asm # engine/battle/ai/scoring.asm # engine/battle/core.asm # engine/battle/effect_commands.asm # engine/battle/misc.asm # engine/battle_anims/getpokeballwobble.asm # engine/breeding.asm # engine/buy_sell_toss.asm # engine/decorations.asm # engine/events/battle_tower/battle_tower.asm # engine/events/battle_tower/rules.asm # engine/events/buena.asm # engine/events/bug_contest/contest_2.asm # engine/events/daycare.asm # engine/events/dratini.asm # engine/events/halloffame.asm # engine/events/happiness_egg.asm # engine/events/kurt.asm # engine/events/lucky_number.asm # engine/events/magnet_train.asm # engine/events/overworld.asm # engine/events/pokerus/pokerus.asm # engine/events/print_unown.asm # engine/events/print_unown_2.asm # engine/events/unown_walls.asm # engine/item_effects.asm # engine/link.asm # engine/mon_menu.asm # engine/player_object.asm # engine/routines/playslowcry.asm # engine/scripting.asm # engine/search.asm # engine/search2.asm # engine/specials.asm # engine/start_menu.asm # engine/timeset.asm # home/battle_vars.asm # home/map.asm # maps/GoldenrodUndergroundSwitchRoomEntrances.asm # maps/IlexForest.asm # maps/KrissHouse2F.asm # maps/Route39Barn.asm # mobile/mobile_12_2.asm # mobile/mobile_40.asm # mobile/mobile_5f.asm # wram.asm
Diffstat (limited to 'engine/save.asm')
-rw-r--r--engine/save.asm62
1 files changed, 31 insertions, 31 deletions
diff --git a/engine/save.asm b/engine/save.asm
index 98be64ee6..073417699 100644
--- a/engine/save.asm
+++ b/engine/save.asm
@@ -165,7 +165,7 @@ AddHallOfFameEntry: ; 14b5f
ld a, c
or b
jr nz, .loop
- ld hl, OverworldMap
+ ld hl, wOverworldMap
ld de, sHallOfFame
ld bc, HOF_LENGTH
call CopyBytes
@@ -226,15 +226,15 @@ SaveTheGame_yesorno: ; 14baf
CompareLoadedAndSavedPlayerID: ; 14bcb
ld a, BANK(sPlayerData)
call GetSRAMBank
- ld hl, sPlayerData + (PlayerID - wPlayerData)
+ ld hl, sPlayerData + (wPlayerID - wPlayerData)
ld a, [hli]
ld c, [hl]
ld b, a
call CloseSRAM
- ld a, [PlayerID]
+ ld a, [wPlayerID]
cp b
ret nz
- ld a, [PlayerID + 1]
+ ld a, [wPlayerID + 1]
cp c
ret
; 14be3
@@ -247,17 +247,17 @@ SavedTheGame: ; 14be6
ld c, $20
call DelayFrames
; copy the original text speed setting to the stack
- ld a, [Options]
+ ld a, [wOptions]
push af
; set text speed super slow
ld a, 3
- ld [Options], a
+ ld [wOptions], a
; <PLAYER> saved the game!
ld hl, Text_PlayerSavedTheGame
call PrintText
; restore the original text speed setting
pop af
- ld [Options], a
+ ld [wOptions], a
ld de, SFX_SAVE
call WaitPlaySFX
call WaitSFX
@@ -332,7 +332,7 @@ UpdateStackTop: ; 14c6b
FindStackTop: ; 14c90
; Find the furthest point that sp has traversed to.
; This is distinct from the current value of sp.
- ld hl, Stack - $ff
+ ld hl, wStack - $ff
.loop
ld a, [hl]
or a
@@ -349,17 +349,17 @@ SavingDontTurnOffThePower: ; 14c99
ld [hJoypadSum], a
ld [hJoypadDown], a
; Save the text speed setting to the stack
- ld a, [Options]
+ ld a, [wOptions]
push af
; Set the text speed to super slow
ld a, $3
- ld [Options], a
+ ld [wOptions], a
; SAVING... DON'T TURN OFF THE POWER.
ld hl, Text_SavingDontTurnOffThePower
call PrintText
; Restore the text speed setting
pop af
- ld [Options], a
+ ld [wOptions], a
; Wait for 16 frames
ld c, $10
call DelayFrames
@@ -508,11 +508,11 @@ ValidateSave: ; 14da9
SaveOptions: ; 14dbb
ld a, BANK(sOptions)
call GetSRAMBank
- ld hl, Options
+ ld hl, wOptions
ld de, sOptions
- ld bc, OptionsEnd - Options
+ ld bc, wOptionsEnd - wOptions
call CopyBytes
- ld a, [Options]
+ ld a, [wOptions]
and $ff ^ (1 << NO_TEXT_SCROLL)
ld [sOptions], a
jp CloseSRAM
@@ -577,9 +577,9 @@ ValidateBackupSave: ; 14e2d
SaveBackupOptions: ; 14e40
ld a, BANK(sBackupOptions)
call GetSRAMBank
- ld hl, Options
+ ld hl, wOptions
ld de, sBackupOptions
- ld bc, OptionsEnd - Options
+ ld bc, wOptionsEnd - wOptions
call CopyBytes
call CloseSRAM
ret
@@ -661,14 +661,14 @@ TryLoadSaveFile: ; 14ea5 (5:4ea5)
ret
.corrupt
- ld a, [Options]
+ ld a, [wOptions]
push af
set NO_TEXT_SCROLL, a
- ld [Options], a
+ ld [wOptions], a
ld hl, Text_SaveFileCorrupted
call PrintText
pop af
- ld [Options], a
+ ld [wOptions], a
scf
ret
@@ -683,8 +683,8 @@ TryLoadSaveData: ; 14f1c
ld a, BANK(sPlayerData)
call GetSRAMBank
- ld hl, sPlayerData + StartDay - wPlayerData
- ld de, StartDay
+ ld hl, sPlayerData + wStartDay - wPlayerData
+ ld de, wStartDay
ld bc, 8
call CopyBytes
ld hl, sPlayerData + wStatusFlags - wPlayerData
@@ -702,8 +702,8 @@ TryLoadSaveData: ; 14f1c
ld a, BANK(sBackupPlayerData)
call GetSRAMBank
- ld hl, sBackupPlayerData + StartDay - wPlayerData
- ld de, StartDay
+ ld hl, sBackupPlayerData + wStartDay - wPlayerData
+ ld de, wStartDay
ld bc, 8
call CopyBytes
ld hl, sBackupPlayerData + wStatusFlags - wPlayerData
@@ -715,8 +715,8 @@ TryLoadSaveData: ; 14f1c
.corrupt
ld hl, DefaultOptions
- ld de, Options
- ld bc, OptionsEnd - Options
+ ld de, wOptions
+ ld bc, wOptionsEnd - wOptions
call CopyBytes
call PanicResetClock
ret
@@ -736,8 +736,8 @@ CheckPrimarySaveFile: ; 14f84
cp SAVE_CHECK_VALUE_2
jr nz, .nope
ld hl, sOptions
- ld de, Options
- ld bc, OptionsEnd - Options
+ ld de, wOptions
+ ld bc, wOptionsEnd - wOptions
call CopyBytes
call CloseSRAM
ld a, $1
@@ -758,8 +758,8 @@ CheckBackupSaveFile: ; 14faf
cp SAVE_CHECK_VALUE_2
jr nz, .nope
ld hl, sBackupOptions
- ld de, Options
- ld bc, OptionsEnd - Options
+ ld de, wOptions
+ ld bc, wOptionsEnd - wOptions
call CopyBytes
ld a, $2
ld [wSaveFileExists], a
@@ -882,7 +882,7 @@ _SaveData: ; 1509a
call CopyBytes
; This block originally had some mobile functionality, but since we're still in
- ; BANK(sCrystalData), it instead overwrites the sixteen EventFlags starting at 1:a603 with
+ ; BANK(sCrystalData), it instead overwrites the sixteen wEventFlags starting at 1:a603 with
; garbage from wd479. This isn't an issue, since ErasePreviousSave is followed by a regular
; save that unwrites the garbage.
@@ -904,7 +904,7 @@ _LoadData: ; 150b9
call CopyBytes
; This block originally had some mobile functionality to mirror _SaveData above, but instead it
- ; (harmlessly) writes the aforementioned EventFlags to the unused wd479.
+ ; (harmlessly) writes the aforementioned wEventFlags to the unused wd479.
ld hl, wd479
ld a, [$a60e + 0]