This commit is contained in:
PikalaxALT 2015-12-15 18:59:49 -05:00
parent efe3462f9a
commit 77ef8404a1
65 changed files with 1512 additions and 1509 deletions

View File

@ -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
@ -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
@ -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
@ -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
@ -5545,7 +5545,7 @@ BattleMonEntrance: ; 3e40b
call SetPlayerTurn
call SpikesDamage
ld a, $2
ld [MenuSelection2], a
ld [wMenuCursorY], a
ret
; 3e459
@ -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
@ -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
@ -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
@ -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
@ -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
@ -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
@ -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
@ -5828,7 +5828,7 @@ endr
cp b
jp nz, .menu_loop
ld a, $1
ld [MenuSelection2], a
ld [wMenuCursorY], a
jp .menu_loop
; 3e643
@ -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]
@ -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
@ -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
@ -5912,7 +5912,7 @@ endr
ret
.start_swap
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
ld [wMoveSwapBuffer], a
jp MoveSelectionScreen
; 3e6c8
@ -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
@ -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
@ -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

View File

@ -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
@ -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

View File

@ -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
@ -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
@ -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)
@ -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
@ -448,7 +448,7 @@ endr
ret
.release: ; e26d8 (38:66d8)
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
push af
call Functione2f5f
jr c, .FailedRelease
@ -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
@ -481,7 +481,7 @@ endr
ld de, PCString_WhatsUp
call Functione2a6e
pop af
ld [MenuSelection2], a
ld [wMenuCursorY], a
ret
.cancel: ; e272b (38:672b)
@ -649,7 +649,7 @@ Functione283d: ; e283d
ld de, PCString_WhatsUp
call Functione2a6e
ld a, $1
ld [MenuSelection2], a
ld [wMenuCursorY], a
call Functione298d
ret
; e285d
@ -657,11 +657,11 @@ Functione283d: ; e283d
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
@ -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
@ -1791,7 +1791,7 @@ Functione2f95: ; e2f95 (38:6f95)
.asm_e2fd1
xor a
ld [wcf73], a
ld [wMenuJoypad], a
ret
Functione2fd6: ; e2fd6 (38:6fd6)
@ -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
@ -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

View File

@ -19,7 +19,7 @@ _KrisDecorationMenu: ; 0x2675c
ld [wMenuCursorBuffer], a
call .FindCategoriesWithOwnedDecos
call DoNthMenu
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
ld [wd1ef], a
jr c, .exit_menu
ld a, [MenuSelection]
@ -401,7 +401,7 @@ PopulateDecoCategoryMenu: ; 2695b
xor a
ld [wMenuScrollPosition], a
call HandleScrollingMenu
ld a, [wcf73]
ld a, [wMenuJoypad]
cp 2
jr z, .no_action_2
call DoDecorationAction2
@ -1009,7 +1009,7 @@ DecoAction_AskWhichSide: ; 26e70
call ExitMenu
call CopyMenuData2
jr c, .nope
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
cp 3
jr z, .nope
ld [Buffer2], a

View File

@ -416,7 +416,7 @@ Functione20e5: ; e20e5
; e2101
Functione2101: ; e2101
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
dec a
ld l, a
ld h, 0

View File

@ -33,9 +33,9 @@ InitGender: ; 48dcb (12:4dcb)
ld hl, .MenuDataHeader
call LoadMenuDataHeader
call WaitBGMap2
call InterpretMenu2
call VerticalMenu
call WriteBackup
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
dec a
ld [PlayerGender], a
ld c, 10

View File

@ -547,7 +547,7 @@ Continue_LoadMenuHeader: ; 5ebf
.pokedex_header
call Function1e35
call MenuBox
call Function1c89
call PlaceVerticalMenuItems
ret
; 5ed9
@ -783,7 +783,7 @@ OakText7: ; 0x606f
NamePlayer: ; 0x6074
callba MovePlayerPicRight
callba ShowPlayerNamingChoices
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
dec a
jr z, .NewName
call StorePlayerName
@ -828,8 +828,8 @@ NamePlayer: ; 0x6074
Function60e9: ; Unreferenced
call LoadMenuDataHeader
call InterpretMenu2
ld a, [MenuSelection2]
call VerticalMenu
ld a, [wMenuCursorY]
dec a
call CopyNameFromMenu
call WriteBackup

View File

@ -155,8 +155,8 @@ ForgetMove: ; 65d3
ld [wcfa3], a
ld a, $1
ld [wcfa4], a
ld [MenuSelection2], a
ld [wcfaa], a
ld [wMenuCursorY], a
ld [wMenuCursorX], a
ld a, $3
ld [wcfa8], a
ld a, $20
@ -165,7 +165,7 @@ ForgetMove: ; 65d3
ld [wcfa6], a
ld a, $20
ld [wcfa7], a
call Function1bc9
call StaticMenuJoypad
push af
call Call_LoadTempTileMapToTileMap
pop af
@ -173,7 +173,7 @@ ForgetMove: ; 65d3
bit 1, a
jr nz, .cancel
push hl
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
dec a
ld c, a
ld b, 0

View File

@ -1219,7 +1219,7 @@ rept 3
endr
ld [hl], a
ld a, $1
ld [MenuSelection2], a
ld [wMenuCursorY], a
inc a
ld [wPlayerLinkAction], a
jp Function2888b
@ -1239,7 +1239,7 @@ Function28803: ; 28803
ld a, $6
ld [wcfa2], a
ld a, $1
ld [wcfaa], a
ld [wMenuCursorX], a
ld a, $10
ld [wcfa7], a
ld a, $20
@ -1264,7 +1264,7 @@ Function28835: ; 28835
.asm_2885b
bit 6, a
jr z, .asm_28883
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
ld b, a
ld a, [OTPartyCount]
cp b
@ -1280,7 +1280,7 @@ Function28835: ; 28835
pop bc
pop hl
ld a, [PartyCount]
ld [MenuSelection2], a
ld [wMenuCursorY], a
jr Function2888b
.asm_28883
@ -1304,7 +1304,7 @@ Function2888b: ; 2888b
ld a, $6
ld [wcfa2], a
ld a, $1
ld [wcfaa], a
ld [wMenuCursorX], a
ld a, $10
ld [wcfa7], a
ld a, $20
@ -1328,7 +1328,7 @@ Function288c5: ; 288c5
.asm_288d9
bit 7, a
jr z, .asm_288fe
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
dec a
jp nz, Function2891c
ld a, $1
@ -1342,13 +1342,13 @@ Function288c5: ; 288c5
pop bc
pop hl
ld a, $1
ld [MenuSelection2], a
ld [wMenuCursorY], a
jp Function28803
.asm_288fe
bit 6, a
jr z, Function2891c
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
ld b, a
ld a, [PartyCount]
cp b
@ -1373,7 +1373,7 @@ Function2891c: ; 2891c
Function28926: ; 28926
call LoadTileMapToTempTileMap
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
push af
hlcoord 0, 15
ld b, $1
@ -1398,21 +1398,21 @@ Function28926: ; 28926
ld a, $1
ld [wcfa2], a
ld a, $1
ld [MenuSelection2], a
ld [wcfaa], a
ld [wMenuCursorY], a
ld [wMenuCursorX], a
ld a, $20
ld [wcfa7], a
xor a
ld [wcfa5], a
ld [wcfa6], a
call Function1bd3
call ScrollingMenuJoypad
bit 4, a
jr nz, .asm_2898d
bit 1, a
jr z, .asm_289cd
.asm_28983
pop af
ld [MenuSelection2], a
ld [wMenuCursorY], a
call Call_LoadTempTileMapToTileMap
jp Function2888b
@ -1430,14 +1430,14 @@ Function28926: ; 28926
ld a, $b
ld [wcfa2], a
ld a, $1
ld [MenuSelection2], a
ld [wcfaa], a
ld [wMenuCursorY], a
ld [wMenuCursorX], a
ld a, $20
ld [wcfa7], a
xor a
ld [wcfa5], a
ld [wcfa6], a
call Function1bd3
call ScrollingMenuJoypad
bit 5, a
jp nz, .asm_28946
bit 1, a
@ -1446,7 +1446,7 @@ Function28926: ; 28926
.asm_289cd
pop af
ld [MenuSelection2], a
ld [wMenuCursorY], a
ld a, $4
ld [wd263], a
callab Function50db9
@ -1465,7 +1465,7 @@ Function28926: ; 28926
.asm_289fe
call Function1bee
pop af
ld [MenuSelection2], a
ld [wMenuCursorY], a
dec a
ld [wd002], a
ld [wPlayerLinkAction], a
@ -1549,7 +1549,7 @@ UnknownText_0x28ac4: ; 0x28ac4
Function28ac9: ; 28ac9
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
cp $1
jp nz, Function2891c
call Function1bf7
@ -1579,12 +1579,12 @@ Function28ade: ; 28ade
bit 6, a
jr z, .asm_28b03
ld a, [OTPartyCount]
ld [MenuSelection2], a
ld [wMenuCursorY], a
jp Function28803
.asm_28b03
ld a, $1
ld [MenuSelection2], a
ld [wMenuCursorY], a
jp Function2888b
.asm_28b0b
@ -1715,17 +1715,17 @@ Function28b87: ; 28b87
ld a, $3
ld [wcfa8], a
ld a, $1
ld [MenuSelection2], a
ld [wcfaa], a
ld [wMenuCursorY], a
ld [wMenuCursorX], a
callba Function4d354
call Function1bd3
call ScrollingMenuJoypad
push af
call Call_ExitMenu
call WaitBGMap2
pop af
bit 1, a
jr nz, .asm_28c33
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
dec a
jr z, .asm_28c54

View File

@ -402,10 +402,10 @@ MailboxPC: ; 0x44806
call HandleScrollingMenu
ld a, [wMenuScrollPosition]
ld [OBPals + 8 * 6], a
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
ld [wCurMessageIndex], a
ld a, [wcf73]
ld a, [wMenuJoypad]
cp $2
jr z, .exit
call Function4484a
@ -419,10 +419,10 @@ MailboxPC: ; 0x44806
Function4484a: ; 0x4484a
ld hl, MenuData44964
call LoadMenuDataHeader
call InterpretMenu2
call VerticalMenu
call ExitMenu
jr c, .exit
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
dec a
ld hl, .JumpTable
rst JumpTable

View File

@ -202,7 +202,7 @@ Function49de4: ; 49de4
set 5, a
ld [wcfa5], a
call Function1f1a
ld a, [wcf73]
ld a, [wMenuJoypad]
cp $2
jr z, .asm_49e07
cp $1
@ -390,15 +390,15 @@ Function49f16: ; 49f16
call PlaceString
call WaitBGMap2
call SetPalettes
call Function1bc9
ld hl, MenuSelection2
call StaticMenuJoypad
ld hl, wMenuCursorY
ld b, [hl]
push bc
jr .asm_49f5d
.asm_49f55
call Function1bd3
ld hl, MenuSelection2
call ScrollingMenuJoypad
ld hl, wMenuCursorY
ld b, [hl]
push bc
@ -410,7 +410,7 @@ Function49f16: ; 49f16
jr .asm_49f97
.asm_49f67
ld hl, MenuSelection2
ld hl, wMenuCursorY
ld a, [hl]
cp $1
jp z, Function4a098
@ -421,7 +421,7 @@ Function49f16: ; 49f16
cp $4
jp z, Function4a100
ld a, $1
call Function1ff8
call MenuClickSound
.asm_49f84
pop bc
@ -434,7 +434,7 @@ Function49f16: ; 49f16
ret
.asm_49f97
ld hl, MenuSelection2
ld hl, wMenuCursorY
ld a, [hl]
dec a
ld hl, MobileStrings2
@ -452,7 +452,7 @@ Function49f16: ; 49f16
.asm_49fb7
call Function4a071
pop bc
ld hl, MenuSelection2
ld hl, wMenuCursorY
ld [hl], b
ld b, $a
ld c, $1
@ -529,7 +529,7 @@ endr
Function4a098: ; 4a098 (12:6098)
ld a, $2
call Function1ff8
call MenuClickSound
call Function1bee
call WaitBGMap
call LoadStandardMenuDataHeader
@ -542,13 +542,13 @@ Function4a098: ; 4a098 (12:6098)
Function4a0b9: ; 4a0b9 (12:60b9)
ld a, $2
call Function1ff8
call MenuClickSound
pop bc
jp Function4a4c4
Function4a0c2: ; 4a0c2 (12:60c2)
ld a, $2
call Function1ff8
call MenuClickSound
ld a, BANK(sPlayerData)
call GetSRAMBank
ld hl, sPlayerData + PlayerName - wPlayerData
@ -574,7 +574,7 @@ Function4a0c2: ; 4a0c2 (12:60c2)
Function4a100: ; 4a100 (12:6100)
ld a, $2
call Function1ff8
call MenuClickSound
call ClearBGPalettes
call Function4a13b
call ClearBGPalettes
@ -630,7 +630,7 @@ Function4a149: ; 4a149 (12:6149)
ld b, $4
ld c, $12
call TextBox
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
dec a
ld hl, Strings_4a23d
call GetNthString
@ -644,15 +644,15 @@ Function4a149: ; 4a149 (12:6149)
call PlaceString
callba Function104148
call SetPalettes
call Function1bc9
ld hl, MenuSelection2
call StaticMenuJoypad
ld hl, wMenuCursorY
ld b, [hl]
push bc
jr asm_4a19d
Function4a195: ; 4a195 (12:6195)
call Function1bd3
ld hl, MenuSelection2
call ScrollingMenuJoypad
ld hl, wMenuCursorY
ld b, [hl]
push bc
@ -663,19 +663,19 @@ asm_4a19d: ; 4a19d (12:619d)
jr nz, .asm_4a1ba
jr .asm_4a1bc
.asm_4a1a7
ld hl, MenuSelection2
ld hl, wMenuCursorY
ld a, [hl]
cp $1
jp z, Function4a20e
cp $2
jp z, Function4a221
ld a, $1
call Function1ff8
call MenuClickSound
.asm_4a1ba
pop bc
ret
.asm_4a1bc
ld hl, MenuSelection2
ld hl, wMenuCursorY
ld a, [hl]
dec a
ld hl, Strings_4a23d
@ -692,7 +692,7 @@ asm_4a19d: ; 4a19d (12:619d)
.asm_4a1db
call Function4a373
pop bc
ld hl, MenuSelection2
ld hl, wMenuCursorY
ld [hl], b
lb bc, 6, 1
hlcoord 2, 3
@ -708,7 +708,7 @@ String_4a1ef: ; 4a1ef
Function4a20e: ; 4a20e (12:620e)
ld a, $1
call Function1ff8
call MenuClickSound
callba Function1719c8
call ClearBGPalettes
call DelayFrame
@ -716,12 +716,12 @@ Function4a20e: ; 4a20e (12:620e)
Function4a221: ; 4a221 (12:6221)
ld a, $1
call Function1ff8
call MenuClickSound
call Function4a28a
jr c, Function4a239
call Function4a373
ld a, $2
ld [MenuSelection2], a
ld [wMenuCursorY], a
jr .asm_4a235
.asm_4a235
pop bc
@ -767,13 +767,13 @@ Function4a28a: ; 4a28a (12:628a)
call PlaceString
callba Function104148
call Function4a118
call Function1bd3
call ScrollingMenuJoypad
push af
call PlayClickSFX
pop af
bit 1, a
jr nz, .asm_4a33b
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
cp $2
jr z, .asm_4a2f0
cp $3
@ -796,10 +796,10 @@ Function4a28a: ; 4a28a (12:628a)
callba Function104148
ld hl, MenuDataHeader_0x4a362
call LoadMenuDataHeader
call InterpretMenu2
call VerticalMenu
bit 1, a
jr nz, .asm_4a338
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
cp $2
jr z, .asm_4a338
ld a, $5
@ -1073,15 +1073,15 @@ Function4a4c4: ; 4a4c4 (12:64c4)
call PlaceString
call WaitBGMap2
call SetPalettes
call Function1bc9
ld hl, MenuSelection2
call StaticMenuJoypad
ld hl, wMenuCursorY
ld b, [hl]
push bc
jr asm_4a54d
Function4a545: ; 4a545 (12:6545)
call Function1bd3
ld hl, MenuSelection2
call ScrollingMenuJoypad
ld hl, wMenuCursorY
ld b, [hl]
push bc
@ -1092,7 +1092,7 @@ asm_4a54d: ; 4a54d (12:654d)
jr nz, .asm_4a574
jr .asm_4a57e
.asm_4a557
ld hl, MenuSelection2
ld hl, wMenuCursorY
ld a, [hl]
cp $1
jp z, Function4a6ab
@ -1103,14 +1103,14 @@ asm_4a54d: ; 4a54d (12:654d)
cp $4
jp z, Function4a6ab
ld a, $1
call Function1ff8
call MenuClickSound
.asm_4a574
pop bc
call ClearBGPalettes
call ClearTileMap
jp Function49f0a
.asm_4a57e
ld hl, MenuSelection2
ld hl, wMenuCursorY
ld a, [hl]
dec a
add a
@ -1138,7 +1138,7 @@ asm_4a54d: ; 4a54d (12:654d)
Function4a5b0: ; 4a5b0 (12:65b0)
call Function4a680
pop bc
ld hl, MenuSelection2
ld hl, wMenuCursorY
ld [hl], b
ld b, $a
ld c, $1
@ -1206,7 +1206,7 @@ endr
Function4a6ab: ; 4a6ab (12:66ab)
ld a, $2
call Function1ff8
call MenuClickSound
call ClearBGPalettes
ld b, SCGB_08
call GetSGBLayout

View File

@ -185,9 +185,9 @@ StandardMart: ; 15b47
.TopMenu: ; 15b6e
ld hl, MenuDataHeader_BuySell
call CopyMenuDataHeader
call InterpretMenu2
call VerticalMenu
jr c, .quit
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
cp $1
jr z, .buy
cp $2
@ -481,10 +481,10 @@ BuyMenuLoop: ; 15cef
call HandleScrollingMenu
ld a, [wMenuScrollPosition]
ld [wd045 + 1], a
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
ld [wd045], a
call SpeechTextBox
ld a, [wcf73]
ld a, [wMenuJoypad]
cp B_BUTTON
jr z, .set_carry
cp A_BUTTON

File diff suppressed because it is too large Load Diff

View File

@ -363,7 +363,7 @@ GetGFXUnlessMobile: ; 8ea3f
FreezeMonIcons: ; 8ea4a
ld hl, wSpriteAnimationStructs
ld e, PARTY_LENGTH
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
ld d, a
.loop
ld a, [hl]

View File

@ -85,10 +85,10 @@ MonMenuLoop: ; 24d59
ld [wMenuData2Flags], a
ld a, [Buffer1] ; items
ld [wMenuData2Items], a
call Function1c10
call InitVerticalMenuCursor
ld hl, wcfa5
set 6, [hl]
call Function1bc9
call StaticMenuJoypad
ld de, SFX_READ_TEXT_2
call PlaySFX
ld a, [hJoyPressed]
@ -103,7 +103,7 @@ MonMenuLoop: ; 24d59
ret
.select
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
dec a
ld c, a
ld b, 0
@ -301,16 +301,16 @@ BattleMonMenu: ; 24e99
ld [hBGMapMode], a
call MenuBox
call UpdateSprites
call Function1c89
call PlaceVerticalMenuItems
call WaitBGMap
call CopyMenuData2
ld a, [wMenuData2Flags]
bit 7, a
jr z, .set_carry
call Function1c10
call InitVerticalMenuCursor
ld hl, wcfa5
set 6, [hl]
call Function1bc9
call StaticMenuJoypad
ld de, SFX_READ_TEXT_2
call PlaySFX
ld a, [hJoyPressed]

View File

@ -72,7 +72,7 @@ Pack: ; 10000
call HandleScrollingMenu
ld a, [wMenuScrollPosition]
ld [wItemsPocketScrollPosition], a
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
ld [wItemsPocketCursor], a
ld b, $7
ld c, $3
@ -100,7 +100,7 @@ Pack: ; 10000
call HandleScrollingMenu
ld a, [wMenuScrollPosition]
ld [wKeyItemsPocketScrollPosition], a
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
ld [wKeyItemsPocketCursor], a
ld b, $3
ld c, $7
@ -140,11 +140,11 @@ Pack: ; 10000
.load_jump
push de
call LoadMenuDataHeader
call InterpretMenu2
call VerticalMenu
call ExitMenu
pop hl
ret c
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
dec a
call Pack_GetJumptablePointer
jp [hl]
@ -233,7 +233,7 @@ Pack: ; 10000
call HandleScrollingMenu
ld a, [wMenuScrollPosition]
ld [wBallsPocketScrollPosition], a
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
ld [wBallsPocketCursor], a
ld b, $1
ld c, $5
@ -302,11 +302,11 @@ Pack: ; 10000
.build_menu
push de
call LoadMenuDataHeader
call InterpretMenu2
call VerticalMenu
call ExitMenu
pop hl
ret c
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
dec a
call Pack_GetJumptablePointer
jp [hl]
@ -737,7 +737,7 @@ BattlePack: ; 10493
call HandleScrollingMenu
ld a, [wMenuScrollPosition]
ld [wItemsPocketScrollPosition], a
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
ld [wItemsPocketCursor], a
ld b, $7
ld c, $3
@ -765,7 +765,7 @@ BattlePack: ; 10493
call HandleScrollingMenu
ld a, [wMenuScrollPosition]
ld [wKeyItemsPocketScrollPosition], a
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
ld [wKeyItemsPocketCursor], a
ld b, $3
ld c, $7
@ -816,7 +816,7 @@ BattlePack: ; 10493
call HandleScrollingMenu
ld a, [wMenuScrollPosition]
ld [wBallsPocketScrollPosition], a
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
ld [wBallsPocketCursor], a
ld b, $1
ld c, $5
@ -841,11 +841,11 @@ TMHMSubmenu: ; 105dc (4:45dc)
.proceed
push de
call LoadMenuDataHeader
call InterpretMenu2
call VerticalMenu
call ExitMenu
pop hl
ret c
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
dec a
call Pack_GetJumptablePointer
jp [hl]
@ -1021,7 +1021,7 @@ DepositSellPack: ; 106be
call HandleScrollingMenu
ld a, [wMenuScrollPosition]
ld [wItemsPocketScrollPosition], a
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
ld [wItemsPocketCursor], a
ret
@ -1037,7 +1037,7 @@ DepositSellPack: ; 106be
call HandleScrollingMenu
ld a, [wMenuScrollPosition]
ld [wKeyItemsPocketScrollPosition], a
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
ld [wKeyItemsPocketCursor], a
ret
@ -1062,7 +1062,7 @@ DepositSellPack: ; 106be
call HandleScrollingMenu
ld a, [wMenuScrollPosition]
ld [wBallsPocketScrollPosition], a
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
ld [wBallsPocketCursor], a
ret

View File

@ -696,7 +696,7 @@ InitPartyMenuWithCancel: ; 50405
ld a, $1
.done
ld [MenuSelection2], a
ld [wMenuCursorY], a
ld a, A_BUTTON | B_BUTTON
ld [wcfa8], a
ret
@ -718,7 +718,7 @@ InitPartyMenuNoCancel: ; 0x5042d
.skip
ld a, $1
.done
ld [MenuSelection2], a
ld [wMenuCursorY], a
ld a, A_BUTTON | B_BUTTON
ld [wcfa8], a
ret
@ -738,12 +738,12 @@ PartyMenuAttributes: ; 5044f
PartyMenuSelect: ; 0x50457
; sets carry if exitted menu.
call Function1bc9
call StaticMenuJoypad
call Function1bee
ld a, [PartyCount]
inc a
ld b, a
ld a, [MenuSelection2] ; menu selection?
ld a, [wMenuCursorY] ; menu selection?
cp b
jr z, .exitmenu ; CANCEL
ld [wPartyMenuCursor], a
@ -751,7 +751,7 @@ PartyMenuSelect: ; 0x50457
ld b, a
bit 1, b
jr nz, .exitmenu ; B button?
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
dec a
ld [CurPartyMon], a
ld c, a

View File

@ -594,14 +594,14 @@ Function15985: ; 0x15985
call HandleScrollingMenu
ld a, [wMenuScrollPosition]
ld [wd0dd], a
ld a, [MenuSelection2]
ld a, [wMenuCursorY]
ld [wd0d7], a
pop af
ld [wSpriteUpdatesEnabled], a
ld a, [wd0e3]
and a
jr nz, .asm_159d8
ld a, [wcf73]
ld a, [wMenuJoypad]
cp $2
jr z, .asm_15a06
cp $1
@ -611,7 +611,7 @@ Function15985: ; 0x15985
jr .asm_159f8
.asm_159d8
ld a, [wcf73]
ld a, [wMenuJoypad]
cp $2
jr z, .asm_159e9
cp $1

View File

@ -20,7 +20,7 @@ Function84022: ; 84022
ld a, [wJumptableIndex]
ld e, a
ld d, 0
ld hl, Jumptable_84031
ld hl, .Jumptable
rept 2
add hl, de
endr
@ -31,27 +31,28 @@ endr
; 84031
Jumptable_84031: ; 84031 (21:4031)
dw Function84077
dw Function84143
dw Function84120
dw Function84099
dw Function84180
dw Function8412e
dw Function840c5
dw Function84180
dw Function84120
dw Function840de
dw Function84180
dw Function84120
dw Function841a1
dw Function84063
dw Function8406d
dw Function84120
dw Function84103
dw Function84071
dw Function841b0
dw Function841b3
.Jumptable: ; 84031 (21:4031)
jumptable_start
jumptable Function84077
jumptable Function84143
jumptable Function84120
jumptable Function84099
jumptable Function84180
jumptable Function8412e
jumptable Function840c5
jumptable Function84180
jumptable Function84120
jumptable Function840de
jumptable Function84180
jumptable Function84120
jumptable Function841a1
jumptable Function84063
jumptable Function8406d
jumptable Function84120
jumptable Function84103
jumptable Function84071
jumptable Function841b0
jumptable Function841b3
Function84059: ; 84059 (21:4059)
@ -427,12 +428,12 @@ Unknown_842d5: db 15, 0, $00, 0, 15, 0 ; unused
; 842db
Function842db:: ; 842db
_PrinterReceive:: ; 842db
ld a, [wc2d5]
add a
ld e, a
ld d, 0
ld hl, Jumptable_842ea
ld hl, .Jumptable
add hl, de
ld a, [hli]
ld h, [hl]
@ -441,39 +442,40 @@ Function842db:: ; 842db
; 842ea
Jumptable_842ea: ; 842ea (21:42ea)
dw Function8432f
dw Function84330
dw Function84339
dw Function84343
dw Function8434d
dw Function84357
dw Function84361
dw Function8438b
dw Function84395
dw Function8439f
dw Function843a8
dw Function843b6
dw Function84330
dw Function843c0
dw Function843c9
dw Function843c9
dw Function843c9
dw Function843c0
dw Function843c9
dw Function8439f
dw Function843a8
dw Function843e6
dw Function84330
dw Function843d2
dw Function843c9
dw Function843c9
dw Function843c9
dw Function843d2
dw Function843c9
dw Function8439f
dw Function843a8
dw Function843b6
.Jumptable: ; 842ea (21:42ea)
jumptable_start
jumptable Function8432f
jumptable Function84330
jumptable Function84339
jumptable Function84343
jumptable Function8434d
jumptable Function84357
jumptable Function84361
jumptable Function8438b
jumptable Function84395
jumptable Function8439f
jumptable Function843a8
jumptable Function843b6
jumptable Function84330
jumptable Function843c0
jumptable Function843c9
jumptable Function843c9
jumptable Function843c9
jumptable Function843c0
jumptable Function843c9
jumptable Function8439f
jumptable Function843a8
jumptable Function843e6
jumptable Function84330
jumptable Function843d2
jumptable Function843c9
jumptable Function843c9
jumptable Function843c9
jumptable Function843d2
jumptable Function843c9
jumptable Function8439f
jumptable Function843a8
jumptable Function843b6
Function8432a: ; 8432a (21:432a)

210
engine/rtc.asm Executable file
View File

@ -0,0 +1,210 @@
StopRTC: ; Unreferenced???
ld a, SRAM_ENABLE
ld [MBC3SRamEnable], a
call LatchClock
ld a, RTC_DH
ld [MBC3SRamBank], a
ld a, [MBC3RTC]
set 6, a ; halt
ld [MBC3RTC], a
call CloseSRAM
ret
; 14019
StartRTC: ; 14019
ld a, SRAM_ENABLE
ld [MBC3SRamEnable], a
call LatchClock
ld a, RTC_DH
ld [MBC3SRamBank], a
ld a, [MBC3RTC]
res 6, a ; halt
ld [MBC3RTC], a
call CloseSRAM
ret
; 14032
GetTimeOfDay:: ; 14032
; get time of day based on the current hour
ld a, [hHours] ; hour
ld hl, TimesOfDay
.check
; if we're within the given time period,
; get the corresponding time of day
cp [hl]
jr c, .match
; else, get the next entry
rept 2
inc hl
endr
; try again
jr .check
.match
; get time of day
inc hl
ld a, [hl]
ld [TimeOfDay], a
ret
; 14044
TimesOfDay: ; 14044
; hours for the time of day
; 04-09 morn | 10-17 day | 18-03 nite
db 04, NITE
db 10, MORN
db 18, DAY
db 24, NITE
db -1, MORN
; 1404e
Unknown_1404e: ; Unreferenced
db 20, 2
db 40, 0
db 60, 1
db -1, 0
; 14056
StageRTCTimeForSave: ; 14056
call UpdateTime
ld hl, wRTC
ld a, [CurDay]
ld [hli], a
ld a, [hHours]
ld [hli], a
ld a, [hMinutes]
ld [hli], a
ld a, [hSeconds]
ld [hli], a
ret
; 1406a
SaveRTC: ; 1406a
ld a, $a
ld [MBC3SRamEnable], a
call LatchClock
ld hl, MBC3RTC
ld a, $c
ld [MBC3SRamBank], a
res 7, [hl]
ld a, BANK(sRTCStatusFlags)
ld [MBC3SRamBank], a
xor a
ld [sRTCStatusFlags], a
call CloseSRAM
ret
; 14089
StartClock:: ; 14089
call GetClock
call Function1409b
call FixDays
jr nc, .skip_set
; bit 5: Day count exceeds 139
; bit 6: Day count exceeds 255
call RecordRTCStatus ; set flag on sRTCStatusFlags
.skip_set
call StartRTC
ret
; 1409b
Function1409b: ; 1409b
ld hl, hRTCDayHi
bit 7, [hl]
jr nz, .set_bit_7
bit 6, [hl]
jr nz, .set_bit_7
xor a
ret
.set_bit_7
; Day count exceeds 16383
ld a, %10000000
call RecordRTCStatus ; set bit 7 on sRTCStatusFlags
ret
; 140ae
Function140ae: ; 140ae
call CheckRTCStatus
ld c, a
and %11000000 ; Day count exceeded 255 or 16383
jr nz, .time_overflow
ld a, c
and %00100000 ; Day count exceeded 139
jr z, .dont_update
call UpdateTime
ld a, [wRTC + 0]
ld b, a
ld a, [CurDay]
cp b
jr c, .dont_update
.time_overflow
callba ClearDailyTimers
callba Function170923
; mobile
ld a, $5
call GetSRAMBank
ld a, [$aa8c]
inc a
ld [$aa8c], a
ld a, [$b2fa]
inc a
ld [$b2fa], a
call CloseSRAM
ret
.dont_update
xor a
ret
; 140ed
Function140ed:: ; 140ed
call GetClock
call FixDays
ld hl, hRTCSeconds
ld de, StartSecond
ld a, [StringBuffer2 + 3]
sub [hl]
dec hl
jr nc, .okay_secs
add 60
.okay_secs
ld [de], a
dec de
ld a, [StringBuffer2 + 2]
sbc [hl]
dec hl
jr nc, .okay_mins
add 60
.okay_mins
ld [de], a
dec de
ld a, [StringBuffer2 + 1]
sbc [hl]
dec hl
jr nc, .okay_hrs
add 24
.okay_hrs
ld [de], a
dec de
ld a, [StringBuffer2]
sbc [hl]
dec hl
jr nc, .okay_days
add 140
ld c, 7
call SimpleDivide
.okay_days
ld [de], a
ret
; 1412a

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