ref: bba84059925c25e04fdcef5e4f3e2192176faf2d
parent: 031e33957dfaf9a5e29fb67aaf600ec809b8e35f
author: yenatch <yenatch@gmail.com>
date: Sun May 25 07:21:48 EDT 2014
Rename GetJoypadState -> Joypad.
--- a/engine/cable_club.asm
+++ b/engine/cable_club.asm
@@ -540,7 +540,7 @@
ld a, $ed
ld [$c4e1], a
.asm_574a
- call GetJoypadStateLowSensitivity
+ call JoypadLowSensitivity
ld a, [$ffb5]
and a
jr z, .asm_574a ; 0x5750 $f8
--- a/engine/evolution.asm
+++ b/engine/evolution.asm
@@ -141,7 +141,7 @@
asm_7befa: ; 7befa (1e:7efa)
call DelayFrame
push bc
- call GetJoypadStateLowSensitivity
+ call JoypadLowSensitivity
ld a, [$ffb5]
pop bc
and $2
--- a/engine/menu/main_menu.asm
+++ b/engine/menu/main_menu.asm
@@ -100,7 +100,7 @@
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 @@
call PlaceMenuCursor
call SetOptionsFromCursorPositions
.getJoypadStateLoop
- call GetJoypadStateLowSensitivity
+ call JoypadLowSensitivity
ld a,[$ffb5]
ld b,a
and a,%11111011 ; any key besides select pressed?
--- a/engine/menu/naming_screen.asm
+++ b/engine/menu/naming_screen.asm
@@ -133,7 +133,7 @@
callba AnimatePartyMon_ForceSpeed1
pop af
ld [wCurrentMenuItem], a ; $cc26
- call GetJoypadStateLowSensitivity
+ call JoypadLowSensitivity
ld a, [hJoyPressed]
and a
jr z, .asm_65ff
--- a/engine/menu/pokedex.asm
+++ b/engine/menu/pokedex.asm
@@ -584,7 +584,7 @@
xor a
ld [$fff4],a
.waitForButtonPress
- call GetJoypadStateLowSensitivity
+ call JoypadLowSensitivity
ld a,[$ffb5]
and a,%00000011 ; A button and B button
jr z,.waitForButtonPress
--- a/engine/menu/start_menu.asm
+++ b/engine/menu/start_menu.asm
@@ -80,7 +80,7 @@
; 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
--- a/engine/slot_machine.asm
+++ b/engine/slot_machine.asm
@@ -799,7 +799,7 @@
SlotMachine_37882: ; 37882 (d:7882)
call DelayFrame
- call GetJoypadStateLowSensitivity
+ call JoypadLowSensitivity
ld a, [$ffb5]
and $1
ret z
--- a/engine/town_map.asm
+++ b/engine/town_map.asm
@@ -67,7 +67,7 @@
call CopyData
.asm_70ec8
call Func_716c6
- call GetJoypadStateLowSensitivity
+ call JoypadLowSensitivity
ld a, [$ffb5]
ld b, a
and $c3
@@ -195,7 +195,7 @@
.asm_71004
push hl
call DelayFrame
- call GetJoypadStateLowSensitivity
+ call JoypadLowSensitivity
ld a, [$ffb5]
ld b, a
pop hl
--- a/home.asm
+++ b/home.asm
@@ -156,12 +156,12 @@
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 @@
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 @@
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 @@
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 @@
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 @@
; (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 @@
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 @@
; 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 @@
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 @@
; 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 @@
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 @@
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 @@
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
--- a/main.asm
+++ b/main.asm
@@ -3075,7 +3075,7 @@
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 @@
ld hl, hSoftReset
dec [hl]
jp z, SoftReset
- jp GetJoypadState
+ jp Joypad
INCLUDE "data/map_songs.asm"