diff --git a/constants/battle_tower_constants.asm b/constants/battle_tower_constants.asm index 9945a08ad..b230bb1ab 100644 --- a/constants/battle_tower_constants.asm +++ b/constants/battle_tower_constants.asm @@ -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 diff --git a/engine/battle/core.asm b/engine/battle/core.asm index e9ef9dc26..4256b0df6 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -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 diff --git a/engine/events/battle_tower/battle_tower.asm b/engine/events/battle_tower/battle_tower.asm index 41de7135e..6ffc3c8e2 100644 --- a/engine/events/battle_tower/battle_tower.asm +++ b/engine/events/battle_tower/battle_tower.asm @@ -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 diff --git a/engine/menus/save.asm b/engine/menus/save.asm index 3676c3528..3bb23f08e 100644 --- a/engine/menus/save.asm +++ b/engine/menus/save.asm @@ -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. diff --git a/engine/printer/printer.asm b/engine/printer/printer.asm index fb696ac4d..1cba451e7 100644 --- a/engine/printer/printer.asm +++ b/engine/printer/printer.asm @@ -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 diff --git a/macros/wram.asm b/macros/wram.asm index 6c211e1ca..453749620 100644 --- a/macros/wram.asm +++ b/macros/wram.asm @@ -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 diff --git a/mobile/mobile_41.asm b/mobile/mobile_41.asm index 9ef8a1383..c38bd9fc2 100644 --- a/mobile/mobile_41.asm +++ b/mobile/mobile_41.asm @@ -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 diff --git a/mobile/mobile_5e.asm b/mobile/mobile_5e.asm index fc66b0521..55654d572 100644 --- a/mobile/mobile_5e.asm +++ b/mobile/mobile_5e.asm @@ -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 diff --git a/sram.asm b/sram.asm index 512cfb2e2..c04fb71ac 100644 --- a/sram.asm +++ b/sram.asm @@ -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