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 ld [wMusicFadeCount], a
; get SO1 volume ; get SO1 volume
ld a, [wVolume] ld a, [wVolume]
and VOLUME_SO1_LEVEL and AUDVOL_RIGHT
; which way are we fading? ; which way are we fading?
bit MUSIC_FADE_IN_F, d bit MUSIC_FADE_IN_F, d
jr nz, .fadein 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 const NOTE_VIBRATO_OVERRIDE ; 6
; wVolume ; wVolume
DEF VOLUME_SO1_F EQU 3 DEF MAX_VOLUME EQU AUDVOL_LEFT | AUDVOL_RIGHT
DEF VOLUME_SO2_F EQU 7
DEF VOLUME_SO1_LEVEL EQU %00000111
DEF VOLUME_SO2_LEVEL EQU %01110000
DEF MAX_VOLUME EQU $77
; wSoundInput ; wSoundInput
DEF SOUND_INPUT_CH1_F EQU 0 DEF SOUND_INPUT_CH1_F EQU 0

View File

@ -22,7 +22,7 @@ endc
; Define the include guard and the current hardware.inc version ; Define the include guard and the current hardware.inc version
; (do this after the RGBDS version check since the `def` syntax depends on it) ; (do this after the RGBDS version check since the `def` syntax depends on it)
def HARDWARE_INC equ 1 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> ; Usage: rev_Check_hardware_inc <min_ver>
; Examples: ; Examples:
@ -85,14 +85,17 @@ def B_PAD_START equ 3
def B_PAD_SELECT equ 2 def B_PAD_SELECT equ 2
def B_PAD_B equ 1 def B_PAD_B equ 1
def B_PAD_A equ 0 def B_PAD_A equ 0
def PAD_DOWN equ 1 << B_PAD_DOWN def PAD_CTRL_PAD equ %1111_0000
def PAD_UP equ 1 << B_PAD_UP def PAD_BUTTONS equ %0000_1111
def PAD_LEFT equ 1 << B_PAD_LEFT def PAD_DOWN equ 1 << B_PAD_DOWN
def PAD_RIGHT equ 1 << B_PAD_RIGHT def PAD_UP equ 1 << B_PAD_UP
def PAD_START equ 1 << B_PAD_START def PAD_LEFT equ 1 << B_PAD_LEFT
def PAD_SELECT equ 1 << B_PAD_SELECT def PAD_RIGHT equ 1 << B_PAD_RIGHT
def PAD_B equ 1 << B_PAD_B def PAD_START equ 1 << B_PAD_START
def PAD_A equ 1 << B_PAD_A 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) ; Combined input byte, with Control Pad in low nybble (swapped order)
def B_PAD_SWAP_START equ 7 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_UP equ 2
def B_PAD_SWAP_LEFT equ 1 def B_PAD_SWAP_LEFT equ 1
def B_PAD_SWAP_RIGHT equ 0 def B_PAD_SWAP_RIGHT equ 0
def PAD_SWAP_START equ 1 << B_PAD_SWAP_START def PAD_SWAP_CTRL_PAD equ %0000_1111
def PAD_SWAP_SELECT equ 1 << B_PAD_SWAP_SELECT def PAD_SWAP_BUTTONS equ %1111_0000
def PAD_SWAP_B equ 1 << B_PAD_SWAP_B def PAD_SWAP_START equ 1 << B_PAD_SWAP_START
def PAD_SWAP_A equ 1 << B_PAD_SWAP_A def PAD_SWAP_SELECT equ 1 << B_PAD_SWAP_SELECT
def PAD_SWAP_DOWN equ 1 << B_PAD_SWAP_DOWN def PAD_SWAP_B equ 1 << B_PAD_SWAP_B
def PAD_SWAP_UP equ 1 << B_PAD_SWAP_UP def PAD_SWAP_A equ 1 << B_PAD_SWAP_A
def PAD_SWAP_LEFT equ 1 << B_PAD_SWAP_LEFT def PAD_SWAP_DOWN equ 1 << B_PAD_SWAP_DOWN
def PAD_SWAP_RIGHT equ 1 << B_PAD_SWAP_RIGHT 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) --------------------------------------------------------------- ; -- SB ($FF01) ---------------------------------------------------------------
; Serial transfer data [r/w] ; 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 ; however, one address for each of these ranges is considered the "canonical" one, and
; these addresses are what's provided here. ; these addresses are what's provided here.
; ** Common to most MBCs ******************************************************
; -- RAMG ($0000-$1FFF) ------------------------------------------------------- ; -- RAMG ($0000-$1FFF) -------------------------------------------------------
; Whether SRAM can be accessed [wo] ; Whether SRAM can be accessed [wo]
def rRAMG equ $0000 def rRAMG equ $0000
; Common values ; Common values (not for HuC1 or HuC-3)
def RAMG_SRAM_DISABLE equ $00 def RAMG_SRAM_DISABLE equ $00
def RAMG_SRAM_ENABLE equ $0A ; some MBCs accept any value whose low nybble is $A def RAMG_SRAM_ENABLE equ $0A ; some MBCs accept any value whose low nybble is $A
; -- ROMB0 ($2000-$3FFF) ------------------------------------------------------ ; (HuC-3 only) switch SRAM to map cartridge RAM, RTC, or IR
; ROM bank number (low 8 bits when applicable) [wo] def RAMG_CART_RAM_RO equ $00 ; select cartridge RAM [ro]
def rROMB0 equ $2000 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) ------------------------------------------------------ ; -- ROMB ($2000-$3FFF) -------------------------------------------------------
; (MBC5 only) ROM bank number high bit (bit 8) [wo] ; ROM bank number (not for MBC5 or MBC6) [wo]
def rROMB1 equ $3000 def rROMB equ $2000
; -- RAMB ($4000-$5FFF) ------------------------------------------------------- ; -- RAMB ($4000-$5FFF) -------------------------------------------------------
; SRAM bank number [wo] ; SRAM bank number (not for MBC2, MBC6, or MBC7) [wo]
def rRAMB equ $4000 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_S equ $08 ; seconds counter (0-59)
def RAMB_RTC_M equ $09 ; minutes counter (0-59) def RAMB_RTC_M equ $09 ; minutes counter (0-59)
def RAMB_RTC_H equ $0A ; hours counter (0-23) 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_OFF equ 0 << B_RAMB_RUMBLE
def RAMB_RUMBLE_ON equ 1 << 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) --------------------------------------------------- ; -- RTCLATCH ($6000-$7FFF) ---------------------------------------------------
; (MBC3 only) RTC latch clock data [wo] ; RTC latch clock data [wo]
def rRTCLATCH equ $6000 def rRTCLATCH equ $6000
; Write $00 then $01 to latch the current time into RTCREG ; 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 def RTCLATCH_FINISH equ $01
; -- RTCREG ($A000-$BFFF) ----------------------------------------------------- ; -- RTCREG ($A000-$BFFF) -----------------------------------------------------
; (MBC3 only) RTC register [r/w] ; RTC register [r/w]
def rRTCREG equ $A000 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 ; 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 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_SIZE equ 2 ; size of color in bytes (little-endian BGR555)
def COLOR_GREEN_LOW equ %111_00000 ; for the low byte def B_COLOR_RED equ 0 ; bits 4-0
def COLOR_RED equ %000_11111 ; for the low byte def B_COLOR_GREEN equ 5 ; bits 9-5
def COLOR_BLUE equ %0_11111_00 ; for the high byte def B_COLOR_BLUE equ 10 ; bits 14-10
def COLOR_GREEN_HIGH equ %000000_11 ; for the high byte 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_COLORS equ 4 ; colors per palette
def PAL_SIZE equ COLOR_SIZE * PAL_COLORS ; size of palette in bytes 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 def TILEMAP1 equ $9C00 ; $9C00-$9FFF
; (CGB only) BG tile attribute fields ; (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_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_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 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 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_TILEID rb ; 2
def OAMA_FLAGS rb ; 3 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_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_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 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 MALE EQU 0
DEF FEMALE EQU 1 DEF FEMALE EQU 1
; input
DEF NO_INPUT EQU %00000000
; FlagAction arguments (see home/flag.asm) ; FlagAction arguments (see home/flag.asm)
const_def const_def
const RESET_FLAG const RESET_FLAG

View File

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

View File

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

View File

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

View File

@ -19,14 +19,14 @@ DudeAutoInputs: ; used only for BANK(DudeAutoInputs)
DudeAutoInput_A: DudeAutoInput_A:
db NO_INPUT, $50 db NO_INPUT, $50
db A_BUTTON, $00 db PAD_A, $00
db NO_INPUT, $ff ; end db NO_INPUT, $ff ; end
DudeAutoInput_RightA: DudeAutoInput_RightA:
db NO_INPUT, $08 db NO_INPUT, $08
db D_RIGHT, $00 db PAD_RIGHT, $00
db NO_INPUT, $08 db NO_INPUT, $08
db A_BUTTON, $00 db PAD_A, $00
db NO_INPUT, $ff ; end db NO_INPUT, $ff ; end
DudeAutoInput_DownA: DudeAutoInput_DownA:
@ -34,10 +34,10 @@ DudeAutoInput_DownA:
db NO_INPUT, $fe db NO_INPUT, $fe
db NO_INPUT, $fe 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 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 db NO_INPUT, $ff ; end

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -204,7 +204,7 @@ TMHM_PocketLoop:
ld [w2DMenuFlags2], a ld [w2DMenuFlags2], a
ld a, $20 ld a, $20
ld [w2DMenuCursorOffsets], a 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 [wMenuJoypadFilter], a
ld a, [wTMHMPocketCursor] ld a, [wTMHMPocketCursor]
inc a inc a
@ -231,9 +231,9 @@ TMHM_JoypadLoop:
jp nz, TMHM_ChooseTMorHM jp nz, TMHM_ChooseTMorHM
bit B_BUTTON_F, a bit B_BUTTON_F, a
jp nz, TMHM_ExitPack jp nz, TMHM_ExitPack
bit D_RIGHT_F, a bit B_PAD_RIGHT, a
jp nz, TMHM_ExitPocket jp nz, TMHM_ExitPocket
bit D_LEFT_F, a bit B_PAD_LEFT, a
jp nz, TMHM_ExitPocket jp nz, TMHM_ExitPocket
TMHM_ShowTMMoveDescription: TMHM_ShowTMMoveDescription:
call TMHM_CheckHoveringOverCancel call TMHM_CheckHoveringOverCancel
@ -288,7 +288,7 @@ TMHM_CheckHoveringOverCancel:
TMHM_ExitPack: TMHM_ExitPack:
call TMHM_PlaySFX_ReadText2 call TMHM_PlaySFX_ReadText2
_TMHM_ExitPack: _TMHM_ExitPack:
ld a, B_BUTTON ld a, PAD_B
ld [wMenuJoypad], a ld [wMenuJoypad], a
and a and a
ret ret
@ -299,7 +299,7 @@ TMHM_ExitPocket:
TMHM_ScrollPocket: TMHM_ScrollPocket:
ld a, b ld a, b
bit D_DOWN_F, a bit B_PAD_DOWN, a
jr nz, .down jr nz, .down
ld hl, wTMHMPocketScrollPosition ld hl, wTMHMPocketScrollPosition
ld a, [hl] ld a, [hl]

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -853,7 +853,7 @@ DeleteMoveScreen2DMenuData:
db _2DMENU_ENABLE_SPRITE_ANIMS ; flags 1 db _2DMENU_ENABLE_SPRITE_ANIMS ; flags 1
db 0 ; flags 2 db 0 ; flags 2
dn 2, 0 ; cursor offset 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: ManagePokemonMoves:
ld a, [wCurPartySpecies] ld a, [wCurPartySpecies]
@ -892,9 +892,9 @@ MoveScreenLoop:
jp nz, .b_button jp nz, .b_button
bit A_BUTTON_F, a bit A_BUTTON_F, a
jp nz, .a_button jp nz, .a_button
bit D_RIGHT_F, a bit B_PAD_RIGHT, a
jp nz, .d_right jp nz, .d_right
bit D_LEFT_F, a bit B_PAD_LEFT, a
jp nz, .d_left jp nz, .d_left
.skip_joy .skip_joy
@ -1083,7 +1083,7 @@ MoveScreen2DMenuData:
db _2DMENU_ENABLE_SPRITE_ANIMS ; flags 1 db _2DMENU_ENABLE_SPRITE_ANIMS ; flags 1
db 0 ; flags 2 db 0 ; flags 2
dn 2, 0 ; cursor offsets 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: String_MoveWhere:
db "Where?@" db "Where?@"

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -15,9 +15,9 @@ MACRO RGB
endr endr
ENDM ENDM
DEF palred EQUS "(1 << 0) *" DEF palred EQUS "(1 << B_COLOR_RED) *"
DEF palgreen EQUS "(1 << 5) *" DEF palgreen EQUS "(1 << B_COLOR_GREEN) *"
DEF palblue EQUS "(1 << 10) *" DEF palblue EQUS "(1 << B_COLOR_BLUE) *"
DEF palettes EQUS "* PAL_SIZE" DEF palettes EQUS "* PAL_SIZE"
DEF palette 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) ; constants/hardware.inc (formerly constants/hardware_constants.asm)
DEF MBC3SRamEnable EQU rRAMG DEF MBC3SRamEnable EQU rRAMG
DEF MBC3RomBank EQU rROMB0 DEF MBC3RomBank EQU rROMB
DEF MBC3SRamBank EQU rRAMB DEF MBC3SRamBank EQU rRAMB
DEF MBC3LatchClock EQU rRTCLATCH DEF MBC3LatchClock EQU rRTCLATCH
DEF MBC3RTC EQU rRTCREG DEF MBC3RTC EQU rRTCREG
@ -511,6 +511,29 @@ DEF rBGPI_AUTO_INCREMENT EQU B_BGPI_AUTOINC
DEF rOBPI_AUTO_INCREMENT EQU B_OBPI_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 ; constants/gfx_constants.asm
DEF LEN_1BPP_TILE EQU TILE_1BPP_SIZE 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_ATTRIBUTES EQU OAMA_FLAGS
DEF SPRITEOAMSTRUCT_LENGTH EQU OBJ_SIZE DEF SPRITEOAMSTRUCT_LENGTH EQU OBJ_SIZE
DEF NUM_SPRITE_OAM_STRUCTS EQU OAM_COUNT 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] ; [print forbid 2]
EXPORT NO_INPUT EXPORT NO_INPUT
EXPORT A_BUTTON EXPORT PAD_A
EXPORT B_BUTTON EXPORT PAD_B
EXPORT D_UP EXPORT PAD_UP
EXPORT D_DOWN EXPORT PAD_DOWN
; [print forbid 3] ; [print forbid 3]
EXPORT MAPGROUP_CIANWOOD EXPORT MAPGROUP_CIANWOOD

View File

@ -582,7 +582,7 @@ Fixcode={db NO_INPUT}
ConditionType = 0 ConditionType = 0
ConditionValueA = {dws_ wWindowStackPointer wWindowStackPointer+1 wMenuJoypad wMenuSelection wMenuSelection wMenuCursorY hJoyPressed hJoyPressed hJoyPressed hJoyPressed} ConditionValueA = {dws_ wWindowStackPointer wWindowStackPointer+1 wMenuJoypad wMenuSelection wMenuSelection wMenuCursorY hJoyPressed hJoyPressed hJoyPressed hJoyPressed}
ConditionValueB = {dws_ == == == >= <= == != != != != } 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 ; -----ddddfffffff99999ccccc77777----0xd9c7 no ..............Mem Write: pc32 = 0x230b addr = 0xd9c7 value = 0x8
; 0xd9c7 is the room number. ; 0xd9c7 is the room number.
@ -597,7 +597,7 @@ Fixcode={db NO_INPUT}
ConditionType = 0 ConditionType = 0
ConditionValueA = {dws_ wWindowStackPointer wWindowStackPointer+1 wMenuJoypad wMenuSelection wMenuCursorY wWarpNumber wMapGroup wMapNumber hJoyPressed hJoyPressed hJoyPressed hJoyPressed} ConditionValueA = {dws_ wWindowStackPointer wWindowStackPointer+1 wMenuJoypad wMenuSelection wMenuCursorY wWarpNumber wMapGroup wMapNumber hJoyPressed hJoyPressed hJoyPressed hJoyPressed}
ConditionValueB = {dws_ == == == == == == == == != != != != } 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:BB29C call unk_934
;ROM:BB29F ld a, [byte_FFA9] ;ROM:BB29F ld a, [byte_FFA9]
@ -638,7 +638,7 @@ Fixcode={db NO_INPUT}
ConditionType = 0 ConditionType = 0
ConditionValueA = {dws_ wWindowStackPointer wWindowStackPointer+1 wMenuJoypad wMenuSelection wDexArrowCursorPosIndex hJoyPressed hJoyPressed hJoyPressed hJoyPressed} ConditionValueA = {dws_ wWindowStackPointer wWindowStackPointer+1 wMenuJoypad wMenuSelection wDexArrowCursorPosIndex hJoyPressed hJoyPressed hJoyPressed hJoyPressed}
ConditionValueB = {dws_ == == == == == != != != != } 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] ; [print forbid 2]
EXPORT NO_INPUT EXPORT NO_INPUT
EXPORT A_BUTTON EXPORT PAD_A
EXPORT B_BUTTON EXPORT PAD_B
EXPORT D_UP EXPORT PAD_UP
EXPORT D_DOWN EXPORT PAD_DOWN
; [print forbid 3] ; [print forbid 3]
EXPORT MAPGROUP_CIANWOOD EXPORT MAPGROUP_CIANWOOD

View File

@ -590,7 +590,7 @@ Fixcode={db NO_INPUT}
ConditionType = 0 ConditionType = 0
ConditionValueA = {dws_ wWindowStackPointer wWindowStackPointer+1 wMenuJoypad wMenuSelection wMenuSelection wMenuCursorY hJoyPressed hJoyPressed hJoyPressed hJoyPressed} ConditionValueA = {dws_ wWindowStackPointer wWindowStackPointer+1 wMenuJoypad wMenuSelection wMenuSelection wMenuCursorY hJoyPressed hJoyPressed hJoyPressed hJoyPressed}
ConditionValueB = {dws_ == == == >= <= == != != != != } 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 ; -----ddddfffffff99999ccccc77777----0xd9c7 no ..............Mem Write: pc32 = 0x230b addr = 0xd9c7 value = 0x8
; 0xd9c7 is the room number. ; 0xd9c7 is the room number.
@ -605,7 +605,7 @@ Fixcode={db NO_INPUT}
ConditionType = 0 ConditionType = 0
ConditionValueA = {dws_ wWindowStackPointer wWindowStackPointer+1 wMenuJoypad wMenuSelection wMenuCursorY hJoyPressed hJoyPressed hJoyPressed hJoyPressed wWarpNumber wMapGroup wMapNumber} ConditionValueA = {dws_ wWindowStackPointer wWindowStackPointer+1 wMenuJoypad wMenuSelection wMenuCursorY hJoyPressed hJoyPressed hJoyPressed hJoyPressed wWarpNumber wMapGroup wMapNumber}
ConditionValueB = {dws_ == == == == == != != != != == == == } 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:BB29C call unk_934
;ROM:BB29F ld a, [byte_FFA9] ;ROM:BB29F ld a, [byte_FFA9]
@ -646,7 +646,7 @@ Fixcode={db NO_INPUT}
ConditionType = 0 ConditionType = 0
ConditionValueA = {dws_ wWindowStackPointer wWindowStackPointer+1 wMenuJoypad wMenuSelection wDexArrowCursorPosIndex hJoyPressed hJoyPressed hJoyPressed hJoyPressed} ConditionValueA = {dws_ wWindowStackPointer wWindowStackPointer+1 wMenuJoypad wMenuSelection wDexArrowCursorPosIndex hJoyPressed hJoyPressed hJoyPressed hJoyPressed}
ConditionValueB = {dws_ == == == == == != != != != } 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 }