diff options
| author | Narishma-gb <194818981+Narishma-gb@users.noreply.github.com> | 2025-11-18 21:17:31 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-18 15:17:31 -0500 |
| commit | f3326786259f4e53c06b7565369add7605bea8ba (patch) | |
| tree | 1e09025ed19a6403fa74c408aa195662178cc0ca /engine/gfx | |
| parent | Add `_vc` patch targets to `.PHONY` (diff) | |
| download | pokeyellow-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/gfx')
| -rw-r--r-- | engine/gfx/load_pokedex_tiles.asm | 2 | ||||
| -rw-r--r-- | engine/gfx/mon_icons.asm | 10 | ||||
| -rw-r--r-- | engine/gfx/palettes.asm | 2 | ||||
| -rw-r--r-- | engine/gfx/sprite_oam.asm | 8 |
4 files changed, 11 insertions, 11 deletions
diff --git a/engine/gfx/load_pokedex_tiles.asm b/engine/gfx/load_pokedex_tiles.asm index a3f69171..b0857137 100644 --- a/engine/gfx/load_pokedex_tiles.asm +++ b/engine/gfx/load_pokedex_tiles.asm @@ -3,7 +3,7 @@ LoadPokedexTilePatterns: call LoadHpBarAndStatusTilePatterns ld de, PokedexTileGraphics ld hl, vChars2 tile $60 - lb bc, BANK(PokedexTileGraphics), (PokedexTileGraphicsEnd - PokedexTileGraphics) / $10 + lb bc, BANK(PokedexTileGraphics), (PokedexTileGraphicsEnd - PokedexTileGraphics) / TILE_SIZE call CopyVideoData ld de, PokeballTileGraphics ld hl, vChars2 tile $72 diff --git a/engine/gfx/mon_icons.asm b/engine/gfx/mon_icons.asm index 49e789a5..63da2345 100644 --- a/engine/gfx/mon_icons.asm +++ b/engine/gfx/mon_icons.asm @@ -44,7 +44,7 @@ GetAnimationSpeed: push bc ld hl, wMonPartySpritesSavedOAM ld de, wShadowOAM - ld bc, $60 + ld bc, OBJ_SIZE * 4 * PARTY_LENGTH call CopyData pop bc xor a @@ -52,7 +52,7 @@ GetAnimationSpeed: .animateSprite push bc ld hl, wShadowOAMSprite00TileID - ld bc, $10 + ld bc, OBJ_SIZE * 4 ld a, [wCurrentMenuItem] call AddNTimes ld c, ICONOFFSET @@ -68,8 +68,8 @@ GetAnimationSpeed: ld c, $1 ; amount to increase the y coord by ; otherwise, load a second sprite frame .editTileIDS - ld b, $4 - ld de, $4 + ld b, 4 + ld de, OBJ_SIZE .loop ld a, [hl] add c @@ -254,7 +254,7 @@ WriteMonPartySpriteOAM: .makeCopy ld hl, wShadowOAM ld de, wMonPartySpritesSavedOAM - ld bc, $60 + ld bc, OBJ_SIZE * 4 * PARTY_LENGTH jp CopyData GetPartyMonSpriteID: diff --git a/engine/gfx/palettes.asm b/engine/gfx/palettes.asm index 0497f74a..f4ae5c39 100644 --- a/engine/gfx/palettes.asm +++ b/engine/gfx/palettes.asm @@ -611,7 +611,7 @@ CopySGBBorderTiles: ld b, 128 .tileLoop ; Copy bit planes 1 and 2 of the tile data. - ld c, 16 + ld c, TILE_SIZE .copyLoop ld a, [hli] ld [de], a diff --git a/engine/gfx/sprite_oam.asm b/engine/gfx/sprite_oam.asm index 737443a6..649ab01e 100644 --- a/engine/gfx/sprite_oam.asm +++ b/engine/gfx/sprite_oam.asm @@ -148,16 +148,16 @@ PrepareOAMData:: ldh a, [hOAMBufferOffset] ld l, a ld h, HIGH(wShadowOAM) - ld de, $4 - ld b, $a0 + ld de, OBJ_SIZE + ld b, SCREEN_HEIGHT_PX + OAM_Y_OFS ld a, [wMovementFlags] bit BIT_LEDGE_OR_FISHING, a - ld a, $a0 + ld a, LOW(wShadowOAMEnd) jr z, .clear ; Don't clear the last 4 entries because they are used for the shadow in the ; jumping down ledge animation and the rod in the fishing animation. - ld a, $90 + ld a, LOW(wShadowOAMSprite36) .clear cp l |
