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_EGGTICKET
const BATTLETOWERACTION_0F ; check w3_d090
const BATTLETOWERACTION_10 ; dw based on 5:a800
const BATTLETOWERACTION_11 ; store 0 in 5:aa8d
const BATTLETOWERACTION_12 ; store 1 in 5:aa8d
const BATTLETOWERACTION_13 ; check 5:aa8d
const BATTLETOWERACTION_10 ; dw based on s5_a800
const BATTLETOWERACTION_11 ; store 0 in s5_aa8d
const BATTLETOWERACTION_12 ; store 1 in s5_aa8d
const BATTLETOWERACTION_13 ; check s5_aa8d
const BATTLETOWERACTION_14 ; if save file is yours: bit 0, [sBattleTowerSaveFileFlags]
const BATTLETOWERACTION_15 ; set 0, [sBattleTowerSaveFileFlags]
const BATTLETOWERACTION_16 ; update time in SRAM bank 5

View File

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

View File

@ -68,7 +68,7 @@ Function170114:
ret
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)
call OpenSRAM
ld de, s5_aa41

View File

@ -826,7 +826,7 @@ _SaveData:
call CopyBytes
; 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
; save that unwrites the garbage.

View File

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

View File

@ -126,7 +126,6 @@ map_connection_struct: MACRO
ENDM
channel_struct: MACRO
; Addreses are wChannel1 (c101).
\1MusicID:: dw
\1MusicBank:: db
\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:
ret
ld a, $5
ld a, BANK(s5_aa8d)
call OpenSRAM
ld a, [$aa8d]
ld a, [s5_aa8d]
and a
call CloseSRAM
ret nz
@ -790,16 +790,16 @@ Mobile_DummyReturnFalse:
Stubbed_Function106314:
ret
ld a, $4
ld a, BANK(s4_b000)
call OpenSRAM
ld a, c
cpl
ld [$b000], a
ld [s4_b000], a
call CloseSRAM
ld a, $7
ld a, BANK(s7_a800)
call OpenSRAM
ld a, c
ld [$a800], a
ld [s7_a800], a
call CloseSRAM
ret
@ -809,27 +809,27 @@ Mobile_AlwaysReturnNotCarry:
Function106331:
; called by Mobile_DummyReturnFalse in Crystal-J
; check ~[4:b000] == [7:a800]
ld a, $4
; check ~[s4_b000] == [s7_a800]
ld a, BANK(s4_b000)
call OpenSRAM
ld a, [$b000]
ld a, [s4_b000]
cpl
ld b, a
call CloseSRAM
ld a, $7
ld a, BANK(s7_a800)
call OpenSRAM
ld a, [$a800]
ld a, [s7_a800]
ld c, a
call CloseSRAM
ld a, c
cp b
jr nz, .nope
; check [7:a800] != 0
; check [s7_a800] != 0
and a
jr z, .nope
; check !([7:a800] & %01110000)
; check !([s7_a800] & %01110000)
and %10001111
cp c
jr nz, .nope
@ -1023,7 +1023,7 @@ Function106464::
call Get2bpp
ld de, $40b0
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
farcall LoadFrame
ret

View File

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

View File

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