ClearWindowData clears four menu data buffers, each the same size

This commit is contained in:
Rangi 2022-01-22 21:43:09 -05:00
parent 20dc31115e
commit ce16317f33
2 changed files with 16 additions and 11 deletions

View File

@ -754,14 +754,14 @@ GetMenuDataPointerTableEntry::
ret
ClearWindowData::
ld hl, wWindowStackPointer
call .bytefill
ld hl, wMenuMetadata
call .ClearMenuData
ld hl, wMenuHeader
call .bytefill
ld hl, wMenuDataFlags
call .bytefill
ld hl, w2DMenuCursorInitY
call .bytefill
call .ClearMenuData
ld hl, wMenuData
call .ClearMenuData
ld hl, wMoreMenuData
call .ClearMenuData
ldh a, [rSVBK]
push af
@ -781,8 +781,11 @@ ClearWindowData::
ldh [rSVBK], a
ret
.bytefill
ld bc, $10
.ClearMenuData:
ld bc, wMenuMetadataEnd - wMenuMetadata
assert wMenuMetadataEnd - wMenuMetadata == wMenuHeaderEnd - wMenuHeader
assert wMenuMetadataEnd - wMenuMetadata == wMenuDataEnd - wMenuData
assert wMenuMetadataEnd - wMenuMetadata == wMoreMenuDataEnd - wMoreMenuData
xor a
call ByteFill
ret

View File

@ -1630,6 +1630,7 @@ wRequested1bppSize:: db
wRequested1bppSource:: dw
wRequested1bppDest:: dw
wMenuMetadata::
wWindowStackPointer:: dw
wMenuJoypad:: db
wMenuSelection:: db
@ -1637,8 +1638,8 @@ wMenuSelectionQuantity:: db
wWhichIndexSet:: db
wScrollingMenuCursorPosition:: db
wWindowStackSize:: db
ds 8
wMenuMetadataEnd::
; menu header
wMenuHeader::
@ -1686,6 +1687,7 @@ wMenuData_ScrollingMenuFunction3:: ds 3
ENDU
wMenuDataEnd::
wMoreMenuData::
w2DMenuData::
w2DMenuCursorInitY:: db
w2DMenuCursorInitX:: db
@ -1710,8 +1712,8 @@ wMenuCursorY:: db
wMenuCursorX:: db
wCursorOffCharacter:: db
wCursorCurrentTile:: dw
ds 3
wMoreMenuDataEnd::
wOverworldDelay:: db
wTextDelayFrames:: db