Remove some more raw addresses

This commit is contained in:
Rangi 2020-06-21 12:21:47 -04:00
parent 9433b5a752
commit 98af69691d
9 changed files with 35 additions and 28 deletions

View File

@ -25,10 +25,10 @@ BATTLE_TOWER_STRUCT_LENGTH EQUS "(NAME_LENGTH + BATTLETOWER_PARTY_LENGTH * NICKN
const BATTLETOWERACTION_0D ; more time stuff in SRAM bank 5 const BATTLETOWERACTION_0D ; more time stuff in SRAM bank 5
const BATTLETOWERACTION_EGGTICKET const BATTLETOWERACTION_EGGTICKET
const BATTLETOWERACTION_0F ; check w3_d090 const BATTLETOWERACTION_0F ; check w3_d090
const BATTLETOWERACTION_10 ; dw based on 5:a800 const BATTLETOWERACTION_10 ; dw based on s5_a800
const BATTLETOWERACTION_11 ; store 0 in 5:aa8d const BATTLETOWERACTION_11 ; store 0 in s5_aa8d
const BATTLETOWERACTION_12 ; store 1 in 5:aa8d const BATTLETOWERACTION_12 ; store 1 in s5_aa8d
const BATTLETOWERACTION_13 ; check 5:aa8d const BATTLETOWERACTION_13 ; check s5_aa8d
const BATTLETOWERACTION_14 ; if save file is yours: bit 0, [sBattleTowerSaveFileFlags] const BATTLETOWERACTION_14 ; if save file is yours: bit 0, [sBattleTowerSaveFileFlags]
const BATTLETOWERACTION_15 ; set 0, [sBattleTowerSaveFileFlags] const BATTLETOWERACTION_15 ; set 0, [sBattleTowerSaveFileFlags]
const BATTLETOWERACTION_16 ; update time in SRAM bank 5 const BATTLETOWERACTION_16 ; update time in SRAM bank 5

View File

@ -8050,11 +8050,11 @@ BattleIntro:
ld b, SCGB_BATTLE_GRAYSCALE ld b, SCGB_BATTLE_GRAYSCALE
call GetSGBLayout call GetSGBLayout
ld hl, rLCDC ld hl, rLCDC
res rLCDC_WINDOW_TILEMAP, [hl] ; select 9800-9BFF res rLCDC_WINDOW_TILEMAP, [hl] ; select vBGMap0/vBGMap2
call InitBattleDisplay call InitBattleDisplay
call BattleStartMessage call BattleStartMessage
ld hl, rLCDC ld hl, rLCDC
set rLCDC_WINDOW_TILEMAP, [hl] ; select 9C00-9FFF set rLCDC_WINDOW_TILEMAP, [hl] ; select vBGMap1/vBGMap3
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a
call EmptyBattleTextbox call EmptyBattleTextbox

View File

@ -68,7 +68,7 @@ Function170114:
ret ret
Function170139: Function170139:
; Convert the 4-digit decimal number at 5:aa41 into binary ; Convert the 4-digit decimal number at s5_aa41 into binary
ld a, BANK(s5_aa41) ld a, BANK(s5_aa41)
call OpenSRAM call OpenSRAM
ld de, s5_aa41 ld de, s5_aa41

View File

@ -826,7 +826,7 @@ _SaveData:
call CopyBytes call CopyBytes
; This block originally had some mobile functionality, but since we're still in ; This block originally had some mobile functionality, but since we're still in
; BANK(sCrystalData), it instead overwrites the sixteen wEventFlags starting at 1:a603 with ; BANK(sCrystalData), it instead overwrites the sixteen wEventFlags starting at 1:s4_a60e with
; garbage from wd479. This isn't an issue, since ErasePreviousSave is followed by a regular ; garbage from wd479. This isn't an issue, since ErasePreviousSave is followed by a regular
; save that unwrites the garbage. ; save that unwrites the garbage.

View File

@ -506,7 +506,7 @@ Printer_RestartMapMusic:
CheckPrinterStatus: CheckPrinterStatus:
; Check for printer errors ; Check for printer errors
; If [ca88] == -1, we're disconnected ; If [wPrinterHandshake] == -1, we're disconnected
ld a, [wPrinterHandshake] ld a, [wPrinterHandshake]
cp -1 cp -1
jr nz, .printer_connected jr nz, .printer_connected

View File

@ -126,7 +126,6 @@ map_connection_struct: MACRO
ENDM ENDM
channel_struct: MACRO channel_struct: MACRO
; Addreses are wChannel1 (c101).
\1MusicID:: dw \1MusicID:: dw
\1MusicBank:: db \1MusicBank:: db
\1Flags1:: db ; 0:on/off 1:subroutine 2:looping 3:sfx 4:noise 5:rest \1Flags1:: db ; 0:on/off 1:subroutine 2:looping 3:sfx 4:noise 5:rest

View File

@ -247,9 +247,9 @@ StubbedTrainerRankings_StepCount:
Unreferenced_StubbedTrainerRankings_BattleTowerWins: Unreferenced_StubbedTrainerRankings_BattleTowerWins:
ret ret
ld a, $5 ld a, BANK(s5_aa8d)
call OpenSRAM call OpenSRAM
ld a, [$aa8d] ld a, [s5_aa8d]
and a and a
call CloseSRAM call CloseSRAM
ret nz ret nz
@ -790,16 +790,16 @@ Mobile_DummyReturnFalse:
Stubbed_Function106314: Stubbed_Function106314:
ret ret
ld a, $4 ld a, BANK(s4_b000)
call OpenSRAM call OpenSRAM
ld a, c ld a, c
cpl cpl
ld [$b000], a ld [s4_b000], a
call CloseSRAM call CloseSRAM
ld a, $7 ld a, BANK(s7_a800)
call OpenSRAM call OpenSRAM
ld a, c ld a, c
ld [$a800], a ld [s7_a800], a
call CloseSRAM call CloseSRAM
ret ret
@ -809,27 +809,27 @@ Mobile_AlwaysReturnNotCarry:
Function106331: Function106331:
; called by Mobile_DummyReturnFalse in Crystal-J ; called by Mobile_DummyReturnFalse in Crystal-J
; check ~[4:b000] == [7:a800] ; check ~[s4_b000] == [s7_a800]
ld a, $4 ld a, BANK(s4_b000)
call OpenSRAM call OpenSRAM
ld a, [$b000] ld a, [s4_b000]
cpl cpl
ld b, a ld b, a
call CloseSRAM call CloseSRAM
ld a, $7 ld a, BANK(s7_a800)
call OpenSRAM call OpenSRAM
ld a, [$a800] ld a, [s7_a800]
ld c, a ld c, a
call CloseSRAM call CloseSRAM
ld a, c ld a, c
cp b cp b
jr nz, .nope jr nz, .nope
; check [7:a800] != 0 ; check [s7_a800] != 0
and a and a
jr z, .nope jr z, .nope
; check !([7:a800] & %01110000) ; check !([s7_a800] & %01110000)
and %10001111 and %10001111
cp c cp c
jr nz, .nope jr nz, .nope
@ -1023,7 +1023,7 @@ Function106464::
call Get2bpp call Get2bpp
ld de, $40b0 ld de, $40b0
ld hl, vTiles2 tile $6b ld hl, vTiles2 tile $6b
ld b, $f ; XXX no graphics at 0f:40b0 ld b, $0f ; XXX no graphics at 0f:40b0
call Get2bpp call Get2bpp
farcall LoadFrame farcall LoadFrame
ret ret

View File

@ -25,7 +25,7 @@ Function17a68f::
ld hl, $d088 ld hl, $d088
bit 5, [hl] bit 5, [hl]
jr z, .asm_17a6a6 jr z, .asm_17a6a6
ld de, wStringBuffer1 ; $d073 ld de, wStringBuffer1
push de push de
call Function17a721 call Function17a721
pop de pop de
@ -39,7 +39,7 @@ Function17a68f::
Function17a6a8: Function17a6a8:
push de push de
push bc push bc
ld hl, wStringBuffer2 ; $d086 ld hl, wStringBuffer2
ld bc, $a ld bc, $a
xor a xor a
call ByteFill call ByteFill
@ -531,7 +531,7 @@ String_17a9b2:
db "@" db "@"
Function17a9cb: Function17a9cb:
ld de, wVirtualOAM ; $c400 ld de, wVirtualOAM
ld hl, $d088 ld hl, $d088
bit 6, [hl] bit 6, [hl]
jr nz, .bit_6_set jr nz, .bit_6_set
@ -773,7 +773,7 @@ Function17abcf:
ldh [rSVBK], a ldh [rSVBK], a
ld hl, Palette_17ac55 ld hl, Palette_17ac55
ld de, wBGPals1 ; $d000 ld de, wBGPals1
ld bc, 6 palettes ld bc, 6 palettes
call CopyBytes call CopyBytes

View File

@ -253,6 +253,10 @@ s4_a60e:: dw
sMobileBattleTimer:: ds 3 sMobileBattleTimer:: ds 3
ds $7fd
s4_b000:: db
SECTION "SRAM Mobile 2", SRAM SECTION "SRAM Mobile 2", SRAM
@ -407,3 +411,7 @@ s6_a000::
SECTION "SRAM Mobile 4", SRAM SECTION "SRAM Mobile 4", SRAM
s7_a000:: s7_a000::
ds $800
s7_a800:: db