Fix some MenuData2 labels

Gave them better names, moved the flags out of the union, and documented
the w2DMenuFlags1.
This commit is contained in:
mid-kid
2017-12-30 12:23:20 +01:00
parent f27f79488a
commit 066cc91b13
2 changed files with 31 additions and 31 deletions

View File

@@ -110,14 +110,14 @@ Mobile_GetMenuSelection: ; 24098
ret ret
; 240cd ; 240cd
GetMenuNumberOfColumns: ; 240cd Get2DMenuNumberOfColumns: ; 240cd
ld a, [wMenuData2Items] ld a, [wMenuData2_2DMenuDimensions]
and $f and $f
ret ret
; 240d3 ; 240d3
GetMenuNumberOfRows: ; 240d3 Get2DMenuNumberOfRows: ; 240d3
ld a, [wMenuData2Items] ld a, [wMenuData2_2DMenuDimensions]
swap a swap a
and $f and $f
ret ret
@@ -130,19 +130,19 @@ Place2DMenuItemStrings: ; 240db
ld d, [hl] ld d, [hl]
call GetMenuTextStartCoord call GetMenuTextStartCoord
call Coord2Tile call Coord2Tile
call GetMenuNumberOfRows call Get2DMenuNumberOfRows
ld b, a ld b, a
.row .row
push bc push bc
push hl push hl
call GetMenuNumberOfColumns call Get2DMenuNumberOfColumns
ld c, a ld c, a
.col .col
push bc push bc
ld a, [wMenuData2_2DMenuItemStringsBank] ld a, [wMenuData2_2DMenuItemStringsBank]
call Place2DMenuItemName call Place2DMenuItemName
inc de inc de
ld a, [wMenuData2Spacing] ld a, [wMenuData2_2DMenuSpacing]
ld c, a ld c, a
ld b, 0 ld b, 0
add hl, bc add hl, bc
@@ -174,9 +174,9 @@ Init2DMenuCursorPosition: ; 2411a (9:411a)
dec c dec c
ld a, c ld a, c
ld [w2DMenuCursorInitX], a ld [w2DMenuCursorInitX], a
call GetMenuNumberOfRows call Get2DMenuNumberOfRows
ld [w2DMenuNumRows], a ld [w2DMenuNumRows], a
call GetMenuNumberOfColumns call Get2DMenuNumberOfColumns
ld [w2DMenuNumCols], a ld [w2DMenuNumCols], a
call .InitFlags_a call .InitFlags_a
call .InitFlags_b call .InitFlags_b
@@ -238,7 +238,7 @@ Init2DMenuCursorPosition: ; 2411a (9:411a)
; 2418a ; 2418a
.InitFlags_b: ; 2418a .InitFlags_b: ; 2418a
ld a, [wMenuData2Spacing] ld a, [wMenuData2_2DMenuSpacing]
or $20 or $20
ld [w2DMenuCursorOffsets], a ld [w2DMenuCursorOffsets], a
ret ret

View File

@@ -1361,37 +1361,28 @@ wMenuDataBank:: db
wMenuDataHeaderEnd:: wMenuDataHeaderEnd::
wMenuData2:: wMenuData2::
UNION ; cf91
; MenuData2 ; MenuData2
wMenuData2Flags:: ; cf91
; bit 7: When set, start printing text one tile to the right of the border wMenuData2Flags:: db ; cf91
; In scrolling menus, SELECT is functional
; bit 6: When set, start printing text one tile below the border UNION ; cf92
; In scrolling menus, START is functional ; Vertical Menu/DoNthMenu/SetUpMenu
; bit 5: ????
; bit 4: ????
; bit 3: ????
; bit 2: ????
; bit 1: Enable Select button
; bit 0: Disable B button
db
wMenuData2Items:: db ; cf92 wMenuData2Items:: db ; cf92
wMenuData2IndicesPointer:: dw ; cf94 wMenuData2IndicesPointer:: dw ; cf94
wMenuData2DisplayFunctionPointer:: dw ; cf96 wMenuData2DisplayFunctionPointer:: dw ; cf96
wMenuData2PointerTableAddr:: dw ; cf97 wMenuData2PointerTableAddr:: dw ; cf97
NEXTU ; cf91 NEXTU ; cf92
; 2D menu ; 2D Menu
ds 2 ; cf91 wMenuData2_2DMenuDimensions:: db ; cf92
wMenuData2Spacing:: db ; cf93 wMenuData2_2DMenuSpacing:: db ; cf93
wMenuData2_2DMenuItemStringsBank:: db ; cf94 wMenuData2_2DMenuItemStringsBank:: db ; cf94
wMenuData2_2DMenuItemStringsAddr:: dw ; cf96 wMenuData2_2DMenuItemStringsAddr:: dw ; cf96
wMenuData2_2DMenuFunctionBank:: db ; cf97 wMenuData2_2DMenuFunctionBank:: db ; cf97
wMenuData2_2DMenuFunctionAddr:: dw ; cf98 wMenuData2_2DMenuFunctionAddr:: dw ; cf98
NEXTU ; cf91 NEXTU ; cf92
; scrolling menu ; Scrolling Menu
ds 1 ; cf91
wMenuData2_ScrollingMenuHeight:: db ; cf92 wMenuData2_ScrollingMenuHeight:: db ; cf92
wMenuData2_ScrollingMenuWidth:: db ; cf93 wMenuData2_ScrollingMenuWidth:: db ; cf93
wMenuData2_ScrollingMenuSpacing:: db ; cf94 wMenuData2_ScrollingMenuSpacing:: db ; cf94
@@ -1408,7 +1399,16 @@ w2DMenuCursorInitY:: db ; cfa1
w2DMenuCursorInitX:: db ; cfa2 w2DMenuCursorInitX:: db ; cfa2
w2DMenuNumRows:: db ; cfa3 w2DMenuNumRows:: db ; cfa3
w2DMenuNumCols:: db ; cfa4 w2DMenuNumCols:: db ; cfa4
w2DMenuFlags1:: db ; cfa5 w2DMenuFlags1:: ; cfa5
; bit 7: Disable checking of wMenuJoypadFilter
; bit 6: Enable sprite animations
; bit 5: Wrap around vertically
; bit 4: Wrap around horizontally
; bit 3: Set bit 7 in w2DMenuFlags2 and exit the loop if bit 5 is disabled and we tried to go too far down
; bit 2: Set bit 7 in w2DMenuFlags2 and exit the loop if bit 5 is disabled and we tried to go too far up
; bit 1: Set bit 7 in w2DMenuFlags2 and exit the loop if bit 4 is disabled and we tried to go too far left
; bit 0: Set bit 7 in w2DMenuFlags2 and exit the loop if bit 4 is disabled and we tried to go too far right
db
w2DMenuFlags2:: db ; cfa6 w2DMenuFlags2:: db ; cfa6
w2DMenuCursorOffsets:: db ; cfa7 w2DMenuCursorOffsets:: db ; cfa7
wMenuJoypadFilter:: db ; cfa8 wMenuJoypadFilter:: db ; cfa8