Skip to content

Commit

Permalink
Menu
Browse files Browse the repository at this point in the history
  • Loading branch information
PikalaxALT committed Dec 15, 2015
1 parent efe3462 commit 77ef840
Show file tree
Hide file tree
Showing 65 changed files with 1,512 additions and 1,509 deletions.
52 changes: 26 additions & 26 deletions battle/core.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2871,13 +2871,13 @@ AskUseNextPokemon: ; 3d1f8
.loop
lb bc, 1, 7
call PlaceYesNoBox
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
jr c, .pressed_b
and a
ret

.pressed_b
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
cp $1 ; YES
jr z, .loop
ld hl, PartyMon1Speed
Expand Down Expand Up @@ -3698,7 +3698,7 @@ OfferSwitch: ; 3d74b
call StdBattleTextBox
lb bc, 1, 7
call PlaceYesNoBox
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
dec a
jr nz, .said_no
call Function3d2f7
Expand Down Expand Up @@ -5303,7 +5303,7 @@ BattleMenu_Pack: ; 3e1c7
.tutorial2
call GetMonFrontpic
ld a, $1
ld [MenuSelection2], a
ld [wMenuCursorY], a
call ExitMenu
call UpdateBattleHUDs
call WaitBGMap
Expand Down Expand Up @@ -5343,7 +5343,7 @@ BattleMenuPKMN_Loop:
call .GetMenu
jr c, .PressedB
call Function1bee
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
cp $1 ; SWITCH
jp z, TryPlayerSwitch
cp $2 ; STATS
Expand Down Expand Up @@ -5545,7 +5545,7 @@ BattleMonEntrance: ; 3e40b
call SetPlayerTurn
call SpikesDamage
ld a, $2
ld [MenuSelection2], a
ld [wMenuCursorY], a
ret
; 3e459

Expand Down Expand Up @@ -5575,7 +5575,7 @@ PassedBattleMonEntrance: ; 3e459
BattleMenu_Run: ; 3e489
call Call_LoadTempTileMapToTileMap
ld a, $3
ld [MenuSelection2], a
ld [wMenuCursorY], a
ld hl, BattleMonSpeed
ld de, EnemyMonSpeed
call TryToRunAwayFromBattle
Expand Down Expand Up @@ -5671,9 +5671,9 @@ MoveSelectionScreen: ; 3e4bc
inc a

.skip_inc
ld [MenuSelection2], a
ld [wMenuCursorY], a
ld a, $1
ld [wcfaa], a
ld [wMenuCursorX], a
ld a, [wNumMoves]
inc a
ld [wcfa3], a
Expand Down Expand Up @@ -5726,7 +5726,7 @@ MoveSelectionScreen: ; 3e4bc
.interpret_joypad
ld a, $1
ld [hBGMapMode], a
call Function1bd3
call ScrollingMenuJoypad
bit D_UP_F, a
jp nz, .pressed_up
bit D_DOWN_F, a
Expand All @@ -5738,9 +5738,9 @@ MoveSelectionScreen: ; 3e4bc

xor a
ld [wMoveSwapBuffer], a
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
dec a
ld [MenuSelection2], a
ld [wMenuCursorY], a
ld b, a
ld a, [wMoveSelectionMenuType]
dec a
Expand All @@ -5763,7 +5763,7 @@ MoveSelectionScreen: ; 3e4bc
ret nz

ld hl, BattleMonPP
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
ld c, a
ld b, 0
add hl, bc
Expand All @@ -5779,7 +5779,7 @@ MoveSelectionScreen: ; 3e4bc
ld a, [wc6e1]
and a
jr nz, .skip2
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
ld hl, BattleMonMoves
ld c, a
ld b, 0
Expand Down Expand Up @@ -5809,17 +5809,17 @@ MoveSelectionScreen: ; 3e4bc
; 3e61d

.pressed_up
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
and a
jp nz, .menu_loop
ld a, [wNumMoves]
inc a
ld [MenuSelection2], a
ld [wMenuCursorY], a
jp .menu_loop
; 3e62e

.pressed_down ; 3e62e
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
ld b, a
ld a, [wNumMoves]
rept 2
Expand All @@ -5828,7 +5828,7 @@ endr
cp b
jp nz, .menu_loop
ld a, $1
ld [MenuSelection2], a
ld [wMenuCursorY], a
jp .menu_loop
; 3e643

Expand All @@ -5845,7 +5845,7 @@ endr
swap a
and $f
ld b, a
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
cp b
jr nz, .not_swapping_disabled_move
ld a, [hl]
Expand All @@ -5864,7 +5864,7 @@ endr
ld a, [hl]
and $f
ld b, a
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
swap a
add b
ld [hl], a
Expand Down Expand Up @@ -5899,7 +5899,7 @@ endr
ld d, h
ld e, l
pop hl
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
dec a
ld c, a
ld b, 0
Expand All @@ -5912,7 +5912,7 @@ endr
ret

.start_swap
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
ld [wMoveSwapBuffer], a
jp MoveSelectionScreen
; 3e6c8
Expand All @@ -5934,7 +5934,7 @@ MoveInfoBox: ; 3e6c8
swap a
and $f
ld b, a
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
cp b
jr nz, .not_disabled

Expand All @@ -5944,11 +5944,11 @@ MoveInfoBox: ; 3e6c8
jr .done

.not_disabled
ld hl, MenuSelection2
ld hl, wMenuCursorY
dec [hl]
call SetPlayerTurn
ld hl, BattleMonMoves
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
ld c, a
ld b, 0
add hl, bc
Expand All @@ -5961,7 +5961,7 @@ MoveInfoBox: ; 3e6c8
ld [MonType], a
callab GetMaxPPOfMove

ld hl, MenuSelection2
ld hl, wMenuCursorY
ld c, [hl]
inc [hl]
ld b, 0
Expand Down
4 changes: 2 additions & 2 deletions battle/menu.asm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ LoadBattleMenu: ; 24ef2
call LoadMenuDataHeader
ld a, [wd0d2]
ld [wMenuCursorBuffer], a
call Function2039
call InterpretBattleMenu
ld a, [wMenuCursorBuffer]
ld [wd0d2], a
call ExitMenu
Expand All @@ -25,7 +25,7 @@ ContestBattleMenu: ; 24f13
Function24f19: ; 24f19
ld a, [wd0d2]
ld [wMenuCursorBuffer], a
call InterpretMenu
call _2DMenu
ld a, [wMenuCursorBuffer]
ld [wd0d2], a
call ExitMenu
Expand Down
48 changes: 24 additions & 24 deletions engine/billspc.asm
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,18 @@ Functione245d: ; e245d (38:645d)
ld de, PCString_WhatsUp
call Functione2a6e
ld a, $1
ld [MenuSelection2], a
ld [wMenuCursorY], a
call Functione298d
ret

Functione247d: ; e247d (38:647d)
ld hl, BillsPCDepositMenuDataHeader
call CopyMenuDataHeader
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
call Function1d4b
call InterpretMenu2
call VerticalMenu
jp c, BillsPCDepositFuncCancel
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
dec a
and $3
ld e, a
Expand Down Expand Up @@ -187,14 +187,14 @@ BillsPCDepositFuncRelease: ; e24e0 (38:64e0)
jr c, BillsPCDepositFuncCancel
call Functione2f5f
jr c, BillsPCDepositFuncCancel
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
push af
ld de, PCString_ReleasePKMN
call Functione2a6e
call LoadStandardMenuDataHeader
lb bc, 14, 11
call PlaceYesNoBox
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
dec a
call ExitMenu
and a
Expand All @@ -218,7 +218,7 @@ BillsPCDepositFuncRelease: ; e24e0 (38:64e0)
ld de, PCString_WhatsUp
call Functione2a6e
pop af
ld [MenuSelection2], a
ld [wMenuCursorY], a
ret

BillsPCDepositFuncCancel: ; e2537 (38:6537)
Expand Down Expand Up @@ -388,18 +388,18 @@ Functione2655: ; e2655 (38:6655)
ld de, PCString_WhatsUp
call Functione2a6e
ld a, $1
ld [MenuSelection2], a
ld [wMenuCursorY], a
call Functione298d
ret

BillsPC_Withdraw: ; e2675 (38:6675)
ld hl, .MenuDataHeader
call CopyMenuDataHeader
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
call Function1d4b
call InterpretMenu2
call VerticalMenu
jp c, .cancel
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
dec a
and 3
ld e, a
Expand Down Expand Up @@ -448,7 +448,7 @@ endr
ret

.release: ; e26d8 (38:66d8)
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
push af
call Functione2f5f
jr c, .FailedRelease
Expand All @@ -457,7 +457,7 @@ endr
call LoadStandardMenuDataHeader
lb bc, 14, 11
call PlaceYesNoBox
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
dec a
call ExitMenu
and a
Expand All @@ -481,7 +481,7 @@ endr
ld de, PCString_WhatsUp
call Functione2a6e
pop af
ld [MenuSelection2], a
ld [wMenuCursorY], a
ret

.cancel: ; e272b (38:672b)
Expand Down Expand Up @@ -649,19 +649,19 @@ Functione283d: ; e283d
ld de, PCString_WhatsUp
call Functione2a6e
ld a, $1
ld [MenuSelection2], a
ld [wMenuCursorY], a
call Functione298d
ret
; e285d

Functione285d: ; e285d
ld hl, MenuDataHeader_0xe28c3
call CopyMenuDataHeader
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
call Function1d4b
call InterpretMenu2
call VerticalMenu
jp c, Functione28bd
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
dec a
and 3
ld e, a
Expand Down Expand Up @@ -1764,11 +1764,11 @@ Functione2f95: ; e2f95 (38:6f95)
ld hl, hJoyPressed ; $ffa7
ld a, [hl]
and A_BUTTON | B_BUTTON | D_RIGHT | D_LEFT
ld [wcf73], a
ld [wMenuJoypad], a
jr nz, .pressed_a_b_right_left
ld a, [hl]
and D_DOWN | D_UP
ld [wcf73], a
ld [wMenuJoypad], a
jr nz, .pressed_down_up
jr .pressed_a_b_right_left

Expand All @@ -1791,7 +1791,7 @@ Functione2f95: ; e2f95 (38:6f95)

.asm_e2fd1
xor a
ld [wcf73], a
ld [wMenuJoypad], a
ret

Functione2fd6: ; e2fd6 (38:6fd6)
Expand Down Expand Up @@ -2367,7 +2367,7 @@ _ChangeBox: ; e35aa (38:75aa)
lb bc, 8, 9
call TextBox
call HandleScrollingMenu
ld a, [wcf73]
ld a, [wMenuJoypad]
cp $2
jr z, .done
call Functione37af
Expand Down Expand Up @@ -2549,10 +2549,10 @@ String_e36f1: ; e36f1
Functione36f9: ; e36f9 (38:76f9)
ld hl, .MenuDataHeader
call LoadMenuDataHeader
call InterpretMenu2
call VerticalMenu
call ExitMenu
ret c
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
cp $1
jr z, .Switch
cp $2
Expand Down
Loading

0 comments on commit 77ef840

Please sign in to comment.