Menu joy flags; started with link address space

This commit is contained in:
PikalaxALT
2015-12-20 12:54:08 -05:00
parent 987ed1fafb
commit 047effba94
18 changed files with 1279 additions and 1207 deletions

View File

@@ -5694,7 +5694,7 @@ MoveSelectionScreen: ; 3e4bc
.okay
ld a, b
ld [w2DMenuFlags4], a
ld [wMenuJoypadFilter], a
ld a, c
ld [w2DMenuFlags1], a
xor a

View File

@@ -291,6 +291,7 @@ MON_SAT EQUS "(PartyMon1SpclAtk - PartyMon1)"
MON_SDF EQUS "(PartyMon1SpclDef - PartyMon1)"
BOXMON_STRUCT_LENGTH EQUS "(PartyMon1End - PartyMon1)"
PARTYMON_STRUCT_LENGTH EQUS "(PartyMon1StatsEnd - PartyMon1)"
REDMON_STRUCT_LENGTH EQU 44
const_value SET 1
const MONMENU_CUT ; 1

View File

@@ -158,7 +158,7 @@ ForgetMove: ; 65d3
ld [wMenuCursorY], a
ld [wMenuCursorX], a
ld a, $3
ld [w2DMenuFlags4], a
ld [wMenuJoypadFilter], a
ld a, $20
ld [w2DMenuFlags1], a
xor a

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -42,7 +42,7 @@ _InterpretMobileMenu:: ; 2403c
and a
jr nz, .quit
call MobileMenuJoypad
ld a, [w2DMenuFlags4]
ld a, [wMenuJoypadFilter]
and c
jr z, .loop
call Mobile_GetMenuSelection
@@ -246,16 +246,16 @@ Init2DMenuCursorPosition: ; 2411a (9:411a)
.InitFlags_c: ; 24193
ld hl, wMenuData2Flags
ld a, %001
ld a, A_BUTTON
bit 0, [hl]
jr nz, .skip
or %010
or B_BUTTON
.skip
bit 1, [hl]
jr z, .skip2
or %100
or SELECT
.skip2
ld [w2DMenuFlags4], a
ld [wMenuJoypadFilter], a
ret
; 241a8
@@ -307,7 +307,7 @@ Function241d5: ; 241d5
jr nz, .done
call GetMenuJoypad
ld c, a
ld a, [w2DMenuFlags4]
ld a, [wMenuJoypadFilter]
and c
jr z, .loop
@@ -345,7 +345,7 @@ MenuJoypadLoop: ; 24216
jr nz, .done
call GetMenuJoypad
ld b, a
ld a, [w2DMenuFlags4]
ld a, [wMenuJoypadFilter]
and b
jr z, .loop
@@ -812,11 +812,11 @@ _InitVerticalMenuCursor:: ; 2446d
; w2DMenuFlags3
ld a, %00100000
ld [hli], a
; w2DMenuFlags4
ld a, %001
; wMenuJoypadFilter
ld a, A_BUTTON
bit 0, b
jr nz, .skip_bit_1
add %010
add B_BUTTON
.skip_bit_1
ld [hli], a
; wMenuCursorY

View File

@@ -693,12 +693,12 @@ InitPartyMenuWithCancel: ; 50405
jr c, .done
.skip
ld a, $1
ld a, 1
.done
ld [wMenuCursorY], a
ld a, A_BUTTON | B_BUTTON
ld [w2DMenuFlags4], a
ld [wMenuJoypadFilter], a
ret
; 5042d
@@ -716,11 +716,11 @@ InitPartyMenuNoCancel: ; 0x5042d
cp b
jr c, .done
.skip
ld a, $1
ld a, 1
.done
ld [wMenuCursorY], a
ld a, A_BUTTON | B_BUTTON
ld [w2DMenuFlags4], a
ld [wMenuJoypadFilter], a
ret
; 5044f (14:444f)

View File

@@ -279,65 +279,64 @@ ScrollingMenu_InitFlags: ; 24764
ld a, [wScrollingMenuListSize]
ld b, a
ld a, [wMenuBorderTopCoord]
add $1
add 1
ld [w2DMenuCursorInitY], a
ld a, [wMenuBorderLeftCoord]
add $0
add 0
ld [w2DMenuCursorInitX], a
ld a, [wMenuData2_ScrollingMenuHeight]
cp b
jr c, .asm_24786
jr z, .asm_24786
jr c, .no_extra_row
jr z, .no_extra_row
ld a, b
inc a
.asm_24786
.no_extra_row
ld [w2DMenuNumRows], a
ld a, $1
ld a, 1
ld [w2DMenuNumCols], a
ld a, $8c
bit 2, c
jr z, .asm_24796
jr z, .skip_set_0
set 0, a
.asm_24796
.skip_set_0
bit 3, c
jr z, .asm_2479c
jr z, .skip_set_1
set 1, a
.asm_2479c
.skip_set_1
ld [w2DMenuFlags1], a
xor a
ld [w2DMenuFlags2], a
ld a, $20
ld [w2DMenuFlags3], a
ld a, $c3
ld a, A_BUTTON | B_BUTTON | D_UP | D_DOWN
bit 7, c
jr z, .asm_247b0
add $4
jr z, .disallow_select
add SELECT
.asm_247b0
.disallow_select
bit 6, c
jr z, .asm_247b6
add $8
jr z, .disallow_start
add START
.asm_247b6
ld [w2DMenuFlags4], a
.disallow_start
ld [wMenuJoypadFilter], a
ld a, [w2DMenuNumRows]
ld b, a
ld a, [wMenuCursorBuffer]
and a
jr z, .asm_247c8
jr z, .reset_cursor
cp b
jr z, .asm_247ca
jr c, .asm_247ca
jr z, .cursor_okay
jr c, .cursor_okay
.asm_247c8
ld a, $1
.reset_cursor
ld a, 1
.asm_247ca
.cursor_okay
ld [wMenuCursorY], a
ld a, $1
ld a, 1
ld [wMenuCursorX], a
xor a
ld [wCursorCurrentTile], a

View File

@@ -216,8 +216,8 @@ TMHM_PocketLoop: ; 2c8d3 (b:48d3)
ld [w2DMenuFlags2], a
ld a, $20
ld [w2DMenuFlags3], a
ld a, $f3
ld [w2DMenuFlags4], a
ld a, A_BUTTON | B_BUTTON | D_UP | D_DOWN | D_LEFT | D_RIGHT
ld [wMenuJoypadFilter], a
ld a, [wTMHMPocketCursor]
inc a
ld [wMenuCursorY], a

View File

@@ -343,27 +343,27 @@ Function1eda:: ; 1eda
Function1eff:: ; 1eff
call InitVerticalMenuCursor
ld hl, w2DMenuFlags4
ld hl, wMenuJoypadFilter
ld a, [wMenuData2Flags]
bit 3, a
jr z, .skip3
set 3, [hl]
jr z, .disallow_select
set START_F, [hl]
.skip3
.disallow_select
ld a, [wMenuData2Flags]
bit 2, a
jr z, .skip4_5
set 5, [hl]
set 4, [hl]
jr z, .disallow_left_right
set D_LEFT_F, [hl]
set D_RIGHT_F, [hl]
.skip4_5
.disallow_left_right
ret
; 1f1a
Function1f1a:: ; 1f1a
call ScrollingMenuJoypad
ld hl, w2DMenuFlags4
ld hl, wMenuJoypadFilter
and [hl]
jr Function1f2a
; 1f23
@@ -375,35 +375,35 @@ Function1f23:: ; 1f23
; 1f2a
Function1f2a:: ; 1f2a
bit 0, a
jr nz, .asm_1f52
bit 1, a
jr nz, .asm_1f6d
bit 3, a
jr nz, .asm_1f6d
bit 4, a
jr nz, .asm_1f44
bit 5, a
jr nz, .asm_1f4b
bit A_BUTTON_F, a
jr nz, .a_button
bit B_BUTTON_F, a
jr nz, .b_start
bit START_F, a
jr nz, .b_start
bit D_RIGHT_F, a
jr nz, .d_right
bit D_LEFT_F, a
jr nz, .d_left
xor a
ld [wMenuJoypad], a
jr .asm_1f57
jr .done
.asm_1f44
ld a, $10
.d_right
ld a, D_RIGHT
ld [wMenuJoypad], a
jr .asm_1f57
jr .done
.asm_1f4b
ld a, $20
.d_left
ld a, D_LEFT
ld [wMenuJoypad], a
jr .asm_1f57
jr .done
.asm_1f52
ld a, $1
.a_button
ld a, A_BUTTON
ld [wMenuJoypad], a
.asm_1f57
.done
call GetMenuIndexSet
ld a, [wMenuCursorY]
ld l, a
@@ -416,10 +416,10 @@ Function1f2a:: ; 1f2a
and a
ret
.asm_1f6d
ld a, $2
.b_start
ld a, B_BUTTON
ld [wMenuJoypad], a
ld a, $ff
ld a, -1
ld [MenuSelection], a
scf
ret

View File

@@ -92,7 +92,7 @@ Serial:: ; 6ef
Function75f:: ; 75f
ld a, $1
ld [hFFCC], a
.asm_763
.loop
ld a, [hl]
ld [hSerialSend], a
call Function78a
@@ -100,28 +100,28 @@ Function75f:: ; 75f
ld b, a
inc hl
ld a, $30
.asm_76e
.wait
dec a
jr nz, .asm_76e
jr nz, .wait
ld a, [hFFCC]
and a
ld a, b
pop bc
jr z, .asm_782
jr z, .load
dec hl
cp $fd
jr nz, .asm_763
jr nz, .loop
xor a
ld [hFFCC], a
jr .asm_763
jr .loop
.asm_782
.load
ld [de], a
inc de
dec bc
ld a, b
or c
jr nz, .asm_763
jr nz, .loop
ret
; 78a

View File

@@ -9805,6 +9805,7 @@ Unknown_4985a: ; unreferenced
INCLUDE "event/celebi.asm"
INCLUDE "engine/main_menu.asm"
INCLUDE "misc/mobile_menu.asm"
INCLUDE "engine/search.asm"
INCLUDE "misc/mobile_12_2.asm"
; mobile battle selection
@@ -10292,7 +10293,7 @@ Function4d35b: ; 4d35b
ld l, e
push bc
push hl
call Function4d37e
call .PlaceBorder
pop hl
pop bc
ld de, AttrMap - TileMap
@@ -10320,12 +10321,12 @@ endr
ret
; 4d37e
Function4d37e: ; 4d37e
.PlaceBorder: ; 4d37e
push hl
ld a, $76
ld [hli], a
inc a
call Function4d3ab
call .PlaceRow
inc a
ld [hl], a
pop hl
@@ -10336,7 +10337,7 @@ Function4d37e: ; 4d37e
ld a, "┌"
ld [hli], a
ld a, " "
call Function4d3ab
call .PlaceRow
ld [hl], "─"
pop hl
ld de, SCREEN_WIDTH
@@ -10346,17 +10347,17 @@ Function4d37e: ; 4d37e
ld a, "┐"
ld [hli], a
ld a, "│"
call Function4d3ab
call .PlaceRow
ld [hl], "└"
ret
; 4d3ab
Function4d3ab: ; 4d3ab
.PlaceRow: ; 4d3ab
ld d, c
.loop
.row_loop
ld [hli], a
dec d
jr nz, .loop
jr nz, .row_loop
ret
; 4d3b1

View File

@@ -488,7 +488,7 @@ Function4ab06: ; 4ab06
Function4ab1a: ; 4ab1a
.asm_4ab1a
ld a, $fb
ld [w2DMenuFlags4], a
ld [wMenuJoypadFilter], a
ld a, $26
ld [w2DMenuFlags3], a
ld a, $2

View File

@@ -2242,7 +2242,7 @@ Function89dab: ; 89dab (22:5dab)
callba MobileMenuJoypad
call Function8923c
ld a, c
ld hl, w2DMenuFlags4
ld hl, wMenuJoypadFilter
and [hl]
ret z
bit 0, a
@@ -3088,7 +3088,7 @@ Function8a31c: ; 8a31c (22:631c)
Function8a383: ; 8a383 (22:6383)
callba MobileMenuJoypad
ld a, c
ld hl, w2DMenuFlags4
ld hl, wMenuJoypadFilter
and [hl]
ret z
bit 0, a

View File

@@ -860,7 +860,7 @@ Function100545: ; 100545
Function10054d: ; 10054d
callba MobileMenuJoypad
ld a, c
ld hl, w2DMenuFlags4
ld hl, wMenuJoypadFilter
and [hl]
ret z
call MenuClickSound
@@ -1829,7 +1829,7 @@ Function100b45: ; 100b45
call Function100e2d
pop bc
jr c, .asm_100b6b
ld a, [w2DMenuFlags4]
ld a, [wMenuJoypadFilter]
and c
jr z, .asm_100b48
callba Mobile_GetMenuSelection
@@ -1890,7 +1890,7 @@ Function100bc2: ; 100bc2
call Function100e2d
pop bc
jr c, .asm_100c25
ld a, [w2DMenuFlags4]
ld a, [wMenuJoypadFilter]
and c
bit 6, a
jp nz, .asm_100bff
@@ -2021,7 +2021,7 @@ Function100cb5: ; 100cb5
call Function100dfd
pop bc
jr c, .asm_100d17
ld a, [w2DMenuFlags4]
ld a, [wMenuJoypadFilter]
and c
jr z, .asm_100cc0
call PlaceHollowCursor
@@ -2075,7 +2075,7 @@ MobileBattleMonMenu: ; 100d22
call Function100dfd
pop bc
jr c, .asm_100d54
ld a, [w2DMenuFlags4]
ld a, [wMenuJoypadFilter]
and c
jr nz, .asm_100d56
jr .asm_100d30
@@ -5722,7 +5722,7 @@ Function1025ff: ; 1025ff
callba Function1009f3
ret c
callba MobileMenuJoypad
ld a, [w2DMenuFlags4]
ld a, [wMenuJoypadFilter]
and c
ret z
bit 0, c
@@ -5784,7 +5784,7 @@ Function10266b: ; 10266b
callba Function1009f3
ret c
callba MobileMenuJoypad
ld a, [w2DMenuFlags4]
ld a, [wMenuJoypadFilter]
and c
ret z
bit 0, c
@@ -6327,7 +6327,7 @@ Function1029fe: ; 1029fe
ret c
callba MobileMenuJoypad
ld a, c
ld hl, w2DMenuFlags4
ld hl, wMenuJoypadFilter
and [hl]
ret z
push af

View File

@@ -1107,7 +1107,7 @@ Function16d734: ; 16d734
jr nz, .asm_16d758
call Function16d713
ld b, a
ld a, [w2DMenuFlags4]
ld a, [wMenuJoypadFilter]
and b
jr z, .asm_16d734

882
misc/mobile_menu.asm Executable file

File diff suppressed because it is too large Load Diff

View File

@@ -44,6 +44,39 @@ party_struct: MACRO
\1StatsEnd::
ENDM
red_box_struct: MACRO
\1Species:: db
\1HP:: dw
\1BoxLevel:: db
\1Status:: db
\1Type::
\1Type1:: db
\1Type2:: db
\1CatchRate:: db
\1Moves:: ds NUM_MOVES
\1OTID:: dw
\1Exp:: ds 3
\1HPExp:: dw
\1AttackExp:: dw
\1DefenseExp:: dw
\1SpeedExp:: dw
\1SpecialExp:: dw
\1DVs:: ds 2
\1PP:: ds NUM_MOVES
ENDM
red_party_struct: MACRO
red_box_struct \1
\1Level:: db
\1Stats::
\1MaxHP:: dw
\1Attack:: dw
\1Defense:: dw
\1Speed:: dw
\1Special:: dw
ENDM
battle_struct: MACRO
\1Species:: db
\1Item:: db
@@ -1136,6 +1169,40 @@ wBillsPCPokemonList::
wMysteryGiftPartyTemp:: ; ds PARTY_LENGTH * (1 + 1 + NUM_MOVES)
wMysteryGiftStaging::
wLinkData:: ; ds $514
ds 6
wLinkPlayerName:: ds NAME_LENGTH
wLinkPartyCount:: ds 1
wLinkPartySpecies:: ds PARTY_LENGTH
wLinkPartySpeciesEnd:: ds 1
wTimeCapsulePlayerData::
wTimeCapsulePartyMon1:: red_party_struct wTimeCapsulePartyMon1
wTimeCapsulePartyMon2:: red_party_struct wTimeCapsulePartyMon2
wTimeCapsulePartyMon3:: red_party_struct wTimeCapsulePartyMon3
wTimeCapsulePartyMon4:: red_party_struct wTimeCapsulePartyMon4
wTimeCapsulePartyMon5:: red_party_struct wTimeCapsulePartyMon5
wTimeCapsulePartyMon6:: red_party_struct wTimeCapsulePartyMon6
wTimeCapsulePartyMonOTNames:: ds PARTY_LENGTH * NAME_LENGTH
wTimeCapsulePartyMonNicks:: ds PARTY_LENGTH * PKMN_NAME_LENGTH
wTimeCapsulePlayerDataEnd::
ds wTimeCapsulePlayerData - @
wLinkPlayerData::
wLinkPlayerPartyMon1:: party_struct wLinkPlayerPartyMon1
wLinkPlayerPartyMon2:: party_struct wLinkPlayerPartyMon2
wLinkPlayerPartyMon3:: party_struct wLinkPlayerPartyMon3
wLinkPlayerPartyMon4:: party_struct wLinkPlayerPartyMon4
wLinkPlayerPartyMon5:: party_struct wLinkPlayerPartyMon5
wLinkPlayerPartyMon6:: party_struct wLinkPlayerPartyMon6
wLinkPlayerPartyMonOTNames:: ds PARTY_LENGTH * NAME_LENGTH
wLinkPlayerPartyMonNicks:: ds PARTY_LENGTH * PKMN_NAME_LENGTH
ds $357
wLinkDataEnd::
ds wLinkData - @
wc800:: ds 1
wc801:: ds 1
wc802:: ds 1
@@ -1514,7 +1581,9 @@ wMenuDataHeaderEnd::
wMenuData2::
wMenuData2Flags:: ds 1 ; cf91
; bit 7: When set, start printing text one tile to the right of the border
; In scrolling menus, SELECT is functional
; bit 6: When set, start printing text one tile below the border
; In scrolling menus, START is functional
; bit 5: ????
; bit 4: ????
; bit 3: ????
@@ -1557,7 +1626,7 @@ w2DMenuNumCols:: ds 1
w2DMenuFlags1:: ds 1
w2DMenuFlags2:: ds 1
w2DMenuFlags3:: ds 1
w2DMenuFlags4:: ds 1
wMenuJoypadFilter:: ds 1
wMenuData3End::
wMenuCursorY:: ds 1