diff --git a/home/menu.asm b/home/menu.asm index 5a3257150..126198809 100644 --- a/home/menu.asm +++ b/home/menu.asm @@ -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 diff --git a/wram.asm b/wram.asm index 84471696d..f9edd34d9 100644 --- a/wram.asm +++ b/wram.asm @@ -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