aboutsummaryrefslogtreecommitdiffstats
path: root/engine/battle/core.asm
diff options
context:
space:
mode:
authorRangi <35663410+Rangi42@users.noreply.github.com>2025-06-30 12:47:22 -0400
committerGitHub <noreply@github.com>2025-06-30 12:47:22 -0400
commit56c405de09ce267c4cfbc68a15c37b2ff51c635a (patch)
tree47d25c237e9af824f7a57295a2d2e298b194a8e6 /engine/battle/core.asm
parentDistinguish single trainer pics section from Pokemon pics (diff)
downloadpokeyellow-56c405de09ce267c4cfbc68a15c37b2ff51c635a.tar.gz
pokeyellow-56c405de09ce267c4cfbc68a15c37b2ff51c635a.tar.xz
pokeyellow-56c405de09ce267c4cfbc68a15c37b2ff51c635a.zip
Replace hardware_constants.asm with hardware.inc (#511)
Diffstat (limited to 'engine/battle/core.asm')
-rw-r--r--engine/battle/core.asm38
1 files changed, 19 insertions, 19 deletions
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index 114e715b..f9b45a88 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, BG_MAP_WIDTH * BG_MAP_HEIGHT
+ ld bc, TILEMAP_WIDTH * TILEMAP_HEIGHT
.clearBackgroundLoop
ld a, " "
ld [hli], a
@@ -2086,9 +2086,9 @@ DisplayBattleMenu::
inc hl
ld a, $1
ld [hli], a ; wMaxMenuItem
- ld [hl], D_RIGHT | A_BUTTON ; wMenuWatchedKeys
+ ld [hl], PAD_RIGHT | PAD_A ; wMenuWatchedKeys
call HandleMenuInput
- bit BIT_D_RIGHT, a
+ bit B_PAD_RIGHT, a
jr nz, .rightColumn
jr .AButtonPressed ; the A button was pressed
.rightColumn ; put cursor in right column of menu
@@ -2119,10 +2119,10 @@ DisplayBattleMenu::
inc hl
ld a, $1
ld [hli], a ; wMaxMenuItem
- ld a, D_LEFT | A_BUTTON
+ ld a, PAD_LEFT | PAD_A
ld [hli], a ; wMenuWatchedKeys
call HandleMenuInput
- bit BIT_D_LEFT, a
+ bit B_PAD_LEFT, a
jr nz, .leftColumn ; if left was pressed, jump
ld a, [wCurrentMenuItem]
add $2 ; if we're in the right column, the actual id is +2
@@ -2346,12 +2346,12 @@ PartyMenuOrRockOrRun:
inc hl
ld a, $2
ld [hli], a ; wMaxMenuItem
- ld a, B_BUTTON | A_BUTTON
+ ld a, PAD_B | PAD_A
ld [hli], a ; wMenuWatchedKeys
xor a
ld [hl], a ; wLastMenuItem
call HandleMenuInput
- bit BIT_B_BUTTON, a
+ bit B_PAD_B, a
jr nz, .partyMonDeselected ; if B was pressed, jump
; A was pressed
call PlaceUnfilledArrowMenuCursor
@@ -2550,10 +2550,10 @@ MoveSelectionMenu:
ld [hli], a ; wMaxMenuItem
ld a, [wMoveMenuType]
dec a
- ld b, D_UP | D_DOWN | A_BUTTON
+ ld b, PAD_UP | PAD_DOWN | PAD_A
jr z, .matchedkeyspicked
dec a
- ld b, D_UP | D_DOWN | A_BUTTON | B_BUTTON
+ ld b, PAD_UP | PAD_DOWN | PAD_A | PAD_B
jr z, .matchedkeyspicked
ld a, [wLinkState]
cp LINK_STATE_BATTLING
@@ -2561,9 +2561,9 @@ MoveSelectionMenu:
; Disable left, right, and START buttons in regular battles.
ld a, [wStatusFlags7]
bit BIT_TEST_BATTLE, a
- ld b, D_UP | D_DOWN | A_BUTTON | B_BUTTON | SELECT
+ ld b, PAD_UP | PAD_DOWN | PAD_A | PAD_B | PAD_SELECT
jr z, .matchedkeyspicked
- ld b, D_UP | D_DOWN | D_LEFT | D_RIGHT | A_BUTTON | B_BUTTON | SELECT | START
+ ld b, PAD_UP | PAD_DOWN | PAD_LEFT | PAD_RIGHT | PAD_A | PAD_B | PAD_SELECT | PAD_START
.matchedkeyspicked
ld a, b
ld [hli], a ; wMenuWatchedKeys
@@ -2609,13 +2609,13 @@ SelectMenuItem:
call HandleMenuInput
ld hl, hUILayoutFlags
res BIT_DOUBLE_SPACED_MENU, [hl]
- bit BIT_D_UP, a
+ bit B_PAD_UP, a
jp nz, SelectMenuItem_CursorUp
- bit BIT_D_DOWN, a
+ bit B_PAD_DOWN, a
jp nz, SelectMenuItem_CursorDown
- bit BIT_SELECT, a
+ bit B_PAD_SELECT, a
jp nz, SwapMovesInMenu
- bit BIT_B_BUTTON, a
+ bit B_PAD_B, a
push af
xor a
ld [wMenuItemToSwap], a
@@ -6373,9 +6373,9 @@ LoadPlayerBackPic:
ld de, vBackPic
call InterlaceMergeSpriteBuffers
ld a, $a
- ld [MBC1SRamEnable], a
+ ld [rRAMG], a
xor a
- ld [MBC1SRamBank], a
+ ld [rRAMB], a
ld hl, vSprites
ld de, sSpriteBuffer1
ldh a, [hLoadedROMBank]
@@ -6383,7 +6383,7 @@ LoadPlayerBackPic:
ld c, 7 * 7
call CopyVideoData
xor a
- ld [MBC1SRamEnable], a
+ ld [rRAMG], a
ld a, $31
ldh [hStartTileID], a
hlcoord 1, 5
@@ -6784,7 +6784,7 @@ DetermineWildOpponent:
bit BIT_DEBUG_MODE, a
jr z, .notDebugMode
ldh a, [hJoyHeld]
- bit BIT_B_BUTTON, a ; disable wild encounters
+ bit B_PAD_B, a ; disable wild encounters
ret nz
.notDebugMode
ld a, [wNumberOfNoRandomBattleStepsLeft]