diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2022-01-22 21:43:09 -0500 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2022-01-22 21:43:09 -0500 |
commit | ce16317f33fc534a6724f5ccfd0901bf2888862b (patch) | |
tree | 6bf5899df5a0cbeea2460590b0ea3b6542b35953 | |
parent | 20dc31115e0234eb3819ce5b0d5dcfa7c009f8ea (diff) |
`ClearWindowData` clears four menu data buffers, each the same size
-rw-r--r-- | home/menu.asm | 21 | ||||
-rw-r--r-- | wram.asm | 6 |
2 files changed, 16 insertions, 11 deletions
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 @@ -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 |