Move all of constants/sram_constants.asm into sram

This way we can easily use `BANK()` where appropriate, and it is more
tidy.
This commit is contained in:
mid-kid
2017-11-20 19:50:54 +01:00
parent 617ba8be3d
commit df118afbca
10 changed files with 75 additions and 72 deletions

View File

@@ -5,7 +5,7 @@ SECTION "bank41_2", ROMX
; Copies certain values at the time the player enters the Hall of Fame.
TrainerRankings_HallOfFame2:: mobile ; 0x105ef6
ld a, $5
ld a, BANK(sTrainerRankingGameTimeHOF)
call GetSRAMBank
ld hl, GameTimeHours
@@ -36,7 +36,7 @@ TrainerRankings_HallOfFame2:: mobile ; 0x105ef6
; 105f33
TrainerRankings_MagikarpLength: mobile ; 105f33
ld a, $5
ld a, BANK(sTrainerRankingLongestMagikarp)
call GetSRAMBank
ld de, Buffer1
ld hl, sTrainerRankingLongestMagikarp
@@ -104,7 +104,7 @@ TrainerRankings_MagikarpLength: mobile ; 105f33
; 105f79
TrainerRankings_BugContestScore: mobile ; 105f79
ld a, $5
ld a, BANK(sTrainerRankingBugContestScore)
call GetSRAMBank
ld a, [hProduct]
ld hl, sTrainerRankingBugContestScore
@@ -133,7 +133,7 @@ TrainerRankings_BugContestScore: mobile ; 105f79
; 105f9f
TrainerRankings_AddToSlotsWinStreak: mobile ; 105f9f
ld a, $5
ld a, BANK(sTrainerRankingCurrentSlotsStreak)
call GetSRAMBank
; Increment the current streak
@@ -173,7 +173,7 @@ TrainerRankings_AddToSlotsWinStreak: mobile ; 105f9f
; 105fd0
TrainerRankings_EndSlotsWinStreak: mobile ; 105fd0
ld a, $5
ld a, BANK(sTrainerRankingCurrentSlotsStreak)
call GetSRAMBank
ld hl, sTrainerRankingCurrentSlotsStreak
xor a
@@ -185,7 +185,7 @@ TrainerRankings_EndSlotsWinStreak: mobile ; 105fd0
; 105fe3
TrainerRankings_AddToSlotsPayouts: mobile ; 105fe3
ld a, $5
ld a, BANK(sTrainerRankingTotalSlotsPayouts)
call GetSRAMBank
ld hl, sTrainerRankingTotalSlotsPayouts + 3
ld a, e
@@ -213,7 +213,7 @@ TrainerRankings_AddToSlotsPayouts: mobile ; 105fe3
; 106008
TrainerRankings_AddToBattlePayouts: mobile ; 106008
ld a, $5
ld a, BANK(sTrainerRankingTotalBattlePayouts)
call GetSRAMBank
ld hl, sTrainerRankingTotalBattlePayouts + 3
ld a, [bc]
@@ -416,7 +416,7 @@ TrainerRankings_Increment1Byte: ; 106129
; Increments a big-endian value of bc + 1 bytes at hl
TrainerRankings_Increment: ; 10612d
ld a, $5
ld a, BANK(sTrainerRankings)
call GetSRAMBank
push hl
push de
@@ -453,7 +453,7 @@ TrainerRankings_Increment: ; 10612d
; Used when SRAM bank 5 isnt already loaded — whats the point of this?
UpdateTrainerRankingsChecksum2: mobile ; 106155
ld a, $5
ld a, BANK(sTrainerRankings)
call GetSRAMBank
call UpdateTrainerRankingsChecksum
call CloseSRAM

View File

@@ -7249,13 +7249,13 @@ Function117942: ; 117942 (45:7942)
call PlaceString
ld a, $1e
ld [wcd4e], a
ld a, $5
ld a, BANK(sMobileLoginPassword)
call GetSRAMBank
ld a, [wcd4f]
ld [sMobileLoginPassword], a
ld hl, $c708
ld de, sMobileLoginPassword + 1
ld bc, LOGIN_PASSWORD_LENGTH
ld bc, MOBILE_LOGIN_PASSWORD_LENGTH
call CopyBytes
call CloseSRAM
ld a, [wcd4f]

View File

@@ -4224,10 +4224,10 @@ Function119eb4: ; 119eb4 (46:5eb4)
ret
Function119ec2: ; 119ec2 (46:5ec2)
ld a, $5
ld a, BANK(sMobileLoginPassword)
call GetSRAMBank
xor a
ld [sMobileLoginPassword + LOGIN_PASSWORD_LENGTH], a
ld [sMobileLoginPassword + MOBILE_LOGIN_PASSWORD_LENGTH], a
ld de, sMobileLoginPassword + 1
.loop
ld a, [de]
@@ -4395,7 +4395,7 @@ Function119f98: ; 119f98
; 11a00e
Function11a00e: ; 11a00e
ld a, $5
ld a, BANK(sMobileLoginPassword)
call GetSRAMBank
ld a, [sMobileLoginPassword]
and a
@@ -4404,7 +4404,7 @@ Function11a00e: ; 11a00e
call CloseSRAM
and a
ret nz
ld a, $5
ld a, BANK(sMobileLoginPassword)
call GetSRAMBank
xor a
ld [sMobileLoginPassword], a

View File

@@ -4688,7 +4688,7 @@ Function17f555: ; 17f555
ret nz
.asm_17f5a1
ld a, $5
ld a, BANK(sMobileLoginPassword)
call GetSRAMBank
xor a
ld [sMobileLoginPassword], a

View File

@@ -441,11 +441,11 @@ Function4a28a: ; 4a28a (12:628a)
ld a, [wMenuCursorY]
cp $2
jr z, .dont_delete_password
ld a, $5
ld a, BANK(sMobileLoginPassword)
call GetSRAMBank
ld hl, sMobileLoginPassword
xor a
ld bc, LOGIN_PASSWORD_LENGTH
ld bc, MOBILE_LOGIN_PASSWORD_LENGTH
call ByteFill
call CloseSRAM
ld hl, UnknownText_0x4a35d