summaryrefslogtreecommitdiff
path: root/home
diff options
context:
space:
mode:
Diffstat (limited to 'home')
-rw-r--r--home/copy.asm4
-rw-r--r--home/fade.asm2
-rw-r--r--home/init.asm17
-rw-r--r--home/map.asm14
-rw-r--r--home/menu.asm26
-rw-r--r--home/movement.asm4
-rw-r--r--home/text.asm10
-rw-r--r--home/window.asm6
8 files changed, 46 insertions, 37 deletions
diff --git a/home/copy.asm b/home/copy.asm
index 183a19811..bf2dee3fb 100644
--- a/home/copy.asm
+++ b/home/copy.asm
@@ -421,9 +421,9 @@ Copy1bpp:: ; fa4
push af
ld h, 0
ld l, c
-rept 3
add hl, hl
-endr
+ add hl, hl
+ add hl, hl
ld b, h
ld c, l
pop af
diff --git a/home/fade.asm b/home/fade.asm
index 579a4125a..c5eb2c2eb 100644
--- a/home/fade.asm
+++ b/home/fade.asm
@@ -2,6 +2,8 @@
Function48c:: ; 48c
+; XXX
+; TimeOfDayFade
ld a, [TimeOfDayPal]
ld b, a
ld hl, IncGradGBPalTable_11
diff --git a/home/init.asm b/home/init.asm
index 69a709769..a479b4b5f 100644
--- a/home/init.asm
+++ b/home/init.asm
@@ -100,7 +100,7 @@ Init:: ; 17d
ld [rSVBK], a
call ClearVRAM
call ClearSprites
- call Function270
+ call ClearsScratch
ld a, BANK(LoadPushOAM)
@@ -194,9 +194,10 @@ ClearVRAM:: ; 245
ClearWRAM:: ; 25a
; Wipe swappable WRAM banks (1-7)
+; Assumes CGB or AGB
ld a, 1
-.asm_25c
+.bank_loop
push af
ld [rSVBK], a
xor a
@@ -206,15 +207,17 @@ ClearWRAM:: ; 25a
pop af
inc a
cp 8
- jr nc, .asm_25c
+ jr nc, .bank_loop
ret
; 270
-Function270:: ; 270
- ld a, $0
+ClearsScratch:: ; 270
+; Wipe the first 32 bytes of sScratch
+
+ ld a, BANK(sScratch)
call GetSRAMBank
- ld hl, $a000
- ld bc, $0020
+ ld hl, sScratch
+ ld bc, $20
xor a
call ByteFill
call CloseSRAM
diff --git a/home/map.asm b/home/map.asm
index 96eae7d37..7f15afc96 100644
--- a/home/map.asm
+++ b/home/map.asm
@@ -155,9 +155,9 @@ LoadMetatiles:: ; 2198
add a
ld l, a
ld h, 0
-rept 3
add hl, hl
-endr
+ add hl, hl
+ add hl, hl
ld a, [TilesetBlocksAddress]
add l
ld l, a
@@ -694,9 +694,9 @@ RestoreFacingAfterWarp:: ; 248a
ld a, [hli]
ld h, [hl]
ld l, a
-rept 3
inc hl ; get to the warp coords
-endr
+ inc hl ; get to the warp coords
+ inc hl ; get to the warp coords
ld a, [WarpNumber]
dec a
ld c, a
@@ -751,9 +751,9 @@ ChangeMap:: ; 24e4
ld [hConnectionStripLength], a
ld c, a
ld b, 0
-rept 3
add hl, bc
-endr
+ add hl, bc
+ add hl, bc
ld c, 3
add hl, bc
ld a, [MapBlockDataBank]
@@ -1072,7 +1072,7 @@ MapTextbox:: ; 269a
push hl
call SpeechTextBox
- call Function2e31
+ call SafeUpdateSprites
ld a, 1
ld [hOAMUpdate], a
call ApplyTilemap
diff --git a/home/menu.asm b/home/menu.asm
index b7755de08..563ee9f99 100644
--- a/home/menu.asm
+++ b/home/menu.asm
@@ -229,9 +229,9 @@ _OffsetMenuDataHeader:: ; 1e35
; 1e5d
DoNthMenu:: ; 1e5d
- call MenuFunc_1e7f
+ call DrawVariableLengthMenuBox
call MenuWriteText
- call Function1eff
+ call InitMenuCursorAndButtonPermissions
call GetStaticMenuJoypad
call GetMenuJoypad
call MenuClickSound
@@ -239,17 +239,17 @@ DoNthMenu:: ; 1e5d
; 1e70
SetUpMenu:: ; 1e70
- call MenuFunc_1e7f ; ???
+ call DrawVariableLengthMenuBox ; ???
call MenuWriteText
- call Function1eff ; set up selection pointer
+ call InitMenuCursorAndButtonPermissions ; set up selection pointer
ld hl, w2DMenuFlags1
set 7, [hl]
ret
-MenuFunc_1e7f::
+DrawVariableLengthMenuBox::
call CopyMenuData2
call GetMenuIndexSet
- call Function1ea6
+ call AutomaticGetMenuBottomCoord
call MenuBox
ret
@@ -257,8 +257,8 @@ MenuWriteText::
xor a
ld [hBGMapMode], a
call GetMenuIndexSet ; sort out the text
- call Function1eda ; actually write it
- call Function2e31
+ call RunMenuItemPrintingFunction ; actually write it
+ call SafeUpdateSprites
ld a, [hOAMUpdate]
push af
ld a, $1
@@ -269,7 +269,7 @@ MenuWriteText::
ret
; 0x1ea6
-Function1ea6:: ; 1ea6
+AutomaticGetMenuBottomCoord:: ; 1ea6
ld a, [wMenuBorderLeftCoord]
ld c, a
ld a, [wMenuBorderRightCoord]
@@ -310,7 +310,7 @@ GetMenuIndexSet:: ; 1ebd
ret
; 1eda
-Function1eda:: ; 1eda
+RunMenuItemPrintingFunction:: ; 1eda
call MenuBoxCoord2Tile
ld bc, 2 * SCREEN_WIDTH + 2
add hl, bc
@@ -325,7 +325,7 @@ Function1eda:: ; 1eda
ld d, h
ld e, l
ld hl, wMenuData2DisplayFunctionPointer
- call .__wMenuData2DisplayFunction__
+ call ._hl_
pop hl
ld de, 2 * SCREEN_WIDTH
add hl, de
@@ -333,14 +333,14 @@ Function1eda:: ; 1eda
jr .loop
; 1efb
-.__wMenuData2DisplayFunction__ ; 1efb
+._hl_ ; 1efb
ld a, [hli]
ld h, [hl]
ld l, a
jp [hl]
; 1eff
-Function1eff:: ; 1eff
+InitMenuCursorAndButtonPermissions:: ; 1eff
call InitVerticalMenuCursor
ld hl, wMenuJoypadFilter
ld a, [wMenuData2Flags]
diff --git a/home/movement.asm b/home/movement.asm
index 8471e81ca..c7f785f09 100644
--- a/home/movement.asm
+++ b/home/movement.asm
@@ -150,9 +150,9 @@ SetMenuAttributes:: ; 1bb1
ld [hli], a
ld [hli], a
xor a
-rept 3
ld [hli], a
-endr
+ ld [hli], a
+ ld [hli], a
pop bc
pop hl
ret
diff --git a/home/text.asm b/home/text.asm
index 08b3f3660..a5ddf43c9 100644
--- a/home/text.asm
+++ b/home/text.asm
@@ -525,7 +525,7 @@ Paragraph:: ; 12f2
call LoadBlinkingCursor
.linkbattle
- call Function13b6
+ call Text_WaitBGMap
call ButtonSound
hlcoord TEXTBOX_INNERX, TEXTBOX_INNERY
lb bc, TEXTBOX_INNERH - 1, TEXTBOX_INNERW
@@ -546,7 +546,7 @@ Char4B:: ; 131f
call LoadBlinkingCursor
.communication
- call Function13b6
+ call Text_WaitBGMap
push de
call ButtonSound
@@ -598,7 +598,7 @@ PromptText:: ; 135a
call LoadBlinkingCursor
.ok
- call Function13b6
+ call Text_WaitBGMap
call ButtonSound
ld a, [wLinkMode]
cp LINK_COLOSSEUM
@@ -655,7 +655,7 @@ TextScroll:: ; 138c
ret
; 13b6
-Function13b6:: ; 13b6
+Text_WaitBGMap:: ; 13b6
push bc
ld a, [hOAMUpdate]
push af
@@ -1029,6 +1029,8 @@ Text_PlaySound:: ; 1500
; 1522
Function1522:: ; 1522
+; XXX
+; TX_CRY
push de
ld e, [hl]
inc hl
diff --git a/home/window.asm b/home/window.asm
index 5922905a9..5832f1f94 100644
--- a/home/window.asm
+++ b/home/window.asm
@@ -39,7 +39,7 @@ CloseText:: ; 2dcf
call _OpenAndCloseMenu_HDMATransferTileMapAndAttrMap
xor a
ld [hBGMapMode], a
- call Function2e31
+ call SafeUpdateSprites
ld a, $90
ld [hWY], a
call ReplaceKrisSprite
@@ -78,7 +78,7 @@ _OpenAndCloseMenu_HDMATransferTileMapAndAttrMap:: ; 2e20
ret
; 2e31
-Function2e31:: ; 2e31
+SafeUpdateSprites:: ; 2e31
ld a, [hOAMUpdate]
push af
ld a, [hBGMapMode]
@@ -87,7 +87,9 @@ Function2e31:: ; 2e31
ld [hBGMapMode], a
ld a, $1
ld [hOAMUpdate], a
+
call UpdateSprites
+
xor a
ld [hOAMUpdate], a
call DelayFrame