summaryrefslogtreecommitdiff
path: root/engine/menus/intro_menu.asm
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2018-08-25 14:28:22 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2018-08-25 14:28:22 -0400
commiteb1e3636bb71509546c274bf2a5910d8e71a9600 (patch)
tree24d7742604073b2afb86c1225258f8217d1653e7 /engine/menus/intro_menu.asm
parent376c64468bab8d162da43fc6e1b6f0942943cf43 (diff)
Use labels instead of constants for HRAM
Use explicit ldh instruction to access HRAM locations, don't rely on optimizing ld
Diffstat (limited to 'engine/menus/intro_menu.asm')
-rw-r--r--engine/menus/intro_menu.asm82
1 files changed, 41 insertions, 41 deletions
diff --git a/engine/menus/intro_menu.asm b/engine/menus/intro_menu.asm
index 4e145664a..d327f2d50 100644
--- a/engine/menus/intro_menu.asm
+++ b/engine/menus/intro_menu.asm
@@ -41,7 +41,7 @@ PrintDayOfWeek:
NewGame_ClearTileMapEtc:
xor a
- ld [hMapAnims], a
+ ldh [hMapAnims], a
call ClearTileMap
call LoadFontsExtra
call LoadStandardFont
@@ -73,7 +73,7 @@ NewGame:
ld [wDefaultSpawnpoint], a
ld a, MAPSETUP_WARP
- ld [hMapEntryMethod], a
+ ldh [hMapEntryMethod], a
jp FinishContinueFunction
AreYouABoyOrAreYouAGirl:
@@ -89,7 +89,7 @@ AreYouABoyOrAreYouAGirl:
ResetWRAM:
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
call _ResetWRAM
ret
@@ -109,16 +109,16 @@ _ResetWRAM:
xor a
call ByteFill
- ld a, [rLY]
- ld [hSecondsBackup], a
+ ldh a, [rLY]
+ ldh [hSecondsBackup], a
call DelayFrame
- ld a, [hRandomSub]
+ ldh a, [hRandomSub]
ld [wPlayerID], a
- ld a, [rLY]
- ld [hSecondsBackup], a
+ ldh a, [rLY]
+ ldh [hSecondsBackup], a
call DelayFrame
- ld a, [hRandomAdd]
+ ldh a, [hRandomAdd]
ld [wPlayerID + 1], a
call Random
@@ -335,7 +335,7 @@ Continue:
call LoadStandardMenuHeader
call DisplaySaveInfoOnContinue
ld a, $1
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
ld c, 20
call DelayFrames
call ConfirmContinue
@@ -369,7 +369,7 @@ Continue:
cp SPAWN_LANCE
jr z, .SpawnAfterE4
ld a, MAPSETUP_CONTINUE
- ld [hMapEntryMethod], a
+ ldh [hMapEntryMethod], a
jp FinishContinueFunction
.FailToLoad:
@@ -389,7 +389,7 @@ PostCreditsSpawn:
xor a
ld [wSpawnAfterChampion], a
ld a, MAPSETUP_WARP
- ld [hMapEntryMethod], a
+ ldh [hMapEntryMethod], a
ret
Continue_MobileAdapterMenu:
@@ -507,7 +507,7 @@ DisplayContinueDataWithRTCError:
Continue_LoadMenuHeader:
xor a
- ld [hBGMapMode], a
+ ldh [hBGMapMode], a
ld hl, .MenuHeader_Dex
ld a, [wStatusFlags]
bit STATUSFLAGS_POKEDEX_F, a
@@ -800,7 +800,7 @@ StorePlayerName:
ret
ShrinkPlayer:
- ld a, [hROMBank]
+ ldh a, [hROMBank]
push af
ld a, 32 ; fade time
@@ -874,24 +874,24 @@ IntroFadePalettes:
Intro_WipeInFrontpic:
ld a, $77
- ld [hWX], a
+ ldh [hWX], a
call DelayFrame
ld a, %11100100
call DmgToCgbBGPals
.loop
call DelayFrame
- ld a, [hWX]
+ ldh a, [hWX]
sub $8
cp -1
ret z
- ld [hWX], a
+ ldh [hWX], a
jr .loop
Intro_PrepTrainerPic:
ld de, vTiles2
farcall GetTrainerPic
xor a
- ld [hGraphicStartTile], a
+ ldh [hGraphicStartTile], a
hlcoord 6, 4
lb bc, 7, 7
predef PlaceGraphic
@@ -902,7 +902,7 @@ ShrinkFrame:
ld c, 7 * 7
predef DecompressGet2bpp
xor a
- ld [hGraphicStartTile], a
+ ldh [hGraphicStartTile], a
hlcoord 6, 4
lb bc, 7, 7
predef PlaceGraphic
@@ -958,10 +958,10 @@ CrystalIntroSequence:
farcall CrystalIntro
StartTitleScreen:
- ld a, [rSVBK]
+ ldh a, [rSVBK]
push af
ld a, BANK(wBGPals1)
- ld [rSVBK], a
+ ldh [rSVBK], a
call .TitleScreen
call DelayFrame
@@ -973,20 +973,20 @@ StartTitleScreen:
call ClearBGPalettes
pop af
- ld [rSVBK], a
+ ldh [rSVBK], a
ld hl, rLCDC
res rLCDC_SPRITE_SIZE, [hl] ; 8x8
call ClearScreen
call WaitBGMap2
xor a
- ld [hLCDCPointer], a
- ld [hSCX], a
- ld [hSCY], a
+ ldh [hLCDCPointer], a
+ ldh [hSCX], a
+ ldh [hSCY], a
ld a, $7
- ld [hWX], a
+ ldh [hWX], a
ld a, $90
- ld [hWY], a
+ ldh [hWY], a
ld b, SCGB_DIPLOMA
call GetSGBLayout
call UpdateTimePals
@@ -1031,7 +1031,7 @@ RunTitleScreen:
ret
Unreferenced_Function6292:
- ld a, [hVBlankCounter]
+ ldh a, [hVBlankCounter]
and $7
ret nz
ld hl, wLYOverrides + $5f
@@ -1066,11 +1066,11 @@ TitleScreenScene:
TitleScreenEntrance:
; Animate the logo:
; Move each line by 4 pixels until our count hits 0.
- ld a, [hSCX]
+ ldh a, [hSCX]
and a
jr z, .done
sub 4
- ld [hSCX], a
+ ldh [hSCX], a
; Lay out a base (all lines scrolling together).
ld e, a
@@ -1100,14 +1100,14 @@ TitleScreenEntrance:
ld hl, wJumptableIndex
inc [hl]
xor a
- ld [hLCDCPointer], a
+ ldh [hLCDCPointer], a
; Play the title screen music.
ld de, MUSIC_TITLE
call PlayMusic
ld a, $88
- ld [hWY], a
+ ldh [hWY], a
ret
TitleScreenTimer:
@@ -1149,7 +1149,7 @@ TitleScreenMain:
; To bring up the clock reset dialog:
; Hold Down + B + Select to initiate the sequence.
- ld a, [hClockResetTrigger]
+ ldh a, [hClockResetTrigger]
cp $34
jr z, .check_clock_reset
@@ -1159,7 +1159,7 @@ TitleScreenMain:
jr nz, .check_start
ld a, $34
- ld [hClockResetTrigger], a
+ ldh [hClockResetTrigger], a
jr .check_start
; Keep Select pressed, and hold Left + Up.
@@ -1169,7 +1169,7 @@ TitleScreenMain:
jr nz, .check_start
xor a
- ld [hClockResetTrigger], a
+ ldh [hClockResetTrigger], a
ld a, [hl]
and D_LEFT + D_UP
@@ -1322,13 +1322,13 @@ GameInit::
call ClearBGPalettes
call ClearTileMap
ld a, HIGH(vBGMap0)
- ld [hBGMapAddress + 1], a
+ ldh [hBGMapAddress + 1], a
xor a ; LOW(vBGMap0)
- ld [hBGMapAddress], a
- ld [hJoyDown], a
- ld [hSCX], a
- ld [hSCY], a
+ ldh [hBGMapAddress], a
+ ldh [hJoyDown], a
+ ldh [hSCX], a
+ ldh [hSCY], a
ld a, $90
- ld [hWY], a
+ ldh [hWY], a
call WaitBGMap
jp CrystalIntroSequence