documenting lots of code and wram related to the minicom mailbox

I checked the new WRAM values in-game with a debugger
This commit is contained in:
mdraves91
2025-11-16 09:15:56 -06:00
parent 6718adb2c0
commit 7cdeea6f20
9 changed files with 394 additions and 325 deletions

View File

@@ -330,7 +330,8 @@ ENDR
DEF wD606_STRUCT_SIZE EQU $8
DEF SCRIPT_BUFFER_SIZE EQU $20
DEF SCRIPT_STACK_SIZE EQU $10
DEF wDD37_BUFFER_SIZE EQU $19
DEF wMAIL_QUEUE_BUFFER_SIZE EQU $19
DEF B_MAIL_READ EQU 7
; TODO: Figure out why 2 is added in IngameCardPop
const_def

View File

@@ -4433,7 +4433,7 @@ Func_a786:
ld [wNumMenuItems], a
.asm_a7ca
ldh a, [hDPadHeld]
and $80
and PAD_DOWN
jr z, .asm_a7d5
call ConfirmSelectionAndReturnCarry
jr .asm_a7e2
@@ -4469,7 +4469,7 @@ Func_a786:
.asm_a80c
call DoFrame
ldh a, [hDPadHeld]
and $40
and PAD_UP
jr z, .asm_a825
ld a, [wTempCardTypeFilter]
ld hl, wScrollMenuScrollOffset
@@ -4484,10 +4484,10 @@ Func_a786:
call HandleScrollListInput
jr c, .asm_a87e
ldh a, [hDPadHeld]
and $08
and PAD_START
jr z, .asm_a80c
.asm_a835
ld a, $01
ld a, MENU_CONFIRM
call PlayConfirmOrCancelSFX
ld a, [wNumMenuItems]
ld [wTempScrollMenuNumVisibleItems], a

View File

@@ -6342,7 +6342,7 @@ Func_131eb:
ret
Func_131fd:
farcall Func_1f324
farcall CheckForBlackBoxCardInMail
ret nc
ldtx hl, GameCenterBlackBoxUnableLastOutputRemainingText
call PrintScrollableText_NoTextBoxLabelVRAM0

File diff suppressed because it is too large Load Diff

View File

@@ -4856,7 +4856,7 @@ Func_2612a:
ldtx hl, GameCenterBillsPCStartPromptText
call YesOrNoMenuWithText
ret c
farcall Func_1f333
farcall CheckForBillsPCCardInMail
ldtx hl, GameCenterBillsPCUnableLastOutputRemainingText
jr c, .asm_2619a
farcall GetGameCenterChips

View File

@@ -4857,7 +4857,7 @@ Func_3ada1:
inc hl
ld [hl], d
call ClearScreenAndDrawDeckMachineScreen
ld a, $32
ld a, NUM_DECK_SAVE_MACHINE_SLOTS
ld [wNumDeckMachineEntries], a
xor a
.asm_3adb7

View File

@@ -2023,7 +2023,7 @@ Func_456de:
ld a, [hli]
ld e, a
ld d, [hl]
ld hl, wdd5f
ld hl, wBlackBoxCardReceived
ld c, $03
.asm_45734
ld a, e
@@ -2057,7 +2057,7 @@ Func_456de:
ld a, [hli]
ld e, a
ld d, [hl]
ld hl, wdd5f
ld hl, wBlackBoxCardReceived
ld c, $05
.asm_4576b
ld a, e
@@ -2080,7 +2080,7 @@ Func_456de:
ld a, [hli]
ld e, a
ld d, [hl]
ld hl, wdd5f
ld hl, wBlackBoxCardReceived
ld a, e
ld [hli], a
ld a, d
@@ -2107,7 +2107,7 @@ Func_456de:
ld a, [hli]
ld e, a
ld d, [hl]
ld hl, wdd5f
ld hl, wBlackBoxCardReceived
ld a, e
ld [hli], a
ld a, d
@@ -2137,7 +2137,7 @@ Func_456de:
ld a, [hli]
ld e, a
ld d, [hl]
ld hl, wdd5f
ld hl, wBlackBoxCardReceived
ld a, e
ld [hli], a
ld a, d
@@ -2215,7 +2215,7 @@ Func_457ea:
ld a, [hli]
ld e, a
ld d, [hl]
ld hl, wdd5f
ld hl, wBlackBoxCardReceived
.asm_45858
ld a, e
ld [hli], a
@@ -2234,7 +2234,7 @@ Func_457ea:
Func_45868:
xor a
ld hl, wdd5f
ld hl, wBlackBoxCardReceived
ld [hli], a
ld [hl], a
ld hl, BlackboxPromoCards
@@ -2262,7 +2262,7 @@ Func_45868:
ld a, [hld]
ld d, a
push hl
ld hl, wdd5f
ld hl, wBlackBoxCardReceived
call AppendCardToListInHL
ld hl, wCurDeckCards
call Func_443bd
@@ -2287,7 +2287,7 @@ Func_45868:
or e
jr z, .asm_458be
push hl
ld hl, wdd5f
ld hl, wBlackBoxCardReceived
call AppendCardToListInHL
pop hl
jr .asm_458ad
@@ -2296,7 +2296,7 @@ Func_45868:
Func_458bf:
xor a
ld hl, wdd5f
ld hl, wBlackBoxCardReceived
ld [hli], a
ld [hl], a
ld hl, wCurDeckCards
@@ -2319,7 +2319,7 @@ Func_458bf:
jr c, .asm_458c8
.asm_458e7
push hl
ld hl, wdd5f
ld hl, wBlackBoxCardReceived
call AppendCardToListInHL
pop hl
jr .asm_458c8
@@ -2387,7 +2387,7 @@ Func_458bf:
cp $02
jp nc, .asm_4593a
push hl
ld hl, wdd5f
ld hl, wBlackBoxCardReceived
call AppendCardToListInHL
pop hl
jr .asm_4593a
@@ -2496,7 +2496,7 @@ Func_458bf:
ld a, [hli]
ld e, a
ld d, [hl]
ld hl, wdd5f
ld hl, wBlackBoxCardReceived
call AppendCardToListInHL
dec c
jr nz, .asm_459f7
@@ -2534,7 +2534,7 @@ Func_458bf:
ld a, [hli]
ld e, a
ld d, [hl]
ld hl, wdd5f
ld hl, wBlackBoxCardReceived
call AppendCardToListInHL
dec c
jr nz, .asm_45a3c
@@ -2572,7 +2572,7 @@ Func_458bf:
ld a, [hli]
ld e, a
ld d, [hl]
ld hl, wdd5f
ld hl, wBlackBoxCardReceived
call AppendCardToListInHL
dec c
jr nz, .asm_45a81
@@ -2580,7 +2580,7 @@ Func_458bf:
ret
.asm_45a9c
call Func_45bc3
ld hl, wdd5f
ld hl, wBlackBoxCardReceived
ld de, $a
call AppendCardToListInHL
jr .asm_45a9b
@@ -2757,7 +2757,7 @@ Func_45bc3:
push de
push hl
ld hl, wCurDeckCards
ld de, wdd5f
ld de, wBlackBoxCardReceived
ld bc, $c
call CopyDataHLtoDE_SaveRegisters
pop hl

View File

@@ -27,7 +27,7 @@ ENDM
\10 ; has horizontal scroll - TRUE or FALSE
\11 ; vertical step - int
\12 ; update function - function ptr or NULL
\13 ; label text ID - text ptr
\13 ; label text ID - text ptr or NULL
15 bytes. Used by LoadMenuBoxParams.
Usually followed by a list of textitem macros, then $ff

View File

@@ -3261,48 +3261,72 @@ wdd2e:: ; dd2e
wdd2f:: ; dd2f
ds $1
ds $6
wdd36:: ; dd36
; id of the mail item being read
wMailId:: ; dd30
ds $1
wdd37:: ; dd37
ds wDD37_BUFFER_SIZE
wdd50:: ; dd50
; 0 - mailbox full, 1 - new mail, 2 - no new mail
wMailboxStatus:: ; dd31
ds $1
wdd51:: ; dd51
; text offset of the sender line. displayed when reading a mail
wMailSenderText:: ; dd32
ds $2
; text offset of the subject line. displayed when reading a mail
wMailSubjectText:: ; dd34
ds $2
; number of minicom mail queued to be delivered. mail is delivered when changing OW locations
wNumMailInQueue:: ; dd36
ds $1
; list of mail items queued to be delivered
wMailQueue:: ; dd37
ds wMAIL_QUEUE_BUFFER_SIZE
; total number of mail in your mailbox
wMailCount:: ; dd50
ds $1
; list of mail items in the player's mailbox. holds up to 8 mail.
; Each byte is the id of a mail item.
; When mail is read, $80 is added to the id
wMailList:: ; dd51
ds $9
wdd5a:: ; dd5a
; $ff when the player has new mail. set to 0 when opening mincom mail menu. affects the mailbox animation
wNewMail:: ; dd5a
ds $1
wdd5b:: ; dd5b
; copied from wNumMailInQueue when visiting world map.
; cleared after viewing the mailbox screen once.
; used to show the "mailbox full" graphic
wTempNumMailInQueue:: ; dd5b
ds $1
wdd5c:: ; dd5c
; which page of mail you are viewing. 0 or 1
wMailboxPage:: ; dd5c
ds $1
wdd5d:: ; dd5d
; the mail you have selected to read/delete
wSelectedMailCursorPosition:: ; dd5d
ds $1
wdd5e:: ; dd5e
; 0 - read mail, 1 - delete mail, 2 - quit
wMailOptionSelected:: ; dd5e
ds $1
wdd5f:: ; dd5f
ds $1
wdd60:: ; dd60
ds $1
; card offset. the card mailed to you after using the Game Center black box
wBlackBoxCardReceived:: ; dd5f
ds $2
; TODO: are these also black box cards?
ds $12
wdd73:: ; dd73
ds $1
wdd74:: ; dd74
ds $1
; card offset. the card mailed to you after using the Game Center Bill's PC
wBillsPCCardReceived:: ; dd73
ds $2
wdd75:: ; dd75
ds $1