aboutsummaryrefslogtreecommitdiffstats
path: root/engine/overworld
diff options
context:
space:
mode:
authorNarishma-gb <194818981+Narishma-gb@users.noreply.github.com>2025-11-18 21:17:31 +0100
committerGitHub <noreply@github.com>2025-11-18 15:17:31 -0500
commitf3326786259f4e53c06b7565369add7605bea8ba (patch)
tree1e09025ed19a6403fa74c408aa195662178cc0ca /engine/overworld
parentAdd `_vc` patch targets to `.PHONY` (diff)
downloadpokeyellow-f3326786259f4e53c06b7565369add7605bea8ba.tar.gz
pokeyellow-f3326786259f4e53c06b7565369add7605bea8ba.tar.xz
pokeyellow-f3326786259f4e53c06b7565369add7605bea8ba.zip
Use more hardware and graphics constants (#532)
- Use `OBJ_SIZE` and `TILE_SIZE` from hardware.inc. - `SPRITESTATEDATA1_LENGTH`, `NUM_SPRITESTATEDATA_STRUCTS` and `TILE_1BPP_SIZE` are used in some places. - Highlight an oversight in `OakSpeech` where several direct MBC bank switches are requested. - Remove redundant comments in home/overworld.asm. - Add unreferenced `FillBgMap` function to avoid a byte of dead code. - Some constants added in wram.asm. - Correctly separate the commented code in `SaveMainData`.
Diffstat (limited to 'engine/overworld')
-rw-r--r--engine/overworld/cut.asm6
-rw-r--r--engine/overworld/dust_smoke.asm4
-rw-r--r--engine/overworld/ledges.asm2
-rw-r--r--engine/overworld/player_animations.asm6
4 files changed, 9 insertions, 9 deletions
diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm
index 93902b51..368941d5 100644
--- a/engine/overworld/cut.asm
+++ b/engine/overworld/cut.asm
@@ -100,13 +100,13 @@ InitCutAnimOAM:
call LoadCutGrassAnimationTilePattern
call WriteCutOrBoulderDustAnimationOAMBlock
ld hl, wShadowOAMSprite36Attributes
- ld de, 4
- ld a, $30
+ ld de, OBJ_SIZE
+ ld a, OAM_XFLIP | OAM_PAL1
ld c, e
.loop
ld [hl], a
add hl, de
- xor $60
+ xor OAM_YFLIP | OAM_XFLIP
dec c
jr nz, .loop
ret
diff --git a/engine/overworld/dust_smoke.asm b/engine/overworld/dust_smoke.asm
index 96dd364a..85b89cdc 100644
--- a/engine/overworld/dust_smoke.asm
+++ b/engine/overworld/dust_smoke.asm
@@ -70,7 +70,7 @@ LoadSmokeTileFourTimes::
push hl
call LoadSmokeTile
pop hl
- ld bc, 1 tiles
+ ld bc, TILE_SIZE
add hl, bc
pop bc
dec c
@@ -79,7 +79,7 @@ LoadSmokeTileFourTimes::
LoadSmokeTile:
ld de, SSAnneSmokePuffTile
- lb bc, BANK(SSAnneSmokePuffTile), (SSAnneSmokePuffTileEnd - SSAnneSmokePuffTile) / $10
+ lb bc, BANK(SSAnneSmokePuffTile), (SSAnneSmokePuffTileEnd - SSAnneSmokePuffTile) / TILE_SIZE
jp CopyVideoData
SSAnneSmokePuffTile:
diff --git a/engine/overworld/ledges.asm b/engine/overworld/ledges.asm
index db8b9e97..69403042 100644
--- a/engine/overworld/ledges.asm
+++ b/engine/overworld/ledges.asm
@@ -59,7 +59,7 @@ INCLUDE "data/tilesets/ledge_tiles.asm"
LoadHoppingShadowOAM:
ld hl, vChars1 tile $7f
ld de, LedgeHoppingShadow
- lb bc, BANK(LedgeHoppingShadow), (LedgeHoppingShadowEnd - LedgeHoppingShadow) / $8
+ lb bc, BANK(LedgeHoppingShadow), (LedgeHoppingShadowEnd - LedgeHoppingShadow) / TILE_1BPP_SIZE
call CopyVideoDataDouble
ld a, $9
lb bc, $54, $48 ; b, c = y, x coordinates of shadow
diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm
index c163b27e..4ed1f49f 100644
--- a/engine/overworld/player_animations.asm
+++ b/engine/overworld/player_animations.asm
@@ -209,13 +209,13 @@ LeaveMapThroughHoleAnim:
ld [wShadowOAMSprite02TileID], a
ld a, [wShadowOAMSprite01TileID]
ld [wShadowOAMSprite03TileID], a
- ld a, $a0
+ ld a, SCREEN_HEIGHT_PX + OAM_Y_OFS
ld [wShadowOAMSprite00YCoord], a
ld [wShadowOAMSprite01YCoord], a
ld c, 2
call DelayFrames
; hide upper half of player's sprite
- ld a, $a0
+ ld a, SCREEN_HEIGHT_PX + OAM_Y_OFS
ld [wShadowOAMSprite02YCoord], a
ld [wShadowOAMSprite03YCoord], a
call GBFadeOutToWhite
@@ -423,7 +423,7 @@ FishingAnim:
ld a, [wSpritePlayerStateData1ImageIndex] ; (image index is locked to standing images)
cp SPRITE_FACING_UP
jr nz, .skipHidingFishingRod
- ld a, $a0
+ ld a, SCREEN_HEIGHT_PX + OAM_Y_OFS
ld [wShadowOAMSprite39YCoord], a
.skipHidingFishingRod