More menu stuff

This commit is contained in:
PikalaxALT 2015-12-17 22:31:16 -05:00
parent fe4ef4e595
commit d644406f61
39 changed files with 764 additions and 763 deletions

View File

@ -5342,7 +5342,7 @@ BattleMenuPKMN_Loop:
callba FreezeMonIcons
call .GetMenu
jr c, .PressedB
call Function1bee
call PlaceHollowCursor
ld a, [wMenuCursorY]
cp $1 ; SWITCH
jp z, TryPlayerSwitch

View File

@ -52,7 +52,7 @@ GiveOddEgg: ; 1fb4b6
ld a, 1
ld [wItemQuantityChangeBuffer], a
ld a, -1
ld [ItemCountBuffer], a
ld [CurItemQuantity], a
ld hl, NumItems
call TossItem

View File

@ -2323,7 +2323,7 @@ _ChangeBox: ; e35aa (38:75aa)
hlcoord 0, 4
lb bc, 8, 9
call TextBox
call HandleScrollingMenu
call ScrollingMenu
ld a, [wMenuJoypad]
cp B_BUTTON
jr z, .done

View File

@ -11,16 +11,16 @@ _KrisDecorationMenu: ; 0x2675c
ld hl, .MenuDataHeader
call LoadMenuDataHeader
xor a
ld [wd1ee], a
ld [Buffer5], a
ld a, $1
ld [wd1ef], a
ld [Buffer6], a
.top_loop
ld a, [wd1ef]
ld a, [Buffer6]
ld [wMenuCursorBuffer], a
call .FindCategoriesWithOwnedDecos
call DoNthMenu
ld a, [wMenuCursorY]
ld [wd1ef], a
ld [Buffer6], a
jr c, .exit_menu
ld a, [MenuSelection]
ld hl, .pointers
@ -31,7 +31,7 @@ _KrisDecorationMenu: ; 0x2675c
call ExitMenu
pop af
ld [wcf76], a
ld a, [wd1ee]
ld a, [Buffer5]
ld c, a
ret
; 0x2679a
@ -400,7 +400,7 @@ PopulateDecoCategoryMenu: ; 2695b
call InitScrollingMenu
xor a
ld [wMenuScrollPosition], a
call HandleScrollingMenu
call ScrollingMenu
ld a, [wMenuJoypad]
cp 2
jr z, .no_action_2
@ -803,7 +803,7 @@ DecoAction_TrySetItUp: ; 26d2d
call DecoAction_SetItUp
jr c, .failed
ld a, 1
ld [wd1ee], a
ld [Buffer5], a
pop hl
ld a, [MenuSelection]
ld [hl], a
@ -865,7 +865,7 @@ DecoAction_TryPutItAway: ; 26d86
jr z, .nothingthere
; Put it away.
ld a, $1
ld [wd1ee], a
ld [Buffer5], a
ld a, [Buffer1]
ld [MenuSelection], a
ld hl, StringBuffer3
@ -889,7 +889,7 @@ DecoAction_setupornament: ; 26db3
call DecoAction_SetItUp_Ornament
jr c, .cancel
ld a, $1
ld [wd1ee], a
ld [Buffer5], a
jr DecoAction_FinishUp_Ornament
.cancel
@ -981,7 +981,7 @@ DecoAction_PutItAway_Ornament: ; 26e46
ld hl, StringBuffer3
call GetDecorationName
ld a, $1
ld [wd1ee], a
ld [Buffer5], a
xor a
ld [wd1ec], a
ld hl, DecoText_PutAwayTheDeco

View File

@ -545,7 +545,7 @@ Continue_LoadMenuHeader: ; 5ebf
ld hl, .MenuDataHeader_NoDex
.pokedex_header
call Function1e35
call _OffsetMenuDataHeader
call MenuBox
call PlaceVerticalMenuItems
ret

View File

@ -1271,7 +1271,7 @@ Function28835: ; 28835
jp nz, Function2891c
xor a
ld [MonType], a
call Function1bf7
call HideCursor
push hl
push bc
ld bc, NAME_LENGTH
@ -1333,7 +1333,7 @@ Function288c5: ; 288c5
jp nz, Function2891c
ld a, $1
ld [MonType], a
call Function1bf7
call HideCursor
push hl
push bc
ld bc, NAME_LENGTH
@ -1353,7 +1353,7 @@ Function288c5: ; 288c5
ld a, [PartyCount]
cp b
jr nz, Function2891c
call Function1bf7
call HideCursor
push hl
push bc
ld bc, NAME_LENGTH
@ -1463,7 +1463,7 @@ Function28926: ; 28926
jp Function2888b
.asm_289fe
call Function1bee
call PlaceHollowCursor
pop af
ld [wMenuCursorY], a
dec a
@ -1552,7 +1552,7 @@ Function28ac9: ; 28ac9
ld a, [wMenuCursorY]
cp $1
jp nz, Function2891c
call Function1bf7
call HideCursor
push hl
push bc
ld bc, NAME_LENGTH

View File

@ -399,7 +399,7 @@ MailboxPC: ; 0x44806
ld [wMenuCursorBuffer], a
ld a, [OBPals + 8 * 6]
ld [wMenuScrollPosition], a
call HandleScrollingMenu
call ScrollingMenu
ld a, [wMenuScrollPosition]
ld [OBPals + 8 * 6], a
ld a, [wMenuCursorY]

View File

@ -530,7 +530,7 @@ endr
Function4a098: ; 4a098 (12:6098)
ld a, $2
call MenuClickSound
call Function1bee
call PlaceHollowCursor
call WaitBGMap
call LoadStandardMenuDataHeader
callba Function89de0
@ -749,7 +749,7 @@ Function4a28a: ; 4a28a (12:628a)
lb bc, 6, 1
ld a, " "
call Function4a6d8
call Function1bee
call PlaceHollowCursor
call WaitBGMap
call LoadStandardMenuDataHeader
ld a, $5
@ -786,7 +786,7 @@ Function4a28a: ; 4a28a (12:628a)
scf
ret
.asm_4a2f0
call Function1bee
call PlaceHollowCursor
ld hl, UnknownText_0x4a358
call PrintText
hlcoord 14, 7

View File

@ -470,7 +470,7 @@ endr
BuyMenuLoop: ; 15cef
callba PlaceMoneyTopRightOW
callba PlaceMoneyTopRight
call UpdateSprites
ld hl, MenuDataHeader_Buy
call CopyMenuDataHeader
@ -478,7 +478,7 @@ BuyMenuLoop: ; 15cef
ld [wMenuCursorBuffer], a
ld a, [wd045 + 1]
ld [wMenuScrollPosition], a
call HandleScrollingMenu
call ScrollingMenu
ld a, [wMenuScrollPosition]
ld [wd045 + 1], a
ld a, [wMenuCursorY]
@ -875,7 +875,7 @@ Function15ee0: ; 15ee0
.okay_to_sell
ld hl, Text_Mart_SellHowMany
call PrintText
callba PlaceMoneyTopRightMenu
callba PlaceMoneyAtTopLeftOfTextbox
callba SelectQuantityToSell
call ExitMenu
jr c, .declined
@ -899,7 +899,7 @@ Function15ee0: ; 15ee0
ld hl, Text_Mart_SoldForAmount
call PrintTextBoxText
call PlayTransactionSound
callba PlaceMoneyBottomLeftOW
callba PlaceMoneyBottomLeft
call JoyWaitAorB
.declined

View File

@ -69,7 +69,7 @@ Pack: ; 10000
ld [wMenuCursorBuffer], a
ld a, [wItemsPocketScrollPosition]
ld [wMenuScrollPosition], a
call HandleScrollingMenu
call ScrollingMenu
ld a, [wMenuScrollPosition]
ld [wItemsPocketScrollPosition], a
ld a, [wMenuCursorY]
@ -97,7 +97,7 @@ Pack: ; 10000
ld [wMenuCursorBuffer], a
ld a, [wKeyItemsPocketScrollPosition]
ld [wMenuScrollPosition], a
call HandleScrollingMenu
call ScrollingMenu
ld a, [wMenuScrollPosition]
ld [wKeyItemsPocketScrollPosition], a
ld a, [wMenuCursorY]
@ -230,7 +230,7 @@ Pack: ; 10000
ld [wMenuCursorBuffer], a
ld a, [wBallsPocketScrollPosition]
ld [wMenuScrollPosition], a
call HandleScrollingMenu
call ScrollingMenu
ld a, [wMenuScrollPosition]
ld [wBallsPocketScrollPosition], a
ld a, [wMenuCursorY]
@ -528,7 +528,7 @@ TossMenu: ; 10364
pop af
jr c, .finish
ld hl, NumItems
ld a, [ItemCountBuffer]
ld a, [CurItemQuantity]
call TossItem
call Pack_GetItemName
ld hl, Text_ThrewAway
@ -577,7 +577,7 @@ RegisterItem: ; 103c2
rrca
and $c0
ld b, a
ld a, [ItemCountBuffer]
ld a, [CurItemQuantity]
inc a
and $3f
or b
@ -734,7 +734,7 @@ BattlePack: ; 10493
ld [wMenuCursorBuffer], a
ld a, [wItemsPocketScrollPosition]
ld [wMenuScrollPosition], a
call HandleScrollingMenu
call ScrollingMenu
ld a, [wMenuScrollPosition]
ld [wItemsPocketScrollPosition], a
ld a, [wMenuCursorY]
@ -762,7 +762,7 @@ BattlePack: ; 10493
ld [wMenuCursorBuffer], a
ld a, [wKeyItemsPocketScrollPosition]
ld [wMenuScrollPosition], a
call HandleScrollingMenu
call ScrollingMenu
ld a, [wMenuScrollPosition]
ld [wKeyItemsPocketScrollPosition], a
ld a, [wMenuCursorY]
@ -813,7 +813,7 @@ BattlePack: ; 10493
ld [wMenuCursorBuffer], a
ld a, [wBallsPocketScrollPosition]
ld [wMenuScrollPosition], a
call HandleScrollingMenu
call ScrollingMenu
ld a, [wMenuScrollPosition]
ld [wBallsPocketScrollPosition], a
ld a, [wMenuCursorY]
@ -1018,7 +1018,7 @@ DepositSellPack: ; 106be
ld [wMenuCursorBuffer], a
ld a, [wItemsPocketScrollPosition]
ld [wMenuScrollPosition], a
call HandleScrollingMenu
call ScrollingMenu
ld a, [wMenuScrollPosition]
ld [wItemsPocketScrollPosition], a
ld a, [wMenuCursorY]
@ -1034,7 +1034,7 @@ DepositSellPack: ; 106be
ld [wMenuCursorBuffer], a
ld a, [wKeyItemsPocketScrollPosition]
ld [wMenuScrollPosition], a
call HandleScrollingMenu
call ScrollingMenu
ld a, [wMenuScrollPosition]
ld [wKeyItemsPocketScrollPosition], a
ld a, [wMenuCursorY]
@ -1059,7 +1059,7 @@ DepositSellPack: ; 106be
ld [wMenuCursorBuffer], a
ld a, [wBallsPocketScrollPosition]
ld [wMenuScrollPosition], a
call HandleScrollingMenu
call ScrollingMenu
ld a, [wMenuScrollPosition]
ld [wBallsPocketScrollPosition], a
ld a, [wMenuCursorY]
@ -1243,7 +1243,7 @@ TutorialPack: ; 107bb
call InitPocket
pop hl
call CopyMenuDataHeader
call HandleScrollingMenu
call ScrollingMenu
ret
Pack_JumptableNext: ; 10866 (4:4866)

View File

@ -739,7 +739,7 @@ PartyMenuAttributes: ; 5044f
PartyMenuSelect: ; 0x50457
; sets carry if exitted menu.
call StaticMenuJoypad
call Function1bee
call PlaceHollowCursor
ld a, [PartyCount]
inc a
ld b, a

View File

@ -591,7 +591,7 @@ Function15985: ; 0x15985
ld [wMenuCursorBuffer], a
ld a, [wd0dd]
ld [wMenuScrollPosition], a
call HandleScrollingMenu
call ScrollingMenu
ld a, [wMenuScrollPosition]
ld [wd0dd], a
ld a, [wMenuCursorY]
@ -636,7 +636,7 @@ Function15985: ; 0x15985
.asm_159fb
callba Function24706
call Function1bee
call PlaceHollowCursor
and a
ret

View File

@ -2385,7 +2385,7 @@ Script_takeitem: ; 977f0
call GetScriptByte
ld [wItemQuantityChangeBuffer], a
ld a, -1
ld [ItemCountBuffer], a
ld [CurItemQuantity], a
ld hl, NumItems
call TossItem
ret nc

544
engine/scrolling_menu.asm Executable file

File diff suppressed because it is too large Load Diff

View File

@ -101,7 +101,7 @@ SpecialsPointers:: ; c029
add_special SpecialCheckPokerus
add_special Special_DisplayCoinCaseBalance
add_special Special_DisplayMoneyAndCoinBalance
add_special PlaceMoneyTopRightOW
add_special PlaceMoneyTopRight
add_special Special_CheckForLuckyNumberWinners
add_special Special_CheckLuckyNumberShowFlag
add_special Special_ResetLuckyNumberShowFlag

View File

@ -42,7 +42,7 @@ StartMenu:: ; 125cd
ld a, [wMenuCursorBuffer]
ld [wd0d2], a
call PlayClickSFX
call Function1bee
call PlaceHollowCursor
call .OpenMenu
; Menu items have different return functions.
@ -1671,7 +1671,7 @@ MoveScreenLoop: ; 12fd5
jr nz, .place_move
ld a, [wMenuCursorY]
ld [wMoveSwapBuffer], a
call Function1bee
call PlaceHollowCursor
jp .moving_move
.place_move

View File

@ -145,7 +145,7 @@ Function249d1: ; 249d1 (9:49d1)
inc hl
pop af
ld [hl], a
ld hl, wMenuData2Addr
ld hl, wMenuData2_ItemsPointerAddr
ld a, [hli]
ld h, [hl]
ld l, a
@ -199,7 +199,7 @@ Function24a4d: ; 24a4d (9:4a4d)
Function24a5c: ; 24a5c (9:4a5c)
push af
call Function24a80
ld hl, wMenuData2Addr
ld hl, wMenuData2_ItemsPointerAddr
ld a, [hli]
ld h, [hl]
ld l, a

View File

@ -5,11 +5,11 @@ TMHMPocket: ; 2c76f (b:476f)
ld a, $0
ld [hInMenu], a
ret nc
call Function1bee
call PlaceHollowCursor
call WaitBGMap
ld a, [CurItem]
dec a
ld [ItemCountBuffer], a
ld [CurItemQuantity], a
ld hl, TMsHMs
ld c, a
ld b, 0

View File

@ -18,12 +18,12 @@ _BasementKey: ; 507b4
; Let's use the Basement Key
ld hl, .BasementKeyScript
call QueueScript
ld a, 1
ld a, TRUE
ld [wItemEffectSucceeded], a
ret
.nope
ld a, $0
ld a, FALSE
ld [wItemEffectSucceeded], a
ret
; 507e1

View File

@ -1,29 +1,29 @@
Function8b1e1: ; 8b1e1
ld de, Unknown_8b1ed
call Function8b25b
CheckForMobileBattleRules: ; 8b1e1
ld de, .PointerTables
call BattleTower_ExecuteJumptable
ret z
call Function8b231
call BattleTower_PleaseReturnWhenReady
scf
ret
; 8b1ed
Unknown_8b1ed: ; 8b1ed
.PointerTables: ; 8b1ed
db 2
dw Unknown_8b1f2
dw Unknown_8b1f6
dw .Functions
dw .TextPointers
Unknown_8b1f2: ; 8b1f2
dw Function8b2bb
dw Function8b2c1
.Functions: ; 8b1f2
dw BattleTower_CheckPartyLengthIs3
dw BattleTower_CheckPartyHasThreeMonsThatAreNotEggs
; 8b1f6
Unknown_8b1f6: ; 8b1f6
dw UnknownText_0x8b1fc
dw UnknownText_0x8b23d
dw UnknownText_0x8b242
.TextPointers: ; 8b1f6
dw .ExcuseMeText
dw JumpText_NeedAtLeastThreeMon
dw JumpText_EggDoesNotQualify
; 8b1fc
UnknownText_0x8b1fc: ; 0x8b1fc
.ExcuseMeText: ; 0x8b1fc
; Excuse me!
text_jump UnknownText_0x1c5937
db "@"
@ -34,27 +34,27 @@ CheckForBattleTowerRules: ; 8b201
ld [hl], "3"
inc hl
ld [hl], "@"
ld de, CheckForBattleTowerRules_FunctionsText
call Function8b25b
ld de, .PointerTables
call BattleTower_ExecuteJumptable
ret z
call Function8b231
call BattleTower_PleaseReturnWhenReady
scf
ret
; 8b215
CheckForBattleTowerRules_FunctionsText: ; 8b215
.PointerTables: ; 8b215
db 4
dw CheckForBattleTowerRules_Functions
dw CheckForBattleTowerRules_Text
dw .Functions
dw .TextPointers
CheckForBattleTowerRules_Functions: ; 8b21a
.Functions: ; 8b21a
dw Function_PartyCountEq3
dw Function_PartySpeciesAreUnique
dw Function_PartyItemsAreUnique
dw Function_HasPartyAnEgg
; 8b222
CheckForBattleTowerRules_Text: ; 8b222
.TextPointers: ; 8b222
dw JumpText_ExcuseMeYoureNotReady
dw JumpText_OnlyThreePkmnMayBeEntered
dw JumpText_ThePkmnMustAllBeDifferentKinds
@ -68,25 +68,25 @@ JumpText_ExcuseMeYoureNotReady: ; 0x8b22c
db "@"
; 0x8b231
Function8b231: ; 8b231
ld hl, UnknownText_0x8b238
BattleTower_PleaseReturnWhenReady: ; 8b231
ld hl, .PleaseReturnWhenReady
call PrintText
ret
; 8b238
UnknownText_0x8b238: ; 0x8b238
.PleaseReturnWhenReady: ; 0x8b238
; Please return when you're ready.
text_jump UnknownText_0x1c5962
db "@"
; 0x8b23d
UnknownText_0x8b23d: ; 0x8b23d
JumpText_NeedAtLeastThreeMon: ; 0x8b23d
; You need at least three #MON.
text_jump UnknownText_0x1c5983
db "@"
; 0x8b242
UnknownText_0x8b242: ; 0x8b242
JumpText_EggDoesNotQualify: ; 0x8b242
; Sorry, an EGG doesn't qualify.
text_jump UnknownText_0x1c59a3
db "@"
@ -116,22 +116,22 @@ JumpText_YouCantTakeAnEgg: ; 0x8b256
db "@"
; 0x8b25b
Function8b25b: ; 8b25b
BattleTower_ExecuteJumptable: ; 8b25b
ld bc, 0
.asm_8b25e
call Function8b26c
call c, Function8b28e
call Function8b276
jr nz, .asm_8b25e
.loop
call .DoJumptableFunction
call c, .PrintFailureText
call .Next_CheckReachedEnd
jr nz, .loop
ld a, b
and a
ret
; 8b26c
Function8b26c: ; 8b26c
.DoJumptableFunction: ; 8b26c
push de
push bc
call Function8b27a
call .GetFunctionPointer
ld a, c
rst JumpTable
pop bc
@ -139,14 +139,14 @@ Function8b26c: ; 8b26c
ret
; 8b276
Function8b276: ; 8b276
.Next_CheckReachedEnd: ; 8b276
inc c
ld a, [de]
cp c
ret
; 8b27a
Function8b27a: ; 8b27a
.GetFunctionPointer: ; 8b27a
inc de
ld a, [de]
ld l, a
@ -156,7 +156,7 @@ Function8b27a: ; 8b27a
ret
; 8b281
Function8b281: ; 8b281
.GetTextPointers: ; 8b281
rept 3
inc de
endr
@ -168,38 +168,38 @@ endr
ret
; 8b28a
Function8b28a: ; 8b28a
.LoadTextPointer: ; 8b28a
ld a, [hli]
ld h, [hl]
ld l, a
ret
; 8b28e
Function8b28e: ; 8b28e
.PrintFailureText: ; 8b28e
push de
push bc
ld a, b
and a
call z, Function8b29d
call z, .PrintFirstText
pop bc
call Function8b2a9
call .PrintNthText
ld b, $1
pop de
ret
; 8b29d
Function8b29d: ; 8b29d
.PrintFirstText: ; 8b29d
push de
call Function8b281
call Function8b28a
call .GetTextPointers
call .LoadTextPointer
call PrintText
pop de
ret
; 8b2a9
Function8b2a9: ; 8b2a9
.PrintNthText: ; 8b2a9
push bc
call Function8b281
call .GetTextPointers
rept 2
inc hl
endr
@ -207,32 +207,32 @@ endr
rept 2
add hl, bc
endr
call Function8b28a
call .LoadTextPointer
call PrintText
pop bc
ret
; 8b2bb
Function8b2bb: ; 8b2bb
BattleTower_CheckPartyLengthIs3: ; 8b2bb
ld a, [PartyCount]
cp 3
ret
; 8b2c1
Function8b2c1: ; 8b2c1
BattleTower_CheckPartyHasThreeMonsThatAreNotEggs: ; 8b2c1
ld hl, PartyCount
ld a, [hli]
ld b, $0
ld c, a
.asm_8b2c8
.loop
ld a, [hli]
cp EGG
jr z, .asm_8b2ce
jr z, .egg
inc b
.asm_8b2ce
.egg
dec c
jr nz, .asm_8b2c8
jr nz, .loop
ld a, [PartyCount]
cp b
ret z

Some files were not shown because too many files have changed in this diff Show More