documenting deck menu

the bulk of the names for functions, labels, wram and constants came from corresponding code in poketcg1

this refactoring extends outside the scope of newly disassembled code from the pause menu, and into code that was disassembled from the big mapfunctions dump
This commit is contained in:
mdraves91
2025-11-14 13:59:52 -06:00
parent 36bb0e4197
commit e26340f332
8 changed files with 492 additions and 336 deletions

View File

@@ -55,6 +55,7 @@ DEF FILTER_ENERGY EQU $20
DEF NUM_FILTERS EQU 9
DEF NUM_DECK_CONFIRMATION_VISIBLE_CARDS EQU 7
DEF NUM_FILTERED_LIST_VISIBLE_CARDS EQU 6
DEF NUM_DECK_SAVE_MACHINE_SLOTS EQU 50
DEF NUM_DECK_MACHINE_VISIBLE_DECKS EQU 5

File diff suppressed because it is too large Load Diff

View File

@@ -1287,17 +1287,17 @@ SECTION "Bank 4@4865", ROMX[$4865], BANK[$4]
PauseMenuDeckScreen:
call Func_1022a
call Func_1086f
call ShowDeckSelectionMenuFromPauseMenu
call Func_10252
ret
Func_1086f:
ShowDeckSelectionMenuFromPauseMenu:
push af
push bc
push de
push hl
call SetFadePalsFrameFunc
farcall Func_8f7f
farcall DeckSelectionMenu
farcall StartFadeToWhite
farcall WaitPalFading_Bank07
call UnsetFadePalsFrameFunc
@@ -1306,9 +1306,6 @@ Func_1086f:
pop bc
pop af
ret
; 0x1088a
SECTION "Bank 4@488a", ROMX[$488a], BANK[$4]
ZeroObjectPositionsAndEnableOBPFading:
push af

View File

@@ -5965,9 +5965,31 @@ HandCardsGfx:
WhatIsYourNameData:
textitem 1, 1, WhatIsYourNameText
db $ff ; end
; 0x1ae65
SECTION "Bank 6@6e92", ROMX[$6e92], BANK[$6]
Deck1RenameText:
textitem 2, 1, Deck1Text
textitem 14, 1, DeckText
db $ff
Deck2RenameText:
textitem 2, 1, Deck2Text
textitem 14, 1, DeckText
db $ff
Deck3RenameText:
textitem 2, 1, Deck3Text
textitem 14, 1, DeckText
db $ff
Deck4RenameText:
textitem 2, 1, Deck4Text
textitem 14, 1, DeckText
db $ff
Deck5RenameText:
textitem 2, 1, Deck5Text
textitem 14, 1, DeckText
db $ff
; dupe of PlayConfirmOrCancelSFX in bank 2
; if a = MENU_CANCEL (-1), play SFX_CANCEL (usually following B button)
@@ -5995,7 +6017,11 @@ InputPlayerName:
lb bc, 12, 1
; fallthrough
Func_1aeab:
; a = maximum length of name (depending on whether player's or deck's).
; bc = position of name.
; de = dest. pointer.
; hl = pointer to text item of the question.
InputName:
call InitializeInputName
call Set_OBJ_8x8

View File

@@ -3531,7 +3531,7 @@ Func_2bc4f:
ld [hl], d
ld a, $ff ; all decks
farcall DrawDeckSelectionMenu
farcall DrawDecksScreen
xor a
.asm_2bc5c
ld hl, .MenuParameters
@@ -3543,7 +3543,7 @@ Func_2bc4f:
call DrawWideTextBox_PrintText
.loop_input
call DoFrame
farcall Func_8fb9
farcall HandleStartButtonInDeckSelectionMenu
jr c, .asm_2bc5c
call HandleMenuInput
jp nc, .loop_input ; can be jr
@@ -3558,7 +3558,7 @@ Func_2bc4f:
farcall CheckIfCurDeckIsEmpty
jp nc, .valid ; can be jr
; deck is empty
farcall Func_9215
farcall PrintThereIsNoDeckHereText
jr .asm_2bc5c
.valid

View File

@@ -4877,20 +4877,20 @@ Func_3ada1:
ld a, [wScrollMenuScrollOffset]
add b
ld [wSelectedDeckMachineEntry], a
farcall Func_9287
farcall ResetCheckMenuCursorPositionAndBlink
call DrawWideTextBox
ld hl, $6e7b
call PlaceTextItems
.asm_3aded:
call DoFrame
farcall Func_9292
farcall HandleCheckMenuInput
jp nc, .asm_3aded
cp $ff
jr nz, .asm_3ae01
ld a, [wTempScrollMenuItem]
jp .asm_3adb7
.asm_3ae01
ld a, [wMusicStereoPanningBackup]
ld a, [wCheckMenuCursorYPosition]
sla a
ld hl, wCurSongBankBackup
add [hl]
@@ -5636,7 +5636,7 @@ SECTION "Bank e@72db", ROMX[$72db], BANK[$e]
Func_3b2db:
ld a, $ff
farcall DrawDeckSelectionMenu
farcall DrawDecksScreen
xor a
.asm_3b2e2
ld hl, $735e
@@ -5645,7 +5645,7 @@ Func_3b2db:
call DrawWideTextBox_PrintText
.asm_3b2ee
call DoFrame
farcall Func_8fb9
farcall HandleStartButtonInDeckSelectionMenu
jr c, .asm_3b2e2
call HandleMenuInput
jp nc, .asm_3b2ee
@@ -5655,7 +5655,7 @@ Func_3b2db:
ld [wCurDeck], a
farcall CheckIfCurDeckIsEmpty
jp nc, Func_3b315
farcall Func_9215
farcall PrintThereIsNoDeckHereText
ld a, [wCurDeck]
jr .asm_3b2e2
@@ -5871,7 +5871,7 @@ Func_3b45f:
ldtx hl, YouMayOnlyCarry4DecksText
call DrawWideTextBox_WaitForInput
ld a, $ff
farcall DrawDeckSelectionMenu
farcall DrawDecksScreen
xor a
.asm_3b46c
ld hl, $735e
@@ -5880,7 +5880,7 @@ Func_3b45f:
call DrawWideTextBox_PrintText
.asm_3b478
call DoFrame
farcall Func_8fb9
farcall HandleStartButtonInDeckSelectionMenu
jr c, .asm_3b46c
call HandleMenuInput
jp nc, .asm_3b478
@@ -5906,13 +5906,13 @@ Func_3b45f:
push hl
ld bc, $18
add hl, bc
farcall Func_9397
farcall AddDeckToCollection
pop hl
ld a, $60
farcall ClearNBytesFromHL
call DisableSRAM
ld a, $ff
farcall DrawDeckSelectionMenu
farcall DrawDecksScreen
ld a, [wCurDeck]
ld hl, $735e
call InitializeMenuParameters
@@ -6001,7 +6001,7 @@ Func_3b4eb:
call CopyBBytesFromHLToDE_Bank0e
call DisableSRAM
ld a, $ff
farcall DrawDeckSelectionMenu
farcall DrawDecksScreen
ld a, [wd496]
ld [wCurDeck], a
ld hl, $735e
@@ -6042,7 +6042,7 @@ Func_3b4eb:
Func_3b5f1:
call Func_3bcd6
farcall DrawDeckSelectionMenu
farcall DrawDecksScreen
ldtx hl, DismantleTheseDecksPromptText
call YesOrNoMenuWithText
jr nc, .asm_3b601
@@ -6075,7 +6075,7 @@ Func_3b5f1:
.asm_3b634
call DisableSRAM
ld a, [wd49a]
farcall DrawDeckSelectionMenu
farcall DrawDecksScreen
ldtx hl, DismantledTheseDecksText
call DrawWideTextBox_WaitForInput
or a
@@ -6090,7 +6090,7 @@ Func_3b646:
push hl
ld bc, $18
add hl, bc
farcall Func_9397
farcall AddDeckToCollection
pop hl
ld a, $60
farcall ClearNBytesFromHL
@@ -6914,7 +6914,7 @@ Func_3bb09:
ld a, [wScrollMenuScrollOffset]
add b
ld [wSelectedDeckMachineEntry], a
farcall Func_9287
farcall ResetCheckMenuCursorPositionAndBlink
xor a
ld [wd0cd], a
call DrawWideTextBox
@@ -6929,7 +6929,7 @@ Func_3bb09:
ld a, [wTempScrollMenuItem]
jp .asm_3bb30
.asm_3bbe6
ld a, [wMusicStereoPanningBackup]
ld a, [wCheckMenuCursorYPosition]
sla a
ld hl, wCurSongBankBackup
add [hl]

View File

@@ -71,10 +71,12 @@ ENDR
sCurrentlySelectedDeck:: ; b7a0
ds $1
s0b7a1:: ; b7a1
ds $1
ds $1
; keeps track of how many unnamed decks have been built
; this is the number that gets appended at the end of
; an unnamed deck (i.e. DECK XXX)
; max number is MAX_UNNAMED_DECK_NUM
sUnnamedDeckCounter:: ; b7a1
ds $2
; each bit represents whether the player has
; obtained a card from a given set

View File

@@ -1861,8 +1861,11 @@ wNumEntriesInCurFilter::
wBoosterPackCardListSize:: ; d0ee
ds $1
wd0ef:: ; d0ef
ds $2
wCheckMenuCursorXPosition:: ; d0ef
ds $1
wCheckMenuCursorYPosition:: ; d0f0
ds $1
; deck selected by the player in the Decks screen
wCurDeck:: ; d0f1
@@ -1940,7 +1943,7 @@ wCurCardTypeFilter:: ; d11a
wTempCurMenuItem:: ; d11b
ds $1
wd11c:: ; d11c
wTempFilteredCardListNumCursorPositions:: ; d11c
ds $1
ds $1
@@ -1948,7 +1951,7 @@ wd11c:: ; d11c
wced7:: ; d11e
ds $1
wd11f:: ; d11f
wCardListVisibleOffsetBackup:: ; d11f
ds $1
; stores how many different cards there are in a deck
@@ -2014,13 +2017,22 @@ wd381:: ; d381
wSameNameCardsLimit:: ; d382
ds $1
wd383:: ; d383
; whether to include the cards in the selected deck
; to appear in the filtered lists
; is TRUE when building a deck (since the cards should be shown for removal)
; is FALSE when choosing a deck configuration to send through Gift Center
; (can't select cards that are included in already built decks)
wIncludeCardsInDeck:: ; d383
ds $1
wd384:: ; d384
; pointer to a function that handles the menu
; when building a deck configuration
wDeckConfigurationMenuHandlerFunction:: ; d384
ds $2
wd386:: ; d386
; pointer to a transition table for the
; function in wDeckConfigurationMenuHandlerFunction
wDeckConfigurationMenuTransitionTable:: ; d386
ds $2
wCurCardListPtr:: ; d388
@@ -2106,6 +2118,8 @@ wNamingScreenNamePosition:: ; d3e9
wNamingScreenMode:: ; d3eb
ds $1
; see also sUnnamedDeckCounter
wTempUnnamedDeckCounter:: ; d3ec
ds $3
wd3ef:: ; d3ef