aboutsummaryrefslogtreecommitdiffstats
path: root/engine
diff options
context:
space:
mode:
authorRangi42 <sylvie.oukaour+rangi42@gmail.com>2025-06-30 13:30:57 -0400
committerRangi <35663410+Rangi42@users.noreply.github.com>2025-06-30 13:45:24 -0400
commit78e44a8fb10307c55d53a69179b9ff7cd6f49fc0 (patch)
treeccc6113a679d842077d67e5453709438c418114f /engine
parentReplace hardware_constants.asm with hardware.inc (#511) (diff)
downloadpokeyellow-78e44a8fb10307c55d53a69179b9ff7cd6f49fc0.tar.gz
pokeyellow-78e44a8fb10307c55d53a69179b9ff7cd6f49fc0.tar.xz
pokeyellow-78e44a8fb10307c55d53a69179b9ff7cd6f49fc0.zip
Use combined hardware constants
Diffstat (limited to 'engine')
-rw-r--r--engine/battle/core.asm6
-rw-r--r--engine/events/black_out.asm2
-rw-r--r--engine/joypad.asm2
-rw-r--r--engine/menus/main_menu.asm2
-rw-r--r--engine/movie/trade.asm2
-rw-r--r--engine/overworld/auto_movement.asm4
-rw-r--r--engine/overworld/ledges.asm2
-rw-r--r--engine/overworld/push_boulder.asm2
8 files changed, 11 insertions, 11 deletions
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index f9b45a88..28c164e5 100644
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -18,7 +18,7 @@ SlidePlayerAndEnemySilhouettesOnScreen:
call LoadFontTilePatterns
call LoadHudAndHpBarAndStatusTilePatterns
ld hl, vBGMap0
- ld bc, TILEMAP_WIDTH * TILEMAP_HEIGHT
+ ld bc, TILEMAP_AREA
.clearBackgroundLoop
ld a, " "
ld [hli], a
@@ -2561,9 +2561,9 @@ MoveSelectionMenu:
; Disable left, right, and START buttons in regular battles.
ld a, [wStatusFlags7]
bit BIT_TEST_BATTLE, a
- ld b, PAD_UP | PAD_DOWN | PAD_A | PAD_B | PAD_SELECT
+ ld b, ~(PAD_LEFT | PAD_RIGHT | PAD_START)
jr z, .matchedkeyspicked
- ld b, PAD_UP | PAD_DOWN | PAD_LEFT | PAD_RIGHT | PAD_A | PAD_B | PAD_SELECT | PAD_START
+ ld b, PAD_CTRL_PAD | PAD_BUTTONS
.matchedkeyspicked
ld a, b
ld [hli], a ; wMenuWatchedKeys
diff --git a/engine/events/black_out.asm b/engine/events/black_out.asm
index ea8ca3bb..f4b0e4bc 100644
--- a/engine/events/black_out.asm
+++ b/engine/events/black_out.asm
@@ -41,6 +41,6 @@ ResetStatusAndHalveMoneyOnBlackout::
set BIT_FLY_OR_DUNGEON_WARP, [hl]
res BIT_FLY_WARP, [hl]
set BIT_ESCAPE_WARP, [hl]
- ld a, PAD_A | PAD_B | PAD_SELECT | PAD_START | PAD_RIGHT | PAD_LEFT | PAD_UP | PAD_DOWN
+ ld a, PAD_BUTTONS | PAD_CTRL_PAD
ld [wJoyIgnore], a
predef_jump HealParty
diff --git a/engine/joypad.asm b/engine/joypad.asm
index 2cb0d8db..b6c50e69 100644
--- a/engine/joypad.asm
+++ b/engine/joypad.asm
@@ -3,7 +3,7 @@ _Joypad::
; hJoyPressed: (hJoyLast ^ hJoyInput) & hJoyInput
ldh a, [hJoyInput]
- cp PAD_A + PAD_B + PAD_SELECT + PAD_START ; soft reset
+ cp PAD_BUTTONS ; soft reset
jp z, TrySoftReset
ld b, a
diff --git a/engine/menus/main_menu.asm b/engine/menus/main_menu.asm
index 44219b14..a3fe6587 100644
--- a/engine/menus/main_menu.asm
+++ b/engine/menus/main_menu.asm
@@ -487,7 +487,7 @@ DisplayOptionMenu:
call JoypadLowSensitivity
ldh a, [hJoy5]
ld b, a
- and PAD_A | PAD_B | PAD_START | PAD_RIGHT | PAD_LEFT | PAD_UP | PAD_DOWN ; any key besides select pressed?
+ and ~PAD_SELECT ; any key besides select pressed?
jr z, .getJoypadStateLoop
bit B_PAD_B, b
jr nz, .exitMenu
diff --git a/engine/movie/trade.asm b/engine/movie/trade.asm
index f2ae9bb7..4d7bd54a 100644
--- a/engine/movie/trade.asm
+++ b/engine/movie/trade.asm
@@ -149,7 +149,7 @@ Trade_Delay80:
Trade_ClearTileMap:
hlcoord 0, 0
- ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
+ ld bc, SCREEN_AREA
ld a, " "
jp FillMemory
diff --git a/engine/overworld/auto_movement.asm b/engine/overworld/auto_movement.asm
index 880f14a4..bed2ffb9 100644
--- a/engine/overworld/auto_movement.asm
+++ b/engine/overworld/auto_movement.asm
@@ -3,7 +3,7 @@ PlayerStepOutFromDoor::
res BIT_EXITING_DOOR, [hl]
call IsPlayerStandingOnDoorTile
jr nc, .notStandingOnDoor
- ld a, PAD_SELECT | PAD_START | PAD_RIGHT | PAD_LEFT | PAD_UP | PAD_DOWN
+ ld a, PAD_SELECT | PAD_START | PAD_CTRL_PAD
ld [wJoyIgnore], a
ld hl, wMovementFlags
set BIT_EXITING_DOOR, [hl]
@@ -81,7 +81,7 @@ PalletMovementScript_OakMoveLeft:
.done
ld hl, wStatusFlags7
set BIT_NO_MAP_MUSIC, [hl]
- ld a, PAD_SELECT | PAD_START | PAD_RIGHT | PAD_LEFT | PAD_UP | PAD_DOWN
+ ld a, PAD_SELECT | PAD_START | PAD_CTRL_PAD
ld [wJoyIgnore], a
ret
diff --git a/engine/overworld/ledges.asm b/engine/overworld/ledges.asm
index a85fae26..db8b9e97 100644
--- a/engine/overworld/ledges.asm
+++ b/engine/overworld/ledges.asm
@@ -39,7 +39,7 @@ HandleLedges::
ldh a, [hJoyHeld]
and e
ret z
- ld a, PAD_A | PAD_B | PAD_SELECT | PAD_START | PAD_RIGHT | PAD_LEFT | PAD_UP | PAD_DOWN
+ ld a, PAD_BUTTONS | PAD_CTRL_PAD
ld [wJoyIgnore], a
ld hl, wMovementFlags
set BIT_LEDGE_OR_FISHING, [hl]
diff --git a/engine/overworld/push_boulder.asm b/engine/overworld/push_boulder.asm
index 54eecb21..2328b07a 100644
--- a/engine/overworld/push_boulder.asm
+++ b/engine/overworld/push_boulder.asm
@@ -28,7 +28,7 @@ TryPushingBoulder::
set BIT_TRIED_PUSH_BOULDER, [hl]
ret z ; the player must try pushing twice before the boulder will move
ldh a, [hJoyHeld]
- and PAD_RIGHT | PAD_LEFT | PAD_UP | PAD_DOWN
+ and PAD_CTRL_PAD
ret z
predef CheckForCollisionWhenPushingBoulder
ld a, [wTileInFrontOfBoulderAndBoulderCollisionResult]