ref: 0b31d12daceb9f431387951ee275e6147285cffd
parent: b577e4e179711e96f8e059b42c7115e7103a4a69
parent: 315d6c665ea0ee4e103f6d8b9dbfb531659ae381
author: Rangi <35663410+Rangi42@users.noreply.github.com>
date: Tue Aug 18 12:35:15 EDT 2020
Merge pull request #756 from mid-kid/master Rub a dub dub, thanks for the grub
--- a/audio/music/lookyoungster.asm
+++ b/audio/music/lookyoungster.asm
@@ -59,8 +59,9 @@
rest 1
rest 16
sound_loop 0, .mainloop
- sound_ret
+ sound_ret ; unused
+
Music_LookYoungster_Ch2:
stereo_panning TRUE, FALSE
vibrato 18, 2, 6
@@ -156,8 +157,9 @@
note C_, 1
rest 1
sound_loop 0, .mainloop
- sound_ret
+ sound_ret ; unused
+
Music_LookYoungster_Ch3:
stereo_panning TRUE, TRUE
vibrato 2, 2, 4
@@ -290,4 +292,5 @@
note G#, 1
rest 1
sound_loop 0, .mainloop
- sound_ret
+
+ sound_ret ; unused
--- a/charmap.asm
+++ b/charmap.asm
@@ -282,6 +282,7 @@
charmap "「", $70
charmap "」", $71
charmap "』", $73
+ charmap "・", $74
charmap "⋯", $75
charmap " ", $7f
--- a/engine/battle/battle_transition.asm
+++ b/engine/battle/battle_transition.asm
@@ -673,7 +673,7 @@
call CopyBytes
pop af
ldh [rSVBK], a
- ld a, 1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
call DelayFrame
call BattleStart_CopyTilemapAtOnce
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -4920,7 +4920,7 @@
ret
.mobile
- farcall Function100b12
+ farcall Mobile_LoadBattleMenu
ld a, [wcd2b]
and a
ret z
@@ -5311,7 +5311,7 @@
MoveSelectionScreen:
call IsMobileBattle
jr nz, .not_mobile
- farcall MobileMoveSelectionScreen
+ farcall Mobile_MoveSelectionScreen
ret
.not_mobile
--- a/engine/battle_anims/anim_commands.asm
+++ b/engine/battle_anims/anim_commands.asm
@@ -1417,7 +1417,7 @@
call CopyPals
pop af
ldh [rSVBK], a
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
@@ -1438,7 +1438,7 @@
call CopyPals
pop af
ldh [rSVBK], a
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
--- a/engine/battle_anims/bg_effects.asm
+++ b/engine/battle_anims/bg_effects.asm
@@ -2546,7 +2546,7 @@
pop bc
pop af
ldh [rSVBK], a
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
@@ -2573,7 +2573,7 @@
pop bc
pop af
ldh [rSVBK], a
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
--- a/engine/debug/color_picker.asm
+++ b/engine/debug/color_picker.asm
@@ -448,7 +448,7 @@
hlcoord 15, 2
ld de, wc608 + 2
call Function81ca7
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ld a, $3
ld [wJumptableIndex], a
@@ -1227,7 +1227,7 @@
call Function81ca7
pop af
ldh [rSVBK], a
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
call DelayFrame
ret
--- a/engine/events/heal_machine_anim.asm
+++ b/engine/events/heal_machine_anim.asm
@@ -167,7 +167,7 @@
ld bc, 1 palettes
ld a, BANK(wOBPals2)
call FarCopyWRAM
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
@@ -231,7 +231,7 @@
pop af
ldh [rSVBK], a
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
--- a/engine/events/poisonstep_pals.asm
+++ b/engine/events/poisonstep_pals.asm
@@ -39,7 +39,7 @@
jr nz, .loop
pop af
ldh [rSVBK], a
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ld c, 4
call DelayFrames
--- a/engine/gfx/cgb_layouts.asm
+++ b/engine/gfx/cgb_layouts.asm
@@ -189,7 +189,7 @@
ld a, BANK(wBGPals1)
call FarCopyWRAM
call ApplyPals
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
@@ -243,7 +243,7 @@
call ApplyAttrmap
call ApplyPals
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
@@ -282,7 +282,7 @@
call FarCopyWRAM
call ApplyAttrmap
call ApplyPals
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
@@ -317,7 +317,7 @@
call InitPartyMenuOBPals
call ApplyAttrmap
call ApplyPals
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
@@ -339,7 +339,7 @@
call InitPartyMenuOBPals
call ApplyAttrmap
call ApplyPals
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
@@ -362,7 +362,7 @@
call InitPartyMenuOBPals
call ApplyAttrmap
call ApplyPals
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
@@ -415,7 +415,7 @@
call ByteFill
call ApplyAttrmap
call ApplyPals
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
@@ -433,7 +433,7 @@
call FillBoxCGB
call ApplyAttrmap
call ApplyPals
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
@@ -573,7 +573,7 @@
call WipeAttrmap
call ApplyAttrmap
call ApplyPals
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
@@ -591,7 +591,7 @@
ld a, SCGB_DIPLOMA
ld [wDefaultSGBLayout], a
call ApplyPals
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
@@ -725,7 +725,7 @@
ld [hl], a
call ApplyAttrmap
call ApplyPals
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
@@ -749,7 +749,7 @@
call FillBoxCGB
call ApplyAttrmap
call ApplyPals
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
@@ -759,7 +759,7 @@
call WipeAttrmap
call ApplyAttrmap
call ApplyPals
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
@@ -771,7 +771,7 @@
call WipeAttrmap
call ApplyAttrmap
call ApplyPals
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
@@ -819,7 +819,7 @@
call FillBoxCGB
call ApplyAttrmap
call ApplyPals
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
@@ -877,7 +877,7 @@
call FillBoxCGB
call ApplyAttrmap
call ApplyPals
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
--- a/engine/gfx/color.asm
+++ b/engine/gfx/color.asm
@@ -150,7 +150,7 @@
call FarCopyWRAM
call ApplyPals
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
@@ -352,7 +352,7 @@
ld bc, 4
ld a, BANK(wBGPals2)
call FarCopyWRAM
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
--- a/engine/gfx/crystal_layouts.asm
+++ b/engine/gfx/crystal_layouts.asm
@@ -157,7 +157,7 @@
.asm_49467
farcall ApplyAttrmap
farcall ApplyPals
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
--- a/engine/gfx/sprite_anims.asm
+++ b/engine/gfx/sprite_anims.asm
@@ -180,12 +180,12 @@
ld a, [hl]
sla a
sla a
- ld d, $2
+ ld d, 2
ld hl, SPRITEANIMSTRUCT_0C
add hl, bc
ld a, [hl]
- add $3
+ add 3
ld [hl], a
call .Sprites_Sine
@@ -204,7 +204,7 @@
ld a, [hl]
inc a
ld [hl], a
- ld d, $2
+ ld d, 2
call .Sprites_Sine
ld hl, SPRITEANIMSTRUCT_YOFFSET
@@ -391,7 +391,7 @@
inc [hl]
.move_vertical
ld a, e
- ld d, $20
+ ld d, 32
call .Sprites_Sine
ld hl, SPRITEANIMSTRUCT_YOFFSET
@@ -456,10 +456,10 @@
ld hl, SPRITEANIMSTRUCT_0C
add hl, bc
ld a, [hl]
- cp $30
+ cp 48
jr c, .asm_8d4cd
dec [hl]
- ld d, $28
+ ld d, 40
call .Sprites_Sine
ld hl, SPRITEANIMSTRUCT_YOFFSET
@@ -492,8 +492,8 @@
ld a, [hl]
and a
jr z, .asm_8d51c
- ld d, a
+ ld d, a
ld hl, SPRITEANIMSTRUCT_0C
add hl, bc
ld a, [hl]
@@ -759,11 +759,11 @@
ld hl, SPRITEANIMSTRUCT_0D
add hl, bc
ld a, [hl]
- add $2
+ add 2
ld [hl], a
xor $ff
inc a
- ld d, $20
+ ld d, 32
call .Sprites_Sine
ld hl, SPRITEANIMSTRUCT_YOFFSET
@@ -777,13 +777,13 @@
ld hl, SPRITEANIMSTRUCT_0C
add hl, bc
ld a, [hl]
- cp $14
+ cp 20
jr nc, .asm_8d67f
- add $2
+ add 2
ld [hl], a
xor $ff
inc a
- ld d, $20
+ ld d, 32
call .Sprites_Sine
ld hl, SPRITEANIMSTRUCT_YOFFSET
@@ -799,7 +799,6 @@
inc [hl]
inc [hl]
inc [hl]
-
ld hl, SPRITEANIMSTRUCT_0C
add hl, bc
ld a, [hl]
--- a/engine/gfx/sprites.asm
+++ b/engine/gfx/sprites.asm
@@ -135,16 +135,16 @@
; Back up the structure address to bc.
ld c, l
ld b, h
-; Value [wSpriteAnimCount] is initially set to -1. Set it to
-; the number of objects loaded into this array.
+
+; Increment [wSpriteAnimCount], skipping a 0 value.
ld hl, wSpriteAnimCount
inc [hl]
ld a, [hl]
and a
- jr nz, .initialized
+ jr nz, .nonzero
inc [hl]
+.nonzero
-.initialized
; Get row a of SpriteAnimSeqData, copy the pointer into de
pop af
ld e, a
@@ -228,9 +228,9 @@
UpdateAnimFrame:
call InitSpriteAnimBuffer ; init WRAM
call GetSpriteAnimFrame ; read from a memory array
- cp -3
+ cp dowait_command
jr z, .done
- cp -4
+ cp delanim_command
jr z, .delete
call GetFrameOAMPointer
; add byte to [wCurAnimVTile]
--- a/engine/items/item_effects.asm
+++ b/engine/items/item_effects.asm
@@ -1141,7 +1141,7 @@
cp EVERSTONE
jr z, .NoEffect
- ld a, $1
+ ld a, TRUE
ld [wForceEvolution], a
farcall EvolvePokemon
--- a/engine/menus/intro_menu.asm
+++ b/engine/menus/intro_menu.asm
@@ -959,6 +959,15 @@
db 10 * 8 + 4, 9 * 8, 2
db 10 * 8 + 4, 10 * 8, 3
+
+ const_def
+ const TITLESCREENOPTION_MAIN_MENU
+ const TITLESCREENOPTION_DELETE_SAVE_DATA
+ const TITLESCREENOPTION_RESTART
+ const TITLESCREENOPTION_UNUSED
+ const TITLESCREENOPTION_RESET_CLOCK
+NUM_TITLESCREENOPTIONS EQU const_value
+
IntroSequence:
callfar Copyright_GameFreakPresents
jr c, StartTitleScreen
@@ -969,7 +978,7 @@
StartTitleScreen:
ldh a, [rSVBK]
push af
- ld a, BANK(wBGPals1)
+ ld a, BANK(wLYOverrides)
ldh [rSVBK], a
call .TitleScreen
@@ -999,8 +1008,8 @@
ld b, SCGB_DIPLOMA
call GetSGBLayout
call UpdateTimePals
- ld a, [wIntroSceneFrameCounter]
- cp $5
+ ld a, [wTitleScreenSelectedOption]
+ cp NUM_TITLESCREENOPTIONS
jr c, .ok
xor a
.ok
@@ -1183,7 +1192,7 @@
ld a, [hl]
and D_LEFT + D_UP
cp D_LEFT + D_UP
- jr z, .clock_reset
+ jr z, .reset_clock
; Press Start or A to start the game.
.check_start
@@ -1193,14 +1202,14 @@
ret
.incave
- ld a, 0
+ ld a, TITLESCREENOPTION_MAIN_MENU
jr .done
.delete_save_data
- ld a, 1
+ ld a, TITLESCREENOPTION_DELETE_SAVE_DATA
.done
- ld [wIntroSceneFrameCounter], a
+ ld [wTitleScreenSelectedOption], a
; Return to the intro sequence.
ld hl, wJumptableIndex
@@ -1223,9 +1232,9 @@
inc [hl]
ret
-.clock_reset
- ld a, 4
- ld [wIntroSceneFrameCounter], a
+.reset_clock
+ ld a, TITLESCREENOPTION_RESET_CLOCK
+ ld [wTitleScreenSelectedOption], a
; Return to the intro sequence.
ld hl, wJumptableIndex
@@ -1242,8 +1251,8 @@
and a
ret nz
- ld a, 2
- ld [wIntroSceneFrameCounter], a
+ ld a, TITLESCREENOPTION_RESTART
+ ld [wTitleScreenSelectedOption], a
; Back to the intro.
ld hl, wJumptableIndex
--- a/engine/movie/intro.asm
+++ b/engine/movie/intro.asm
@@ -308,7 +308,7 @@
ld [wOBPals2 + 13], a
pop af
ldh [rSVBK], a
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
@@ -1508,7 +1508,7 @@
jr nz, .loop1
pop af
ldh [rSVBK], a
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
@@ -1632,7 +1632,7 @@
pop af
ldh [rSVBK], a
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
@@ -1710,7 +1710,7 @@
pop af
ldh [rSVBK], a
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
@@ -1773,7 +1773,7 @@
pop af
ldh [rSVBK], a
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
@@ -1886,7 +1886,7 @@
dw IntroGrass2GFX
Intro_SetCGBPalUpdate:
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
@@ -1903,7 +1903,7 @@
pop af
ldh [rSVBK], a
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
call DelayFrame
call DelayFrame
--- a/engine/movie/title.asm
+++ b/engine/movie/title.asm
@@ -10,7 +10,7 @@
; Reset timing variables
ld hl, wJumptableIndex
ld [hli], a ; wJumptableIndex
- ld [hli], a ; wIntroSceneFrameCounter
+ ld [hli], a ; wTitleScreenSelectedOption
ld [hli], a ; wTitleScreenTimer
ld [hl], a ; wTitleScreenTimer + 1
@@ -74,7 +74,7 @@
; 'CRYSTAL VERSION'
hlbgcoord 5, 9
- ld bc, NAME_LENGTH ; length of version text
+ ld bc, 11 ; length of version text
ld a, 1
call ByteFill
@@ -85,7 +85,7 @@
call ByteFill
; Back to VRAM bank 0
- ld a, $0
+ ld a, 0
ldh [rVBK], a
; Decompress logo
@@ -108,7 +108,7 @@
hlcoord 0, 3
lb bc, 7, 20
ld d, $80
- ld e, $14
+ ld e, 20
call DrawTitleGraphic
; Draw copyright text
@@ -115,7 +115,7 @@
hlbgcoord 3, 0, vBGMap1
lb bc, 1, 13
ld d, $c
- ld e, $10
+ ld e, 16
call DrawTitleGraphic
; Initialize running Suicune?
@@ -125,14 +125,12 @@
; Initialize background crystal
call InitializeBackground
-; Save WRAM bank
+; Update palette colors
ldh a, [rSVBK]
push af
-; WRAM bank 5
ld a, BANK(wBGPals1)
ldh [rSVBK], a
-; Update palette colors
ld hl, TitleScreenPalettes
ld de, wBGPals1
ld bc, 16 palettes
@@ -143,7 +141,6 @@
ld bc, 16 palettes
call CopyBytes
-; Restore WRAM bank
pop af
ldh [rSVBK], a
@@ -201,7 +198,7 @@
ld a, -112
ldh [hWY], a
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
; Update BG Map 0 (bank 0)
--- a/engine/movie/unused_title.asm
+++ b/engine/movie/unused_title.asm
@@ -88,7 +88,7 @@
pop af
ldh [rSVBK], a
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ld de, MUSIC_TITLE
--- a/engine/overworld/init_map.asm
+++ b/engine/overworld/init_map.asm
@@ -33,7 +33,7 @@
call _OpenAndCloseMenu_HDMATransferTilemapAndAttrmap
farcall LoadOW_BGPal7
farcall ApplyPals
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
xor a
ldh [hBGMapMode], a
--- a/engine/pokegear/radio.asm
+++ b/engine/pokegear/radio.asm
@@ -246,7 +246,7 @@
.loop3
; Choose one of the middle three Pokemon.
call Random
- and NUM_GRASSMON
+ maskbits NUM_GRASSMON
cp 2
jr c, .loop3
cp 5
--- a/engine/pokemon/mon_menu.asm
+++ b/engine/pokemon/mon_menu.asm
@@ -811,8 +811,8 @@
.ChooseMoveToDelete
call SetUpMoveScreenBG
- ld de, DeleteMoveScreenAttrs
- call SetMenuAttributes
+ ld de, DeleteMoveScreen2DMenuData
+ call Load2DMenuData
call SetUpMoveList
ld hl, w2DMenuFlags1
set 6, [hl]
@@ -848,12 +848,12 @@
pop af
ret
-DeleteMoveScreenAttrs:
- db 3, 1
- db 3, 1
- db $40, $00
- dn 2, 0
- db D_UP | D_DOWN | A_BUTTON | B_BUTTON
+DeleteMoveScreen2DMenuData:
+ db 3, 1 ; cursor start y, x
+ db 3, 1 ; rows, columns
+ db $40, $00 ; flags
+ dn 2, 0 ; cursor offset
+ db D_UP | D_DOWN | A_BUTTON | B_BUTTON ; accepted buttons
ManagePokemonMoves:
ld a, [wCurPartySpecies]
@@ -878,8 +878,8 @@
ld [wPartyMenuCursor], a
call SetUpMoveScreenBG
call PlaceMoveScreenArrows
- ld de, MoveScreenAttributes
- call SetMenuAttributes
+ ld de, MoveScreen2DMenuData
+ call Load2DMenuData
.loop
call SetUpMoveList
ld hl, w2DMenuFlags1
@@ -1077,12 +1077,12 @@
call ClearSprites
jp ClearTilemap
-MoveScreenAttributes:
- db 3, 1
- db 3, 1
- db $40, $00
- dn 2, 0
- db D_UP | D_DOWN | D_LEFT | D_RIGHT | A_BUTTON | B_BUTTON
+MoveScreen2DMenuData:
+ db 3, 1 ; cursor start y, x
+ db 3, 1 ; rows, columns
+ db $40, $00 ; flags
+ dn 2, 0 ; cursor offsets
+ db D_UP | D_DOWN | D_LEFT | D_RIGHT | A_BUTTON | B_BUTTON ; accepted buttons
String_MoveWhere:
db "Where?@"
--- a/engine/pokemon/party_menu.asm
+++ b/engine/pokemon/party_menu.asm
@@ -612,8 +612,8 @@
; with cancel
xor a
ld [wSwitchMon], a
- ld de, PartyMenuAttributes
- call SetMenuAttributes
+ ld de, PartyMenu2DMenuData
+ call Load2DMenuData
ld a, [wPartyCount]
inc a
ld [w2DMenuNumRows], a ; list length
@@ -637,8 +637,8 @@
InitPartyMenuNoCancel:
; no cancel
- ld de, PartyMenuAttributes
- call SetMenuAttributes
+ ld de, PartyMenu2DMenuData
+ call Load2DMenuData
ld a, [wPartyCount]
ld [w2DMenuNumRows], a ; list length
ld b, a
@@ -656,20 +656,12 @@
ld [wMenuJoypadFilter], a
ret
-PartyMenuAttributes:
-; cursor y
-; cursor x
-; num rows
-; num cols
-; bit 6: animate sprites bit 5: wrap around
-; ?
-; distance between items (hi: y, lo: x)
-; allowed buttons (mask)
- db 1, 0
- db 0, 1
- db $60, $00
- dn 2, 0
- db 0
+PartyMenu2DMenuData:
+ db 1, 0 ; cursor start y, x
+ db 0, 1 ; rows, columns
+ db $60, $00 ; flags
+ dn 2, 0 ; cursor offset
+ db 0 ; accepted buttons
PartyMenuSelect:
; sets carry if exitted menu.
--- a/home/menu.asm
+++ b/home/menu.asm
@@ -1,8 +1,8 @@
-SetMenuAttributes::
+Load2DMenuData::
push hl
push bc
- ld hl, w2DMenuCursorInitY
- ld b, $8
+ ld hl, w2DMenuData
+ ld b, w2DMenuDataEnd - w2DMenuData
.loop
ld a, [de]
inc de
@@ -9,12 +9,14 @@
ld [hli], a
dec b
jr nz, .loop
+
+ ; Reset menu state
ld a, $1
- ld [hli], a
- ld [hli], a
+ ld [hli], a ; wMenuCursorY
+ ld [hli], a ; wMenuCursorX
xor a
- ld [hli], a
- ld [hli], a
+ ld [hli], a ; wCursorOffCharacter
+ ld [hli], a ; wCursorCurrentTile
ld [hli], a
pop bc
pop hl
--- a/home/palettes.asm
+++ b/home/palettes.asm
@@ -99,7 +99,7 @@
ld c, 8
call CopyPals
; request pal update
- ld a, 1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
pop af
@@ -147,7 +147,7 @@
ld c, 8
call CopyPals
; request pal update
- ld a, 1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
pop af
@@ -182,7 +182,7 @@
ld b, a
ld c, 1
call CopyPals
- ld a, 1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
pop af
@@ -219,7 +219,7 @@
ld b, a
ld c, 1
call CopyPals
- ld a, 1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
pop af
@@ -319,7 +319,7 @@
call ByteFill
pop af
ldh [rSVBK], a
- ld a, 1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
call DelayFrame
ret
--- a/home/text.asm
+++ b/home/text.asm
@@ -698,7 +698,7 @@
dw TextCommand_PROMPT_BUTTON ; TX_PROMPT_BUTTON
dw TextCommand_SCROLL ; TX_SCROLL
dw TextCommand_START_ASM ; TX_START_ASM
- dw TextCommand_NUM ; TX_NUM
+ dw TextCommand_DECIMAL ; TX_DECIMAL
dw TextCommand_PAUSE ; TX_PAUSE
dw TextCommand_SOUND ; TX_SOUND_DEX_FANFARE_50_79
dw TextCommand_DOTS ; TX_DOTS
@@ -851,8 +851,8 @@
ld [hl], a
ret
-TextCommand_NUM::
-; print a number
+TextCommand_DECIMAL::
+; print a decimal number
ld a, [hli]
ld e, a
ld a, [hli]
--- a/home/tilemap.asm
+++ b/home/tilemap.asm
@@ -197,7 +197,7 @@
ldh [rSVBK], a
; Request palette update
- ld a, 1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
--- a/hram.asm
+++ b/hram.asm
@@ -89,7 +89,7 @@
NEXTU
; miscellaneous
- ds 9
+ ds 9
hMGStatusFlags:: db
ENDU
--- a/macros/scripts/text.asm
+++ b/macros/scripts/text.asm
@@ -61,9 +61,9 @@
db TX_START_ASM
ENDM
- const TX_NUM ; $09
+ const TX_DECIMAL ; $09
text_decimal: MACRO
- db TX_NUM
+ db TX_DECIMAL
dw \1 ; address
dn \2, \3 ; bytes, digits
ENDM
--- a/mobile/mobile_40.asm
+++ b/mobile/mobile_40.asm
@@ -409,7 +409,7 @@
Function1002ed:
farcall LoadOW_BGPal7
farcall ApplyPals
- ld a, $01
+ ld a, TRUE
ldh [hCGBPalUpdate], a
call DelayFrame
ret
@@ -1689,7 +1689,7 @@
popc
-Function100b12:
+Mobile_LoadBattleMenu:
call Function100dd8
ret c
ld hl, BattleMenuHeader
@@ -1747,7 +1747,7 @@
set 7, [hl]
ret
-MobileMoveSelectionScreen:
+Mobile_MoveSelectionScreen:
xor a
ld [wMoveSwapBuffer], a
farcall CheckPlayerHasUsableMoves
@@ -1765,7 +1765,7 @@
.GetMoveSelection:
xor a
ldh [hBGMapMode], a
- call Function100c74
+ call .ListMoves
call Function100c98
.master_loop
farcall MoveInfoBox
@@ -1860,7 +1860,7 @@
call SafeLoadTempTilemapToTilemap
jp .GetMoveSelection
-Function100c74:
+.ListMoves:
hlcoord 0, 8
ld b, 8
ld c, 8
@@ -1876,8 +1876,8 @@
ret
Function100c98:
- ld de, .attrs
- call SetMenuAttributes
+ ld de, .data
+ call Load2DMenuData
ld a, [wNumMoves]
inc a
ld [w2DMenuNumRows], a
@@ -1886,12 +1886,12 @@
ld [wMenuCursorY], a
ret
-.attrs
- db 10, 1
- db 255, 1
- db $a0, $00
- dn 2, 0
- db D_UP | D_DOWN | A_BUTTON | B_BUTTON
+.data:
+ db 10, 1 ; cursor start y, x
+ db -1, 1 ; rows, columns
+ db $a0, $00 ; flags
+ dn 2, 0 ; cursor offsets
+ db D_UP | D_DOWN | A_BUTTON | B_BUTTON ; accepted buttons
Mobile_PartyMenuSelect:
call Function100dd8
@@ -2210,7 +2210,7 @@
Function100ed4:
farcall ApplyPals
- ld a, $01
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
@@ -5944,7 +5944,7 @@
ld hl, wcd4b
set 1, [hl]
ld de, MenuData3_102a33
- call SetMenuAttributes
+ call Load2DMenuData
ld a, [wcd4a]
inc a
ld [wcd4a], a
@@ -5981,11 +5981,11 @@
db "@"
MenuData3_102a33:
- db 8, 11
- db 2, 1
- db $80, $00
- dn 2, 0
- db A_BUTTON
+ db 8, 11 ; cursor start y, x
+ db 2, 1 ; rows, columns
+ db $80, $00 ; flags
+ dn 2, 0 ; cursor offset
+ db A_BUTTON ; accepted buttons
Function102a3b:
ld a, [wcd30]
@@ -6115,8 +6115,8 @@
ld [wMonType], a
ld a, [wMenuCursorY]
push af
- ld de, Unknown_102b73
- call SetMenuAttributes
+ ld de, MenuData_102b73
+ call Load2DMenuData
pop af
ld [wMenuCursorY], a
ld a, [wOTPartyCount]
@@ -6130,12 +6130,12 @@
call ByteFill
ret
-Unknown_102b73:
- db 9, 6
- db 255, 1
- db $a0, $00
- dn 1, 0
- db D_UP | D_DOWN | A_BUTTON
+MenuData_102b73:
+ db 9, 6 ; cursor start y, x
+ db -1, 1 ; rows, columns
+ db $a0, $00 ; flags
+ dn 1, 0 ; cursor offset
+ db D_UP | D_DOWN | A_BUTTON ; accepted buttons
Function102b7b:
xor a
@@ -6142,8 +6142,8 @@
ld [wMonType], a
ld a, [wMenuCursorY]
push af
- ld de, Unknown_102b94
- call SetMenuAttributes
+ ld de, MenuData_102b94
+ call Load2DMenuData
pop af
ld [wMenuCursorY], a
ld a, [wPartyCount]
@@ -6150,12 +6150,12 @@
ld [w2DMenuNumRows], a
ret
-Unknown_102b94:
- db 1, 6
- db 255, 1
- db $a0, $00
- dn 1, 0
- db D_UP | D_DOWN | A_BUTTON
+MenuData_102b94:
+ db 1, 6 ; cursor start y, x
+ db 255, 1 ; rows, columns
+ db $a0, $00 ; flags
+ dn 1, 0 ; cursor offset
+ db D_UP | D_DOWN | A_BUTTON ; accepted buttons
Function102b9c:
ld a, [wcd4d]
--- a/mobile/mobile_42.asm
+++ b/mobile/mobile_42.asm
@@ -1450,7 +1450,7 @@
jr nz, .loop
pop af
ldh [rSVBK], a
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
@@ -1474,7 +1474,7 @@
ld [hld], a
pop af
ldh [rSVBK], a
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
--- a/mobile/mobile_5b.asm
+++ b/mobile/mobile_5b.asm
@@ -650,7 +650,7 @@
ld a, $5
call FarCopyWRAM
farcall ApplyPals
- ld a, $1
+ ld a, TRUE
ldh [hCGBPalUpdate], a
ret
--- a/wram.asm
+++ b/wram.asm
@@ -1436,13 +1436,14 @@
wcf66:: db
NEXTU
-; intro and title data
+; intro data
wIntroSceneFrameCounter:: db
-UNION
wIntroSceneTimer:: db
+
NEXTU
+; title data
+wTitleScreenSelectedOption:: db
wTitleScreenTimer:: dw
-ENDU
NEXTU
; credits data