mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-10-16 04:04:19 +13:00
Rename GetJoypadState -> Joypad.
This commit is contained in:
parent
031e33957d
commit
bba8405992
|
@ -540,7 +540,7 @@ TradeCenter_SelectMon:
|
|||
ld a, $ed
|
||||
ld [$c4e1], a
|
||||
.asm_574a
|
||||
call GetJoypadStateLowSensitivity
|
||||
call JoypadLowSensitivity
|
||||
ld a, [$ffb5]
|
||||
and a
|
||||
jr z, .asm_574a ; 0x5750 $f8
|
||||
|
|
|
@ -141,7 +141,7 @@ Func_7bed6: ; 7bed6 (1e:7ed6)
|
|||
asm_7befa: ; 7befa (1e:7efa)
|
||||
call DelayFrame
|
||||
push bc
|
||||
call GetJoypadStateLowSensitivity
|
||||
call JoypadLowSensitivity
|
||||
ld a, [$ffb5]
|
||||
pop bc
|
||||
and $2
|
||||
|
|
|
@ -100,7 +100,7 @@ MainMenu: ; 5af2 (1:5af2)
|
|||
ld [hJoyPressed],a
|
||||
ld [hJoyReleased],a
|
||||
ld [hJoyHeld],a
|
||||
call GetJoypadState
|
||||
call Joypad
|
||||
ld a,[hJoyHeld]
|
||||
bit 0,a
|
||||
jr nz,.next5
|
||||
|
@ -483,7 +483,7 @@ DisplayOptionMenu: ; 5e8a (1:5e8a)
|
|||
call PlaceMenuCursor
|
||||
call SetOptionsFromCursorPositions
|
||||
.getJoypadStateLoop
|
||||
call GetJoypadStateLowSensitivity
|
||||
call JoypadLowSensitivity
|
||||
ld a,[$ffb5]
|
||||
ld b,a
|
||||
and a,%11111011 ; any key besides select pressed?
|
||||
|
|
|
@ -133,7 +133,7 @@ DisplayNamingScreen: ; 6596 (1:6596)
|
|||
callba AnimatePartyMon_ForceSpeed1
|
||||
pop af
|
||||
ld [wCurrentMenuItem], a ; $cc26
|
||||
call GetJoypadStateLowSensitivity
|
||||
call JoypadLowSensitivity
|
||||
ld a, [hJoyPressed]
|
||||
and a
|
||||
jr z, .asm_65ff
|
||||
|
|
|
@ -584,7 +584,7 @@ ShowPokedexDataInternal: ; 402e2 (10:42e2)
|
|||
xor a
|
||||
ld [$fff4],a
|
||||
.waitForButtonPress
|
||||
call GetJoypadStateLowSensitivity
|
||||
call JoypadLowSensitivity
|
||||
ld a,[$ffb5]
|
||||
and a,%00000011 ; A button and B button
|
||||
jr z,.waitForButtonPress
|
||||
|
|
|
@ -80,7 +80,7 @@ RedisplayStartMenu:: ; 2adf (0:2adf)
|
|||
|
||||
; EXIT falls through to here
|
||||
CloseStartMenu:: ; 2b70 (0:2b70)
|
||||
call GetJoypadState
|
||||
call Joypad
|
||||
ld a,[hJoyPressed]
|
||||
bit 0,a ; was A button newly pressed?
|
||||
jr nz,CloseStartMenu
|
||||
|
|
|
@ -799,7 +799,7 @@ SlotMachine_3784e: ; 3784e (d:784e)
|
|||
|
||||
SlotMachine_37882: ; 37882 (d:7882)
|
||||
call DelayFrame
|
||||
call GetJoypadStateLowSensitivity
|
||||
call JoypadLowSensitivity
|
||||
ld a, [$ffb5]
|
||||
and $1
|
||||
ret z
|
||||
|
|
|
@ -67,7 +67,7 @@ Func_70e92: ; 70e92 (1c:4e92)
|
|||
call CopyData
|
||||
.asm_70ec8
|
||||
call Func_716c6
|
||||
call GetJoypadStateLowSensitivity
|
||||
call JoypadLowSensitivity
|
||||
ld a, [$ffb5]
|
||||
ld b, a
|
||||
and $c3
|
||||
|
@ -195,7 +195,7 @@ LoadTownMap_Fly: ; 70f90 (1c:4f90)
|
|||
.asm_71004
|
||||
push hl
|
||||
call DelayFrame
|
||||
call GetJoypadStateLowSensitivity
|
||||
call JoypadLowSensitivity
|
||||
ld a, [$ffb5]
|
||||
ld b, a
|
||||
pop hl
|
||||
|
|
32
home.asm
32
home.asm
|
@ -156,12 +156,12 @@ ReadJoypad::
|
|||
ld [rJOYP], a
|
||||
ret
|
||||
|
||||
GetJoypadState::
|
||||
Joypad::
|
||||
; Update the joypad state variables:
|
||||
; [hJoyReleased] keys released since last time
|
||||
; [hJoyPressed] keys pressed since last time
|
||||
; [hJoyHeld] currently pressed keys
|
||||
homecall _GetJoypadState
|
||||
homecall _Joypad
|
||||
ret
|
||||
|
||||
|
||||
|
@ -220,7 +220,7 @@ OverworldLoopLessDelay::
|
|||
ld a,[wWalkCounter]
|
||||
and a
|
||||
jp nz,.moveAhead ; if the player sprite has not yet completed the walking animation
|
||||
call GetJoypadStateOverworld ; get joypad state (which is possibly simulated)
|
||||
call JoypadOverworld ; get joypad state (which is possibly simulated)
|
||||
callba SafariZoneCheck
|
||||
ld a,[$da46]
|
||||
and a
|
||||
|
@ -588,7 +588,7 @@ CheckWarpsNoCollisionLoop:: ; 06cc (0:06cc)
|
|||
jr nz,WarpFound1
|
||||
push de
|
||||
push bc
|
||||
call GetJoypadState
|
||||
call Joypad
|
||||
pop bc
|
||||
pop de
|
||||
ld a,[hJoyHeld] ; current joypad state
|
||||
|
@ -2006,12 +2006,12 @@ DrawTileBlock:: ; 0f1d (0:0f1d)
|
|||
ret
|
||||
|
||||
; function to update joypad state and simulate button presses
|
||||
GetJoypadStateOverworld:: ; 0f4d (0:0f4d)
|
||||
JoypadOverworld:: ; 0f4d (0:0f4d)
|
||||
xor a
|
||||
ld [$c103],a
|
||||
ld [$c105],a
|
||||
call RunMapScript
|
||||
call GetJoypadState
|
||||
call Joypad
|
||||
ld a,[W_FLAGS_D733]
|
||||
bit 3,a ; check if a trainer wants a challenge
|
||||
jr nz,.notForcedDownwards
|
||||
|
@ -2596,7 +2596,7 @@ ForceBikeOrSurf:: ; 12ed (0:12ed)
|
|||
CheckForUserInterruption:: ; 12f8 (0:12f8)
|
||||
call DelayFrame
|
||||
push bc
|
||||
call GetJoypadStateLowSensitivity
|
||||
call JoypadLowSensitivity
|
||||
pop bc
|
||||
ld a,[hJoyHeld] ; currently pressed buttons
|
||||
cp a,%01000110 ; Up, Select button, B button
|
||||
|
@ -4225,7 +4225,7 @@ TextCommand09:: ; 1bff (0:1bff)
|
|||
; (no arguments)
|
||||
TextCommand0A:: ; 1c1d (0:1c1d)
|
||||
push bc
|
||||
call GetJoypadState
|
||||
call Joypad
|
||||
ld a,[hJoyHeld]
|
||||
and a,%00000011 ; A and B buttons
|
||||
jr nz,.skipDelay
|
||||
|
@ -4302,7 +4302,7 @@ TextCommand0C:: ; 1c78 (0:1c78)
|
|||
ld a,$75 ; ellipsis
|
||||
ld [hli],a
|
||||
push de
|
||||
call GetJoypadState
|
||||
call Joypad
|
||||
pop de
|
||||
ld a,[hJoyHeld] ; joypad state
|
||||
and a,%00000011 ; is A or B button pressed?
|
||||
|
@ -6513,7 +6513,7 @@ AfterDisplayingTextID:: ; 29d6 (0:29d6)
|
|||
|
||||
; loop to hold the dialogue box open as long as the player keeps holding down the A button
|
||||
HoldTextDisplayOpen:: ; 29df (0:29df)
|
||||
call GetJoypadState
|
||||
call Joypad
|
||||
ld a,[hJoyHeld]
|
||||
bit 0,a ; is the A button being pressed?
|
||||
jr nz,HoldTextDisplayOpen
|
||||
|
@ -6953,7 +6953,7 @@ DisplayChooseQuantityMenu:: ; 2d57 (0:2d57)
|
|||
ld [$cf96],a ; initialize current quantity to 0
|
||||
jp .incrementQuantity
|
||||
.waitForKeyPressLoop
|
||||
call GetJoypadStateLowSensitivity
|
||||
call JoypadLowSensitivity
|
||||
ld a,[hJoyPressed] ; newly pressed buttons
|
||||
bit 0,a ; was the A button pressed?
|
||||
jp nz,.buttonAPressed
|
||||
|
@ -8773,8 +8773,8 @@ CopyString:: ; 3829 (0:3829)
|
|||
; report only one button press.
|
||||
; 3. Same as 2, but report no buttons as pressed if A or B is held down.
|
||||
; ([$ffb7] == 1, [$ffb6] == 0)
|
||||
GetJoypadStateLowSensitivity:: ; 3831 (0:3831)
|
||||
call GetJoypadState
|
||||
JoypadLowSensitivity:: ; 3831 (0:3831)
|
||||
call Joypad
|
||||
ld a,[$ffb7] ; flag
|
||||
and a ; get all currently pressed buttons or only newly pressed buttons?
|
||||
ld a,[hJoyPressed] ; newly pressed buttons
|
||||
|
@ -8832,7 +8832,7 @@ WaitForTextScrollButtonPress:: ; 3865 (0:3865)
|
|||
ld hl, Coord
|
||||
call HandleDownArrowBlinkTiming
|
||||
pop hl
|
||||
call GetJoypadStateLowSensitivity
|
||||
call JoypadLowSensitivity
|
||||
ld a, $2d
|
||||
call Predef ; indirect jump to Func_5a5f (5a5f (1:5a5f))
|
||||
ld a, [$ffb5]
|
||||
|
@ -8922,7 +8922,7 @@ PrintLetterDelay:: ; 38d3 (0:38d3)
|
|||
ld a,1
|
||||
ld [H_FRAMECOUNTER],a
|
||||
.checkButtons
|
||||
call GetJoypadState
|
||||
call Joypad
|
||||
ld a,[hJoyHeld]
|
||||
.checkAButton
|
||||
bit 0,a ; is the A button pressed?
|
||||
|
@ -9301,7 +9301,7 @@ HandleMenuInputPokemonSelection:: ; 3ac2 (0:3ac2)
|
|||
callba AnimatePartyMon ; shake mini sprite of selected pokemon
|
||||
.getJoypadState
|
||||
pop hl
|
||||
call GetJoypadStateLowSensitivity
|
||||
call JoypadLowSensitivity
|
||||
ld a,[$ffb5]
|
||||
and a ; was a key pressed?
|
||||
jr nz,.keyPressed
|
||||
|
|
4
main.asm
4
main.asm
|
@ -3075,7 +3075,7 @@ Func_7c18: ; 7c18 (1:7c18)
|
|||
|
||||
SECTION "bank3",ROMX,BANK[$3]
|
||||
|
||||
_GetJoypadState::
|
||||
_Joypad::
|
||||
ld a, [hJoyInput]
|
||||
cp A_BUTTON + B_BUTTON + SELECT + START ; soft reset
|
||||
jp z, TrySoftReset
|
||||
|
@ -3125,7 +3125,7 @@ TrySoftReset:
|
|||
ld hl, hSoftReset
|
||||
dec [hl]
|
||||
jp z, SoftReset
|
||||
jp GetJoypadState
|
||||
jp Joypad
|
||||
|
||||
INCLUDE "data/map_songs.asm"
|
||||
|
||||
|
|
Loading…
Reference in a new issue