Update hardware.inc to 5.1.0

This commit is contained in:
Rangi42 2025-06-30 12:34:30 -04:00 committed by Rangi
parent 8d9317abd7
commit b03ba1a549
64 changed files with 620 additions and 471 deletions

View File

@ -630,7 +630,7 @@ FadeMusic:
ld [wMusicFadeCount], a
; get SO1 volume
ld a, [wVolume]
and VOLUME_SO1_LEVEL
and AUDVOL_RIGHT
; which way are we fading?
bit MUSIC_FADE_IN_F, d
jr nz, .fadein

View File

@ -113,11 +113,7 @@ DEF NOISE_CHAN_F EQU 2 ; bit set in CHAN5-CHAN7
const NOTE_VIBRATO_OVERRIDE ; 6
; wVolume
DEF VOLUME_SO1_F EQU 3
DEF VOLUME_SO2_F EQU 7
DEF VOLUME_SO1_LEVEL EQU %00000111
DEF VOLUME_SO2_LEVEL EQU %01110000
DEF MAX_VOLUME EQU $77
DEF MAX_VOLUME EQU AUDVOL_LEFT | AUDVOL_RIGHT
; wSoundInput
DEF SOUND_INPUT_CH1_F EQU 0

View File

@ -22,7 +22,7 @@ endc
; Define the include guard and the current hardware.inc version
; (do this after the RGBDS version check since the `def` syntax depends on it)
def HARDWARE_INC equ 1
def HARDWARE_INC_VERSION equs "5.0.0"
def HARDWARE_INC_VERSION equs "5.1.0"
; Usage: rev_Check_hardware_inc <min_ver>
; Examples:
@ -85,14 +85,17 @@ def B_PAD_START equ 3
def B_PAD_SELECT equ 2
def B_PAD_B equ 1
def B_PAD_A equ 0
def PAD_DOWN equ 1 << B_PAD_DOWN
def PAD_UP equ 1 << B_PAD_UP
def PAD_LEFT equ 1 << B_PAD_LEFT
def PAD_RIGHT equ 1 << B_PAD_RIGHT
def PAD_START equ 1 << B_PAD_START
def PAD_SELECT equ 1 << B_PAD_SELECT
def PAD_B equ 1 << B_PAD_B
def PAD_A equ 1 << B_PAD_A
def PAD_CTRL_PAD equ %1111_0000
def PAD_BUTTONS equ %0000_1111
def PAD_DOWN equ 1 << B_PAD_DOWN
def PAD_UP equ 1 << B_PAD_UP
def PAD_LEFT equ 1 << B_PAD_LEFT
def PAD_RIGHT equ 1 << B_PAD_RIGHT
def PAD_START equ 1 << B_PAD_START
def PAD_SELECT equ 1 << B_PAD_SELECT
def PAD_B equ 1 << B_PAD_B
def PAD_A equ 1 << B_PAD_A
; Combined input byte, with Control Pad in low nybble (swapped order)
def B_PAD_SWAP_START equ 7
@ -103,14 +106,16 @@ def B_PAD_SWAP_DOWN equ 3
def B_PAD_SWAP_UP equ 2
def B_PAD_SWAP_LEFT equ 1
def B_PAD_SWAP_RIGHT equ 0
def PAD_SWAP_START equ 1 << B_PAD_SWAP_START
def PAD_SWAP_SELECT equ 1 << B_PAD_SWAP_SELECT
def PAD_SWAP_B equ 1 << B_PAD_SWAP_B
def PAD_SWAP_A equ 1 << B_PAD_SWAP_A
def PAD_SWAP_DOWN equ 1 << B_PAD_SWAP_DOWN
def PAD_SWAP_UP equ 1 << B_PAD_SWAP_UP
def PAD_SWAP_LEFT equ 1 << B_PAD_SWAP_LEFT
def PAD_SWAP_RIGHT equ 1 << B_PAD_SWAP_RIGHT
def PAD_SWAP_CTRL_PAD equ %0000_1111
def PAD_SWAP_BUTTONS equ %1111_0000
def PAD_SWAP_START equ 1 << B_PAD_SWAP_START
def PAD_SWAP_SELECT equ 1 << B_PAD_SWAP_SELECT
def PAD_SWAP_B equ 1 << B_PAD_SWAP_B
def PAD_SWAP_A equ 1 << B_PAD_SWAP_A
def PAD_SWAP_DOWN equ 1 << B_PAD_SWAP_DOWN
def PAD_SWAP_UP equ 1 << B_PAD_SWAP_UP
def PAD_SWAP_LEFT equ 1 << B_PAD_SWAP_LEFT
def PAD_SWAP_RIGHT equ 1 << B_PAD_SWAP_RIGHT
; -- SB ($FF01) ---------------------------------------------------------------
; Serial transfer data [r/w]
@ -723,27 +728,38 @@ def B_IE_VBLANK equ 0 ; 1 = VBlank interrupt is enabled [r/w]
; however, one address for each of these ranges is considered the "canonical" one, and
; these addresses are what's provided here.
; ** Common to most MBCs ******************************************************
; -- RAMG ($0000-$1FFF) -------------------------------------------------------
; Whether SRAM can be accessed [wo]
def rRAMG equ $0000
; Common values
; Common values (not for HuC1 or HuC-3)
def RAMG_SRAM_DISABLE equ $00
def RAMG_SRAM_ENABLE equ $0A ; some MBCs accept any value whose low nybble is $A
; -- ROMB0 ($2000-$3FFF) ------------------------------------------------------
; ROM bank number (low 8 bits when applicable) [wo]
def rROMB0 equ $2000
; (HuC-3 only) switch SRAM to map cartridge RAM, RTC, or IR
def RAMG_CART_RAM_RO equ $00 ; select cartridge RAM [ro]
def RAMG_CART_RAM equ $0A ; select cartridge RAM [r/w]
def RAMG_RTC_IN equ $0B ; select RTC command/argument [wo]
def RAMG_RTC_IN_CMD equ %0_111_0000 ; command
def RAMG_RTC_IN_ARG equ %0_000_1111 ; argument
def RAMG_RTC_OUT equ $0C ; select RTC command/response [ro]
def RAMG_RTC_OUT_CMD equ %0_111_0000 ; command
def RAMG_RTC_OUT_RESULT equ %0_000_1111 ; result
def RAMG_RTC_SEMAPHORE equ $0D ; select RTC semaphore [r/w]
def RAMG_IR equ $0E ; (HuC1 and HuC-3 only) select IR [r/w]
; -- ROMB1 ($3000-$3FFF) ------------------------------------------------------
; (MBC5 only) ROM bank number high bit (bit 8) [wo]
def rROMB1 equ $3000
; -- ROMB ($2000-$3FFF) -------------------------------------------------------
; ROM bank number (not for MBC5 or MBC6) [wo]
def rROMB equ $2000
; -- RAMB ($4000-$5FFF) -------------------------------------------------------
; SRAM bank number [wo]
; SRAM bank number (not for MBC2, MBC6, or MBC7) [wo]
def rRAMB equ $4000
; (MBC3-only) Special RAM bank numbers that actually map values into RTCREG
; (MBC3 only) Special RAM bank numbers that actually map values into RTCREG
def RAMB_RTC_S equ $08 ; seconds counter (0-59)
def RAMB_RTC_M equ $09 ; minutes counter (0-59)
def RAMB_RTC_H equ $0A ; hours counter (0-23)
@ -761,8 +777,28 @@ def B_RAMB_RUMBLE equ 3 ; (MBC5 and MBC7 only) enable the rumble motor (if any)
def RAMB_RUMBLE_OFF equ 0 << B_RAMB_RUMBLE
def RAMB_RUMBLE_ON equ 1 << B_RAMB_RUMBLE
; ** MBC1 and MMM01 only ******************************************************
; -- BMODE ($6000-$7FFF) ------------------------------------------------------
; Banking mode select [wo]
def rBMODE equ $6000
def BMODE_SIMPLE equ $00 ; locks ROMB and RAMB to bank 0
def BMODE_ADVANCED equ $01 ; allows bank-switching with RAMB
; ** MBC2 only ****************************************************************
; -- ROM2B ($0000-$3FFF with bit 8 set) ---------------------------------------
; ROM bank number [wo]
def rROM2B equ $2100
; ** MBC3 only ****************************************************************
; -- RTCLATCH ($6000-$7FFF) ---------------------------------------------------
; (MBC3 only) RTC latch clock data [wo]
; RTC latch clock data [wo]
def rRTCLATCH equ $6000
; Write $00 then $01 to latch the current time into RTCREG
@ -770,10 +806,107 @@ def RTCLATCH_START equ $00
def RTCLATCH_FINISH equ $01
; -- RTCREG ($A000-$BFFF) -----------------------------------------------------
; (MBC3 only) RTC register [r/w]
; RTC register [r/w]
def rRTCREG equ $A000
; ** MBC5 only ****************************************************************
; -- ROMB0 ($2000-$3FFF) ------------------------------------------------------
; ROM bank number low byte (bits 0-7) [wo]
def rROMB0 equ $2000
; -- ROMB1 ($3000-$3FFF) ------------------------------------------------------
; ROM bank number high bit (bit 8) [wo]
def rROMB1 equ $3000
; ** MBC6 only ****************************************************************
; -- RAMBA ($0400-$07FF) ------------------------------------------------------
; RAM bank A number [wo]
def rRAMBA equ $0400
; -- RAMBB ($0800-$0BFF) ------------------------------------------------------
; RAM bank B number [wo]
def rRAMBB equ $0800
; -- FLASH ($0C00-$0FFF) ------------------------------------------------------
; Whether the flash chip can be accessed [wo]
def rFLASH equ $0C00
; -- FMODE ($1000) ------------------------------------------------------------
; Write mode select for the flash chip
def rFMODE equ $1000
; -- ROMBA ($2000-$27FF) ------------------------------------------------------
; ROM/Flash bank A number [wo]
def rROMBA equ $2000
; -- FLASHA ($2800-$2FFF) -----------------------------------------------------
; ROM/Flash bank A select [wo]
def rFLASHA equ $2800
; -- ROMBB ($3000-$37FF) ------------------------------------------------------
; ROM/Flash bank B number [wo]
def rROMBB equ $3000
; -- FLASHB ($3800-$3FFF) -----------------------------------------------------
; ROM/Flash bank B select [wo]
def rFLASHB equ $3800
; ** MBC7 only ****************************************************************
; -- RAMREG ($4000-$5FFF) -----------------------------------------------------
; Enable RAM register access [wo]
def rRAMREG equ $4000
def RAMREG_ENABLE equ $40
; -- ACCLATCH0 ($Ax0x) --------------------------------------------------------
; Latch accelerometer start [wo]
def rACCLATCH0 equ $A000
def ACCLATCH0_START equ $55
; -- ACCLATCH1 ($Ax1x) --------------------------------------------------------
; Latch accelerometer finish [wo]
def rACCLATCH1 equ $A010
def ACCLATCH1_FINISH equ $AA
; -- ACCELX0 ($Ax2x) ----------------------------------------------------------
; Accelerometer X value low byte [ro]
def rACCELX0 equ $A020
; -- ACCELX1 ($Ax3x) ----------------------------------------------------------
; Accelerometer X value high byte [ro]
def rACCELX1 equ $A030
; -- ACCELY0 ($Ax4x) ----------------------------------------------------------
; Accelerometer Y value low byte [ro]
def rACCELY0 equ $A040
; -- ACCELY1 ($Ax5x) ----------------------------------------------------------
; Accelerometer Y value high byte [ro]
def rACCELY1 equ $A050
; -- EEPROM ($Ax8x) -----------------------------------------------------------
; EEPROM access [r/w]
def rEEPROM equ $A080
; ** HuC1 only ****************************************************************
; -- IRREG ($A000-$BFFF) ------------------------------------------------------
; IR register [r/w]
def rIRREG equ $A000
def IR_LED_OFF equ $C0
def IR_LED_ON equ $C1
;******************************************************************************
; Screen-related constants
;******************************************************************************
@ -795,10 +928,13 @@ def TILE_HEIGHT equ 8 ; height of tile in pixels
def TILE_SIZE equ 16 ; size of tile in bytes (2 bits/pixel)
def COLOR_SIZE equ 2 ; size of color in bytes (little-endian BGR555)
def COLOR_GREEN_LOW equ %111_00000 ; for the low byte
def COLOR_RED equ %000_11111 ; for the low byte
def COLOR_BLUE equ %0_11111_00 ; for the high byte
def COLOR_GREEN_HIGH equ %000000_11 ; for the high byte
def B_COLOR_RED equ 0 ; bits 4-0
def B_COLOR_GREEN equ 5 ; bits 9-5
def B_COLOR_BLUE equ 10 ; bits 14-10
def COLOR_RED equ %000_11111 ; for the low byte
def COLOR_GREEN_LOW equ %111_00000 ; for the low byte
def COLOR_GREEN_HIGH equ %0_00000_11 ; for the high byte
def COLOR_BLUE equ %0_11111_00 ; for the high byte
def PAL_COLORS equ 4 ; colors per palette
def PAL_SIZE equ COLOR_SIZE * PAL_COLORS ; size of palette in bytes
@ -807,7 +943,7 @@ def TILEMAP0 equ $9800 ; $9800-$9BFF
def TILEMAP1 equ $9C00 ; $9C00-$9FFF
; (CGB only) BG tile attribute fields
def B_BG_PRIO equ 7 ; whether the BG tile colors 1-3 are drawn below OBJs
def B_BG_PRIO equ 7 ; whether the BG tile colors 1-3 are drawn above OBJs
def B_BG_YFLIP equ 6 ; whether the whole BG tile is flipped vertically
def B_BG_XFLIP equ 5 ; whether the whole BG tile is flipped horizontally
def B_BG_BANK1 equ 3 ; which VRAM bank the BG tile is taken from
@ -831,7 +967,7 @@ def OAMA_X rb ; 1
def OAM_X_OFS equ 8 ; subtract 8 from what's written to OAM to get the real X position
def OAMA_TILEID rb ; 2
def OAMA_FLAGS rb ; 3
def B_OAM_PRIO equ 7 ; whether the OBJ is drawn above BG colors 1-3
def B_OAM_PRIO equ 7 ; whether the OBJ is drawn below BG colors 1-3
def B_OAM_YFLIP equ 6 ; whether the whole OBJ is flipped vertically
def B_OAM_XFLIP equ 5 ; whether the whole OBJ is flipped horizontally
def B_OAM_PAL1 equ 4 ; (DMG only) which of the two palettes the OBJ uses

View File

@ -1,15 +0,0 @@
; joypad buttons
const_def
shift_const A_BUTTON ; 0
shift_const B_BUTTON ; 1
shift_const SELECT ; 2
shift_const START ; 3
shift_const D_RIGHT ; 4
shift_const D_LEFT ; 5
shift_const D_UP ; 6
shift_const D_DOWN ; 7
DEF NO_INPUT EQU %00000000
DEF BUTTONS EQU A_BUTTON | B_BUTTON | SELECT | START
DEF D_PAD EQU D_RIGHT | D_LEFT | D_UP | D_DOWN

View File

@ -6,6 +6,9 @@ DEF TRUE EQU 1
DEF MALE EQU 0
DEF FEMALE EQU 1
; input
DEF NO_INPUT EQU %00000000
; FlagAction arguments (see home/flag.asm)
const_def
const RESET_FLAG

View File

@ -5117,15 +5117,15 @@ MoveSelectionScreen:
ld c, STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP
ld a, [wMoveSelectionMenuType]
dec a
ld b, D_DOWN | D_UP | A_BUTTON
ld b, PAD_DOWN | PAD_UP | PAD_A
jr z, .okay
dec a
ld b, D_DOWN | D_UP | A_BUTTON | B_BUTTON
ld b, PAD_DOWN | PAD_UP | PAD_A | PAD_B
jr z, .okay
ld a, [wLinkMode]
cp LINK_COLOSSEUM
jr z, .okay
ld b, D_DOWN | D_UP | A_BUTTON | B_BUTTON | SELECT
ld b, PAD_DOWN | PAD_UP | PAD_A | PAD_B | PAD_SELECT
.okay
ld a, b
@ -5162,11 +5162,11 @@ MoveSelectionScreen:
ld a, $1
ldh [hBGMapMode], a
call ScrollingMenuJoypad
bit D_UP_F, a
bit B_PAD_UP, a
jp nz, .pressed_up
bit D_DOWN_F, a
bit B_PAD_DOWN, a
jp nz, .pressed_down
bit SELECT_F, a
bit B_PAD_SELECT, a
jp nz, .pressed_select
bit B_BUTTON_F, a
; A button

View File

@ -232,10 +232,10 @@ DebugColorMain:
jr nc, .no_start_select
ld hl, hJoyLast
ld a, [hl]
and SELECT
and PAD_SELECT
jr nz, .NextMon
ld a, [hl]
and START
and PAD_START
jr nz, .PreviousMon
.no_start_select
@ -530,10 +530,10 @@ DebugColor_PrintHexColor:
DebugColor_Joypad:
ldh a, [hJoyLast]
and B_BUTTON
and PAD_B
jr nz, .tmhm
ldh a, [hJoyLast]
and A_BUTTON
and PAD_A
jr nz, .toggle_shiny
ld a, [wDebugColorRGBJumptableIndex]
@ -582,13 +582,13 @@ DebugColor_Joypad:
DebugColor_SelectColorBox:
ld hl, hJoyLast
ld a, [hl]
and D_DOWN
and PAD_DOWN
jr nz, DebugColor_NextRGBColor
ld a, [hl]
and D_LEFT
and PAD_LEFT
jr nz, .light
ld a, [hl]
and D_RIGHT
and PAD_RIGHT
jr nz, .dark
ret
@ -609,10 +609,10 @@ DebugColor_SelectColorBox:
DebugColor_ChangeRedValue:
ld hl, hJoyLast
ld a, [hl]
and D_DOWN
and PAD_DOWN
jr nz, DebugColor_NextRGBColor
ld a, [hl]
and D_UP
and PAD_UP
jr nz, DebugColor_PreviousRGBColor
ld hl, wDebugRedChannel
jr DebugColor_UpdateRGBColor
@ -620,10 +620,10 @@ DebugColor_ChangeRedValue:
DebugColor_ChangeGreenValue:
ld hl, hJoyLast
ld a, [hl]
and D_DOWN
and PAD_DOWN
jr nz, DebugColor_NextRGBColor
ld a, [hl]
and D_UP
and PAD_UP
jr nz, DebugColor_PreviousRGBColor
ld hl, wDebugGreenChannel
jr DebugColor_UpdateRGBColor
@ -631,17 +631,17 @@ DebugColor_ChangeGreenValue:
DebugColor_ChangeBlueValue:
ld hl, hJoyLast
ld a, [hl]
and D_UP
and PAD_UP
jr nz, DebugColor_PreviousRGBColor
ld hl, wDebugBlueChannel
; fallthrough
DebugColor_UpdateRGBColor:
ldh a, [hJoyLast]
and D_RIGHT
and PAD_RIGHT
jr nz, .increment
ldh a, [hJoyLast]
and D_LEFT
and PAD_LEFT
jr nz, .decrement
ret
@ -692,7 +692,7 @@ DebugColor_InitTMHM:
DebugColor_TMHMJoypad:
ld hl, hJoyPressed
ld a, [hl]
and B_BUTTON
and PAD_B
jr nz, .cancel
call .scroll
ret
@ -710,10 +710,10 @@ DebugColor_TMHMJoypad:
.scroll:
ld hl, hJoyLast
ld a, [hl]
and D_UP
and PAD_UP
jr nz, .up
ld a, [hl]
and D_DOWN
and PAD_DOWN
jr nz, .down
ret
@ -1164,10 +1164,10 @@ DebugTileset_LoadPalettes:
DebugColorMain2: ; unreferenced
ld hl, hJoyLast
ld a, [hl]
and SELECT
and PAD_SELECT
jr nz, .next_palette
ld a, [hl]
and B_BUTTON
and PAD_B
jr nz, .cancel
call DebugTileset_Joypad
ret
@ -1264,13 +1264,13 @@ DebugTileset_Joypad:
DebugTileset_SelectColorBox:
ld hl, hJoyLast
ld a, [hl]
and D_DOWN
and PAD_DOWN
jr nz, DebugTileset_NextRGBColor
ld a, [hl]
and D_LEFT
and PAD_LEFT
jr nz, .left
ld a, [hl]
and D_RIGHT
and PAD_RIGHT
jr nz, .right
ret
@ -1299,10 +1299,10 @@ DebugTileset_SelectColorBox:
DebugTileset_ChangeRedValue:
ld hl, hJoyLast
ld a, [hl]
and D_DOWN
and PAD_DOWN
jr nz, DebugTileset_NextRGBColor
ld a, [hl]
and D_UP
and PAD_UP
jr nz, DebugTileset_PreviousRGBColor
ld hl, wDebugRedChannel
jr DebugTileset_UpdateRGBColor
@ -1310,10 +1310,10 @@ DebugTileset_ChangeRedValue:
DebugTileset_ChangeGreenValue:
ld hl, hJoyLast
ld a, [hl]
and D_DOWN
and PAD_DOWN
jr nz, DebugTileset_NextRGBColor
ld a, [hl]
and D_UP
and PAD_UP
jr nz, DebugTileset_PreviousRGBColor
ld hl, wDebugGreenChannel
jr DebugTileset_UpdateRGBColor
@ -1321,17 +1321,17 @@ DebugTileset_ChangeGreenValue:
DebugTileset_ChangeBlueValue:
ld hl, hJoyLast
ld a, [hl]
and D_UP
and PAD_UP
jr nz, DebugTileset_PreviousRGBColor
ld hl, wDebugBlueChannel
; fallthrough
DebugTileset_UpdateRGBColor:
ldh a, [hJoyLast]
and D_RIGHT
and PAD_RIGHT
jr nz, .increment
ldh a, [hJoyLast]
and D_LEFT
and PAD_LEFT
jr nz, .decrement
ret

View File

@ -22,8 +22,8 @@ DEF DEBUGROOMMENU_NUM_PAGES EQU const_value
_DebugRoom:
ldh a, [hJoyDown]
and SELECT | START
cp SELECT | START
and PAD_SELECT | PAD_START
cp PAD_SELECT | PAD_START
ret nz
ldh a, [hDebugRoomMenuPage]
push af
@ -45,10 +45,10 @@ _DebugRoom:
.wait
call GetScrollingMenuJoypad
ld a, [wMenuJoypad]
and A_BUTTON | B_BUTTON
and PAD_A | PAD_B
jr z, .wait
call CloseWindow
cp B_BUTTON
cp PAD_B
jr z, .done
ld a, [wMenuSelection]
ld hl, .Jumptable
@ -433,17 +433,17 @@ DebugRoom_EditPagedValues:
rra ; A_BUTTON_F?
jr c, DebugRoom_PagedValuePressedA
rra ; skip B_BUTTON_F
rra ; SELECT_F?
rra ; B_PAD_SELECT?
jr c, DebugRoom_PagedValuePressedSelect
rra ; START_F?
rra ; B_PAD_START?
jr c, DebugRoom_PagedValuePressedStart
rra ; D_RIGHT_F?
rra ; B_PAD_RIGHT?
jp c, DebugRoom_IncrementPagedValue
rra ; D_LEFT_F?
rra ; B_PAD_LEFT?
jp c, DebugRoom_DecrementPagedValue
rra ; D_UP_F?
rra ; B_PAD_UP?
jp c, DebugRoom_PrevPagedValue
rra ; D_DOWN_F?
rra ; B_PAD_DOWN?
jp c, DebugRoom_NextPagedValue
pop hl
.continue
@ -818,7 +818,7 @@ DebugRoom_JoyWaitABSelect:
.loop
call GetJoypad
ldh a, [hJoyPressed]
and A_BUTTON | B_BUTTON | SELECT
and PAD_A | PAD_B | PAD_SELECT
jr z, .loop
ret

View File

@ -19,14 +19,14 @@ DudeAutoInputs: ; used only for BANK(DudeAutoInputs)
DudeAutoInput_A:
db NO_INPUT, $50
db A_BUTTON, $00
db PAD_A, $00
db NO_INPUT, $ff ; end
DudeAutoInput_RightA:
db NO_INPUT, $08
db D_RIGHT, $00
db PAD_RIGHT, $00
db NO_INPUT, $08
db A_BUTTON, $00
db PAD_A, $00
db NO_INPUT, $ff ; end
DudeAutoInput_DownA:
@ -34,10 +34,10 @@ DudeAutoInput_DownA:
db NO_INPUT, $fe
db NO_INPUT, $fe
db NO_INPUT, $fe
db D_DOWN, $00
db PAD_DOWN, $00
db NO_INPUT, $fe
db NO_INPUT, $fe
db NO_INPUT, $fe
db NO_INPUT, $fe
db A_BUTTON, $00
db PAD_A, $00
db NO_INPUT, $ff ; end

View File

@ -128,7 +128,7 @@ Elevator_AskWhichFloor:
call ScrollingMenu
call CloseWindow
ld a, [wMenuJoypad]
cp B_BUTTON
cp PAD_B
jr z, .cancel
xor a
ld a, [wScrollingMenuCursorPosition]

View File

@ -311,13 +311,13 @@ _HallOfFamePC:
call JoyTextDelay
ld hl, hJoyLast
ld a, [hl]
and B_BUTTON
and PAD_B
jr nz, .b_button
ld a, [hl]
and A_BUTTON
and PAD_A
jr nz, .a_button
ld a, [hl]
and START
and PAD_START
jr nz, .start_button
call DelayFrame
jr .loop

View File

@ -453,10 +453,10 @@ Mom_WithdrawDepositMenuJoypad:
call JoyTextDelay
ld hl, hJoyPressed
ld a, [hl]
and B_BUTTON
and PAD_B
jr nz, .pressedB
ld a, [hl]
and A_BUTTON
and PAD_A
jr nz, .pressedA
call .dpadaction
xor a
@ -494,16 +494,16 @@ Mom_WithdrawDepositMenuJoypad:
.dpadaction
ld hl, hJoyLast
ld a, [hl]
and D_UP
and PAD_UP
jr nz, .incrementdigit
ld a, [hl]
and D_DOWN
and PAD_DOWN
jr nz, .decrementdigit
ld a, [hl]
and D_LEFT
and PAD_LEFT
jr nz, .movecursorleft
ld a, [hl]
and D_RIGHT
and PAD_RIGHT
jr nz, .movecursorright
and a
ret

View File

@ -594,21 +594,21 @@ PCItemsJoypad:
and a
jr nz, .moving_stuff_around
ld a, [wMenuJoypad]
cp B_BUTTON
cp PAD_B
jr z, .b_1
cp A_BUTTON
cp PAD_A
jr z, .a_1
cp SELECT
cp PAD_SELECT
jr z, .select_1
jr .next
.moving_stuff_around
ld a, [wMenuJoypad]
cp B_BUTTON
cp PAD_B
jr z, .b_2
cp A_BUTTON
cp PAD_A
jr z, .a_select_2
cp SELECT
cp PAD_SELECT
jr z, .a_select_2
jr .next

View File

@ -70,7 +70,7 @@ _UnownPrinter:
call JoyTextDelay
ldh a, [hJoyPressed]
and B_BUTTON
and PAD_B
jr nz, .pressed_b
ldh a, [hJoyPressed]
@ -78,7 +78,7 @@ _UnownPrinter:
if DEF(_GOLD_VC) || DEF(_SILVER_VC)
and NO_INPUT
else
and A_BUTTON
and PAD_A
endc
vc_patch_end
jr nz, .pressed_a
@ -106,10 +106,10 @@ endc
.LeftRight:
ldh a, [hJoyLast]
and D_RIGHT
and PAD_RIGHT
jr nz, .press_right
ldh a, [hJoyLast]
and D_LEFT
and PAD_LEFT
jr nz, .press_left
ret

View File

@ -177,7 +177,7 @@ _CardFlip:
.loop
call JoyTextDelay
ldh a, [hJoyLast]
and A_BUTTON
and PAD_A
jr nz, .next
ld de, SFX_KINESIS
call PlaySFX
@ -228,7 +228,7 @@ _CardFlip:
.betloop
call JoyTextDelay
ldh a, [hJoyLast]
and A_BUTTON
and PAD_A
jr nz, .betdone
call ChooseCard_HandleJoypad
call CardFlip_UpdateCursorOAM
@ -1172,16 +1172,16 @@ PlaceOAMCardBorder:
ChooseCard_HandleJoypad:
ld hl, hJoyLast
ld a, [hl]
and D_LEFT
and PAD_LEFT
jp nz, .d_left
ld a, [hl]
and D_RIGHT
and PAD_RIGHT
jp nz, .d_right
ld a, [hl]
and D_UP
and PAD_UP
jp nz, .d_up
ld a, [hl]
and D_DOWN
and PAD_DOWN
jp nz, .d_down
ret

View File

@ -201,7 +201,7 @@ endr
.RevealAll:
ldh a, [hJoypadPressed]
and A_BUTTON
and PAD_A
ret z
xor a
ld [wMemoryGameCounter], a
@ -500,19 +500,19 @@ MemoryGame_InterpretJoypad_AnimateCursor:
call JoyTextDelay
ld hl, hJoypadPressed
ld a, [hl]
and A_BUTTON
and PAD_A
jr nz, .pressed_a
ld a, [hl]
and D_LEFT
and PAD_LEFT
jr nz, .pressed_left
ld a, [hl]
and D_RIGHT
and PAD_RIGHT
jr nz, .pressed_right
ld a, [hl]
and D_UP
and PAD_UP
jr nz, .pressed_up
ld a, [hl]
and D_DOWN
and PAD_DOWN
jr nz, .pressed_down
ret

View File

@ -353,7 +353,7 @@ SlotsAction_WaitStart:
SlotsAction_WaitReel1:
ld hl, hJoypadSum
ld a, [hl]
and A_BUTTON
and PAD_A
ret z
call SlotsAction_Next
call Slots_StopReel1
@ -373,7 +373,7 @@ SlotsAction_WaitStopReel1:
SlotsAction_WaitReel2:
ld hl, hJoypadSum
ld a, [hl]
and A_BUTTON
and PAD_A
ret z
call SlotsAction_Next
call Slots_StopReel2
@ -393,7 +393,7 @@ SlotsAction_WaitStopReel2:
SlotsAction_WaitReel3:
ld hl, hJoypadSum
ld a, [hl]
and A_BUTTON
and PAD_A
ret z
call SlotsAction_Next
call Slots_StopReel3

View File

@ -176,23 +176,23 @@ UnownPuzzleJumptable:
.Function:
ldh a, [hJoyPressed]
and START
and PAD_START
jp nz, UnownPuzzle_Quit
ldh a, [hJoyPressed]
and A_BUTTON
and PAD_A
jp nz, UnownPuzzle_A
ld hl, hJoyLast
ld a, [hl]
and D_UP
and PAD_UP
jr nz, .d_up
ld a, [hl]
and D_DOWN
and PAD_DOWN
jr nz, .d_down
ld a, [hl]
and D_LEFT
and PAD_LEFT
jr nz, .d_left
ld a, [hl]
and D_RIGHT
and PAD_RIGHT
jr nz, .d_right
ret

View File

@ -48,13 +48,13 @@ BuySellToss_InterpretJoypad:
jr nz, .b
bit A_BUTTON_F, c
jr nz, .a
bit D_DOWN_F, c
bit B_PAD_DOWN, c
jr nz, .down
bit D_UP_F, c
bit B_PAD_UP, c
jr nz, .up
bit D_LEFT_F, c
bit B_PAD_LEFT, c
jr nz, .left
bit D_RIGHT_F, c
bit B_PAD_RIGHT, c
jr nz, .right
and a
ret

View File

@ -420,9 +420,9 @@ BuyMenuLoop:
ld [wMenuCursorPositionBackup], a
call SpeechTextbox
ld a, [wMenuJoypad]
cp B_BUTTON
cp PAD_B
jr z, .set_carry
cp A_BUTTON
cp PAD_A
jr z, .useless_pointer
.useless_pointer

View File

@ -1015,16 +1015,16 @@ InitPocket:
DepositSellTutorial_InterpretJoypad:
ld hl, wMenuJoypad
ld a, [hl]
and A_BUTTON
and PAD_A
jr nz, .a_button
ld a, [hl]
and B_BUTTON
and PAD_B
jr nz, .b_button
ld a, [hl]
and D_LEFT
and PAD_LEFT
jr nz, .d_left
ld a, [hl]
and D_RIGHT
and PAD_RIGHT
jr nz, .d_right
scf
ret
@ -1238,19 +1238,19 @@ Pack_InterpretJoypad:
and a
jr nz, .switching_item
ld a, [hl]
and A_BUTTON
and PAD_A
jr nz, .a_button
ld a, [hl]
and B_BUTTON
and PAD_B
jr nz, .b_button
ld a, [hl]
and D_LEFT
and PAD_LEFT
jr nz, .d_left
ld a, [hl]
and D_RIGHT
and PAD_RIGHT
jr nz, .d_right
ld a, [hl]
and SELECT
and PAD_SELECT
jr nz, .select
scf
ret
@ -1296,10 +1296,10 @@ Pack_InterpretJoypad:
.switching_item
ld a, [hl]
and A_BUTTON | SELECT
and PAD_A | PAD_SELECT
jr nz, .place_insert
ld a, [hl]
and B_BUTTON
and PAD_B
jr nz, .end_switch
scf
ret

View File

@ -204,7 +204,7 @@ TMHM_PocketLoop:
ld [w2DMenuFlags2], a
ld a, $20
ld [w2DMenuCursorOffsets], a
ld a, A_BUTTON | B_BUTTON | D_UP | D_DOWN | D_LEFT | D_RIGHT
ld a, PAD_A | PAD_B | PAD_UP | PAD_DOWN | PAD_LEFT | PAD_RIGHT
ld [wMenuJoypadFilter], a
ld a, [wTMHMPocketCursor]
inc a
@ -231,9 +231,9 @@ TMHM_JoypadLoop:
jp nz, TMHM_ChooseTMorHM
bit B_BUTTON_F, a
jp nz, TMHM_ExitPack
bit D_RIGHT_F, a
bit B_PAD_RIGHT, a
jp nz, TMHM_ExitPocket
bit D_LEFT_F, a
bit B_PAD_LEFT, a
jp nz, TMHM_ExitPocket
TMHM_ShowTMMoveDescription:
call TMHM_CheckHoveringOverCancel
@ -288,7 +288,7 @@ TMHM_CheckHoveringOverCancel:
TMHM_ExitPack:
call TMHM_PlaySFX_ReadText2
_TMHM_ExitPack:
ld a, B_BUTTON
ld a, PAD_B
ld [wMenuJoypad], a
and a
ret
@ -299,7 +299,7 @@ TMHM_ExitPocket:
TMHM_ScrollPocket:
ld a, b
bit D_DOWN_F, a
bit B_PAD_DOWN, a
jr nz, .down
ld hl, wTMHMPocketScrollPosition
ld a, [hl]

View File

@ -1174,7 +1174,7 @@ InitTradeMenuDisplay:
LinkTrade_OTPartyMenu:
ld a, OTPARTYMON
ld [wMonType], a
ld a, A_BUTTON | D_UP | D_DOWN
ld a, PAD_A | PAD_UP | PAD_DOWN
ld [wMenuJoypadFilter], a
ld a, [wOTPartyCount]
ld [w2DMenuNumRows], a
@ -1207,7 +1207,7 @@ LinkTradeOTPartymonMenuLoop:
jp LinkTradePartiesMenuMasterLoop
.not_a_button
bit D_UP_F, a
bit B_PAD_UP, a
jr z, .not_d_up
ld a, [wMenuCursorY]
ld b, a
@ -1222,14 +1222,14 @@ LinkTradeOTPartymonMenuLoop:
jr LinkTrade_PlayerPartyMenu
.not_d_up
bit D_DOWN_F, a
bit B_PAD_DOWN, a
jp z, LinkTradePartiesMenuMasterLoop
jp LinkTradeOTPartymonMenuCheckCancel
LinkTrade_PlayerPartyMenu:
xor a
ld [wMonType], a
ld a, A_BUTTON | D_UP | D_DOWN
ld a, PAD_A | PAD_UP | PAD_DOWN
ld [wMenuJoypadFilter], a
ld a, [wPartyCount]
ld [w2DMenuNumRows], a
@ -1260,7 +1260,7 @@ LinkTradePartymonMenuLoop:
jp LinkTrade_TradeStatsMenu
.not_a_button
bit D_DOWN_F, a
bit B_PAD_DOWN, a
jr z, .not_d_down
ld a, [wMenuCursorY]
dec a
@ -1273,7 +1273,7 @@ LinkTradePartymonMenuLoop:
jp LinkTrade_OTPartyMenu
.not_d_down
bit D_UP_F, a
bit B_PAD_UP, a
jr z, LinkTradePartiesMenuMasterLoop
ld a, [wMenuCursorY]
ld b, a
@ -1308,7 +1308,7 @@ LinkTrade_TradeStatsMenu:
.joy_loop
ld a, " "
ldcoord_a 11, 16
ld a, A_BUTTON | B_BUTTON | D_RIGHT
ld a, PAD_A | PAD_B | PAD_RIGHT
ld [wMenuJoypadFilter], a
ld a, 1
ld [w2DMenuNumRows], a
@ -1327,7 +1327,7 @@ LinkTrade_TradeStatsMenu:
ld [w2DMenuFlags1], a
ld [w2DMenuFlags2], a
call ScrollingMenuJoypad
bit D_RIGHT_F, a
bit B_PAD_RIGHT, a
jr nz, .d_right
bit B_BUTTON_F, a
jr z, .show_stats
@ -1340,7 +1340,7 @@ LinkTrade_TradeStatsMenu:
.d_right
ld a, " "
ldcoord_a 1, 16
ld a, A_BUTTON | B_BUTTON | D_LEFT
ld a, PAD_A | PAD_B | PAD_LEFT
ld [wMenuJoypadFilter], a
ld a, 1
ld [w2DMenuNumRows], a
@ -1359,7 +1359,7 @@ LinkTrade_TradeStatsMenu:
ld [w2DMenuFlags1], a
ld [w2DMenuFlags2], a
call ScrollingMenuJoypad
bit D_LEFT_F, a
bit B_PAD_LEFT, a
jp nz, .joy_loop
bit B_BUTTON_F, a
jr nz, .b_button
@ -1468,7 +1468,7 @@ LinkTradeOTPartymonMenuCheckCancel:
jr z, .loop2
bit A_BUTTON_F, a
jr nz, .a_button
bit D_UP_F, a
bit B_PAD_UP, a
jr z, .loop2
ld a, " "
ldcoord_a 1, 16
@ -1598,7 +1598,7 @@ LinkTrade:
ld [w2DMenuFlags2], a
ld a, $20
ld [w2DMenuCursorOffsets], a
ld a, A_BUTTON | B_BUTTON
ld a, PAD_A | PAD_B
ld [wMenuJoypadFilter], a
ld a, 1
ld [wMenuCursorY], a

View File

@ -988,19 +988,19 @@ TitleScreenMain:
call GetJoypad
ld hl, hJoyDown
ld a, [hl]
and D_UP + B_BUTTON + SELECT
cp D_UP + B_BUTTON + SELECT
and PAD_UP + PAD_B + PAD_SELECT
cp PAD_UP + PAD_B + PAD_SELECT
jr z, .delete_save_data
; Clock can be reset by pressing Down + B + Select.
ld a, [hl]
and D_DOWN + B_BUTTON + SELECT
cp D_DOWN + B_BUTTON + SELECT
and PAD_DOWN + PAD_B + PAD_SELECT
cp PAD_DOWN + PAD_B + PAD_SELECT
jr z, .reset_clock
; Press Start or A to start the game.
ld a, [hl]
and START | A_BUTTON
and PAD_START | PAD_A
jr nz, .incave
ret

View File

@ -145,9 +145,9 @@ MainMenuJoypadLoop:
call MainMenu_PrintCurrentTimeAndDay
call GetScrollingMenuJoypad
ld a, [wMenuJoypad]
cp B_BUTTON
cp PAD_B
jr z, .b_button
cp A_BUTTON
cp PAD_A
jr z, .a_button
jr .loop

View File

@ -12,7 +12,7 @@ _2DMenu_::
bit STATICMENU_ENABLE_SELECT_F, a
jr z, .skip
call GetMenuJoypad
bit SELECT_F, a
bit B_PAD_SELECT, a
jr nz, .quit1
.skip
@ -173,14 +173,14 @@ Init2DMenuCursorPosition:
.InitFlags_c:
ld hl, wMenuDataFlags
ld a, A_BUTTON
ld a, PAD_A
bit STATICMENU_DISABLE_B_F, [hl]
jr nz, .skip
or B_BUTTON
or PAD_B
.skip
bit STATICMENU_ENABLE_SELECT_F, [hl]
jr z, .skip2
or SELECT
or PAD_SELECT
.skip2
ld [wMenuJoypadFilter], a
ret
@ -254,17 +254,17 @@ _2DMenuInterpretJoypad:
jp nz, .a_b_start_select
bit B_BUTTON_F, a
jp nz, .a_b_start_select
bit SELECT_F, a
bit B_PAD_SELECT, a
jp nz, .a_b_start_select
bit START_F, a
bit B_PAD_START, a
jp nz, .a_b_start_select
bit D_RIGHT_F, a
bit B_PAD_RIGHT, a
jr nz, .d_right
bit D_LEFT_F, a
bit B_PAD_LEFT, a
jr nz, .d_left
bit D_UP_F, a
bit B_PAD_UP, a
jr nz, .d_up
bit D_DOWN_F, a
bit B_PAD_DOWN, a
jr nz, .d_down
and a
ret
@ -649,10 +649,10 @@ _InitVerticalMenuCursor::
ln a, 2, 0
ld [hli], a
; wMenuJoypadFilter
ld a, A_BUTTON
ld a, PAD_A
bit STATICMENU_DISABLE_B_F, b
jr nz, .skip_bit_1
add B_BUTTON
add PAD_B
.skip_bit_1
ld [hli], a
; wMenuCursorY

View File

@ -376,16 +376,16 @@ NamingScreenJoypadLoop:
.ReadButtons:
ld hl, hJoyPressed
ld a, [hl]
and A_BUTTON
and PAD_A
jr nz, .a
ld a, [hl]
and B_BUTTON
and PAD_B
jr nz, .b
ld a, [hl]
and START
and PAD_START
jr nz, .start
ld a, [hl]
and SELECT
and PAD_SELECT
jr nz, .select
ret
@ -531,16 +531,16 @@ NamingScreen_AnimateCursor:
.GetDPad:
ld hl, hJoyLast
ld a, [hl]
and D_UP
and PAD_UP
jr nz, .up
ld a, [hl]
and D_DOWN
and PAD_DOWN
jr nz, .down
ld a, [hl]
and D_LEFT
and PAD_LEFT
jr nz, .left
ld a, [hl]
and D_RIGHT
and PAD_RIGHT
jr nz, .right
ret
@ -1057,16 +1057,16 @@ INCBIN "gfx/naming_screen/mail.2bpp"
.process_joypad
ld hl, hJoyPressed
ld a, [hl]
and A_BUTTON
and PAD_A
jr nz, .a
ld a, [hl]
and B_BUTTON
and PAD_B
jr nz, .b
ld a, [hl]
and START
and PAD_START
jr nz, .start
ld a, [hl]
and SELECT
and PAD_SELECT
jr nz, .select
ret
@ -1184,16 +1184,16 @@ ComposeMail_AnimateCursor:
.GetDPad:
ld hl, hJoyLast
ld a, [hl]
and D_UP
and PAD_UP
jr nz, .up
ld a, [hl]
and D_DOWN
and PAD_DOWN
jr nz, .down
ld a, [hl]
and D_LEFT
and PAD_LEFT
jr nz, .left
ld a, [hl]
and D_RIGHT
and PAD_RIGHT
jr nz, .right
ret

View File

@ -53,7 +53,7 @@ _Option:
.joypad_loop
call JoyTextDelay
ldh a, [hJoyPressed]
and START | B_BUTTON
and PAD_START | PAD_B
jr nz, .ExitOptions
call OptionsControl
jr c, .dpad
@ -110,9 +110,9 @@ GetOptionPointer:
Options_TextSpeed:
call GetTextSpeed
ldh a, [hJoyPressed]
bit D_LEFT_F, a
bit B_PAD_LEFT, a
jr nz, .LeftPressed
bit D_RIGHT_F, a
bit B_PAD_RIGHT, a
jr z, .NonePressed
ld a, c ; right pressed
cp OPT_TEXT_SPEED_SLOW
@ -191,9 +191,9 @@ GetTextSpeed:
Options_BattleScene:
ld hl, wOptions
ldh a, [hJoyPressed]
bit D_LEFT_F, a
bit B_PAD_LEFT, a
jr nz, .LeftPressed
bit D_RIGHT_F, a
bit B_PAD_RIGHT, a
jr z, .NonePressed
bit BATTLE_SCENE, [hl]
jr nz, .ToggleOn
@ -230,9 +230,9 @@ Options_BattleScene:
Options_BattleStyle:
ld hl, wOptions
ldh a, [hJoyPressed]
bit D_LEFT_F, a
bit B_PAD_LEFT, a
jr nz, .LeftPressed
bit D_RIGHT_F, a
bit B_PAD_RIGHT, a
jr z, .NonePressed
bit BATTLE_SHIFT, [hl]
jr nz, .ToggleShift
@ -268,9 +268,9 @@ Options_BattleStyle:
Options_Sound:
ld hl, wOptions
ldh a, [hJoyPressed]
bit D_LEFT_F, a
bit B_PAD_LEFT, a
jr nz, .LeftPressed
bit D_RIGHT_F, a
bit B_PAD_RIGHT, a
jr z, .NonePressed
bit STEREO, [hl]
jr nz, .SetMono
@ -320,9 +320,9 @@ Options_Sound:
Options_Print:
call GetPrinterSetting
ldh a, [hJoyPressed]
bit D_LEFT_F, a
bit B_PAD_LEFT, a
jr nz, .LeftPressed
bit D_RIGHT_F, a
bit B_PAD_RIGHT, a
jr z, .NonePressed
ld a, c
cp OPT_PRINT_DARKEST
@ -415,9 +415,9 @@ GetPrinterSetting:
Options_MenuAccount:
ld hl, wOptions2
ldh a, [hJoyPressed]
bit D_LEFT_F, a
bit B_PAD_LEFT, a
jr nz, .LeftPressed
bit D_RIGHT_F, a
bit B_PAD_RIGHT, a
jr z, .NonePressed
bit MENU_ACCOUNT, [hl]
jr nz, .ToggleOff
@ -453,9 +453,9 @@ Options_MenuAccount:
Options_Frame:
ld hl, wTextboxFrame
ldh a, [hJoyPressed]
bit D_LEFT_F, a
bit B_PAD_LEFT, a
jr nz, .LeftPressed
bit D_RIGHT_F, a
bit B_PAD_RIGHT, a
jr nz, .RightPressed
and a
ret
@ -483,7 +483,7 @@ UpdateFrame:
Options_Cancel:
ldh a, [hJoyPressed]
and A_BUTTON
and PAD_A
jr nz, .Exit
and a
ret
@ -495,9 +495,9 @@ Options_Cancel:
OptionsControl:
ld hl, wJumptableIndex
ldh a, [hJoyLast]
cp D_DOWN
cp PAD_DOWN
jr z, .DownPressed
cp D_UP
cp PAD_UP
jr z, .UpPressed
and a
ret

View File

@ -55,26 +55,26 @@ ScrollingMenuJoyAction:
.loop
call ScrollingMenuJoypad
ldh a, [hJoyLast]
and D_PAD
and PAD_CTRL_PAD
ld b, a
ldh a, [hJoyPressed]
and BUTTONS
and PAD_BUTTONS
or b
bit A_BUTTON_F, a
jp nz, .a_button
bit B_BUTTON_F, a
jp nz, .b_button
bit SELECT_F, a
bit B_PAD_SELECT, a
jp nz, .select
bit START_F, a
bit B_PAD_START, a
jp nz, .start
bit D_RIGHT_F, a
bit B_PAD_RIGHT, a
jp nz, .d_right
bit D_LEFT_F, a
bit B_PAD_LEFT, a
jp nz, .d_left
bit D_UP_F, a
bit B_PAD_UP, a
jp nz, .d_up
bit D_DOWN_F, a
bit B_PAD_DOWN, a
jp nz, .d_down
jr .loop
@ -99,12 +99,12 @@ ScrollingMenuJoyAction:
ld a, [wMenuSelection]
cp -1
jr z, .b_button
ld a, A_BUTTON
ld a, PAD_A
scf
ret
.b_button
ld a, B_BUTTON
ld a, PAD_B
scf
ret
@ -121,7 +121,7 @@ ScrollingMenuJoyAction:
call ScrollingMenu_GetCursorPosition
dec a
ld [wScrollingMenuCursorPosition], a
ld a, SELECT
ld a, PAD_SELECT
scf
ret
@ -129,7 +129,7 @@ ScrollingMenuJoyAction:
ld a, [wMenuDataFlags]
bit SCROLLINGMENU_ENABLE_START_F, a
jp z, xor_a_dec_a
ld a, START
ld a, PAD_START
scf
ret
@ -140,7 +140,7 @@ ScrollingMenuJoyAction:
ld a, [wMenuDataFlags]
bit SCROLLINGMENU_ENABLE_LEFT_F, a
jp z, xor_a_dec_a
ld a, D_LEFT
ld a, PAD_LEFT
scf
ret
@ -151,7 +151,7 @@ ScrollingMenuJoyAction:
ld a, [wMenuDataFlags]
bit SCROLLINGMENU_ENABLE_RIGHT_F, a
jp z, xor_a_dec_a
ld a, D_RIGHT
ld a, PAD_RIGHT
scf
ret
@ -293,15 +293,15 @@ ScrollingMenu_InitFlags:
ld [w2DMenuFlags2], a
ld a, $20
ld [w2DMenuCursorOffsets], a
ld a, A_BUTTON | B_BUTTON | D_UP | D_DOWN
ld a, PAD_A | PAD_B | PAD_UP | PAD_DOWN
bit SCROLLINGMENU_ENABLE_SELECT_F, c
jr z, .disallow_select
add SELECT
add PAD_SELECT
.disallow_select
bit SCROLLINGMENU_ENABLE_START_F, c
jr z, .disallow_start
add START
add PAD_START
.disallow_start
ld [wMenuJoypadFilter], a

View File

@ -104,9 +104,9 @@ StartMenu::
call .PrintMenuAccount
call GetScrollingMenuJoypad
ld a, [wMenuJoypad]
cp B_BUTTON
cp PAD_B
jr z, .b
cp A_BUTTON
cp PAD_A
jr z, .a
jr .loop
.a

View File

@ -25,7 +25,7 @@ TrainerCard:
bit JUMPTABLE_EXIT_F, a
jr nz, .quit
ldh a, [hJoyLast]
and B_BUTTON
and PAD_B
jr nz, .quit
call .RunJumptable
call DelayFrame
@ -117,7 +117,7 @@ TrainerCard_Page1_Joypad:
call TrainerCard_Page1_PrintGameTime
ld hl, hJoyLast
ld a, [hl]
and D_RIGHT | A_BUTTON
and PAD_RIGHT | PAD_A
jr nz, .pressed_right_a
ret
@ -157,10 +157,10 @@ TrainerCard_Page2_Joypad:
call TrainerCard_Page2_3_AnimateBadges
ld hl, hJoyLast
ld a, [hl]
and A_BUTTON
and PAD_A
jr nz, .Quit
ld a, [hl]
and D_LEFT
and PAD_LEFT
jr nz, .d_left
ret
@ -205,10 +205,10 @@ TrainerCard_Page3_Joypad:
call TrainerCard_Page2_3_AnimateBadges
ld hl, hJoyLast
ld a, [hl]
and D_LEFT
and PAD_LEFT
jr nz, .left
ld a, [hl]
and D_RIGHT
and PAD_RIGHT
jr nz, .right
ret

View File

@ -106,7 +106,7 @@ Credits::
Credits_HandleAButton:
ldh a, [hJoypadDown]
and A_BUTTON
and PAD_A
ret z
ld a, [wJumptableIndex]
bit JUMPTABLE_EXIT_F, a
@ -114,7 +114,7 @@ Credits_HandleAButton:
Credits_HandleBButton:
ldh a, [hJoypadDown]
and B_BUTTON
and PAD_B
ret z
ld a, [wJumptableIndex]
bit ALLOW_SKIPPING_CREDITS_F, a

View File

@ -173,7 +173,7 @@ EvolutionAnimation:
call JoyTextDelay
ldh a, [hJoyDown]
pop bc
and B_BUTTON
and PAD_B
jr nz, .pressed_b
.loop3
dec c

View File

@ -15,7 +15,7 @@ GoldSilverIntro:
.PlayFrame:
call JoyTextDelay
ldh a, [hJoyLast]
and BUTTONS
and PAD_BUTTONS
jr nz, .Finish
; check done flag

View File

@ -88,7 +88,7 @@ GameFreakPresentsFrame:
call JoyTextDelay
ldh a, [hJoyLast]
and BUTTONS
and PAD_BUTTONS
jr nz, .pressed_button
; high bits of wJumptableIndex are recycled for some flags

View File

@ -376,7 +376,7 @@ PopulateDecoCategoryMenu:
ld [wMenuScrollPosition], a
call ScrollingMenu
ld a, [wMenuJoypad]
cp B_BUTTON
cp PAD_B
jr z, .no_action_2
call DoDecorationAction2

View File

@ -499,7 +499,7 @@ OWPlayerInput:
CheckAPressOW:
ldh a, [hJoyPressed]
and A_BUTTON
and PAD_A
ret z
call TryObjectEvent
ret c
@ -805,10 +805,10 @@ CheckMenuOW:
ldh [hUnusedByte], a
ldh a, [hJoyPressed]
bit SELECT_F, a
bit B_PAD_SELECT, a
jr nz, .Select
bit START_F, a
bit B_PAD_START, a
jr z, .NoMenu
ld a, BANK(StartMenuScript)

View File

@ -21,11 +21,11 @@ DoPlayerMovement::
ret z
ld c, a
and D_PAD
and PAD_CTRL_PAD
ret nz
ld a, c
or D_DOWN
or PAD_DOWN
ld [wCurInput], a
ret
@ -546,13 +546,13 @@ DoPlayerMovement::
ld hl, .forced_dpad
add hl, de
ld a, [wCurInput]
and BUTTONS
and PAD_BUTTONS
or [hl]
ld [wCurInput], a
ret
.forced_dpad
db D_DOWN, D_UP, D_LEFT, D_RIGHT
db PAD_DOWN, PAD_UP, PAD_LEFT, PAD_RIGHT
.GetAction:
; Poll player input and update movement info.
@ -560,13 +560,13 @@ DoPlayerMovement::
ld hl, .action_table
ld de, .action_table_1_end - .action_table_1
ld a, [wCurInput]
bit D_DOWN_F, a
bit B_PAD_DOWN, a
jr nz, .d_down
bit D_UP_F, a
bit B_PAD_UP, a
jr nz, .d_up
bit D_LEFT_F, a
bit B_PAD_LEFT, a
jr nz, .d_left
bit D_RIGHT_F, a
bit B_PAD_RIGHT, a
jr nz, .d_right
; Standing
jr .update

View File

@ -264,16 +264,16 @@ Pokedex_InitMainScreen:
Pokedex_UpdateMainScreen:
ld hl, hJoyPressed
ld a, [hl]
and B_BUTTON
and PAD_B
jr nz, .b
ld a, [hl]
and A_BUTTON
and PAD_A
jr nz, .a
ld a, [hl]
and SELECT
and PAD_SELECT
jr nz, .select
ld a, [hl]
and START
and PAD_START
jr nz, .start
call Pokedex_ListingHandleDPadInput
ret nc
@ -353,11 +353,11 @@ Pokedex_UpdateDexEntryScreen:
call Pokedex_MoveArrowCursor
ld hl, hJoyPressed
ld a, [hl]
and B_BUTTON
and PAD_B
jr nz, .return_to_prev_screen
vc_hook Forbid_printing_Pokedex
ld a, [hl]
and A_BUTTON
and PAD_A
jr nz, .do_menu_action
call Pokedex_NextOrPreviousDexEntry
ret nc
@ -420,7 +420,7 @@ Pokedex_ReinitDexEntryScreen:
ret
DexEntryScreen_ArrowCursorData:
db D_RIGHT | D_LEFT, 4
db PAD_RIGHT | PAD_LEFT, 4
dwcoord 1, 17 ; PAGE
dwcoord 6, 17 ; AREA
dwcoord 11, 17 ; CRY
@ -537,10 +537,10 @@ Pokedex_UpdateOptionScreen:
call c, Pokedex_DisplayModeDescription
ld hl, hJoyPressed
ld a, [hl]
and SELECT | B_BUTTON
and PAD_SELECT | PAD_B
jr nz, .return_to_main_screen
ld a, [hl]
and A_BUTTON
and PAD_A
jr nz, .do_menu_action
ret
@ -557,13 +557,13 @@ Pokedex_UpdateOptionScreen:
ret
.NoUnownModeArrowCursorData:
db D_UP | D_DOWN, 3
db PAD_UP | PAD_DOWN, 3
dwcoord 2, 4 ; NEW
dwcoord 2, 6 ; OLD
dwcoord 2, 8 ; ABC
.ArrowCursorData:
db D_UP | D_DOWN, 4
db PAD_UP | PAD_DOWN, 4
dwcoord 2, 4 ; NEW
dwcoord 2, 6 ; OLD
dwcoord 2, 8 ; ABC
@ -639,10 +639,10 @@ Pokedex_UpdateSearchScreen:
call c, Pokedex_PlaceSearchScreenTypeStrings
ld hl, hJoyPressed
ld a, [hl]
and START | B_BUTTON
and PAD_START | PAD_B
jr nz, .cancel
ld a, [hl]
and A_BUTTON
and PAD_A
jr nz, .do_menu_action
ret
@ -659,7 +659,7 @@ Pokedex_UpdateSearchScreen:
ret
.ArrowCursorData:
db D_UP | D_DOWN, 4
db PAD_UP | PAD_DOWN, 4
dwcoord 2, 4 ; TYPE 1
dwcoord 2, 6 ; TYPE 2
dwcoord 2, 13 ; BEGIN SEARCH
@ -754,10 +754,10 @@ Pokedex_InitSearchResultsScreen:
Pokedex_UpdateSearchResultsScreen:
ld hl, hJoyPressed
ld a, [hl]
and B_BUTTON
and PAD_B
jr nz, .return_to_search_screen
ld a, [hl]
and A_BUTTON
and PAD_A
jr nz, .go_to_dex_entry
call Pokedex_ListingHandleDPadInput
ret nc
@ -814,7 +814,7 @@ Pokedex_InitUnownMode:
Pokedex_UpdateUnownMode:
ld hl, hJoyPressed
ld a, [hl]
and A_BUTTON | B_BUTTON
and PAD_A | PAD_B
jr nz, .a_b
call Pokedex_UnownModeHandleDPadInput
ret
@ -841,10 +841,10 @@ Pokedex_UpdateUnownMode:
Pokedex_UnownModeHandleDPadInput:
ld hl, hJoyLast
ld a, [hl]
and D_RIGHT
and PAD_RIGHT
jr nz, .right
ld a, [hl]
and D_LEFT
and PAD_LEFT
jr nz, .left
ret
@ -911,10 +911,10 @@ Pokedex_NextOrPreviousDexEntry:
ld [wBackupDexListingPage], a
ld hl, hJoyLast
ld a, [hl]
and D_UP
and PAD_UP
jr nz, .up
ld a, [hl]
and D_DOWN
and PAD_DOWN
jr nz, .down
and a
ret
@ -963,19 +963,19 @@ Pokedex_ListingHandleDPadInput:
ld e, a
ld hl, hJoyLast
ld a, [hl]
and D_UP
and PAD_UP
jr nz, Pokedex_ListingMoveCursorUp
ld a, [hl]
and D_DOWN
and PAD_DOWN
jr nz, Pokedex_ListingMoveCursorDown
ld a, d
cp e
jr nc, Pokedex_ListingPosStayedSame
ld a, [hl]
and D_LEFT
and PAD_LEFT
jr nz, Pokedex_ListingMoveUpOnePage
ld a, [hl]
and D_RIGHT
and PAD_RIGHT
jr nz, Pokedex_ListingMoveDownOnePage
jr Pokedex_ListingPosStayedSame
@ -1776,10 +1776,10 @@ Pokedex_UpdateSearchMonType:
jr nc, .no_change
ld hl, hJoyLast
ld a, [hl]
and D_LEFT
and PAD_LEFT
jr nz, Pokedex_PrevSearchMonType
ld a, [hl]
and D_RIGHT
and PAD_RIGHT
jr nz, Pokedex_NextSearchMonType
.no_change
and a
@ -2197,26 +2197,26 @@ Pokedex_MoveArrowCursor:
ld hl, hJoyPressed
ld a, [hl]
and D_LEFT | D_UP
and PAD_LEFT | PAD_UP
and b
jr nz, .move_left_or_up
ld a, [hl]
and D_RIGHT | D_DOWN
and PAD_RIGHT | PAD_DOWN
and b
jr nz, .move_right_or_down
ld a, [hl]
and SELECT
and PAD_SELECT
and b
jr nz, .select
call Pokedex_ArrowCursorDelay
jr c, .no_action
ld hl, hJoyLast
ld a, [hl]
and D_LEFT | D_UP
and PAD_LEFT | PAD_UP
and b
jr nz, .move_left_or_up
ld a, [hl]
and D_RIGHT | D_DOWN
and PAD_RIGHT | PAD_DOWN
and b
jr nz, .move_right_or_down
jr .no_action

View File

@ -455,10 +455,10 @@ PokegearClock_Joypad:
call .UpdateClock
ld hl, hJoyLast
ld a, [hl]
and A_BUTTON | B_BUTTON | START | SELECT
and PAD_A | PAD_B | PAD_START | PAD_SELECT
jr nz, .quit
ld a, [hl]
and D_RIGHT
and PAD_RIGHT
ret z
ld a, [wPokegearFlags]
bit POKEGEAR_MAP_CARD_F, a
@ -562,13 +562,13 @@ PokegearMap_JohtoMap:
PokegearMap_ContinueMap:
ld hl, hJoyLast
ld a, [hl]
and B_BUTTON
and PAD_B
jr nz, .cancel
ld a, [hl]
and D_RIGHT
and PAD_RIGHT
jr nz, .right
ld a, [hl]
and D_LEFT
and PAD_LEFT
jr nz, .left
call .DPad
ret
@ -604,10 +604,10 @@ PokegearMap_ContinueMap:
.DPad:
ld hl, hJoyLast
ld a, [hl]
and D_UP
and PAD_UP
jr nz, .up
ld a, [hl]
and D_DOWN
and PAD_DOWN
jr nz, .down
ret
@ -739,10 +739,10 @@ PokegearRadio_Init:
PokegearRadio_Joypad:
ld hl, hJoyLast
ld a, [hl]
and B_BUTTON
and PAD_B
jr nz, .cancel
ld a, [hl]
and D_LEFT
and PAD_LEFT
jr nz, .left
ld a, [wPokegearRadioChannelAddr]
ld l, a
@ -798,17 +798,17 @@ PokegearPhone_Init:
PokegearPhone_Joypad:
ld hl, hJoyPressed
ld a, [hl]
and B_BUTTON
and PAD_B
jr nz, .b
ld a, [hl]
and A_BUTTON
and PAD_A
jr nz, .a
ld hl, hJoyLast
ld a, [hl]
and D_LEFT
and PAD_LEFT
jr nz, .left
ld a, [hl]
and D_RIGHT
and PAD_RIGHT
jr nz, .right
call PokegearPhone_GetDPad
ret
@ -923,7 +923,7 @@ PokegearPhone_MakePhoneCall:
PokegearPhone_FinishPhoneCall:
ldh a, [hJoyPressed]
and A_BUTTON | B_BUTTON
and PAD_A | PAD_B
ret z
farcall HangUp
ld a, POKEGEARSTATE_PHONEJOYPAD
@ -935,10 +935,10 @@ PokegearPhone_FinishPhoneCall:
PokegearPhone_GetDPad:
ld hl, hJoyLast
ld a, [hl]
and D_UP
and PAD_UP
jr nz, .up
ld a, [hl]
and D_DOWN
and PAD_DOWN
jr nz, .down
ret
@ -1127,13 +1127,13 @@ PokegearPhoneContactSubmenu:
pop de
ld hl, hJoyPressed
ld a, [hl]
and D_UP
and PAD_UP
jr nz, .d_up
ld a, [hl]
and D_DOWN
and PAD_DOWN
jr nz, .d_down
ld a, [hl]
and A_BUTTON | B_BUTTON
and PAD_A | PAD_B
jr nz, .a_b
call DelayFrame
jr .loop
@ -1166,7 +1166,7 @@ PokegearPhoneContactSubmenu:
ldh [hBGMapMode], a
pop hl
ldh a, [hJoyPressed]
and B_BUTTON
and PAD_B
jr nz, .Cancel
ld a, [wPokegearPhoneSubmenuCursor]
ld e, a
@ -1364,10 +1364,10 @@ AnimateTuningKnob:
.TuningKnob:
ld hl, hJoyLast
ld a, [hl]
and D_DOWN
and PAD_DOWN
jr nz, .down
ld a, [hl]
and D_UP
and PAD_UP
jr nz, .up
ret
@ -1783,16 +1783,16 @@ _TownMap:
call JoyTextDelay
ld hl, hJoyPressed
ld a, [hl]
and B_BUTTON
and PAD_B
ret nz
ld hl, hJoyLast
ld a, [hl]
and D_UP
and PAD_UP
jr nz, .pressed_up
ld a, [hl]
and D_DOWN
and PAD_DOWN
jr nz, .pressed_down
.loop2
push de
@ -1884,7 +1884,7 @@ PlayRadio:
.loop
call JoyTextDelay
ldh a, [hJoyPressed]
and A_BUTTON | B_BUTTON
and PAD_A | PAD_B
jr nz, .stop
ld a, [wPokegearRadioChannelAddr]
ld l, a
@ -1999,10 +1999,10 @@ _FlyMap:
call JoyTextDelay
ld hl, hJoyPressed
ld a, [hl]
and B_BUTTON
and PAD_B
jr nz, .pressedB
ld a, [hl]
and A_BUTTON
and PAD_A
jr nz, .pressedA
call .HandleDPad
call GetMapCursorCoordinates
@ -2044,10 +2044,10 @@ _FlyMap:
ld d, a
ld hl, hJoyLast
ld a, [hl]
and D_UP
and PAD_UP
jr nz, .ScrollNext
ld a, [hl]
and D_DOWN
and PAD_DOWN
jr nz, .ScrollPrev
ret
@ -2324,10 +2324,10 @@ Pokedex_GetArea:
call JoyTextDelay
ld hl, hJoyPressed
ld a, [hl]
and A_BUTTON | B_BUTTON
and PAD_A | PAD_B
jr nz, .a_b
ldh a, [hJoypadDown]
and SELECT
and PAD_SELECT
jr nz, .select
call .LeftRightInput
call .BlinkNestIcons
@ -2349,10 +2349,10 @@ Pokedex_GetArea:
.LeftRightInput:
ld a, [hl]
and D_LEFT
and PAD_LEFT
jr nz, .left
ld a, [hl]
and D_RIGHT
and PAD_RIGHT
jr nz, .right
ret
@ -2768,10 +2768,10 @@ EntireFlyMap: ; unreferenced
call JoyTextDelay
ld hl, hJoyPressed
ld a, [hl]
and B_BUTTON
and PAD_B
jr nz, .pressedB
ld a, [hl]
and A_BUTTON
and PAD_A
jr nz, .pressedA
call .HandleDPad
call GetMapCursorCoordinates
@ -2809,10 +2809,10 @@ EntireFlyMap: ; unreferenced
.HandleDPad:
ld hl, hJoyLast
ld a, [hl]
and D_DOWN | D_RIGHT
and PAD_DOWN | PAD_RIGHT
jr nz, .ScrollNext
ld a, [hl]
and D_UP | D_LEFT
and PAD_UP | PAD_LEFT
jr nz, .ScrollPrev
ret

View File

@ -72,10 +72,10 @@ _DepositPKMN:
.HandleJoypad:
ld hl, hJoyPressed
ld a, [hl]
and B_BUTTON
and PAD_B
jr nz, .b_button
ld a, [hl]
and A_BUTTON
and PAD_A
jr nz, .a_button
call Withdraw_UpDown
and a
@ -315,10 +315,10 @@ _WithdrawPKMN:
.Joypad:
ld hl, hJoyPressed
ld a, [hl]
and B_BUTTON
and PAD_B
jr nz, .b_button
ld a, [hl]
and A_BUTTON
and PAD_A
jr nz, .a_button
call Withdraw_UpDown
and a
@ -556,10 +556,10 @@ _MovePKMNWithoutMail:
.Joypad:
ld hl, hJoyPressed
ld a, [hl]
and B_BUTTON
and PAD_B
jr nz, .b_button
ld a, [hl]
and A_BUTTON
and PAD_A
jr nz, .a_button
call MoveMonWithoutMail_DPad
jr c, .d_pad
@ -705,10 +705,10 @@ _MovePKMNWithoutMail:
.Joypad2:
ld hl, hJoyPressed
ld a, [hl]
and B_BUTTON
and PAD_B
jr nz, .b_button_2
ld a, [hl]
and A_BUTTON
and PAD_A
jr nz, .a_button_2
call MoveMonWithoutMail_DPad_2
jr c, .dpad_2
@ -795,10 +795,10 @@ _StatsScreenDPad:
jr z, .empty
ld e, a
ld a, [hl]
and D_UP
and PAD_UP
jr nz, BillsPC_PressUp
ld a, [hl]
and D_DOWN
and PAD_DOWN
jr nz, BillsPC_PressDown
.empty
jp BillsPC_JoypadDidNothing
@ -812,10 +812,10 @@ Withdraw_UpDown:
and a
jr z, .empty
ld a, [hl]
and D_UP
and PAD_UP
jr nz, BillsPC_PressUp
ld a, [hl]
and D_DOWN
and PAD_DOWN
jr nz, BillsPC_PressDown
.empty
jp BillsPC_JoypadDidNothing
@ -829,18 +829,18 @@ MoveMonWithoutMail_DPad:
and a
jr z, .check_left_right
ld a, [hl]
and D_UP
and PAD_UP
jr nz, BillsPC_PressUp
ld a, [hl]
and D_DOWN
and PAD_DOWN
jr nz, BillsPC_PressDown
.check_left_right
ld a, [hl]
and D_LEFT
and PAD_LEFT
jr nz, BillsPC_PressLeft
ld a, [hl]
and D_RIGHT
and PAD_RIGHT
jr nz, BillsPC_PressRight
jr BillsPC_JoypadDidNothing
@ -854,18 +854,18 @@ MoveMonWithoutMail_DPad_2:
jr z, .check_left_right
ld a, [hl]
and D_UP
and PAD_UP
jr nz, BillsPC_PressUp
ld a, [hl]
and D_DOWN
and PAD_DOWN
jr nz, BillsPC_PressDown
.check_left_right
ld a, [hl]
and D_LEFT
and PAD_LEFT
jr nz, BillsPC_PressLeft
ld a, [hl]
and D_RIGHT
and PAD_RIGHT
jr nz, BillsPC_PressRight
jr BillsPC_JoypadDidNothing
@ -1644,11 +1644,11 @@ StatsScreenDPad:
call JoyTextDelay
ld hl, hJoyPressed
ld a, [hl]
and A_BUTTON | B_BUTTON | D_RIGHT | D_LEFT
and PAD_A | PAD_B | PAD_RIGHT | PAD_LEFT
ld [wMenuJoypad], a
jr nz, .pressed_a_b_right_left
ld a, [hl]
and D_DOWN | D_UP
and PAD_DOWN | PAD_UP
ld [wMenuJoypad], a
jr nz, .pressed_down_up
call DelayFrame
@ -2216,7 +2216,7 @@ _ChangeBox:
call Textbox
call ScrollingMenu
ld a, [wMenuJoypad]
cp B_BUTTON
cp PAD_B
jr z, .done
call BillsPC_PlaceWhatsUpString
call BillsPC_ChangeBoxSubmenu

View File

@ -392,7 +392,7 @@ MailboxPC:
ld [wCurMessageIndex], a
ld a, [wMenuJoypad]
cp B_BUTTON
cp PAD_B
jr z, .exit
call .Submenu
jr .loop

View File

@ -46,13 +46,13 @@ ReadAnyMail:
.loop
call GetJoypad
ldh a, [hJoyPressed]
and A_BUTTON | B_BUTTON | START
and PAD_A | PAD_B | PAD_START
jr z, .loop
vc_patch Forbid_printing_mail
if DEF(_GOLD_VC) || DEF(_SILVER_VC)
and NO_INPUT
else
and START
and PAD_START
endc
vc_patch_end
jr nz, .pressed_start

View File

@ -853,7 +853,7 @@ DeleteMoveScreen2DMenuData:
db _2DMENU_ENABLE_SPRITE_ANIMS ; flags 1
db 0 ; flags 2
dn 2, 0 ; cursor offset
db D_UP | D_DOWN | A_BUTTON | B_BUTTON ; accepted buttons
db PAD_UP | PAD_DOWN | PAD_A | PAD_B ; accepted buttons
ManagePokemonMoves:
ld a, [wCurPartySpecies]
@ -892,9 +892,9 @@ MoveScreenLoop:
jp nz, .b_button
bit A_BUTTON_F, a
jp nz, .a_button
bit D_RIGHT_F, a
bit B_PAD_RIGHT, a
jp nz, .d_right
bit D_LEFT_F, a
bit B_PAD_LEFT, a
jp nz, .d_left
.skip_joy
@ -1083,7 +1083,7 @@ MoveScreen2DMenuData:
db _2DMENU_ENABLE_SPRITE_ANIMS ; flags 1
db 0 ; flags 2
dn 2, 0 ; cursor offsets
db D_UP | D_DOWN | D_LEFT | D_RIGHT | A_BUTTON | B_BUTTON ; accepted buttons
db PAD_UP | PAD_DOWN | PAD_LEFT | PAD_RIGHT | PAD_A | PAD_B ; accepted buttons
String_MoveWhere:
db "Where?@"

View File

@ -555,7 +555,7 @@ InitPartyMenuWithCancel:
.done
ld [wMenuCursorY], a
ld a, A_BUTTON | B_BUTTON
ld a, PAD_A | PAD_B
ld [wMenuJoypadFilter], a
ret
@ -576,7 +576,7 @@ InitPartyMenuNoCancel:
ld a, 1
.done
ld [wMenuCursorY], a
ld a, A_BUTTON | B_BUTTON
ld a, PAD_A | PAD_B
ld [wMenuJoypadFilter], a
ret

View File

@ -79,7 +79,7 @@ StatsScreen_LoadPage:
pop de
pop hl
ld a, [wMenuJoypad]
and D_DOWN | D_UP
and PAD_DOWN | PAD_UP
jr nz, StatsScreenMain
ld a, [wMenuJoypad]
jr .joypad_action
@ -88,17 +88,17 @@ StatsScreen_LoadPage:
ldh a, [hJoyPressed]
.joypad_action
and D_DOWN | D_UP | D_LEFT | D_RIGHT | A_BUTTON | B_BUTTON
and PAD_DOWN | PAD_UP | PAD_LEFT | PAD_RIGHT | PAD_A | PAD_B
jr z, .joypad_loop
bit B_BUTTON_F, a
jp nz, StatsScreen_Exit
bit D_LEFT_F, a
bit B_PAD_LEFT, a
jr nz, .d_left
bit D_RIGHT_F, a
bit B_PAD_RIGHT, a
jr nz, .d_right
bit A_BUTTON_F, a
jr nz, .a_button
bit D_UP_F, a
bit B_PAD_UP, a
jr nz, .d_up
; down
@ -192,7 +192,7 @@ EggStats_JoypadLoop:
pop de
pop hl
ld a, [wMenuJoypad]
and D_DOWN | D_UP
and PAD_DOWN | PAD_UP
jp nz, StatsScreenMain
ld a, [wMenuJoypad]
jr .joypad_action
@ -200,15 +200,15 @@ EggStats_JoypadLoop:
.not_tempmon
ldh a, [hJoyPressed]
.joypad_action
and D_DOWN | D_UP | A_BUTTON | B_BUTTON
and PAD_DOWN | PAD_UP | PAD_A | PAD_B
jr z, EggStats_JoypadLoop
bit A_BUTTON_F, a
jr nz, StatsScreen_Exit
bit B_BUTTON_F, a
jr nz, StatsScreen_Exit
bit D_UP_F, a
bit B_PAD_UP, a
jr nz, EggStats_UpAction
bit D_DOWN_F, a
bit B_PAD_DOWN, a
jp EggStats_DownAction
StatsScreen_Exit:

View File

@ -444,7 +444,7 @@ _PrintDiploma:
CheckCancelPrint:
ldh a, [hJoyDown]
and B_BUTTON
and PAD_B
jr nz, .pressed_b
and a
ret

View File

@ -71,10 +71,10 @@ ClockResetPassword:
call JoyTextDelay
ldh a, [hJoyLast]
ld b, a
and A_BUTTON
and PAD_A
jr nz, .confirm
ld a, b
and D_PAD
and PAD_CTRL_PAD
jr z, .loop2
call .dpadinput
ld c, 3
@ -126,16 +126,16 @@ ClockResetPassword:
.dpadinput
ld a, b
and D_LEFT
and PAD_LEFT
jr nz, .left
ld a, b
and D_RIGHT
and PAD_RIGHT
jr nz, .right
ld a, b
and D_UP
and PAD_UP
jr nz, .up
ld a, b
and D_DOWN
and PAD_DOWN
jr nz, .down
ret

View File

@ -125,13 +125,13 @@ RestartClock:
jr nz, .press_A
bit B_BUTTON_F, a
jr nz, .press_B
bit D_UP_F, a
bit B_PAD_UP, a
jr nz, .pressed_up
bit D_DOWN_F, a
bit B_PAD_DOWN, a
jr nz, .pressed_down
bit D_LEFT_F, a
bit B_PAD_LEFT, a
jr nz, .pressed_left
bit D_RIGHT_F, a
bit B_PAD_RIGHT, a
jr nz, .pressed_right
jr .joy_loop

View File

@ -130,15 +130,15 @@ InitClock:
SetHour:
ldh a, [hJoyPressed]
and A_BUTTON
and PAD_A
jr nz, .Confirm
ld hl, hJoyLast
ld a, [hl]
and D_UP
and PAD_UP
jr nz, .up
ld a, [hl]
and D_DOWN
and PAD_DOWN
jr nz, .down
call DelayFrame
and a
@ -221,14 +221,14 @@ DisplayHoursMinutesWithMinString: ; unreferenced
SetMinutes:
ldh a, [hJoyPressed]
and A_BUTTON
and PAD_A
jr nz, .a_button
ld hl, hJoyLast
ld a, [hl]
and D_UP
and PAD_UP
jr nz, .d_up
ld a, [hl]
and D_DOWN
and PAD_DOWN
jr nz, .d_down
call DelayFrame
and a
@ -433,7 +433,7 @@ SetDayOfWeek:
.GetJoypadAction:
ldh a, [hJoyPressed]
and A_BUTTON
and PAD_A
jr z, .not_A
scf
ret
@ -441,10 +441,10 @@ SetDayOfWeek:
.not_A
ld hl, hJoyLast
ld a, [hl]
and D_UP
and PAD_UP
jr nz, .d_up
ld a, [hl]
and D_DOWN
and PAD_DOWN
jr nz, .d_down
call DelayFrame
and a

View File

@ -10,13 +10,13 @@ InitSound::
push af
ld a, BANK(_InitSound)
ldh [hROMBank], a
ld [rROMB0], a
ld [rROMB], a
call _InitSound
pop af
ldh [hROMBank], a
ld [rROMB0], a
ld [rROMB], a
pop af
pop bc
@ -34,13 +34,13 @@ UpdateSound::
push af
ld a, BANK(_UpdateSound)
ldh [hROMBank], a
ld [rROMB0], a
ld [rROMB], a
call _UpdateSound
pop af
ldh [hROMBank], a
ld [rROMB0], a
ld [rROMB], a
pop af
pop bc
@ -51,14 +51,14 @@ UpdateSound::
_LoadMusicByte::
; [wCurMusicByte] = [a:de]
ldh [hROMBank], a
ld [rROMB0], a
ld [rROMB], a
ld a, [de]
ld [wCurMusicByte], a
ld a, BANK(LoadMusicByte)
ldh [hROMBank], a
ld [rROMB0], a
ld [rROMB], a
ret
PlayMusic::
@ -73,7 +73,7 @@ PlayMusic::
push af
ld a, BANK(_PlayMusic) ; aka BANK(_InitSound)
ldh [hROMBank], a
ld [rROMB0], a
ld [rROMB], a
ld a, e
and a
@ -88,7 +88,7 @@ PlayMusic::
.end
pop af
ldh [hROMBank], a
ld [rROMB0], a
ld [rROMB], a
pop af
pop bc
pop de
@ -107,7 +107,7 @@ PlayMusic2::
push af
ld a, BANK(_PlayMusic)
ldh [hROMBank], a
ld [rROMB0], a
ld [rROMB], a
push de
ld de, MUSIC_NONE
@ -118,7 +118,7 @@ PlayMusic2::
pop af
ldh [hROMBank], a
ld [rROMB0], a
ld [rROMB], a
pop af
pop bc
@ -140,7 +140,7 @@ PlayCry::
; Cries are stuck in one bank.
ld a, BANK(PokemonCries)
ldh [hROMBank], a
ld [rROMB0], a
ld [rROMB], a
ld hl, PokemonCries
rept MON_CRY_LENGTH
@ -163,13 +163,13 @@ endr
ld a, BANK(_PlayCry)
ldh [hROMBank], a
ld [rROMB0], a
ld [rROMB], a
call _PlayCry
pop af
ldh [hROMBank], a
ld [rROMB0], a
ld [rROMB], a
pop af
pop bc
@ -200,7 +200,7 @@ PlaySFX::
push af
ld a, BANK(_PlaySFX)
ldh [hROMBank], a
ld [rROMB0], a
ld [rROMB], a
ld a, e
ld [wCurSFX], a
@ -208,7 +208,7 @@ PlaySFX::
pop af
ldh [hROMBank], a
ld [rROMB0], a
ld [rROMB], a
.done
pop af

View File

@ -164,7 +164,7 @@ FarCopyRadioText::
ld d, a
ld a, [hli]
ldh [hROMBank], a
ld [rROMB0], a
ld [rROMB], a
ld a, e
ld l, a
ld a, d
@ -174,7 +174,7 @@ FarCopyRadioText::
call CopyBytes
pop af
ldh [hROMBank], a
ld [rROMB0], a
ld [rROMB], a
ret

View File

@ -11,7 +11,7 @@ FarCall::
SECTION "rst10", ROM0[$0010]
Bankswitch::
ldh [hROMBank], a
ld [rROMB0], a
ld [rROMB], a
ret
SECTION "rst18", ROM0[$0018]

View File

@ -97,8 +97,8 @@ endr
; Now that we have the input, we can do stuff with it.
; For example, soft reset:
and A_BUTTON | B_BUTTON | SELECT | START
cp A_BUTTON | B_BUTTON | SELECT | START
and PAD_A | PAD_B | PAD_SELECT | PAD_START
cp PAD_A | PAD_B | PAD_SELECT | PAD_START
jp z, Reset
ret
@ -271,12 +271,12 @@ JoyTitleScreenInput:: ; unreferenced
; Save data can be deleted by pressing Up + B + Select.
ldh a, [hJoyDown]
cp D_UP | SELECT | B_BUTTON
cp PAD_UP | PAD_SELECT | PAD_B
jr z, .keycombo
; Press Start or A to start the game.
ldh a, [hJoyLast]
and START | A_BUTTON
and PAD_START | PAD_A
jr nz, .keycombo
dec c
@ -294,7 +294,7 @@ JoyWaitAorB::
call DelayFrame
call GetJoypad
ldh a, [hJoyPressed]
and A_BUTTON | B_BUTTON
and PAD_A | PAD_B
ret nz
call UpdateTimeAndPals
jr .loop
@ -363,7 +363,7 @@ WaitPressAorB_BlinkCursor::
call JoyTextDelay
ldh a, [hJoyLast]
and A_BUTTON | B_BUTTON
and PAD_A | PAD_B
jr z, .loop
pop af
@ -376,7 +376,7 @@ SimpleWaitPressAorB::
.loop
call JoyTextDelay
ldh a, [hJoyLast]
and A_BUTTON | B_BUTTON
and PAD_A | PAD_B
jr z, .loop
ret
@ -412,7 +412,7 @@ PromptButton::
call .blink_cursor
call JoyTextDelay
ldh a, [hJoyPressed]
and A_BUTTON | B_BUTTON
and PAD_A | PAD_B
jr nz, .received_input
call UpdateTimeAndPals
ld a, $1

View File

@ -36,10 +36,10 @@ GetMenuJoypad::
push bc
push af
ldh a, [hJoyLast]
and D_PAD
and PAD_CTRL_PAD
ld b, a
ldh a, [hJoyPressed]
and BUTTONS
and PAD_BUTTONS
or b
ld b, a
pop af
@ -579,14 +579,14 @@ InitMenuCursorAndButtonPermissions::
ld a, [wMenuDataFlags]
bit STATICMENU_ENABLE_START_F, a
jr z, .disallow_start
set START_F, [hl]
set B_PAD_START, [hl]
.disallow_start
ld a, [wMenuDataFlags]
bit STATICMENU_ENABLE_LEFT_RIGHT_F, a
jr z, .disallow_left_right
set D_LEFT_F, [hl]
set D_RIGHT_F, [hl]
set B_PAD_LEFT, [hl]
set B_PAD_RIGHT, [hl]
.disallow_left_right
ret
@ -607,28 +607,28 @@ ContinueGettingMenuJoypad:
jr nz, .a_button
bit B_BUTTON_F, a
jr nz, .b_start
bit START_F, a
bit B_PAD_START, a
jr nz, .b_start
bit D_RIGHT_F, a
bit B_PAD_RIGHT, a
jr nz, .d_right
bit D_LEFT_F, a
bit B_PAD_LEFT, a
jr nz, .d_left
xor a
ld [wMenuJoypad], a
jr .done
.d_right
ld a, D_RIGHT
ld a, PAD_RIGHT
ld [wMenuJoypad], a
jr .done
.d_left
ld a, D_LEFT
ld a, PAD_LEFT
ld [wMenuJoypad], a
jr .done
.a_button
ld a, A_BUTTON
ld a, PAD_A
ld [wMenuJoypad], a
.done
@ -645,7 +645,7 @@ ContinueGettingMenuJoypad:
ret
.b_start
ld a, B_BUTTON
ld a, PAD_B
ld [wMenuJoypad], a
ld a, -1
ld [wMenuSelection], a
@ -745,7 +745,7 @@ ClearWindowData::
MenuClickSound::
push af
and A_BUTTON | B_BUTTON
and PAD_A | PAD_B
jr z, .nosound
ld hl, wMenuFlags
bit MENU_NO_CLICK_SFX_F, a

View File

@ -52,10 +52,10 @@ JoyTextDelay_ForcehJoyDown::
ldh [hInMenu], a
ldh a, [hJoyLast]
and D_RIGHT + D_LEFT + D_UP + D_DOWN
and PAD_RIGHT + PAD_LEFT + PAD_UP + PAD_DOWN
ld c, a
ldh a, [hJoyPressed]
and A_BUTTON + B_BUTTON + SELECT + START
and PAD_A + PAD_B + PAD_SELECT + PAD_START
or c
ld c, a
ret

View File

@ -678,7 +678,7 @@ TextCommand_FAR::
ld a, [hli]
ldh [hROMBank], a
ld [rROMB0], a
ld [rROMB], a
push hl
ld h, d
@ -688,7 +688,7 @@ TextCommand_FAR::
pop af
ldh [hROMBank], a
ld [rROMB0], a
ld [rROMB], a
ret
TextCommand_BCD::
@ -800,7 +800,7 @@ TextCommand_PAUSE::
push bc
call GetJoypad
ldh a, [hJoyDown]
and A_BUTTON | B_BUTTON
and PAD_A | PAD_B
jr nz, .done
ld c, 30
call DelayFrames
@ -877,7 +877,7 @@ TextCommand_DOTS::
ld [hli], a
call GetJoypad
ldh a, [hJoyDown]
and A_BUTTON | B_BUTTON
and PAD_A | PAD_B
jr nz, .next
ld c, 10
call DelayFrames

View File

@ -24,7 +24,6 @@ INCLUDE "constants/hardware.inc"
INCLUDE "constants/deco_constants.asm"
INCLUDE "constants/ram_constants.asm"
INCLUDE "constants/misc_constants.asm"
INCLUDE "constants/input_constants.asm"
INCLUDE "constants/gfx_constants.asm"
INCLUDE "constants/text_constants.asm"
INCLUDE "constants/audio_constants.asm"

View File

@ -15,9 +15,9 @@ MACRO RGB
endr
ENDM
DEF palred EQUS "(1 << 0) *"
DEF palgreen EQUS "(1 << 5) *"
DEF palblue EQUS "(1 << 10) *"
DEF palred EQUS "(1 << B_COLOR_RED) *"
DEF palgreen EQUS "(1 << B_COLOR_GREEN) *"
DEF palblue EQUS "(1 << B_COLOR_BLUE) *"
DEF palettes EQUS "* PAL_SIZE"
DEF palette EQUS "+ PAL_SIZE *"

View File

@ -421,7 +421,7 @@ DEF PAL_OW_SILVER EQUS "PAL_OW_EMOTE"
; constants/hardware.inc (formerly constants/hardware_constants.asm)
DEF MBC3SRamEnable EQU rRAMG
DEF MBC3RomBank EQU rROMB0
DEF MBC3RomBank EQU rROMB
DEF MBC3SRamBank EQU rRAMB
DEF MBC3LatchClock EQU rRTCLATCH
DEF MBC3RTC EQU rRTCREG
@ -511,6 +511,29 @@ DEF rBGPI_AUTO_INCREMENT EQU B_BGPI_AUTOINC
DEF rOBPI_AUTO_INCREMENT EQU B_OBPI_AUTOINC
; constants/input_constants.asm
DEF A_BUTTON_F EQU B_PAD_A
DEF B_BUTTON_F EQU B_PAD_B
DEF SELECT_F EQU B_PAD_SELECT
DEF START_F EQU B_PAD_START
DEF D_RIGHT_F EQU B_PAD_RIGHT
DEF D_LEFT_F EQU B_PAD_LEFT
DEF D_UP_F EQU B_PAD_UP
DEF D_DOWN_F EQU B_PAD_DOWN
DEF A_BUTTON EQU PAD_A
DEF B_BUTTON EQU PAD_B
DEF SELECT EQU PAD_SELECT
DEF START EQU PAD_START
DEF D_RIGHT EQU PAD_RIGHT
DEF D_LEFT EQU PAD_LEFT
DEF D_UP EQU PAD_UP
DEF D_DOWN EQU PAD_DOWN
DEF BUTTONS EQU PAD_BUTTONS
DEF D_PAD EQU PAD_CTRL_PAD
; constants/gfx_constants.asm
DEF LEN_1BPP_TILE EQU TILE_1BPP_SIZE
@ -529,3 +552,10 @@ DEF SPRITEOAMSTRUCT_TILE_ID EQU OAMA_TILEID
DEF SPRITEOAMSTRUCT_ATTRIBUTES EQU OAMA_FLAGS
DEF SPRITEOAMSTRUCT_LENGTH EQU OBJ_SIZE
DEF NUM_SPRITE_OAM_STRUCTS EQU OAM_COUNT
; constants/audio_constants.asm
DEF VOLUME_SO1_F EQU B_AUDVOL_VIN_RIGHT
DEF VOLUME_SO2_F EQU B_AUDVOL_VIN_LEFT
DEF VOLUME_SO1_LEVEL EQU AUDVOL_RIGHT
DEF VOLUME_SO2_LEVEL EQU AUDVOL_LEFT

View File

@ -40,10 +40,10 @@ EXPORT SCREEN_HEIGHT_PX
; [print forbid 2]
EXPORT NO_INPUT
EXPORT A_BUTTON
EXPORT B_BUTTON
EXPORT D_UP
EXPORT D_DOWN
EXPORT PAD_A
EXPORT PAD_B
EXPORT PAD_UP
EXPORT PAD_DOWN
; [print forbid 3]
EXPORT MAPGROUP_CIANWOOD

View File

@ -582,7 +582,7 @@ Fixcode={db NO_INPUT}
ConditionType = 0
ConditionValueA = {dws_ wWindowStackPointer wWindowStackPointer+1 wMenuJoypad wMenuSelection wMenuSelection wMenuCursorY hJoyPressed hJoyPressed hJoyPressed hJoyPressed}
ConditionValueB = {dws_ == == == >= <= == != != != != }
ConditionValueC = {dws_ 0xb7 0xb9 A_BUTTON 0x00 0x0f 0x03 D_DOWN D_UP B_BUTTON NO_INPUT }
ConditionValueC = {dws_ 0xb7 0xb9 PAD_A 0x00 0x0f 0x03 PAD_DOWN PAD_UP PAD_B NO_INPUT }
; -----ddddfffffff99999ccccc77777----0xd9c7 no ..............Mem Write: pc32 = 0x230b addr = 0xd9c7 value = 0x8
; 0xd9c7 is the room number.
@ -597,7 +597,7 @@ Fixcode={db NO_INPUT}
ConditionType = 0
ConditionValueA = {dws_ wWindowStackPointer wWindowStackPointer+1 wMenuJoypad wMenuSelection wMenuCursorY wWarpNumber wMapGroup wMapNumber hJoyPressed hJoyPressed hJoyPressed hJoyPressed}
ConditionValueB = {dws_ == == == == == == == == != != != != }
ConditionValueC = {dws_ 0xcd 0xbf NO_INPUT 0x00 0x01 0x01 MAPGROUP_CIANWOOD MAP_CIANWOOD_PHOTO_STUDIO D_DOWN D_UP B_BUTTON NO_INPUT }
ConditionValueC = {dws_ 0xcd 0xbf NO_INPUT 0x00 0x01 0x01 MAPGROUP_CIANWOOD MAP_CIANWOOD_PHOTO_STUDIO PAD_DOWN PAD_UP PAD_B NO_INPUT }
;ROM:BB29C call unk_934
;ROM:BB29F ld a, [byte_FFA9]
@ -638,7 +638,7 @@ Fixcode={db NO_INPUT}
ConditionType = 0
ConditionValueA = {dws_ wWindowStackPointer wWindowStackPointer+1 wMenuJoypad wMenuSelection wDexArrowCursorPosIndex hJoyPressed hJoyPressed hJoyPressed hJoyPressed}
ConditionValueB = {dws_ == == == == == != != != != }
ConditionValueC = {dws_ 0xbd 0xbd A_BUTTON 0x00 0x03 D_DOWN D_UP B_BUTTON NO_INPUT }
ConditionValueC = {dws_ 0xbd 0xbd PAD_A 0x00 0x03 PAD_DOWN PAD_UP PAD_B NO_INPUT }

View File

@ -40,10 +40,10 @@ EXPORT SCREEN_HEIGHT_PX
; [print forbid 2]
EXPORT NO_INPUT
EXPORT A_BUTTON
EXPORT B_BUTTON
EXPORT D_UP
EXPORT D_DOWN
EXPORT PAD_A
EXPORT PAD_B
EXPORT PAD_UP
EXPORT PAD_DOWN
; [print forbid 3]
EXPORT MAPGROUP_CIANWOOD

View File

@ -590,7 +590,7 @@ Fixcode={db NO_INPUT}
ConditionType = 0
ConditionValueA = {dws_ wWindowStackPointer wWindowStackPointer+1 wMenuJoypad wMenuSelection wMenuSelection wMenuCursorY hJoyPressed hJoyPressed hJoyPressed hJoyPressed}
ConditionValueB = {dws_ == == == >= <= == != != != != }
ConditionValueC = {dws_ 0xb7 0xb9 A_BUTTON 0x00 0x0f 0x03 D_DOWN D_UP B_BUTTON NO_INPUT }
ConditionValueC = {dws_ 0xb7 0xb9 PAD_A 0x00 0x0f 0x03 PAD_DOWN PAD_UP PAD_B NO_INPUT }
; -----ddddfffffff99999ccccc77777----0xd9c7 no ..............Mem Write: pc32 = 0x230b addr = 0xd9c7 value = 0x8
; 0xd9c7 is the room number.
@ -605,7 +605,7 @@ Fixcode={db NO_INPUT}
ConditionType = 0
ConditionValueA = {dws_ wWindowStackPointer wWindowStackPointer+1 wMenuJoypad wMenuSelection wMenuCursorY hJoyPressed hJoyPressed hJoyPressed hJoyPressed wWarpNumber wMapGroup wMapNumber}
ConditionValueB = {dws_ == == == == == != != != != == == == }
ConditionValueC = {dws_ 0xcd 0xbf NO_INPUT 0x00 0x01 D_DOWN D_UP B_BUTTON NO_INPUT 0x01 MAPGROUP_CIANWOOD MAP_CIANWOOD_PHOTO_STUDIO}
ConditionValueC = {dws_ 0xcd 0xbf NO_INPUT 0x00 0x01 PAD_DOWN PAD_UP PAD_B NO_INPUT 0x01 MAPGROUP_CIANWOOD MAP_CIANWOOD_PHOTO_STUDIO}
;ROM:BB29C call unk_934
;ROM:BB29F ld a, [byte_FFA9]
@ -646,7 +646,7 @@ Fixcode={db NO_INPUT}
ConditionType = 0
ConditionValueA = {dws_ wWindowStackPointer wWindowStackPointer+1 wMenuJoypad wMenuSelection wDexArrowCursorPosIndex hJoyPressed hJoyPressed hJoyPressed hJoyPressed}
ConditionValueB = {dws_ == == == == == != != != != }
ConditionValueC = {dws_ 0xbd 0xbd A_BUTTON 0x00 0x03 D_DOWN D_UP B_BUTTON NO_INPUT }
ConditionValueC = {dws_ 0xbd 0xbd PAD_A 0x00 0x03 PAD_DOWN PAD_UP PAD_B NO_INPUT }