Better label 2D menu data

This commit is contained in:
mid-kid 2020-06-20 17:56:18 +02:00
parent 248763b238
commit 79bb2784e9
5 changed files with 68 additions and 74 deletions

View File

@ -1141,7 +1141,7 @@ EvoStoneEffect:
cp EVERSTONE cp EVERSTONE
jr z, .NoEffect jr z, .NoEffect
ld a, $1 ld a, TRUE
ld [wForceEvolution], a ld [wForceEvolution], a
farcall EvolvePokemon farcall EvolvePokemon

View File

@ -811,8 +811,8 @@ ChooseMoveToDelete:
.ChooseMoveToDelete .ChooseMoveToDelete
call SetUpMoveScreenBG call SetUpMoveScreenBG
ld de, DeleteMoveScreenAttrs ld de, DeleteMoveScreen2DMenuData
call SetMenuAttributes call Load2DMenuData
call SetUpMoveList call SetUpMoveList
ld hl, w2DMenuFlags1 ld hl, w2DMenuFlags1
set 6, [hl] set 6, [hl]
@ -848,12 +848,12 @@ ChooseMoveToDelete:
pop af pop af
ret ret
DeleteMoveScreenAttrs: DeleteMoveScreen2DMenuData:
db 3, 1 db 3, 1 ; cursor start y, x
db 3, 1 db 3, 1 ; rows, columns
db $40, $00 db $40, $00 ; flags
dn 2, 0 dn 2, 0 ; cursor offset
db D_UP | D_DOWN | A_BUTTON | B_BUTTON db D_UP | D_DOWN | A_BUTTON | B_BUTTON ; accepted buttons
ManagePokemonMoves: ManagePokemonMoves:
ld a, [wCurPartySpecies] ld a, [wCurPartySpecies]
@ -878,8 +878,8 @@ MoveScreenLoop:
ld [wPartyMenuCursor], a ld [wPartyMenuCursor], a
call SetUpMoveScreenBG call SetUpMoveScreenBG
call PlaceMoveScreenArrows call PlaceMoveScreenArrows
ld de, MoveScreenAttributes ld de, MoveScreen2DMenuData
call SetMenuAttributes call Load2DMenuData
.loop .loop
call SetUpMoveList call SetUpMoveList
ld hl, w2DMenuFlags1 ld hl, w2DMenuFlags1
@ -1077,12 +1077,12 @@ MoveScreenLoop:
call ClearSprites call ClearSprites
jp ClearTilemap jp ClearTilemap
MoveScreenAttributes: MoveScreen2DMenuData:
db 3, 1 db 3, 1 ; cursor start y, x
db 3, 1 db 3, 1 ; rows, columns
db $40, $00 db $40, $00 ; flags
dn 2, 0 dn 2, 0 ; cursor offsets
db D_UP | D_DOWN | D_LEFT | D_RIGHT | A_BUTTON | B_BUTTON db D_UP | D_DOWN | D_LEFT | D_RIGHT | A_BUTTON | B_BUTTON ; accepted buttons
String_MoveWhere: String_MoveWhere:
db "Where?@" db "Where?@"

View File

@ -612,8 +612,8 @@ InitPartyMenuWithCancel:
; with cancel ; with cancel
xor a xor a
ld [wSwitchMon], a ld [wSwitchMon], a
ld de, PartyMenuAttributes ld de, PartyMenu2DMenuData
call SetMenuAttributes call Load2DMenuData
ld a, [wPartyCount] ld a, [wPartyCount]
inc a inc a
ld [w2DMenuNumRows], a ; list length ld [w2DMenuNumRows], a ; list length
@ -637,8 +637,8 @@ InitPartyMenuWithCancel:
InitPartyMenuNoCancel: InitPartyMenuNoCancel:
; no cancel ; no cancel
ld de, PartyMenuAttributes ld de, PartyMenu2DMenuData
call SetMenuAttributes call Load2DMenuData
ld a, [wPartyCount] ld a, [wPartyCount]
ld [w2DMenuNumRows], a ; list length ld [w2DMenuNumRows], a ; list length
ld b, a ld b, a
@ -656,20 +656,12 @@ InitPartyMenuNoCancel:
ld [wMenuJoypadFilter], a ld [wMenuJoypadFilter], a
ret ret
PartyMenuAttributes: PartyMenu2DMenuData:
; cursor y db 1, 0 ; cursor start y, x
; cursor x db 0, 1 ; rows, columns
; num rows db $60, $00 ; flags
; num cols dn 2, 0 ; cursor offset
; bit 6: animate sprites bit 5: wrap around db 0 ; accepted buttons
; ?
; distance between items (hi: y, lo: x)
; allowed buttons (mask)
db 1, 0
db 0, 1
db $60, $00
dn 2, 0
db 0
PartyMenuSelect: PartyMenuSelect:
; sets carry if exitted menu. ; sets carry if exitted menu.

View File

@ -1,20 +1,22 @@
SetMenuAttributes:: Load2DMenuData::
push hl push hl
push bc push bc
ld hl, w2DMenuCursorInitY ld hl, w2DMenuData
ld b, $8 ld b, w2DMenuDataEnd - w2DMenuData
.loop .loop
ld a, [de] ld a, [de]
inc de inc de
ld [hli], a ld [hli], a
dec b dec b
jr nz, .loop jr nz, .loop
; Reset menu state
ld a, $1 ld a, $1
ld [hli], a ld [hli], a ; wMenuCursorY
ld [hli], a ld [hli], a ; wMenuCursorX
xor a xor a
ld [hli], a ld [hli], a ; wCursorOffCharacter
ld [hli], a ld [hli], a ; wCursorCurrentTile
ld [hli], a ld [hli], a
pop bc pop bc
pop hl pop hl

View File

@ -1765,7 +1765,7 @@ MobileMoveSelectionScreen:
.GetMoveSelection: .GetMoveSelection:
xor a xor a
ldh [hBGMapMode], a ldh [hBGMapMode], a
call Function100c74 call .ListMoves
call Function100c98 call Function100c98
.master_loop .master_loop
farcall MoveInfoBox farcall MoveInfoBox
@ -1860,7 +1860,7 @@ MobileMoveSelectionScreen:
call SafeLoadTempTilemapToTilemap call SafeLoadTempTilemapToTilemap
jp .GetMoveSelection jp .GetMoveSelection
Function100c74: .ListMoves:
hlcoord 0, 8 hlcoord 0, 8
ld b, 8 ld b, 8
ld c, 8 ld c, 8
@ -1876,8 +1876,8 @@ Function100c74:
ret ret
Function100c98: Function100c98:
ld de, .attrs ld de, .data
call SetMenuAttributes call Load2DMenuData
ld a, [wNumMoves] ld a, [wNumMoves]
inc a inc a
ld [w2DMenuNumRows], a ld [w2DMenuNumRows], a
@ -1886,12 +1886,12 @@ Function100c98:
ld [wMenuCursorY], a ld [wMenuCursorY], a
ret ret
.attrs .data:
db 10, 1 db 10, 1 ; cursor start y, x
db 255, 1 db -1, 1 ; rows, columns
db $a0, $00 db $a0, $00 ; flags
dn 2, 0 dn 2, 0 ; cursor offsets
db D_UP | D_DOWN | A_BUTTON | B_BUTTON db D_UP | D_DOWN | A_BUTTON | B_BUTTON ; accepted buttons
Mobile_PartyMenuSelect: Mobile_PartyMenuSelect:
call Function100dd8 call Function100dd8
@ -5944,7 +5944,7 @@ Function1029cf:
ld hl, wcd4b ld hl, wcd4b
set 1, [hl] set 1, [hl]
ld de, MenuData3_102a33 ld de, MenuData3_102a33
call SetMenuAttributes call Load2DMenuData
ld a, [wcd4a] ld a, [wcd4a]
inc a inc a
ld [wcd4a], a ld [wcd4a], a
@ -5981,11 +5981,11 @@ String_102a26:
db "@" db "@"
MenuData3_102a33: MenuData3_102a33:
db 8, 11 db 8, 11 ; cursor start y, x
db 2, 1 db 2, 1 ; rows, columns
db $80, $00 db $80, $00 ; flags
dn 2, 0 dn 2, 0 ; cursor offset
db A_BUTTON db A_BUTTON ; accepted buttons
Function102a3b: Function102a3b:
ld a, [wcd30] ld a, [wcd30]
@ -6115,8 +6115,8 @@ Function102b4e:
ld [wMonType], a ld [wMonType], a
ld a, [wMenuCursorY] ld a, [wMenuCursorY]
push af push af
ld de, Unknown_102b73 ld de, MenuData_102b73
call SetMenuAttributes call Load2DMenuData
pop af pop af
ld [wMenuCursorY], a ld [wMenuCursorY], a
ld a, [wOTPartyCount] ld a, [wOTPartyCount]
@ -6130,32 +6130,32 @@ Function102b68: ; unreferenced
call ByteFill call ByteFill
ret ret
Unknown_102b73: MenuData_102b73:
db 9, 6 db 9, 6 ; cursor start y, x
db 255, 1 db -1, 1 ; rows, columns
db $a0, $00 db $a0, $00 ; flags
dn 1, 0 dn 1, 0 ; cursor offset
db D_UP | D_DOWN | A_BUTTON db D_UP | D_DOWN | A_BUTTON ; accepted buttons
Function102b7b: Function102b7b:
xor a xor a
ld [wMonType], a ld [wMonType], a
ld a, [wMenuCursorY] ld a, [wMenuCursorY]
push af push af
ld de, Unknown_102b94 ld de, MenuData_102b94
call SetMenuAttributes call Load2DMenuData
pop af pop af
ld [wMenuCursorY], a ld [wMenuCursorY], a
ld a, [wPartyCount] ld a, [wPartyCount]
ld [w2DMenuNumRows], a ld [w2DMenuNumRows], a
ret ret
Unknown_102b94: MenuData_102b94:
db 1, 6 db 1, 6 ; cursor start y, x
db 255, 1 db 255, 1 ; rows, columns
db $a0, $00 db $a0, $00 ; flags
dn 1, 0 dn 1, 0 ; cursor offset
db D_UP | D_DOWN | A_BUTTON db D_UP | D_DOWN | A_BUTTON ; accepted buttons
Function102b9c: Function102b9c:
ld a, [wcd4d] ld a, [wcd4d]