diff --git a/audio/engine.asm b/audio/engine.asm index 01d3228e..0082ebab 100644 --- a/audio/engine.asm +++ b/audio/engine.asm @@ -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 diff --git a/constants/audio_constants.asm b/constants/audio_constants.asm index 85763a66..7ea321c9 100644 --- a/constants/audio_constants.asm +++ b/constants/audio_constants.asm @@ -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 diff --git a/constants/hardware.inc b/constants/hardware.inc index 60123261..628b6820 100644 --- a/constants/hardware.inc +++ b/constants/hardware.inc @@ -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 ; 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 diff --git a/constants/input_constants.asm b/constants/input_constants.asm deleted file mode 100644 index 8febf47d..00000000 --- a/constants/input_constants.asm +++ /dev/null @@ -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 diff --git a/constants/misc_constants.asm b/constants/misc_constants.asm index 07f7aa8e..1620f2d2 100644 --- a/constants/misc_constants.asm +++ b/constants/misc_constants.asm @@ -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 diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 321b20f6..b01ae37d 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -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 diff --git a/engine/debug/color_picker.asm b/engine/debug/color_picker.asm index 240e86bf..0cbc7a9c 100644 --- a/engine/debug/color_picker.asm +++ b/engine/debug/color_picker.asm @@ -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 diff --git a/engine/debug/debug_room.asm b/engine/debug/debug_room.asm index 2e099ccc..9bbf0e30 100644 --- a/engine/debug/debug_room.asm +++ b/engine/debug/debug_room.asm @@ -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 diff --git a/engine/events/catch_tutorial_input.asm b/engine/events/catch_tutorial_input.asm index cca2db2d..cb3cb960 100644 --- a/engine/events/catch_tutorial_input.asm +++ b/engine/events/catch_tutorial_input.asm @@ -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 diff --git a/engine/events/elevator.asm b/engine/events/elevator.asm index 001122fb..2b1d4a2a 100644 --- a/engine/events/elevator.asm +++ b/engine/events/elevator.asm @@ -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] diff --git a/engine/events/halloffame.asm b/engine/events/halloffame.asm index 42956890..115bbffd 100644 --- a/engine/events/halloffame.asm +++ b/engine/events/halloffame.asm @@ -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 diff --git a/engine/events/mom.asm b/engine/events/mom.asm index 507d13a4..e1b3a364 100644 --- a/engine/events/mom.asm +++ b/engine/events/mom.asm @@ -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 diff --git a/engine/events/pokecenter_pc.asm b/engine/events/pokecenter_pc.asm index 9ffb4361..a9348c68 100644 --- a/engine/events/pokecenter_pc.asm +++ b/engine/events/pokecenter_pc.asm @@ -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 diff --git a/engine/events/print_unown.asm b/engine/events/print_unown.asm index 54db9037..58ae4840 100644 --- a/engine/events/print_unown.asm +++ b/engine/events/print_unown.asm @@ -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 diff --git a/engine/games/card_flip.asm b/engine/games/card_flip.asm index c0004016..2758ac86 100644 --- a/engine/games/card_flip.asm +++ b/engine/games/card_flip.asm @@ -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 diff --git a/engine/games/memory_game.asm b/engine/games/memory_game.asm index c352ba1e..5e8151e6 100644 --- a/engine/games/memory_game.asm +++ b/engine/games/memory_game.asm @@ -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 diff --git a/engine/games/slot_machine.asm b/engine/games/slot_machine.asm index e8b52345..bca3799e 100644 --- a/engine/games/slot_machine.asm +++ b/engine/games/slot_machine.asm @@ -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 diff --git a/engine/games/unown_puzzle.asm b/engine/games/unown_puzzle.asm index 77054421..941cf9d8 100644 --- a/engine/games/unown_puzzle.asm +++ b/engine/games/unown_puzzle.asm @@ -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 diff --git a/engine/items/buy_sell_toss.asm b/engine/items/buy_sell_toss.asm index da9b5ef6..57f5ea98 100644 --- a/engine/items/buy_sell_toss.asm +++ b/engine/items/buy_sell_toss.asm @@ -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 diff --git a/engine/items/mart.asm b/engine/items/mart.asm index 5f697b00..be504d16 100644 --- a/engine/items/mart.asm +++ b/engine/items/mart.asm @@ -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 diff --git a/engine/items/pack.asm b/engine/items/pack.asm index f6038bc0..a9d5d186 100644 --- a/engine/items/pack.asm +++ b/engine/items/pack.asm @@ -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 diff --git a/engine/items/tmhm.asm b/engine/items/tmhm.asm index e83caf8c..ddf37b62 100644 --- a/engine/items/tmhm.asm +++ b/engine/items/tmhm.asm @@ -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] diff --git a/engine/link/link.asm b/engine/link/link.asm index 0cbb269a..03d176d1 100644 --- a/engine/link/link.asm +++ b/engine/link/link.asm @@ -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 diff --git a/engine/menus/intro_menu.asm b/engine/menus/intro_menu.asm index 6991efaf..5633a42a 100644 --- a/engine/menus/intro_menu.asm +++ b/engine/menus/intro_menu.asm @@ -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 diff --git a/engine/menus/main_menu.asm b/engine/menus/main_menu.asm index 483f909b..bd429e87 100644 --- a/engine/menus/main_menu.asm +++ b/engine/menus/main_menu.asm @@ -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 diff --git a/engine/menus/menu.asm b/engine/menus/menu.asm index f756b211..772ee76c 100644 --- a/engine/menus/menu.asm +++ b/engine/menus/menu.asm @@ -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 diff --git a/engine/menus/naming_screen.asm b/engine/menus/naming_screen.asm index 1d4af1c6..d04d4aa0 100644 --- a/engine/menus/naming_screen.asm +++ b/engine/menus/naming_screen.asm @@ -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 diff --git a/engine/menus/options_menu.asm b/engine/menus/options_menu.asm index 8776bdd4..5ab6c748 100644 --- a/engine/menus/options_menu.asm +++ b/engine/menus/options_menu.asm @@ -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 diff --git a/engine/menus/scrolling_menu.asm b/engine/menus/scrolling_menu.asm index 2d19b770..ac2150c3 100644 --- a/engine/menus/scrolling_menu.asm +++ b/engine/menus/scrolling_menu.asm @@ -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 diff --git a/engine/menus/start_menu.asm b/engine/menus/start_menu.asm index c464898d..505cb1f0 100644 --- a/engine/menus/start_menu.asm +++ b/engine/menus/start_menu.asm @@ -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 diff --git a/engine/menus/trainer_card.asm b/engine/menus/trainer_card.asm index 8bfbd93e..2422b3ae 100644 --- a/engine/menus/trainer_card.asm +++ b/engine/menus/trainer_card.asm @@ -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 diff --git a/engine/movie/credits.asm b/engine/movie/credits.asm index d48365a1..d6b96597 100644 --- a/engine/movie/credits.asm +++ b/engine/movie/credits.asm @@ -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 diff --git a/engine/movie/evolution_animation.asm b/engine/movie/evolution_animation.asm index 551296dd..491752fe 100644 --- a/engine/movie/evolution_animation.asm +++ b/engine/movie/evolution_animation.asm @@ -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 diff --git a/engine/movie/intro.asm b/engine/movie/intro.asm index dfa45c06..73bc62df 100644 --- a/engine/movie/intro.asm +++ b/engine/movie/intro.asm @@ -15,7 +15,7 @@ GoldSilverIntro: .PlayFrame: call JoyTextDelay ldh a, [hJoyLast] - and BUTTONS + and PAD_BUTTONS jr nz, .Finish ; check done flag diff --git a/engine/movie/splash.asm b/engine/movie/splash.asm index 0a815cf9..892f9a95 100644 --- a/engine/movie/splash.asm +++ b/engine/movie/splash.asm @@ -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 diff --git a/engine/overworld/decorations.asm b/engine/overworld/decorations.asm index 38dab31e..db4926be 100644 --- a/engine/overworld/decorations.asm +++ b/engine/overworld/decorations.asm @@ -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 diff --git a/engine/overworld/events.asm b/engine/overworld/events.asm index 0be62ab6..f46cbbc3 100644 --- a/engine/overworld/events.asm +++ b/engine/overworld/events.asm @@ -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) diff --git a/engine/overworld/player_movement.asm b/engine/overworld/player_movement.asm index a23ce6e6..7a753313 100644 --- a/engine/overworld/player_movement.asm +++ b/engine/overworld/player_movement.asm @@ -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 diff --git a/engine/pokedex/pokedex.asm b/engine/pokedex/pokedex.asm index babbafed..5f325880 100644 --- a/engine/pokedex/pokedex.asm +++ b/engine/pokedex/pokedex.asm @@ -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 diff --git a/engine/pokegear/pokegear.asm b/engine/pokegear/pokegear.asm index 989d977b..6627ebd8 100644 --- a/engine/pokegear/pokegear.asm +++ b/engine/pokegear/pokegear.asm @@ -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 diff --git a/engine/pokemon/bills_pc.asm b/engine/pokemon/bills_pc.asm index 7fe2ffe1..ea33dc06 100644 --- a/engine/pokemon/bills_pc.asm +++ b/engine/pokemon/bills_pc.asm @@ -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 diff --git a/engine/pokemon/mail.asm b/engine/pokemon/mail.asm index 77801eec..f95ee9e5 100644 --- a/engine/pokemon/mail.asm +++ b/engine/pokemon/mail.asm @@ -392,7 +392,7 @@ MailboxPC: ld [wCurMessageIndex], a ld a, [wMenuJoypad] - cp B_BUTTON + cp PAD_B jr z, .exit call .Submenu jr .loop diff --git a/engine/pokemon/mail_2.asm b/engine/pokemon/mail_2.asm index e1eade25..00c7a03d 100644 --- a/engine/pokemon/mail_2.asm +++ b/engine/pokemon/mail_2.asm @@ -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 diff --git a/engine/pokemon/mon_menu.asm b/engine/pokemon/mon_menu.asm index fa1e9398..0b38518f 100644 --- a/engine/pokemon/mon_menu.asm +++ b/engine/pokemon/mon_menu.asm @@ -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?@" diff --git a/engine/pokemon/party_menu.asm b/engine/pokemon/party_menu.asm index 2a8f30c4..e854da11 100644 --- a/engine/pokemon/party_menu.asm +++ b/engine/pokemon/party_menu.asm @@ -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 diff --git a/engine/pokemon/stats_screen.asm b/engine/pokemon/stats_screen.asm index 3fbb16e9..22ad15d3 100644 --- a/engine/pokemon/stats_screen.asm +++ b/engine/pokemon/stats_screen.asm @@ -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: diff --git a/engine/printer/printer.asm b/engine/printer/printer.asm index 11459a22..bb1eca8a 100644 --- a/engine/printer/printer.asm +++ b/engine/printer/printer.asm @@ -444,7 +444,7 @@ _PrintDiploma: CheckCancelPrint: ldh a, [hJoyDown] - and B_BUTTON + and PAD_B jr nz, .pressed_b and a ret diff --git a/engine/rtc/reset_password.asm b/engine/rtc/reset_password.asm index a1c0a359..56db033c 100644 --- a/engine/rtc/reset_password.asm +++ b/engine/rtc/reset_password.asm @@ -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 diff --git a/engine/rtc/restart_clock.asm b/engine/rtc/restart_clock.asm index 263c1b44..510d1601 100644 --- a/engine/rtc/restart_clock.asm +++ b/engine/rtc/restart_clock.asm @@ -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 diff --git a/engine/rtc/timeset.asm b/engine/rtc/timeset.asm index f8859a77..e6c8f9a6 100644 --- a/engine/rtc/timeset.asm +++ b/engine/rtc/timeset.asm @@ -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 diff --git a/home/audio.asm b/home/audio.asm index 427fd61c..06c9c560 100644 --- a/home/audio.asm +++ b/home/audio.asm @@ -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 diff --git a/home/battle.asm b/home/battle.asm index 6ca1fc40..c231f134 100644 --- a/home/battle.asm +++ b/home/battle.asm @@ -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 diff --git a/home/header.asm b/home/header.asm index 940911f5..7244a13c 100644 --- a/home/header.asm +++ b/home/header.asm @@ -11,7 +11,7 @@ FarCall:: SECTION "rst10", ROM0[$0010] Bankswitch:: ldh [hROMBank], a - ld [rROMB0], a + ld [rROMB], a ret SECTION "rst18", ROM0[$0018] diff --git a/home/joypad.asm b/home/joypad.asm index e969ce82..631800ff 100644 --- a/home/joypad.asm +++ b/home/joypad.asm @@ -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 diff --git a/home/menu.asm b/home/menu.asm index 7ee837ea..a8b2f10f 100644 --- a/home/menu.asm +++ b/home/menu.asm @@ -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 diff --git a/home/scrolling_menu.asm b/home/scrolling_menu.asm index ee302609..62899e80 100644 --- a/home/scrolling_menu.asm +++ b/home/scrolling_menu.asm @@ -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 diff --git a/home/text.asm b/home/text.asm index fce949ea..a04a338d 100644 --- a/home/text.asm +++ b/home/text.asm @@ -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 diff --git a/includes.asm b/includes.asm index a358f6d7..a4f5f2d2 100644 --- a/includes.asm +++ b/includes.asm @@ -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" diff --git a/macros/gfx.asm b/macros/gfx.asm index 760101f8..c2dc9ff6 100644 --- a/macros/gfx.asm +++ b/macros/gfx.asm @@ -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 *" diff --git a/macros/legacy.asm b/macros/legacy.asm index f1fd26f0..5954b37d 100644 --- a/macros/legacy.asm +++ b/macros/legacy.asm @@ -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 diff --git a/vc/pokegold.constants.asm b/vc/pokegold.constants.asm index e1e3e2b0..11bda344 100644 --- a/vc/pokegold.constants.asm +++ b/vc/pokegold.constants.asm @@ -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 diff --git a/vc/pokegold.patch.template b/vc/pokegold.patch.template index 07cee240..491f52c2 100644 --- a/vc/pokegold.patch.template +++ b/vc/pokegold.patch.template @@ -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 } diff --git a/vc/pokesilver.constants.asm b/vc/pokesilver.constants.asm index cae2c7cb..b9f88e03 100644 --- a/vc/pokesilver.constants.asm +++ b/vc/pokesilver.constants.asm @@ -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 diff --git a/vc/pokesilver.patch.template b/vc/pokesilver.patch.template index b9aa36b3..e3b64cb9 100644 --- a/vc/pokesilver.patch.template +++ b/vc/pokesilver.patch.template @@ -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 }