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 callba FreezeMonIcons
call .GetMenu call .GetMenu
jr c, .PressedB jr c, .PressedB
call Function1bee call PlaceHollowCursor
ld a, [wMenuCursorY] ld a, [wMenuCursorY]
cp $1 ; SWITCH cp $1 ; SWITCH
jp z, TryPlayerSwitch jp z, TryPlayerSwitch

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

544
engine/scrolling_menu.asm Executable file
View File

@ -0,0 +1,544 @@
_InitScrollingMenu:: ; 245af
xor a
ld [wMenuJoypad], a
ld [hBGMapMode], a
inc a
ld [hInMenu], a
call InitScrollingMenuCursor
call ScrollingMenu_InitFlags
call ScrollingMenu_ValidateSwitchItem
call ScrollingMenu_InitDisplay
call ApplyTilemap
xor a
ld [hBGMapMode], a
ret
; 245cb
_ScrollingMenu:: ; 245cb
.loop
call ScrollingMenuJoyAction
jp c, .exit
call z, .zero
jr .loop
; 245d6
.exit: ; 245d6
call MenuClickSound
ld [wMenuJoypad], a
ld a, 0
ld [hInMenu], a
ret
; 245e1
.zero: ; 245e1
call ScrollingMenu_InitDisplay
ld a, 1
ld [hBGMapMode], a
ld c, 3
call DelayFrames
xor a
ld [hBGMapMode], a
ret
; 245f1
ScrollingMenu_InitDisplay: ; 245f1
xor a
ld [hBGMapMode], a
ld hl, Options
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
call ScrollingMenu_UpdateDisplay
call ScrollingMenu_PlaceCursor
call ScrollingMenu_CheckCallFunction3
pop af
ld [Options], a
ret
; 24609
ScrollingMenuJoyAction: ; 24609
.loop
call ScrollingMenuJoypad
ld a, [hJoyLast]
and D_PAD
ld b, a
ld a, [hJoyPressed]
and BUTTONS
or b
bit 0, a ; A
jp nz, .a_button
bit 1, a ; B
jp nz, .b_button
bit 2, a ; Select
jp nz, .select
bit 3, a ; Start
jp nz, .start
bit 4, a ; Right
jp nz, .d_right
bit 5, a ; Left
jp nz, .d_left
bit 6, a ; Up
jp nz, .d_up
bit 7, a ; Down
jp nz, .d_down
jr .loop
; 24640
.unreferenced: ; unreferenced
ld a, -1
and a
ret
; 24644
.a_button: ; 24644
call PlaceHollowCursor
ld a, [wMenuCursorY]
dec a
call ScrollingMenu_GetListItemCoordAndFunctionArgs
ld a, [MenuSelection]
ld [CurItem], a
ld a, [MenuSelectionQuantity]
ld [wItemQuantityBuffer], a
call ScrollingMenu_GetCursorPosition
dec a
ld [wScrollingMenuCursorPosition], a
ld [CurItemQuantity], a
ld a, [MenuSelection]
cp -1
jr z, .b_button
ld a, A_BUTTON
scf
ret
; 2466f
.b_button: ; 2466f
ld a, B_BUTTON
scf
ret
; 24673
.select: ; 24673
ld a, [wMenuData2Flags]
bit 7, a
jp z, xor_a_dec_a
ld a, [wMenuCursorY]
dec a
call ScrollingMenu_GetListItemCoordAndFunctionArgs
ld a, [MenuSelection]
cp -1
jp z, xor_a_dec_a
call ScrollingMenu_GetCursorPosition
dec a
ld [wScrollingMenuCursorPosition], a
ld a, SELECT
scf
ret
; 24695
.start: ; 24695
ld a, [wMenuData2Flags]
bit 6, a
jp z, xor_a_dec_a
ld a, START
scf
ret
; 246a1
.d_left: ; 246a1
ld hl, w2DMenuFlags2
bit 7, [hl]
jp z, xor_a_dec_a
ld a, [wMenuData2Flags]
bit 3, a
jp z, xor_a_dec_a
ld a, D_LEFT
scf
ret
; 246b5
.d_right: ; 246b5
ld hl, w2DMenuFlags2
bit 7, [hl]
jp z, xor_a_dec_a
ld a, [wMenuData2Flags]
bit 2, a
jp z, xor_a_dec_a
ld a, D_RIGHT
scf
ret
; 246c9
.d_up: ; 246c9
ld hl, w2DMenuFlags2
bit 7, [hl]
jp z, xor_a
ld hl, wMenuScrollPosition
ld a, [hl]
and a
jr z, .xor_dec_up
dec [hl]
jp xor_a
.xor_dec_up
jp xor_a_dec_a
; 246df
.d_down: ; 246df
ld hl, w2DMenuFlags2
bit 7, [hl]
jp z, xor_a
ld hl, wMenuScrollPosition
ld a, [wMenuData2_ScrollingMenuHeight]
add [hl]
ld b, a
ld a, [wScrollingMenuListSize]
cp b
jr c, .xor_dec_down
inc [hl]
jp xor_a
.xor_dec_down
jp xor_a_dec_a
; 246fc
ScrollingMenu_GetCursorPosition: ; 246fc
ld a, [wMenuScrollPosition]
ld c, a
ld a, [wMenuCursorY]
add c
ld c, a
ret
; 24706
Function24706: ; 24706 (9:4706)
call MenuBoxCoord2Tile
ld de, SCREEN_WIDTH
add hl, de
ld de, 2 * SCREEN_WIDTH
ld a, [wMenuData2_ScrollingMenuHeight]
.asm_24713
ld [hl], " "
add hl, de
dec a
jr nz, .asm_24713
ret
InitScrollingMenuCursor: ; 2471a
ld hl, wMenuData2_ItemsPointerAddr
ld a, [hli]
ld h, [hl]
ld l, a
ld a, [wMenuData2_ItemsPointerBank]
call GetFarByte
ld [wScrollingMenuListSize], a
ld a, [wMenuData2_ScrollingMenuHeight]
ld c, a
ld a, [wMenuScrollPosition]
add c
ld c, a
ld a, [wScrollingMenuListSize]
inc a
cp c
jr nc, .skip
ld a, [wMenuData2_ScrollingMenuHeight]
ld c, a
ld a, [wScrollingMenuListSize]
inc a
sub c
jr nc, .store
xor a
.store
ld [wMenuScrollPosition], a
.skip
ld a, [wMenuScrollPosition]
ld c, a
ld a, [wMenuCursorBuffer]
add c
ld b, a
ld a, [wScrollingMenuListSize]
inc a
cp b
jr c, .asm_2475a
jr nc, .asm_24763
.asm_2475a
xor a
ld [wMenuScrollPosition], a
ld a, $1
ld [wMenuCursorBuffer], a
.asm_24763
ret
; 24764
ScrollingMenu_InitFlags: ; 24764
ld a, [wMenuData2Flags]
ld c, a
ld a, [wScrollingMenuListSize]
ld b, a
ld a, [wMenuBorderTopCoord]
add $1
ld [w2DMenuCursorInitY], a
ld a, [wMenuBorderLeftCoord]
add $0
ld [w2DMenuCursorInitX], a
ld a, [wMenuData2_ScrollingMenuHeight]
cp b
jr c, .asm_24786
jr z, .asm_24786
ld a, b
inc a
.asm_24786
ld [w2DMenuNumRows], a
ld a, $1
ld [w2DMenuNumCols], a
ld a, $8c
bit 2, c
jr z, .asm_24796
set 0, a
.asm_24796
bit 3, c
jr z, .asm_2479c
set 1, a
.asm_2479c
ld [w2DMenuFlags1], a
xor a
ld [w2DMenuFlags2], a
ld a, $20
ld [w2DMenuFlags3], a
ld a, $c3
bit 7, c
jr z, .asm_247b0
add $4
.asm_247b0
bit 6, c
jr z, .asm_247b6
add $8
.asm_247b6
ld [w2DMenuFlags4], a
ld a, [w2DMenuNumRows]
ld b, a
ld a, [wMenuCursorBuffer]
and a
jr z, .asm_247c8
cp b
jr z, .asm_247ca
jr c, .asm_247ca
.asm_247c8
ld a, $1
.asm_247ca
ld [wMenuCursorY], a
ld a, $1
ld [wMenuCursorX], a
xor a
ld [wCursorCurrentTile], a
ld [wCursorCurrentTile + 1], a
ld [wCursorOffCharacter], a
ret
; 247dd
ScrollingMenu_ValidateSwitchItem: ; 247dd
ld a, [wScrollingMenuListSize]
ld c, a
ld a, [wSwitchItem]
and a
jr z, .done
dec a
cp c
jr c, .done
xor a
ld [wSwitchItem], a
.done
ret
; 247f0
ScrollingMenu_UpdateDisplay: ; 247f0
call ClearWholeMenuBox
ld a, [wMenuData2Flags]
bit 4, a ; place arrows
jr z, .okay
ld a, [wMenuScrollPosition]
and a
jr z, .okay
ld a, [wMenuBorderTopCoord]
ld b, a
ld a, [wMenuBorderRightCoord]
ld c, a
call Coord2Tile
ld [hl], "▲"
.okay
call MenuBoxCoord2Tile
ld bc, SCREEN_WIDTH + 1
add hl, bc
ld a, [wMenuData2_ScrollingMenuHeight]
ld b, a
ld c, $0
.loop
ld a, [wMenuScrollPosition]
add c
ld [wScrollingMenuCursorPosition], a
ld a, c
call ScrollingMenu_GetListItemCoordAndFunctionArgs
ld a, [MenuSelection]
cp -1
jr z, .cancel
push bc
push hl
call ScrollingMenu_CallFunctions1and2
pop hl
ld bc, 2 * SCREEN_WIDTH
add hl, bc
pop bc
inc c
ld a, c
cp b
jr nz, .loop
ld a, [wMenuData2Flags]
bit 4, a ; place arrows
jr z, .done
ld a, [wMenuBorderBottomCoord]
ld b, a
ld a, [wMenuBorderRightCoord]
ld c, a
call Coord2Tile
ld [hl], "▼"
.done
ret
.cancel
ld a, [wMenuData2Flags]
bit 0, a ; call function on cancel
jr nz, .call_function
ld de, .string_2485f
call PlaceString
ret
.string_2485f
db "CANCEL@"
.call_function
ld d, h
ld e, l
ld hl, wMenuData2_ScrollingMenuFunction1
jp CallPointerAt
; 2486e
ScrollingMenu_CallFunctions1and2: ; 2486e
push hl
ld d, h
ld e, l
ld hl, wMenuData2_ScrollingMenuFunction1
call CallPointerAt
pop hl
ld a, [wMenuData2_ScrollingMenuWidth]
and a
jr z, .done
ld e, a
ld d, $0
add hl, de
ld d, h
ld e, l
ld hl, wMenuData2_ScrollingMenuFunction2
call CallPointerAt
.done
ret
; 2488b
ScrollingMenu_PlaceCursor: ; 2488b
ld a, [wSwitchItem]
and a
jr z, .done
ld b, a
ld a, [wMenuScrollPosition]
cp b
jr nc, .done
ld c, a
ld a, [wMenuData2_ScrollingMenuHeight]
add c
cp b
jr c, .done
ld a, b
sub c
dec a
add a
add $1
ld c, a
ld a, [wMenuBorderTopCoord]
add c
ld b, a
ld a, [wMenuBorderLeftCoord]
add $0
ld c, a
call Coord2Tile
ld [hl], "▷"
.done
ret
; 248b8
ScrollingMenu_CheckCallFunction3: ; 248b8
ld a, [wMenuData2Flags]
bit 5, a ; call function 3
ret z
bit 1, a ; call function 3 if not switching items
jr z, .call
ld a, [wSwitchItem]
and a
ret nz
.call
ld a, [wMenuCursorY]
dec a
call ScrollingMenu_GetListItemCoordAndFunctionArgs
ld hl, wMenuData2_ScrollingMenuFunction3
call CallPointerAt
ret
; 248d5
ScrollingMenu_GetListItemCoordAndFunctionArgs: ; 248d5
push de
push hl
ld e, a
ld a, [wMenuScrollPosition]
add e
ld e, a
ld d, $0
ld hl, wMenuData2_ItemsPointerAddr
ld a, [hli]
ld h, [hl]
ld l, a
inc hl ; items
ld a, [wMenuData2_ScrollingMenuSpacing]
cp 1
jr z, .got_spacing
cp 2
jr z, .pointless_jump
.pointless_jump
add hl, de
.got_spacing
add hl, de
ld a, [wMenuData2_ItemsPointerBank]
call GetFarByte
ld [MenuSelection], a
ld [CurItem], a
inc hl
ld a, [wMenuData2_ItemsPointerBank]
call GetFarByte
ld [MenuSelectionQuantity], a
pop hl
pop de
ret
; 2490c

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -82,10 +82,10 @@ SpecialBuenaPrize: ; 8afd4
.okay .okay
call DelayFrame call DelayFrame
call UpdateSprites call UpdateSprites
call Function8b097 call PrintBlueCardBalance
call Function8b0e2 call Function8b0e2
jr z, .done jr z, .done
ld [wcf75], a ld [MenuSelectionQuantity], a
call Buena_getprize call Buena_getprize
ld a, [hl] ld a, [hl]
ld [wd265], a ld [wd265], a
@ -95,7 +95,7 @@ SpecialBuenaPrize: ; 8afd4
call YesNoBox call YesNoBox
jr c, .loop jr c, .loop
ld a, [wcf75] ld a, [MenuSelectionQuantity]
call Buena_getprize call Buena_getprize
inc hl inc hl
ld a, [hld] ld a, [hld]
@ -118,7 +118,7 @@ SpecialBuenaPrize: ; 8afd4
ld a, [wBlueCardBalance] ld a, [wBlueCardBalance]
sub c sub c
ld [wBlueCardBalance], a ld [wBlueCardBalance], a
call Function8b097 call PrintBlueCardBalance
jr .Purchase jr .Purchase
.InsufficientBalance .InsufficientBalance
@ -184,34 +184,34 @@ SpecialBuenaPrize: ; 8afd4
; 0x8b090 ; 0x8b090
Function8b090: ; 8b090 Function8b090: ; 8b090
ld hl, MenuDataHeader_0x8b0d1 ld hl, BlueCardBalanceMenuDataHeader
call LoadMenuDataHeader call LoadMenuDataHeader
ret ret
; 8b097 ; 8b097
Function8b097: ; 8b097 PrintBlueCardBalance: ; 8b097
ld de, wBlueCardBalance ld de, wBlueCardBalance
call Function8b09e call .DrawBox
ret ret
; 8b09e ; 8b09e
Function8b09e: ; 8b09e .DrawBox: ; 8b09e
push de push de
xor a xor a
ld [hBGMapMode], a ld [hBGMapMode], a
ld hl, MenuDataHeader_0x8b0d1 ld hl, BlueCardBalanceMenuDataHeader
call CopyMenuDataHeader call CopyMenuDataHeader
call MenuBox call MenuBox
call UpdateSprites call UpdateSprites
call MenuBoxCoord2Tile call MenuBoxCoord2Tile
ld bc, $0015 ld bc, SCREEN_WIDTH + 1
add hl, bc add hl, bc
ld de, .Points_string ld de, .Points_string
call PlaceString call PlaceString
ld h, b ld h, b
ld l, c ld l, c
inc hl inc hl
ld a, $7f ld a, " "
ld [hli], a ld [hli], a
ld [hld], a ld [hld], a
pop de pop de
@ -224,7 +224,7 @@ Function8b09e: ; 8b09e
db "Points@" db "Points@"
; 8b0d1 ; 8b0d1
MenuDataHeader_0x8b0d1: ; 0x8b0d1 BlueCardBalanceMenuDataHeader: ; 0x8b0d1
db $40 ; flags db $40 ; flags
db 11, 00 ; start coords db 11, 00 ; start coords
db 13, 11 ; end coords db 13, 11 ; end coords
@ -252,19 +252,19 @@ Function8b0e2: ; 8b0e2
ld [hBGMapMode], a ld [hBGMapMode], a
call InitScrollingMenu call InitScrollingMenu
call UpdateSprites call UpdateSprites
call HandleScrollingMenu call ScrollingMenu
ld a, [MenuSelection] ld a, [MenuSelection]
ld c, a ld c, a
ld a, [wMenuCursorY] ld a, [wMenuCursorY]
ld [MenuSelection], a ld [MenuSelection], a
ld a, [wMenuJoypad] ld a, [wMenuJoypad]
cp $2 cp $2
jr z, .asm_8b111 jr z, .cancel
ld a, c ld a, c
and a and a
ret nz ret nz
.asm_8b111 .cancel
xor a xor a
ret ret
; 8b113 ; 8b113
@ -281,8 +281,8 @@ Function8b0e2: ; 8b0e2
.MenuData2: ; 0x8b11c .MenuData2: ; 0x8b11c
db $10 ; flags db $10 ; flags
db 4 ; items db 4, 13 ; rows, columns
db $d, $1 db 1 ; spacing
dba .indices dba .indices
dba .prizeitem dba .prizeitem
dba .prizepoints dba .prizepoints

View File

@ -130,7 +130,7 @@ Elevator_AskWhichFloor: ; 134dd
call UpdateSprites call UpdateSprites
xor a xor a
ld [wMenuScrollPosition], a ld [wMenuScrollPosition], a
call HandleScrollingMenu call ScrollingMenu
call WriteBackup call WriteBackup
ld a, [wMenuJoypad] ld a, [wMenuJoypad]
cp B_BUTTON cp B_BUTTON

View File

@ -67,7 +67,7 @@ Kurt_SelectApricorn: ; 88055
ld [hBGMapMode], a ld [hBGMapMode], a
call InitScrollingMenu call InitScrollingMenu
call UpdateSprites call UpdateSprites
call HandleScrollingMenu call ScrollingMenu
ld a, [wMenuJoypad] ld a, [wMenuJoypad]
cp $2 cp $2
jr z, .nope jr z, .nope
@ -116,7 +116,7 @@ Kurt_SelectApricorn: ; 88055
call Kurt_GetQuantityOfApricorn call Kurt_GetQuantityOfApricorn
ret z ret z
ld a, [wItemQuantityChangeBuffer] ld a, [wItemQuantityChangeBuffer]
ld [wcf75], a ld [MenuSelectionQuantity], a
callba PlaceMenuItemQuantity callba PlaceMenuItemQuantity
ret ret
; 880c2 ; 880c2
@ -231,16 +231,16 @@ Kurt_GiveUpSelectedQuantityOfSelectedApricorn: ; 88161
ld c, a ld c, a
ld e, $0 ld e, $0
xor a xor a
ld [ItemCountBuffer], a ld [CurItemQuantity], a
ld a, -1 ld a, -1
ld [wd002], a ld [wd002], a
; Search for [CurItem] in the bag. ; Search for [CurItem] in the bag.
.loop1 .loop1
; Increase the total count. ; Increase the total count.
ld a, [ItemCountBuffer] ld a, [CurItemQuantity]
inc a inc a
ld [ItemCountBuffer], a ld [CurItemQuantity], a
; Get the index of the next item. ; Get the index of the next item.
inc hl inc hl
ld a, [hli] ld a, [hli]
@ -256,7 +256,7 @@ Kurt_GiveUpSelectedQuantityOfSelectedApricorn: ; 88161
ld hl, wd002 ld hl, wd002
add hl, de add hl, de
inc e inc e
ld a, [ItemCountBuffer] ld a, [CurItemQuantity]
dec a dec a
ld [hli], a ld [hli], a
ld a, -1 ld a, -1
@ -322,7 +322,7 @@ Kurt_GiveUpSelectedQuantityOfSelectedApricorn: ; 88161
cp -1 cp -1
jr z, .done jr z, .done
push hl push hl
ld [ItemCountBuffer], a ld [CurItemQuantity], a
call Kurt_GetRidOfItem call Kurt_GetRidOfItem
pop hl pop hl
ld a, [wItemQuantityChangeBuffer] ld a, [wItemQuantityChangeBuffer]
@ -375,7 +375,7 @@ endr
Kurt_GetRidOfItem: ; 88211 Kurt_GetRidOfItem: ; 88211
push bc push bc
ld hl, NumItems ld hl, NumItems
ld a, [ItemCountBuffer] ld a, [CurItemQuantity]
ld c, a ld c, a
ld b, $0 ld b, $0
inc hl inc hl

View File

@ -1146,17 +1146,17 @@ GetMoveName:: ; 34f8
; 350c ; 350c
HandleScrollingMenu:: ; 350c ScrollingMenu:: ; 350c
call CopyMenuData2 call CopyMenuData2
ld a, [hROMBank] ld a, [hROMBank]
push af push af
ld a, BANK(Function245af) ld a, BANK(_ScrollingMenu)
rst Bankswitch rst Bankswitch
call Function245af call _InitScrollingMenu
call Function3524 call .UpdatePalettes
call Function245cb call _ScrollingMenu
pop af pop af
rst Bankswitch rst Bankswitch
@ -1165,7 +1165,7 @@ HandleScrollingMenu:: ; 350c
ret ret
; 3524 ; 3524
Function3524:: ; 3524 .UpdatePalettes ; 3524
ld hl, VramState ld hl, VramState
bit 0, [hl] bit 0, [hl]
jp nz, UpdateTimePals jp nz, UpdateTimePals

View File

@ -34,12 +34,12 @@ ret_1d57:: ; 1d57
; 1d58 ; 1d58
LoadMenuTextBox:: ; 1d58 LoadMenuTextBox:: ; 1d58
ld hl, MenuDataHeader_0x1d5f ld hl, .MenuDataHeader
call LoadMenuDataHeader call LoadMenuDataHeader
ret ret
; 1d5f ; 1d5f
MenuDataHeader_0x1d5f:: ; 1d5f .MenuDataHeader ; 1d5f
db $40 ; tile backup db $40 ; tile backup
db 12, 0 ; start coords db 12, 0 ; start coords
db 17, 19 ; end coords db 17, 19 ; end coords
@ -54,12 +54,12 @@ MenuTextBoxBackup:: ; 1d67
; 1d6e ; 1d6e
LoadStandardMenuDataHeader:: ; 1d6e LoadStandardMenuDataHeader:: ; 1d6e
ld hl, MenuDataHeader_0x1d75 ld hl, .MenuDataHeader
call LoadMenuDataHeader call LoadMenuDataHeader
ret ret
; 1d75 ; 1d75
MenuDataHeader_0x1d75:: ; 1d75 .MenuDataHeader ; 1d75
db $40 ; tile backup db $40 ; tile backup
db 0, 0 ; start coords db 0, 0 ; start coords
db 17, 19 ; end coords db 17, 19 ; end coords
@ -187,24 +187,24 @@ YesNoMenuDataHeader:: ; 1e1d
db $40 ; tile backup db $40 ; tile backup
db 5, 10 ; start coords db 5, 10 ; start coords
db 9, 15 ; end coords db 9, 15 ; end coords
dw YesNoMenuData2 dw .MenuData2
db 1 ; default option db 1 ; default option
; 1e25 ; 1e25
YesNoMenuData2:: ; 1e25 .MenuData2 ; 1e25
db $c0 ; flags db $c0 ; flags
db 2 db 2
db "YES@" db "YES@"
db "NO@" db "NO@"
; 1e2e ; 1e2e
Function1e2e:: ; 1e2e OffsetMenuDataHeader:: ; 1e2e
call Function1e35 call _OffsetMenuDataHeader
call BackUpTiles call BackUpTiles
ret ret
; 1e35 ; 1e35
Function1e35:: ; 1e35 _OffsetMenuDataHeader:: ; 1e35
push de push de
call CopyMenuDataHeader call CopyMenuDataHeader
pop de pop de
@ -243,7 +243,7 @@ SetUpMenu:: ; 1e70
call MenuFunc_1e7f ; ??? call MenuFunc_1e7f ; ???
call MenuWriteText call MenuWriteText
call Function1eff ; set up selection pointer call Function1eff ; set up selection pointer
ld hl, wcfa5 ld hl, w2DMenuFlags1
set 7, [hl] set 7, [hl]
ret ret
@ -287,23 +287,23 @@ Function1ea6:: ; 1ea6
; 1ebd ; 1ebd
Function1ebd:: ; 1ebd Function1ebd:: ; 1ebd
ld hl, wcf93 ld hl, wMenuData2IndicesPointer
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a
ld a, [wcf76] ld a, [wcf76]
and a and a
jr z, .asm_1ed3 jr z, .skip
ld b, a ld b, a
ld c, $ff ld c, -1
.asm_1ecc .loop
ld a, [hli] ld a, [hli]
cp c cp c
jr nz, .asm_1ecc jr nz, .loop
dec b dec b
jr nz, .asm_1ecc jr nz, .loop
.asm_1ed3 .skip
ld d, h ld d, h
ld e, l ld e, l
ld a, [hl] ld a, [hl]
@ -313,28 +313,28 @@ Function1ebd:: ; 1ebd
Function1eda:: ; 1eda Function1eda:: ; 1eda
call MenuBoxCoord2Tile call MenuBoxCoord2Tile
ld bc, $002a ld bc, 2 * SCREEN_WIDTH + 2
add hl, bc add hl, bc
.asm_1ee1 .loop
inc de inc de
ld a, [de] ld a, [de]
cp $ff cp -1
ret z ret z
ld [MenuSelection], a ld [MenuSelection], a
push de push de
push hl push hl
ld d, h ld d, h
ld e, l ld e, l
ld hl, wcf95 ld hl, wMenuData2DisplayFunctionPointer
call Function1efb call .__wMenuData2DisplayFunction__
pop hl pop hl
ld de, $0028 ld de, 2 * SCREEN_WIDTH
add hl, de add hl, de
pop de pop de
jr .asm_1ee1 jr .loop
; 1efb ; 1efb
Function1efb:: ; 1efb .__wMenuData2DisplayFunction__ ; 1efb
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a
@ -343,27 +343,27 @@ Function1efb:: ; 1efb
Function1eff:: ; 1eff Function1eff:: ; 1eff
call InitVerticalMenuCursor call InitVerticalMenuCursor
ld hl, wcfa8 ld hl, w2DMenuFlags4
ld a, [wMenuData2Flags] ld a, [wMenuData2Flags]
bit 3, a bit 3, a
jr z, .asm_1f0e jr z, .skip3
set 3, [hl] set 3, [hl]
.asm_1f0e .skip3
ld a, [wMenuData2Flags] ld a, [wMenuData2Flags]
bit 2, a bit 2, a
jr z, .asm_1f19 jr z, .skip4_5
set 5, [hl] set 5, [hl]
set 4, [hl] set 4, [hl]
.asm_1f19 .skip4_5
ret ret
; 1f1a ; 1f1a
Function1f1a:: ; 1f1a Function1f1a:: ; 1f1a
call ScrollingMenuJoypad call ScrollingMenuJoypad
ld hl, wcfa8 ld hl, w2DMenuFlags4
and [hl] and [hl]
jr Function1f2a jr Function1f2a
; 1f23 ; 1f23

View File

@ -188,7 +188,7 @@ GetMenuJoypad:: ; 1bdd
ret ret
; 1bee ; 1bee
Function1bee:: ; 1bee PlaceHollowCursor:: ; 1bee
ld hl, wCursorCurrentTile ld hl, wCursorCurrentTile
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
@ -197,7 +197,7 @@ Function1bee:: ; 1bee
ret ret
; 1bf7 ; 1bf7
Function1bf7:: ; 1bf7 HideCursor:: ; 1bf7
ld hl, wCursorCurrentTile ld hl, wCursorCurrentTile
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]

572
main.asm
View File

@ -4456,7 +4456,7 @@ RemoveItemFromPocket: ; d2ff
ld e, l ld e, l
ld a, [hli] ld a, [hli]
ld c, a ld c, a
ld a, [ItemCountBuffer] ld a, [CurItemQuantity]
cp c cp c
jr nc, .ok ; memory jr nc, .ok ; memory
ld c, a ld c, a
@ -7944,555 +7944,7 @@ GetObjectTimeMask: ; 245a7 (9:45a7)
xor a xor a
ret ret
Function245af:: ; 245af INCLUDE "engine/scrolling_menu.asm"
xor a
ld [wMenuJoypad], a
ld [hBGMapMode], a
inc a
ld [hInMenu], a
call ClearObjectStructsa
call Function24764
call Function247dd
call Function245f1
call ApplyTilemap
xor a
ld [hBGMapMode], a
ret
; 245cb
Function245cb:: ; 245cb
.loop
call MenuJoyAction
jp c, .exit
call z, .zero
jr .loop
; 245d6
.exit: ; 245d6
call MenuClickSound
ld [wMenuJoypad], a
ld a, 0
ld [hInMenu], a
ret
; 245e1
.zero: ; 245e1
call Function245f1
ld a, 1
ld [hBGMapMode], a
ld c, 3
call DelayFrames
xor a
ld [hBGMapMode], a
ret
; 245f1
Function245f1: ; 245f1
xor a
ld [hBGMapMode], a
ld hl, Options
ld a, [hl]
push af
set NO_TEXT_SCROLL, [hl]
call Function247f0
call Function2488b
call Function248b8
pop af
ld [Options], a
ret
; 24609
MenuJoyAction: ; 24609
.loop
call ScrollingMenuJoypad
ld a, [hJoyLast]
and D_PAD
ld b, a
ld a, [hJoyPressed]
and BUTTONS
or b
bit 0, a ; A
jp nz, .a_button
bit 1, a ; B
jp nz, .b_button
bit 2, a ; Select
jp nz, .select
bit 3, a ; Start
jp nz, .start
bit 4, a ; Right
jp nz, .d_right
bit 5, a ; Left
jp nz, .d_left
bit 6, a ; Up
jp nz, .d_up
bit 7, a ; Down
jp nz, .d_down
jr .loop
; 24640
.unreferenced: ; unreferenced
ld a, -1
and a
ret
; 24644
.a_button: ; 24644
call Function1bee
ld a, [wMenuCursorY]
dec a
call Function248d5
ld a, [MenuSelection]
ld [CurItem], a
ld a, [wcf75]
ld [wItemQuantityBuffer], a
call Function246fc
dec a
ld [wScrollingMenuCursorPosition], a
ld [wd107], a
ld a, [MenuSelection]
cp -1
jr z, .b_button
ld a, A_BUTTON
scf
ret
; 2466f
.b_button: ; 2466f
ld a, B_BUTTON
scf
ret
; 24673
.select: ; 24673
ld a, [wMenuData2Flags]
bit 7, a
jp z, xor_a_dec_a
ld a, [wMenuCursorY]
dec a
call Function248d5
ld a, [MenuSelection]
cp -1
jp z, xor_a_dec_a
call Function246fc
dec a
ld [wScrollingMenuCursorPosition], a
ld a, SELECT
scf
ret
; 24695
.start: ; 24695
ld a, [wMenuData2Flags]
bit 6, a
jp z, xor_a_dec_a
ld a, START
scf
ret
; 246a1
.d_left: ; 246a1
ld hl, wcfa6
bit 7, [hl]
jp z, xor_a_dec_a
ld a, [wMenuData2Flags]
bit 3, a
jp z, xor_a_dec_a
ld a, D_LEFT
scf
ret
; 246b5
.d_right: ; 246b5
ld hl, wcfa6
bit 7, [hl]
jp z, xor_a_dec_a
ld a, [wMenuData2Flags]
bit 2, a
jp z, xor_a_dec_a
ld a, D_RIGHT
scf
ret
; 246c9
.d_up: ; 246c9
ld hl, wcfa6
bit 7, [hl]
jp z, xor_a
ld hl, wMenuScrollPosition
ld a, [hl]
and a
jr z, .xor_dec_up
dec [hl]
jp xor_a
.xor_dec_up
jp xor_a_dec_a
; 246df
.d_down: ; 246df
ld hl, wcfa6
bit 7, [hl]
jp z, xor_a
ld hl, wMenuScrollPosition
ld a, [wMenuData2Items]
add [hl]
ld b, a
ld a, [wd144]
cp b
jr c, .xor_dec_down
inc [hl]
jp xor_a
.xor_dec_down
jp xor_a_dec_a
; 246fc
Function246fc: ; 246fc
ld a, [wMenuScrollPosition]
ld c, a
ld a, [wMenuCursorY]
add c
ld c, a
ret
; 24706
Function24706: ; 24706 (9:4706)
call MenuBoxCoord2Tile
ld de, SCREEN_WIDTH
add hl, de
ld de, 2 * SCREEN_WIDTH
ld a, [wMenuData2Items]
.asm_24713
ld [hl], " "
add hl, de
dec a
jr nz, .asm_24713
ret
ClearObjectStructsa: ; 2471a
; Get the value of (wMenuData2Bank):(wMenuData2Addr) and store it in wd144.
ld hl, wMenuData2Addr
ld a, [hli]
ld h, [hl]
ld l, a
ld a, [wMenuData2Bank]
call GetFarByte
ld [wd144], a
; if ([wd144] + 1) < [wMenuData2Items] + [wMenuScrollPosition]: [wMenuScrollPosition] = max(([wd144] + 1) - [wMenuData2Items], 0)
ld a, [wMenuData2Items]
ld c, a
ld a, [wMenuScrollPosition]
add c
ld c, a
ld a, [wd144]
inc a
cp c
jr nc, .skip
ld a, [wMenuData2Items]
ld c, a
ld a, [wd144]
inc a
sub c
jr nc, .store
xor a
.store
ld [wMenuScrollPosition], a
.skip
ld a, [wMenuScrollPosition]
ld c, a
ld a, [wMenuCursorBuffer]
add c
ld b, a
ld a, [wd144]
inc a
cp b
jr c, .asm_2475a
jr nc, .asm_24763
.asm_2475a
xor a
ld [wMenuScrollPosition], a
ld a, $1
ld [wMenuCursorBuffer], a
.asm_24763
ret
; 24764
Function24764: ; 24764
ld a, [wMenuData2Flags]
ld c, a
ld a, [wd144]
ld b, a
ld a, [wMenuBorderTopCoord]
add $1
ld [wcfa1], a
ld a, [wMenuBorderLeftCoord]
add $0
ld [wcfa2], a
ld a, [wMenuData2Items]
cp b
jr c, .asm_24786
jr z, .asm_24786
ld a, b
inc a
.asm_24786
ld [wcfa3], a
ld a, $1
ld [wcfa4], a
ld a, $8c
bit 2, c
jr z, .asm_24796
set 0, a
.asm_24796
bit 3, c
jr z, .asm_2479c
set 1, a
.asm_2479c
ld [wcfa5], a
xor a
ld [wcfa6], a
ld a, $20
ld [wcfa7], a
ld a, $c3
bit 7, c
jr z, .asm_247b0
add $4
.asm_247b0
bit 6, c
jr z, .asm_247b6
add $8
.asm_247b6
ld [wcfa8], a
ld a, [wcfa3]
ld b, a
ld a, [wMenuCursorBuffer]
and a
jr z, .asm_247c8
cp b
jr z, .asm_247ca
jr c, .asm_247ca
.asm_247c8
ld a, $1
.asm_247ca
ld [wMenuCursorY], a
ld a, $1
ld [wMenuCursorX], a
xor a
ld [wCursorCurrentTile], a
ld [wCursorCurrentTile + 1], a
ld [wCursorOffCharacter], a
ret
; 247dd
Function247dd: ; 247dd
ld a, [wd144]
ld c, a
ld a, [wd0e3]
and a
jr z, .asm_247ef
dec a
cp c
jr c, .asm_247ef
xor a
ld [wd0e3], a
.asm_247ef
ret
; 247f0
Function247f0: ; 247f0
call ClearWholeMenuBox
ld a, [wMenuData2Flags]
bit 4, a
jr z, .asm_2480d
ld a, [wMenuScrollPosition]
and a
jr z, .asm_2480d
ld a, [wMenuBorderTopCoord]
ld b, a
ld a, [wMenuBorderRightCoord]
ld c, a
call Coord2Tile
ld [hl], $61
.asm_2480d
call MenuBoxCoord2Tile
ld bc, $15
add hl, bc
ld a, [wMenuData2Items]
ld b, a
ld c, $0
.asm_2481a
ld a, [wMenuScrollPosition]
add c
ld [wScrollingMenuCursorPosition], a
ld a, c
call Function248d5
ld a, [MenuSelection]
cp $ff
jr z, .asm_24851
push bc
push hl
call Function2486e
pop hl
ld bc, $28
add hl, bc
pop bc
inc c
ld a, c
cp b
jr nz, .asm_2481a
ld a, [wMenuData2Flags]
bit 4, a
jr z, .asm_24850
ld a, [wMenuBorderBottomCoord]
ld b, a
ld a, [wMenuBorderRightCoord]
ld c, a
call Coord2Tile
ld [hl], $ee
.asm_24850
ret
.asm_24851
ld a, [wMenuData2Flags]
bit 0, a
jr nz, .asm_24866
ld de, .string_2485f
call PlaceString
ret
.string_2485f
db "CANCEL@"
.asm_24866
ld d, h
ld e, l
ld hl, wcf98
jp CallPointerAt
; 2486e
Function2486e: ; 2486e
push hl
ld d, h
ld e, l
ld hl, wcf98
call CallPointerAt
pop hl
ld a, [wcf93]
and a
jr z, .asm_2488a
ld e, a
ld d, $0
add hl, de
ld d, h
ld e, l
ld hl, wcf9b
call CallPointerAt
.asm_2488a
ret
; 2488b
Function2488b: ; 2488b
ld a, [wd0e3]
and a
jr z, .asm_248b7
ld b, a
ld a, [wMenuScrollPosition]
cp b
jr nc, .asm_248b7
ld c, a
ld a, [wMenuData2Items]
add c
cp b
jr c, .asm_248b7
ld a, b
sub c
dec a
add a
add $1
ld c, a
ld a, [wMenuBorderTopCoord]
add c
ld b, a
ld a, [wMenuBorderLeftCoord]
add $0
ld c, a
call Coord2Tile
ld [hl], $ec
.asm_248b7
ret
; 248b8
Function248b8: ; 248b8
ld a, [wMenuData2Flags]
bit 5, a
ret z
bit 1, a
jr z, .asm_248c7
ld a, [wd0e3]
and a
ret nz
.asm_248c7
ld a, [wMenuCursorY]
dec a
call Function248d5
ld hl, wcf9e
call CallPointerAt
ret
; 248d5
Function248d5: ; 248d5
push de
push hl
ld e, a
ld a, [wMenuScrollPosition]
add e
ld e, a
ld d, $0
ld hl, wMenuData2Addr
ld a, [hli]
ld h, [hl]
ld l, a
inc hl
ld a, [wcf94]
cp $1
jr z, .asm_248f2
cp $2
jr z, .asm_248f1
.asm_248f1
add hl, de
.asm_248f2
add hl, de
ld a, [wMenuData2Bank]
call GetFarByte
ld [MenuSelection], a
ld [CurItem], a
inc hl
ld a, [wMenuData2Bank]
call GetFarByte
ld [wcf75], a
pop hl
pop de
ret
; 2490c
INCLUDE "engine/switch_items.asm" INCLUDE "engine/switch_items.asm"
PlaceMenuItemName: ; 0x24ab4 PlaceMenuItemName: ; 0x24ab4
@ -8518,7 +7970,7 @@ PlaceMenuItemQuantity: ; 0x24ac3
add hl, de add hl, de
ld [hl], "×" ld [hl], "×"
inc hl inc hl
ld de, wcf75 ld de, MenuSelectionQuantity
lb bc, 1, 2 lb bc, 1, 2
call PrintNum call PrintNum
@ -8526,25 +7978,25 @@ PlaceMenuItemQuantity: ; 0x24ac3
ret ret
; 0x24ae8 ; 0x24ae8
PlaceMoneyTopRightOW: ; 24ae8 PlaceMoneyTopRight: ; 24ae8
ld hl, MenuDataHeader_0x24b15 ld hl, MenuDataHeader_0x24b15
call CopyMenuDataHeader call CopyMenuDataHeader
jr Function24b01 jr PlaceMoneyDataHeader
PlaceMoneyBottomLeftOW: ; 24af0 PlaceMoneyBottomLeft: ; 24af0
ld hl, MenuDataHeader_0x24b1d ld hl, MenuDataHeader_0x24b1d
call CopyMenuDataHeader call CopyMenuDataHeader
jr Function24b01 jr PlaceMoneyDataHeader
PlaceMoneyTopRightMenu: ; 24af8 PlaceMoneyAtTopLeftOfTextbox: ; 24af8
ld hl, MenuDataHeader_0x24b15 ld hl, MenuDataHeader_0x24b15
ld de, $b lb de, 0, 11
call Function1e2e call OffsetMenuDataHeader
Function24b01: ; 24b01 PlaceMoneyDataHeader: ; 24b01
call MenuBox call MenuBox
call MenuBoxCoord2Tile call MenuBoxCoord2Tile
ld de, $15 ld de, SCREEN_WIDTH + 1
add hl, de add hl, de
ld de, Money ld de, Money
lb bc, PRINTNUM_MONEY | 3, 6 lb bc, PRINTNUM_MONEY | 3, 6

View File

@ -27,7 +27,7 @@ CeladonVendingMachine:
opentext opentext
writetext CeladonVendingText writetext CeladonVendingText
.Start .Start
special PlaceMoneyTopRightOW special PlaceMoneyTopRight
loadmenudata .MenuData loadmenudata .MenuData
verticalmenu verticalmenu
writebackup writebackup

View File

@ -13,7 +13,7 @@ GoldenrodVendingMachine:
opentext opentext
writetext GoldenrodVendingText writetext GoldenrodVendingText
.Start .Start
special PlaceMoneyTopRightOW special PlaceMoneyTopRight
loadmenudata .MenuData loadmenudata .MenuData
verticalmenu verticalmenu
writebackup writebackup

View File

@ -57,7 +57,7 @@ UnknownScript_0x190039:
UnknownScript_0x190040: UnknownScript_0x190040:
opentext opentext
writetext UnknownText_0x1900b0 writetext UnknownText_0x1900b0
special PlaceMoneyTopRightOW special PlaceMoneyTopRight
yesorno yesorno
iffalse UnknownScript_0x190072 iffalse UnknownScript_0x190072
checkmoney $0, 300 checkmoney $0, 300
@ -67,7 +67,7 @@ UnknownScript_0x190040:
waitsfx waitsfx
playsound SFX_TRANSACTION playsound SFX_TRANSACTION
takemoney $0, 300 takemoney $0, 300
special PlaceMoneyTopRightOW special PlaceMoneyTopRight
writetext UnknownText_0x19014a writetext UnknownText_0x19014a
waitbutton waitbutton
closetext closetext

View File

@ -24,7 +24,7 @@ UnknownScript_0x9cec5:
checkitem MOOMOO_MILK checkitem MOOMOO_MILK
iftrue UnknownScript_0x9cf08 iftrue UnknownScript_0x9cf08
writetext UnknownText_0x9cfe1 writetext UnknownText_0x9cfe1
special PlaceMoneyTopRightOW special PlaceMoneyTopRight
yesorno yesorno
iffalse UnknownScript_0x9cf02 iffalse UnknownScript_0x9cf02
checkmoney $0, 500 checkmoney $0, 500
@ -32,7 +32,7 @@ UnknownScript_0x9cec5:
giveitem MOOMOO_MILK giveitem MOOMOO_MILK
iffalse UnknownScript_0x9cefc iffalse UnknownScript_0x9cefc
takemoney $0, 500 takemoney $0, 500
special PlaceMoneyTopRightOW special PlaceMoneyTopRight
waitsfx waitsfx
playsound SFX_TRANSACTION playsound SFX_TRANSACTION
writetext UnknownText_0x9d05d writetext UnknownText_0x9d05d

View File

@ -197,7 +197,7 @@ OlderHaircutBrotherScript:
.DoHaircut: .DoHaircut:
checkflag ENGINE_GOLDENROD_UNDERGROUND_GOT_HAIRCUT checkflag ENGINE_GOLDENROD_UNDERGROUND_GOT_HAIRCUT
iftrue .AlreadyGotHaircut iftrue .AlreadyGotHaircut
special PlaceMoneyTopRightOW special PlaceMoneyTopRight
writetext UnknownText_0x7c5f9 writetext UnknownText_0x7c5f9
yesorno yesorno
iffalse .Refused iffalse .Refused
@ -233,7 +233,7 @@ OlderHaircutBrotherScript:
.then: .then:
takemoney $0, 500 takemoney $0, 500
special PlaceMoneyTopRightOW special PlaceMoneyTopRight
writetext UnknownText_0x7c6b8 writetext UnknownText_0x7c6b8
waitbutton waitbutton
closetext closetext
@ -280,7 +280,7 @@ YoungerHaircutBrotherScript:
.DoHaircut: .DoHaircut:
checkflag ENGINE_GOLDENROD_UNDERGROUND_GOT_HAIRCUT checkflag ENGINE_GOLDENROD_UNDERGROUND_GOT_HAIRCUT
iftrue .AlreadyGotHaircut iftrue .AlreadyGotHaircut
special PlaceMoneyTopRightOW special PlaceMoneyTopRight
writetext UnknownText_0x7c75c writetext UnknownText_0x7c75c
yesorno yesorno
iffalse .Refused iffalse .Refused
@ -316,7 +316,7 @@ YoungerHaircutBrotherScript:
.then: .then:
takemoney $0, 300 takemoney $0, 300
special PlaceMoneyTopRightOW special PlaceMoneyTopRight
writetext UnknownText_0x7c80e writetext UnknownText_0x7c80e
waitbutton waitbutton
closetext closetext

View File

@ -1401,7 +1401,7 @@ endr
ld a, 1 ld a, 1
ld [wItemQuantityChangeBuffer], a ld [wItemQuantityChangeBuffer], a
ld a, -1 ld a, -1
ld [ItemCountBuffer], a ld [CurItemQuantity], a
ld hl, NumItems ld hl, NumItems
call TossItem call TossItem
ld a, $1 ld a, $1

View File

@ -214,7 +214,7 @@ String_48202: ; 48202
; 4820d ; 4820d
Function4820d: ; 4820d (12:420d) Function4820d: ; 4820d (12:420d)
call Function1bee call PlaceHollowCursor
ld hl, wMenuCursorY ld hl, wMenuCursorY
ld a, [hl] ld a, [hl]
push af push af
@ -361,7 +361,7 @@ Function48304: ; 48304 (12:4304)
ld [wMenuScrollPosition], a ld [wMenuScrollPosition], a
callba Function104148 callba Function104148
.asm_48348 .asm_48348
call HandleScrollingMenu call ScrollingMenu
ld de, $629 ld de, $629
call Function48383 call Function48383
jr c, .asm_48348 jr c, .asm_48348

View File

@ -499,7 +499,7 @@ Function4ab1a: ; 4ab1a
jr c, .asm_4ab1a jr c, .asm_4ab1a
push af push af
call Function4ab99 call Function4ab99
call nc, Function1bee call nc, PlaceHollowCursor
pop af pop af
bit 1, a bit 1, a
jr nz, .asm_4ab6d jr nz, .asm_4ab6d

View File

@ -2258,7 +2258,7 @@ Function89dab: ; 89dab (22:5dab)
ld a, [wMenuCursorY] ld a, [wMenuCursorY]
cp c cp c
jr z, .asm_89dd9 jr z, .asm_89dd9
call Function1bee call PlaceHollowCursor
scf scf
ret ret
.asm_89dd9 .asm_89dd9
@ -3076,7 +3076,7 @@ Function8a31c: ; 8a31c (22:631c)
ret ret
.asm_8a370 .asm_8a370
call Function89448 call Function89448
call Function1bee call PlaceHollowCursor
call Function8a3a2 call Function8a3a2
ld a, [MenuSelection] ld a, [MenuSelection]
cp $ff cp $ff

View File

@ -828,7 +828,7 @@ Function8b7bd: ; 8b7bd
call Function8b75d call Function8b75d
call UpdateSprites call UpdateSprites
call Function89209 call Function89209
call HandleScrollingMenu call ScrollingMenu
call Function8920f call Function8920f
ld a, [wMenuJoypad] ld a, [wMenuJoypad]
cp $2 cp $2

View File

@ -2024,7 +2024,7 @@ Function100cb5: ; 100cb5
ld a, [wcfa8] ld a, [wcfa8]
and c and c
jr z, .asm_100cc0 jr z, .asm_100cc0
call Function1bee call PlaceHollowCursor
ld a, [PartyCount] ld a, [PartyCount]
inc a inc a
ld b, a ld b, a
@ -5569,7 +5569,7 @@ Function1024de: ; 1024de
; 1024f6 ; 1024f6
Function1024f6: ; 1024f6 Function1024f6: ; 1024f6
call Function1bee call PlaceHollowCursor
ld hl, wcd4b ld hl, wcd4b
set 1, [hl] set 1, [hl]
ld a, [wcd4c] ld a, [wcd4c]
@ -5746,7 +5746,7 @@ Function1025ff: ; 1025ff
ld a, [OTPartyCount] ld a, [OTPartyCount]
cp b cp b
ret nz ret nz
call Function1bf7 call HideCursor
ld a, [PartyCount] ld a, [PartyCount]
ld [wMenuCursorY], a ld [wMenuCursorY], a
ld a, $1d ld a, $1d
@ -5806,7 +5806,7 @@ Function10266b: ; 10266b
ld a, [wMenuCursorY] ld a, [wMenuCursorY]
dec a dec a
ret nz ret nz
call Function1bf7 call HideCursor
ld a, $1f ld a, $1f
ld [wcd49], a ld [wcd49], a
ret ret
@ -5847,7 +5847,7 @@ Jumptable_1026da: ; 1026da
; 1026de ; 1026de
Function1026de: ; 1026de Function1026de: ; 1026de
call Function1bf7 call HideCursor
hlcoord 9, 17 hlcoord 9, 17
ld [hl], $ed ld [hl], $ed
ld a, [wcd4a] ld a, [wcd4a]
@ -5901,7 +5901,7 @@ Function1026f3: ; 1026f3
Function102738: ; 102738 Function102738: ; 102738
ld hl, wcd4b ld hl, wcd4b
set 6, [hl] set 6, [hl]
call Function1bee call PlaceHollowCursor
call Function1027eb call Function1027eb
ld hl, wcd4b ld hl, wcd4b
set 1, [hl] set 1, [hl]
@ -7796,7 +7796,7 @@ Mobile_SelectThreeMons: ; 10366e
call PrintText call PrintText
call YesNoBox call YesNoBox
jr c, .asm_103696 jr c, .asm_103696
callba Function8b1e1 callba CheckForMobileBattleRules
jr nc, .asm_103690 jr nc, .asm_103690
call JoyWaitAorB call JoyWaitAorB
jr .asm_103696 jr .asm_103696
@ -7841,7 +7841,7 @@ Mobile_SelectThreeMons: ; 10366e
jr .asm_1036b5 jr .asm_1036b5
.asm_1036d9 .asm_1036d9
callba Function8b1e1 callba CheckForMobileBattleRules
jr nc, .asm_1036e6 jr nc, .asm_1036e6
call JoyWaitAorB call JoyWaitAorB
jr .asm_1036f4 jr .asm_1036f4

View File

@ -1492,8 +1492,7 @@ Requested1bppDest:: ; cf6f
wWindowStackPointer:: dw ; cf71 wWindowStackPointer:: dw ; cf71
wMenuJoypad:: ds 1 ; cf73 wMenuJoypad:: ds 1 ; cf73
MenuSelection:: ds 1 ; cf74 MenuSelection:: ds 1 ; cf74
MenuSelectionQuantity:: ds 1 ; cf75
wcf75:: ds 1
wcf76:: ds 1 wcf76:: ds 1
wScrollingMenuCursorPosition:: ds 1 wScrollingMenuCursorPosition:: ds 1
wWindowStackSize:: ds 9 wWindowStackSize:: ds 9
@ -1523,24 +1522,30 @@ wMenuData2Flags:: ds 1 ; cf91
; bit 1: Enable Select button ; bit 1: Enable Select button
; bit 0: Disable B button ; bit 0: Disable B button
wMenuData2_ScrollingMenuHeight::
wMenuData2Items:: ds 1 wMenuData2Items:: ds 1
wMenuData2IndicesPointer:: wMenuData2IndicesPointer::
wMenuData2Spacing:: wMenuData2Spacing::
wMenuData2_ScrollingMenuWidth::
wcf93:: ds 1 wcf93:: ds 1
wMenuData2_2DMenuItemStringsBank:: wMenuData2_2DMenuItemStringsBank::
wMenuData2_ScrollingMenuSpacing::
wcf94:: ds 1 wcf94:: ds 1
wMenuData2_2DMenuItemStringsAddr:: wMenuData2_2DMenuItemStringsAddr::
wMenuData2DisplayFunctionPointer:: wMenuData2DisplayFunctionPointer::
wMenuData2Bank:: wMenuData2_ItemsPointerBank::
wcf95:: ds 1 ; bank wcf95:: ds 1 ; bank
wMenuData2Addr:: wMenuData2_ItemsPointerAddr::
wcf96:: ds 1 ; addr lo wcf96:: ds 1 ; addr lo
wMenuData2PointerTableAddr:: wMenuData2PointerTableAddr::
wMenuData2_2DMenuFunctionBank:: wMenuData2_2DMenuFunctionBank::
wcf97:: ds 1 ; addr hi wcf97:: ds 1 ; addr hi
wMenuData2_2DMenuFunctionAddr:: wMenuData2_2DMenuFunctionAddr::
wMenuData2_ScrollingMenuFunction1::
wcf98:: ds 3 wcf98:: ds 3
wMenuData2_ScrollingMenuFunction2::
wcf9b:: ds 3 wcf9b:: ds 3
wMenuData2_ScrollingMenuFunction3::
wcf9e:: ds 3 wcf9e:: ds 3
wMenuData2End:: wMenuData2End::
wMenuData3:: wMenuData3::
@ -1941,7 +1946,7 @@ wd105:: ds 1
CurItem:: ; d106 CurItem:: ; d106
ds 1 ds 1
ItemCountBuffer:: ; d107 CurItemQuantity:: ; d107
wMartItemID:: wMartItemID::
wd107:: ds 1 wd107:: ds 1
@ -1981,7 +1986,7 @@ wItemAttributeParamBuffer:: ; d142
CurPartyLevel:: ; d143 CurPartyLevel:: ; d143
ds 1 ds 1
wd144:: ds 2 wScrollingMenuListSize:: ds 2
; used when following a map warp ; used when following a map warp
; d146 ; d146