summaryrefslogtreecommitdiff
path: root/home
diff options
context:
space:
mode:
Diffstat (limited to 'home')
-rw-r--r--home/audio.asm31
-rw-r--r--home/battle.asm4
-rw-r--r--home/fade.asm3
-rw-r--r--home/init.asm2
-rw-r--r--home/lcd.asm3
-rw-r--r--home/map.asm20
-rw-r--r--home/map_objects.asm4
-rw-r--r--home/menu.asm17
-rw-r--r--home/mobile.asm6
-rw-r--r--home/palettes.asm2
-rw-r--r--home/pokedex_flags.asm2
-rw-r--r--home/serial.asm3
-rw-r--r--home/sine.asm2
-rw-r--r--home/text.asm9
-rw-r--r--home/time.asm6
-rw-r--r--home/trainers.asm2
-rw-r--r--home/vblank.asm4
-rw-r--r--home/video.asm2
-rw-r--r--home/window.asm2
19 files changed, 55 insertions, 69 deletions
diff --git a/home/audio.asm b/home/audio.asm
index 35f98af4d..f904e9599 100644
--- a/home/audio.asm
+++ b/home/audio.asm
@@ -319,7 +319,7 @@ Unused_FadeOutMusic:: ; 3ca8
; 3cae
FadeInMusic:: ; 3cae
- ld a, 4 | 1 << 7
+ ld a, 4 | (1 << MUSIC_FADE_IN_F)
ld [MusicFade], a
ret
; 3cb4
@@ -502,20 +502,19 @@ GetMapMusic:: ; 3d97
ret
; 3d9f
-Function3d9f:: ; 3d9f
+Unreferenced_Function3d9f:: ; 3d9f
; Places a BCD number at the
; upper center of the screen.
-; Unreferenced.
- ld a, 4 * 8
- ld [Sprites + 38 * 4], a
- ld [Sprites + 39 * 4], a
- ld a, 10 * 8
- ld [Sprites + 38 * 4 + 1], a
- ld a, 11 * 8
- ld [Sprites + 39 * 4 + 1], a
+ ld a, 4 * TILE_WIDTH
+ ld [Sprite39YCoord], a
+ ld [Sprite40YCoord], a
+ ld a, 10 * TILE_WIDTH
+ ld [Sprite39XCoord], a
+ ld a, 11 * TILE_WIDTH
+ ld [Sprite40XCoord], a
xor a
- ld [Sprites + 38 * 4 + 3], a
- ld [Sprites + 39 * 4 + 3], a
+ ld [Sprite39Attributes], a
+ ld [Sprite40Attributes], a
ld a, [wc296]
cp 100
jr nc, .max
@@ -525,17 +524,17 @@ Function3d9f:: ; 3d9f
swap a
and $f
add "0"
- ld [Sprites + 38 * 4 + 2], a
+ ld [Sprite39TileID], a
ld a, b
and $f
add "0"
- ld [Sprites + 39 * 4 + 2], a
+ ld [Sprite40TileID], a
ret
.max
ld a, "9"
- ld [Sprites + 38 * 4 + 2], a
- ld [Sprites + 39 * 4 + 2], a
+ ld [Sprite39TileID], a
+ ld [Sprite40TileID], a
ret
; 3dde
diff --git a/home/battle.asm b/home/battle.asm
index 30096fd4a..b44fa5d97 100644
--- a/home/battle.asm
+++ b/home/battle.asm
@@ -130,8 +130,8 @@ RefreshBattleHuds:: ; 39c9
; 39d4
UpdateBattleHuds:: ; 39d4
- farcall UpdatePlayerHUD
- farcall UpdateEnemyHUD
+ farcall Predef_UpdatePlayerHUD
+ farcall Predef_UpdateEnemyHUD
ret
; 39e1
diff --git a/home/fade.asm b/home/fade.asm
index c5eb2c2eb..d81a49c6c 100644
--- a/home/fade.asm
+++ b/home/fade.asm
@@ -1,8 +1,7 @@
; Functions to fade the screen in and out.
-Function48c:: ; 48c
-; XXX
+Unreferenced_Function48c:: ; 48c
; TimeOfDayFade
ld a, [TimeOfDayPal]
ld b, a
diff --git a/home/init.asm b/home/init.asm
index dbdbccf3d..26fb17313 100644
--- a/home/init.asm
+++ b/home/init.asm
@@ -166,7 +166,7 @@ Init:: ; 17d
call DelayFrame
- predef InitSGBBorder ; SGB init
+ predef Predef_InitSGBBorder ; SGB init
call MapSetup_Sound_Off
xor a
diff --git a/home/lcd.asm b/home/lcd.asm
index dfb174ee1..e2fb4c5a9 100644
--- a/home/lcd.asm
+++ b/home/lcd.asm
@@ -1,8 +1,7 @@
; LCD handling
-Function547:: ; 547
-; Unreferenced
+Unreferenced_Function547:: ; 547
ld a, [hLCDCPointer]
cp rSCX - $ff00
ret nz
diff --git a/home/map.asm b/home/map.asm
index b48f01ce1..4d16ff7b3 100644
--- a/home/map.asm
+++ b/home/map.asm
@@ -384,7 +384,7 @@ CheckIndoorMap:: ; 22f4
ret
; 2300
-; XXX
+; unused
cp INDOOR
ret z
cp GATE
@@ -1371,7 +1371,7 @@ UpdateBGMapColumn:: ; 27f8
inc d
; cap d at HIGH(vBGMap0)
ld a, d
- and $3
+ and %11
or HIGH(vBGMap0)
ld d, a
@@ -1383,7 +1383,7 @@ UpdateBGMapColumn:: ; 27f8
ret
; 2816
-; unreferenced
+Unreferenced_Function2816::
ld hl, BGMapBuffer
ld bc, BGMapBufferEnd - BGMapBuffer
xor a
@@ -1429,6 +1429,7 @@ LoadTilesetGFX:: ; 2821
pop af
ld [rSVBK], a
+; These tilesets support dynamic per-mapgroup roof tiles.
ld a, [wTileset]
cp TILESET_JOHTO_1
jr z, .load_roof
@@ -1983,7 +1984,7 @@ FadeToMenu:: ; 2b29
xor a
ld [hBGMapMode], a
call LoadStandardMenuDataHeader
- farcall FadeOutPalettes
+ farcall Special_FadeOutPalettes
call ClearSprites
call DisableSpriteUpdates
ret
@@ -2009,7 +2010,7 @@ FinishExitMenu:: ; 2b5c
call GetSGBLayout
farcall LoadOW_BGPal7
call WaitBGMap2
- farcall FadeInPalettes
+ farcall Special_FadeInPalettes
call EnableSpriteUpdates
ret
; 2b74
@@ -2042,7 +2043,7 @@ ReturnToMapWithSpeechTextbox:: ; 0x2b74
ReloadTilesetAndPalettes:: ; 2bae
call DisableLCD
call ClearSprites
- farcall RefreshSprites
+ farcall Special_RefreshSprites
call LoadStandardFont
call LoadFontsExtra
ld a, [hROMBank]
@@ -2075,7 +2076,6 @@ GetAnyMapHeaderPointer:: ; 0x2bed
; inputs:
; b = map group, c = map number
-; XXX de = ???
; outputs:
; hl points to the map header
@@ -2106,11 +2106,11 @@ GetMapHeaderMember:: ; 0x2c04
; Extract data from the current map's header.
; inputs:
-; de = offset of desired data within the mapheader
+; de = offset of desired data within the mapheader (a MAPHEADER_* constant)
; outputs:
; bc = data from the current map's header
-; (e.g., de = $0003 would return a pointer to the secondary map header)
+; (e.g., de = MAPHEADER_MAPHEADER2 would return a pointer to the secondary map header)
ld a, [MapGroup]
ld b, a
@@ -2247,7 +2247,7 @@ GetMapEnvironment:: ; 2c8a
ret
; 2c98
- ret ; XXX
+ ret ; unused
; 2c99
GetAnyMapEnvironment:: ; 2c99
diff --git a/home/map_objects.asm b/home/map_objects.asm
index 3857bef0c..1db2bb3ba 100644
--- a/home/map_objects.asm
+++ b/home/map_objects.asm
@@ -316,7 +316,7 @@ CheckObjectTime:: ; 18f5
ret
; 194d
-; XXX
+; unused
ld [hMapObjectIndexBuffer], a
call GetMapObject
call CopyObjectStruct
@@ -383,7 +383,7 @@ CopyPlayerObjectTemplate:: ; 19a6
ret
; 19b8
-; XXX
+Unreferenced_Function19b8:
call GetMapObject
ld hl, MAPOBJECT_OBJECT_STRUCT_ID
add hl, bc
diff --git a/home/menu.asm b/home/menu.asm
index 2be46120d..b2ab0feb0 100644
--- a/home/menu.asm
+++ b/home/menu.asm
@@ -28,8 +28,7 @@ MenuTextBox:: ; 1d4f
jp PrintText
; 1d57
-ret_1d57:: ; 1d57
-; unreferenced
+; unused
ret
; 1d58
@@ -41,8 +40,7 @@ LoadMenuTextBox:: ; 1d58
.MenuDataHeader: ; 1d5f
db $40 ; tile backup
- db 12, 0 ; start coords
- db 17, 19 ; end coords
+ menu_coords 0, 12, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
dw vTiles0
db 0 ; default option
; 1d67
@@ -61,8 +59,7 @@ LoadStandardMenuDataHeader:: ; 1d6e
.MenuDataHeader: ; 1d75
db $40 ; tile backup
- db 0, 0 ; start coords
- db 17, 19 ; end coords
+ menu_coords 0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
dw 0
db 1 ; default option
; 1d7d
@@ -184,8 +181,7 @@ InterpretTwoOptionMenu:: ; 1dfe
YesNoMenuDataHeader:: ; 1e1d
db $40 ; tile backup
- db 5, 10 ; start coords
- db 9, 15 ; end coords
+ menu_coords 10, 5, 15, 9
dw .MenuData2
db 1 ; default option
; 1e25
@@ -453,8 +449,7 @@ PlaceNthMenuStrings:: ; 1f8d
ret
; 1f9e
-Function1f9e:: ; 1f9e
-; unreferenced
+Unreferenced_Function1f9e:: ; 1f9e
call GetMenuDataPointerTableEntry
inc hl
inc hl
@@ -517,7 +512,7 @@ ClearWindowData:: ; 1fbf
; 1ff0
.bytefill ; 1ff0
- ld bc, $0010
+ ld bc, $10
xor a
call ByteFill
ret
diff --git a/home/mobile.asm b/home/mobile.asm
index f50571ff4..1248c3f7e 100644
--- a/home/mobile.asm
+++ b/home/mobile.asm
@@ -127,8 +127,7 @@ Timer:: ; 3e93
reti
; 3ed7
-Function3ed7:: ; 3ed7
-; unreferenced
+Unreferenced_Function3ed7:: ; 3ed7
ld [$dc02], a
ld a, [hROMBank]
push af
@@ -160,8 +159,7 @@ Function3eea:: ; 3eea
ret
; 3efd
-Function3efd:: ; 3efd
-; unreferenced
+Unreferenced_Function3efd:: ; 3efd
push hl
hlcoord 0, 12
ld b, 4
diff --git a/home/palettes.asm b/home/palettes.asm
index 79ff71887..9f10da118 100644
--- a/home/palettes.asm
+++ b/home/palettes.asm
@@ -319,7 +319,7 @@ ret_d90:: ; d90
; d91
-Special_ReloadSpritesNoPalettes:: ; d91
+ReloadSpritesNoPalettes:: ; d91
ld a, [hCGB]
and a
ret z
diff --git a/home/pokedex_flags.asm b/home/pokedex_flags.asm
index 7aacd4981..ace3d6802 100644
--- a/home/pokedex_flags.asm
+++ b/home/pokedex_flags.asm
@@ -31,7 +31,7 @@ CheckSeenMon:: ; 339b
PokedexFlagAction:: ; 33a1
ld d, 0
- predef FlagPredef
+ predef Predef_SmallFarFlagAction
ld a, c
and a
ret
diff --git a/home/serial.asm b/home/serial.asm
index b0151eae2..1d6f11bd1 100644
--- a/home/serial.asm
+++ b/home/serial.asm
@@ -398,8 +398,7 @@ LinkDataReceived:: ; 908
ret
; 919
-Function919:: ; 919
-; XXX
+Unreferenced_Function919:: ; 919
ld a, [wLinkMode]
and a
ret nz
diff --git a/home/sine.asm b/home/sine.asm
index 810845860..eff5ed299 100644
--- a/home/sine.asm
+++ b/home/sine.asm
@@ -1,6 +1,6 @@
Cosine:: ; 1b0f
; Return d * cos(a) in hl
- add $10 ; 90 degrees
+ add %010000 ; 90 degrees
Sine:: ; 1b11
; Return d * sin(a) in hl
diff --git a/home/text.asm b/home/text.asm
index 191c96172..a89f39eb2 100644
--- a/home/text.asm
+++ b/home/text.asm
@@ -47,10 +47,8 @@ ClearScreen:: ; fdb
TextBox:: ; fe8
-; Draw a text box at hl with room for
-; b lines of c characters each.
-; Places a border around the textbox,
-; then switches the palette to the
+; Draw a text box at hl with room for b lines of c characters each.
+; Places a border around the textbox, then switches the palette to the
; text black-and-white scheme.
push bc
push hl
@@ -1015,8 +1013,7 @@ Text_PlaySound:: ; 1500
ret
; 1522
-Function1522:: ; 1522
-; XXX
+Unreferenced_Function1522:: ; 1522
; TX_CRY
push de
ld e, [hl]
diff --git a/home/time.asm b/home/time.asm
index 9ed703686..be141a066 100644
--- a/home/time.asm
+++ b/home/time.asm
@@ -48,17 +48,17 @@ GetClock:: ; 5b7
ld [hl], RTC_S
ld a, [de]
- maskbits 60
+ maskbits 60 - 1
ld [hRTCSeconds], a
ld [hl], RTC_M
ld a, [de]
- maskbits 60
+ maskbits 60 - 1
ld [hRTCMinutes], a
ld [hl], RTC_H
ld a, [de]
- maskbits 24
+ maskbits 24 - 1
ld [hRTCHours], a
ld [hl], RTC_DL
diff --git a/home/trainers.asm b/home/trainers.asm
index 857a95629..44093bfc1 100644
--- a/home/trainers.asm
+++ b/home/trainers.asm
@@ -240,7 +240,7 @@ PrintWinLossText:: ; 3718
cp BATTLETYPE_CANLOSE
jr .canlose ; ??????????
-; unreferenced
+; unused
ld hl, wWinTextPointer
jr .ok
diff --git a/home/vblank.asm b/home/vblank.asm
index cb8c5ba56..5afecdad0 100644
--- a/home/vblank.asm
+++ b/home/vblank.asm
@@ -190,7 +190,7 @@ VBlank1:: ; 337
jr c, .done
call UpdateBGMap
- call Serve2bppRequest@VBlank
+ call Serve2bppRequest_VBlank
call hPushOAM
.done
@@ -280,7 +280,7 @@ VBlank3:: ; 396
jr c, .done
call UpdateBGMap
- call Serve2bppRequest@VBlank
+ call Serve2bppRequest_VBlank
call hPushOAM
.done
diff --git a/home/video.asm b/home/video.asm
index a533a4b77..ae4d6031e 100644
--- a/home/video.asm
+++ b/home/video.asm
@@ -379,7 +379,7 @@ Serve2bppRequest:: ; 1769
jr _Serve2bppRequest
-Serve2bppRequest@VBlank:: ; 1778
+Serve2bppRequest_VBlank:: ; 1778
ld a, [Requested2bpp]
and a
diff --git a/home/window.asm b/home/window.asm
index 0570bbb01..67debe5d3 100644
--- a/home/window.asm
+++ b/home/window.asm
@@ -99,7 +99,7 @@ SafeUpdateSprites:: ; 2e31
ld [hOAMUpdate], a
ret
-; XXX
+; unused
scf
ret
; 2e50