diff --git a/constants/gfx_constants.asm b/constants/gfx_constants.asm index 863c39921..7cb7322e6 100644 --- a/constants/gfx_constants.asm +++ b/constants/gfx_constants.asm @@ -22,7 +22,7 @@ DEF HP_BAR_GREEN EQU 0 DEF HP_BAR_YELLOW EQU 1 DEF HP_BAR_RED EQU 2 -; wOAMBuffer +; wShadowOAM DEF NUM_SPRITE_OAM_STRUCTS EQU 40 ; hAutoBGTransferEnabled diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index 8cd62d2b1..9a58c2213 100644 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -174,7 +174,7 @@ DrawFrameBlock: jr z, .resetFrameBlockDestAddr call AnimationCleanOAM .resetFrameBlockDestAddr - ld hl, wOAMBuffer ; OAM buffer + ld hl, wShadowOAM ld a, l ld [wFBDestAddr + 1], a ld a, h @@ -622,7 +622,7 @@ PlaySubanimation: call GetMoveSound call PlaySound .skipPlayingSound - ld hl, wOAMBuffer ; base address of OAM buffer + ld hl, wShadowOAM ld a, l ld [wFBDestAddr + 1], a ld a, h @@ -895,7 +895,7 @@ TradeShakePokeball: ; if it's the end of the animation, make the ball jump up ld de, BallMoveDistances1 .loop - ld hl, wOAMBuffer ; OAM buffer + ld hl, wShadowOAM ld bc, 4 .innerLoop ld a, [de] @@ -925,7 +925,7 @@ BallMoveDistances1: TradeJumpPokeball: ld de, BallMoveDistances2 .loop - ld hl, wOAMBuffer ; OAM buffer + ld hl, wShadowOAM ld bc, 4 .innerLoop ld a, [de] @@ -965,8 +965,8 @@ BallMoveDistances2: ; this function copies the current musical note graphic ; so that there are two musical notes flying towards the defending pokemon DoGrowlSpecialEffects: - ld hl, wOAMBuffer ; OAM buffer - ld de, wOAMBuffer + $10 + ld hl, wShadowOAM + ld de, wShadowOAMSprite04 ld bc, $10 call CopyData ; copy the musical note graphic ld a, [wSubAnimCounter] @@ -1180,7 +1180,7 @@ AnimationWaterDropletsEverywhere: ret _AnimationWaterDroplets: - ld hl, wOAMBuffer + ld hl, wShadowOAM .loop ld a, $1 ld [wdef5], a @@ -1323,7 +1323,7 @@ ShakeEnemyHUD_WritePlayerMonPicOAM: ld [wBaseCoordX], a ld a, $30 ld [wBaseCoordY], a - ld hl, wOAMBuffer + ld hl, wShadowOAM ld d, 0 ld c, 7 .loop @@ -1571,7 +1571,7 @@ AnimationSpiralBallsInward: .loop push hl ld c, 3 - ld de, wOAMBuffer + ld de, wShadowOAM .innerLoop ld a, [hl] cp $ff @@ -1723,7 +1723,7 @@ _AnimationShootBallsUpward: call LoadAnimationTileset pop bc ld d, $7a ; ball tile - ld hl, wOAMBuffer + ld hl, wShadowOAM push bc ld a, [wBaseCoordY] ld e, a @@ -1737,7 +1737,7 @@ _AnimationShootBallsUpward: ld [wNumShootingBalls], a .loop push bc - ld hl, wOAMBuffer + ld hl, wShadowOAM .innerLoop ld a, [wBaseCoordY] add 8 @@ -2240,7 +2240,7 @@ InitMultipleObjectsOAM: xor a ld e, a ld [wBaseCoordX], a - ld hl, wOAMBuffer + ld hl, wShadowOAM .loop call BattleAnimWriteOAMEntry dec c @@ -2494,7 +2494,7 @@ AnimationFallingObjects: call InitMultipleObjectsOAM call FallingObjects_InitXCoords call FallingObjects_InitMovementData - ld hl, wOAMBuffer + ld hl, wShadowOAM ld [hl], 0 .loop ld hl, wFallingObjectsMovementData @@ -2521,7 +2521,7 @@ AnimationFallingObjects: dec c jr nz, .innerLoop call Delay3 - ld hl, wOAMBuffer + ld hl, wShadowOAM ld a, [hl] ; Y cp 104 ; has the top falling object reached 104 yet? jr nz, .loop ; keep moving the falling objects down until it does @@ -2530,7 +2530,7 @@ AnimationFallingObjects: FallingObjects_UpdateOAMEntry: ; Increases Y by 2 pixels and adjusts X and X flip based on the falling object's ; movement byte. - ld hl, wOAMBuffer + ld hl, wShadowOAM add hl, de ld a, $1 ld [wdef5], a @@ -2616,7 +2616,7 @@ FallingObjects_UpdateMovementByte: ret FallingObjects_InitXCoords: - ld hl, wOAMBuffer + $01 + ld hl, wShadowOAMSprite00XCoord ld de, FallingObjects_InitialXCoords ld a, [wNumFallingObjects] ld c, a diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm index 88cd1d6e8..b0289d7e4 100644 --- a/engine/battle/battle_transitions.asm +++ b/engine/battle/battle_transitions.asm @@ -26,7 +26,7 @@ BattleTransition: jr nz, .loop1 ; Clear OAM except for the blocks used by the player and enemy trainer sprites. - ld hl, wOAMBuffer + $10 + ld hl, wShadowOAMSprite04 ld c, 9 .loop2 ld a, b diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 03566487c..23cac58ac 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -108,7 +108,7 @@ SlidePlayerAndEnemySilhouettesOnScreen: ; instead, the enemy pic is part of the background and uses the scroll register, while the player's head is a sprite and is slid by changing its X coordinates in a loop SlidePlayerHeadLeft: push bc - ld hl, wOAMBuffer + $01 + ld hl, wShadowOAMSprite00XCoord ld c, $15 ; number of OAM entries ld de, $4 ; size of OAM entry .loop @@ -6511,7 +6511,7 @@ LoadPlayerBackPic: ASSERT BANK(RedPicBack) == BANK(ProfOakPicBack) call UncompressSpriteFromDE predef ScaleSpriteByTwo - ld hl, wOAMBuffer + ld hl, wShadowOAM xor a ldh [hOAMTile], a ; initial tile number ld b, $7 ; 7 columns diff --git a/engine/battle/draw_hud_pokeball_gfx.asm b/engine/battle/draw_hud_pokeball_gfx.asm index 6aed1d0a4..3f16850a7 100644 --- a/engine/battle/draw_hud_pokeball_gfx.asm +++ b/engine/battle/draw_hud_pokeball_gfx.asm @@ -29,7 +29,7 @@ SetupOwnPartyPokeballs: ld [wHUDPokeballGfxOffsetX], a xor a ld [wdef5], a - ld hl, wOAMBuffer + ld hl, wShadowOAM jp WritePokeballOAMData SetupEnemyPartyPokeballs: @@ -45,7 +45,7 @@ SetupEnemyPartyPokeballs: ld [wHUDPokeballGfxOffsetX], a ld a, $1 ld [wdef5], a - ld hl, wOAMBuffer + PARTY_LENGTH * 4 + ld hl, wShadowOAMSprite06 jp WritePokeballOAMData SetupPokeballs: @@ -180,7 +180,7 @@ SetupPlayerAndEnemyPokeballs: ld [wHUDPokeballGfxOffsetX], a xor a ld [wdef5], a - ld hl, wOAMBuffer + ld hl, wShadowOAM call WritePokeballOAMData ld hl, wEnemyMons ld de, wEnemyPartyCount @@ -191,7 +191,7 @@ SetupPlayerAndEnemyPokeballs: ld [hl], $68 ld a, $1 ld [wdef5], a - ld hl, wOAMBuffer + $18 + ld hl, wShadowOAMSprite06 jp WritePokeballOAMData ; four tiles: pokeball, black pokeball (status ailment), crossed out pokeball (fainted) and pokeball slot (no mon) diff --git a/engine/battle/ghost_marowak_anim.asm b/engine/battle/ghost_marowak_anim.asm index fd21b29e8..7fe421214 100644 --- a/engine/battle/ghost_marowak_anim.asm +++ b/engine/battle/ghost_marowak_anim.asm @@ -61,7 +61,7 @@ CopyMonPicFromBGToSpriteVRAM: ld [wBaseCoordY], a ld a, $70 ld [wBaseCoordX], a - ld hl, wOAMBuffer + ld hl, wShadowOAM lb bc, 6, 6 ld d, $8 .oamLoop diff --git a/engine/gfx/animated_objects.asm b/engine/gfx/animated_objects.asm index 971af6b5b..208a2f859 100644 --- a/engine/gfx/animated_objects.asm +++ b/engine/gfx/animated_objects.asm @@ -28,10 +28,10 @@ RunObjectAnimations: jr nz, .loop ld a, [wCurrentAnimatedObjectOAMBufferOffset] ld l, a - ld h, HIGH(wOAMBuffer) + ld h, HIGH(wShadowOAM) .deinit_unused_oam_loop ld a, l - cp LOW(wOAMBufferEnd) + cp LOW(wShadowOAMEnd) jr nc, .quit xor a ld [hli], a @@ -158,7 +158,7 @@ UpdateCurrentAnimatedObjectFrame: push bc ld a, [wCurrentAnimatedObjectOAMBufferOffset] ld e, a - ld d, HIGH(wOAMBuffer) + ld d, HIGH(wShadowOAM) ld a, [hli] ld c, a .loop @@ -205,7 +205,7 @@ UpdateCurrentAnimatedObjectFrame: inc de ld a, e ld [wCurrentAnimatedObjectOAMBufferOffset], a - cp LOW(wOAMBufferEnd) + cp LOW(wShadowOAMEnd) jr nc, .oam_is_full dec c jr nz, .loop diff --git a/engine/gfx/mon_icons.asm b/engine/gfx/mon_icons.asm index cb5534d04..dce62c9a5 100644 --- a/engine/gfx/mon_icons.asm +++ b/engine/gfx/mon_icons.asm @@ -43,7 +43,7 @@ GetAnimationSpeed: .resetSprites push bc ld hl, wMonPartySpritesSavedOAM - ld de, wOAMBuffer + ld de, wShadowOAM ld bc, $60 call CopyData pop bc @@ -51,7 +51,7 @@ GetAnimationSpeed: jr .incTimer .animateSprite push bc - ld hl, wOAMBuffer + $02 ; OAM tile id + ld hl, wShadowOAMSprite00TileID ld bc, $10 ld a, [wCurrentMenuItem] call AddNTimes @@ -186,7 +186,7 @@ WriteMonPartySpriteOAMByPartyIndex: ret .asm_7191f - ld hl, wOAMBuffer + ld hl, wShadowOAM ld de, wMonPartySpritesSavedOAM ld bc, $60 call CopyData @@ -248,7 +248,7 @@ WriteMonPartySpriteOAM: ; make a copy at wMonPartySpritesSavedOAM. push af ld c, $10 - ld h, HIGH(wOAMBuffer) + ld h, HIGH(wShadowOAM) ldh a, [hPartyMonIndex] swap a ld l, a @@ -264,7 +264,7 @@ WriteMonPartySpriteOAM: ; Make a copy of the OAM buffer with the first animation frame written so that ; we can flip back to it from the second frame by copying it back. .makeCopy - ld hl, wOAMBuffer + ld hl, wShadowOAM ld de, wMonPartySpritesSavedOAM ld bc, $60 jp CopyData diff --git a/engine/gfx/oam_dma.asm b/engine/gfx/oam_dma.asm index fe93e90d4..11e52694a 100644 --- a/engine/gfx/oam_dma.asm +++ b/engine/gfx/oam_dma.asm @@ -16,7 +16,7 @@ DMARoutine: LOAD "OAM DMA", HRAM hDMARoutine:: ; initiate DMA - ld a, HIGH(wOAMBuffer) + ld a, HIGH(wShadowOAM) ldh [rDMA], a ; wait for DMA to finish ld a, $28 diff --git a/engine/gfx/sprite_oam.asm b/engine/gfx/sprite_oam.asm index 3ffd995f2..406d44fd3 100644 --- a/engine/gfx/sprite_oam.asm +++ b/engine/gfx/sprite_oam.asm @@ -1,6 +1,6 @@ PrepareOAMData:: ; Determine OAM data for currently visible -; sprites and write it to wOAMBuffer. +; sprites and write it to wShadowOAM. ; Yellow code has been changed to use registers more efficiently ; as well as tweaking the code to show gbc palettes @@ -83,7 +83,7 @@ PrepareOAMData:: ldh a, [hOAMBufferOffset] ld e, a - ld d, HIGH(wOAMBuffer) + ld d, HIGH(wShadowOAM) .tileLoop ld a, [hli] @@ -153,7 +153,7 @@ PrepareOAMData:: cp c ret nc ld l, a - ld h, HIGH(wOAMBuffer) + ld h, HIGH(wShadowOAM) ld a, c ld de, $4 ; entry size ld b, $a0 diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index 66f7832b5..d98ec7d35 100644 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -1295,7 +1295,7 @@ ItemUseMedicine: xor a ld [wBattleMonStatus], a ; remove the status ailment in the in-battle pokemon data .calculateHPBarCoords - ld hl, wOAMBuffer + $90 + ld hl, wShadowOAMSprite36 ld bc, 2 * SCREEN_WIDTH inc d .calculateHPBarCoordsLoop diff --git a/engine/items/town_map.asm b/engine/items/town_map.asm index ebd1d4b97..1ed146f27 100644 --- a/engine/items/town_map.asm +++ b/engine/items/town_map.asm @@ -16,7 +16,7 @@ DisplayTownMap: hlcoord 1, 0 ld de, wcd6d call PlaceString - ld hl, wOAMBuffer + ld hl, wShadowOAM ld de, wTileMapBackup ld bc, $10 call CopyData @@ -47,7 +47,7 @@ DisplayTownMap: call TownMapCoordsToOAMCoords ld a, $4 ld [wOAMBaseTile], a - ld hl, wOAMBuffer + $10 + ld hl, wShadowOAMSprite04 call WriteTownMapSpriteOAM ; town map cursor sprite pop hl ld de, wcd6d @@ -60,7 +60,7 @@ DisplayTownMap: hlcoord 1, 0 ld de, wcd6d call PlaceString - ld hl, wOAMBuffer + $10 + ld hl, wShadowOAMSprite04 ld de, wTileMapBackup + 16 ld bc, $10 call CopyData @@ -372,7 +372,7 @@ DrawPlayerOrBirdSprite: inc de cp "@" jr nz, .loop - ld hl, wOAMBuffer + ld hl, wShadowOAM ld de, wTileMapBackup ld bc, $a0 jp CopyData @@ -380,7 +380,7 @@ DrawPlayerOrBirdSprite: DisplayWildLocations: farcall FindWildLocationsOfMon call ZeroOutDuplicatesInList - ld hl, wOAMBuffer + ld hl, wShadowOAM ld de, wTownMapCoords .loop ld a, [de] @@ -419,7 +419,7 @@ DisplayWildLocations: ld b, $0 call DrawPlayerOrBirdSprite .done - ld hl, wOAMBuffer + ld hl, wShadowOAM ld de, wTileMapBackup ld bc, $a0 jp CopyData @@ -448,9 +448,9 @@ TownMapCoordsToOAMCoords: WritePlayerOrBirdSpriteOAM: ld a, [wOAMBaseTile] and a - ld hl, wOAMBuffer + $90 ; for player sprite + ld hl, wShadowOAMSprite36 ; for player sprite jr z, WriteTownMapSpriteOAM - ld hl, wOAMBuffer + $80 ; for bird sprite + ld hl, wShadowOAMSprite32 ; for bird sprite WriteTownMapSpriteOAM: push hl @@ -609,13 +609,13 @@ TownMapSpriteBlinkingAnimation:: jr nz, .done ; show sprites when the counter reaches 50 ld hl, wTileMapBackup - ld de, wOAMBuffer + ld de, wShadowOAM ld bc, $90 call CopyData xor a jr .done .hideSprites - ld hl, wOAMBuffer + ld hl, wShadowOAM ld b, $24 ld de, $4 .hideSpritesLoop diff --git a/engine/menus/start_sub_menus.asm b/engine/menus/start_sub_menus.asm index 8a0b7b824..3e8ce5d1e 100644 --- a/engine/menus/start_sub_menus.asm +++ b/engine/menus/start_sub_menus.asm @@ -695,7 +695,7 @@ SwitchPartyMon_ClearGfx: dec c jr nz, .clearMonBGLoop pop af - ld hl, wOAMBuffer + ld hl, wShadowOAM ld bc, $10 call AddNTimes ld de, $4 diff --git a/engine/minigame/surfing_pikachu.asm b/engine/minigame/surfing_pikachu.asm index e554b14a6..3d0ed892a 100644 --- a/engine/minigame/surfing_pikachu.asm +++ b/engine/minigame/surfing_pikachu.asm @@ -657,7 +657,7 @@ SurfingMinigame_UpdatePikachuDistance: ret nc ld hl, wc5e5 inc [hl] - ld hl, wOAMBuffer + 4 * 4 + 1 + ld hl, wShadowOAMSprite04XCoord dec [hl] dec [hl] ret @@ -1313,7 +1313,7 @@ SurfingMinigame_MoveClouds: ld a, l ld [wc635], a ld d, h - ld hl, wOAMBuffer + 5 * 4 + 1 + ld hl, wShadowOAMSprite05XCoord ld e, $9 .loop ld a, [hl] @@ -1430,10 +1430,10 @@ SurfingMinigame_Deduct1HP: SurfingMinigame_DrawHP: ld de, wSurfingMinigamePikachuHP + 1 - ld hl, wOAMBuffer + 0 * 4 + 2 + ld hl, wShadowOAMSprite00TileID ld a, [de] call .PlaceBCDNumber - ld hl, wOAMBuffer + 2 * 4 + 2 + ld hl, wShadowOAMSprite02TileID ld a, [de] .PlaceBCDNumber: ld c, a @@ -1461,7 +1461,7 @@ SurfingMinigame_DrawResultsScreen: ld bc, .BeachTilemapEnd - .BeachTilemap call CopyData call .PlaceTextbox - ld hl, wOAMBuffer + 5 * 4 + 1 + ld hl, wShadowOAMSprite05XCoord ld bc, 9 * 4 xor a call FillMemory diff --git a/engine/movie/intro.asm b/engine/movie/intro.asm index 8d431aae5..691f9c789 100644 --- a/engine/movie/intro.asm +++ b/engine/movie/intro.asm @@ -20,7 +20,7 @@ PlayIntro: ret InitIntroNidorinoOAM: - ld hl, wOAMBuffer + ld hl, wShadowOAM ld d, 0 .loop push bc diff --git a/engine/movie/intro_yellow.asm b/engine/movie/intro_yellow.asm index a67c6de49..78dcdf0a2 100644 --- a/engine/movie/intro_yellow.asm +++ b/engine/movie/intro_yellow.asm @@ -57,42 +57,42 @@ PlayIntroScene: ret Func_f98a2: - ld a, [wOAMBuffer + 8 * 4 + 3] + ld a, [wShadowOAMSprite08Attributes] or $1 - ld [wOAMBuffer + 8 * 4 + 3], a - ld a, [wOAMBuffer + 14 * 4 + 3] + ld [wShadowOAMSprite08Attributes], a + ld a, [wShadowOAMSprite14Attributes] or $1 - ld [wOAMBuffer + 14 * 4 + 3], a - ld a, [wOAMBuffer + 16 * 4 + 3] + ld [wShadowOAMSprite14Attributes], a + ld a, [wShadowOAMSprite16Attributes] or $1 - ld [wOAMBuffer + 16 * 4 + 3], a - ld a, [wOAMBuffer + 18 * 4 + 3] + ld [wShadowOAMSprite16Attributes], a + ld a, [wShadowOAMSprite18Attributes] or $1 - ld [wOAMBuffer + 18 * 4 + 3], a - ld a, [wOAMBuffer + 19 * 4 + 3] + ld [wShadowOAMSprite18Attributes], a + ld a, [wShadowOAMSprite19Attributes] or $1 - ld [wOAMBuffer + 19 * 4 + 3], a + ld [wShadowOAMSprite19Attributes], a ret Func_f98cb: - ld a, [wOAMBuffer + 18 * 4 + 3] + ld a, [wShadowOAMSprite18Attributes] or $1 - ld [wOAMBuffer + 18 * 4 + 3], a - ld a, [wOAMBuffer + 19 * 4 + 3] + ld [wShadowOAMSprite18Attributes], a + ld a, [wShadowOAMSprite19Attributes] or $1 - ld [wOAMBuffer + 19 * 4 + 3], a - ld a, [wOAMBuffer + 20 * 4 + 3] + ld [wShadowOAMSprite19Attributes], a + ld a, [wShadowOAMSprite20Attributes] or $1 - ld [wOAMBuffer + 20 * 4 + 3], a - ld a, [wOAMBuffer + 25 * 4 + 3] + ld [wShadowOAMSprite20Attributes], a + ld a, [wShadowOAMSprite25Attributes] or $1 - ld [wOAMBuffer + 25 * 4 + 3], a - ld a, [wOAMBuffer + 26 * 4 + 3] + ld [wShadowOAMSprite25Attributes], a + ld a, [wShadowOAMSprite26Attributes] or $1 - ld [wOAMBuffer + 26 * 4 + 3], a - ld a, [wOAMBuffer + 28 * 4 + 3] + ld [wShadowOAMSprite26Attributes], a + ld a, [wShadowOAMSprite28Attributes] or $1 - ld [wOAMBuffer + 28 * 4 + 3], a + ld [wShadowOAMSprite28Attributes], a ret Func_f98fc: @@ -911,8 +911,8 @@ Bank3E_FillMemory: ret YellowIntro_BlankOAMBuffer: - ld hl, wOAMBuffer - ld bc, wOAMBufferEnd - wOAMBuffer + ld hl, wShadowOAM + ld bc, wShadowOAMEnd - wShadowOAM xor a call Bank3E_FillMemory ret diff --git a/engine/movie/splash.asm b/engine/movie/splash.asm index 0b14dcaa1..13f80bb13 100644 --- a/engine/movie/splash.asm +++ b/engine/movie/splash.asm @@ -18,11 +18,11 @@ LoadShootingStarGraphics: lb bc, BANK(FallingStar), (FallingStarEnd - FallingStar) / $10 call CopyVideoData ld hl, GameFreakLogoOAMData - ld de, wOAMBuffer + $60 + ld de, wShadowOAMSprite24 ld bc, GameFreakLogoOAMDataEnd - GameFreakLogoOAMData call CopyData ld hl, GameFreakShootingStarOAMData - ld de, wOAMBuffer + ld de, wShadowOAM ld bc, GameFreakShootingStarOAMDataEnd - GameFreakShootingStarOAMData jp CopyData @@ -32,7 +32,7 @@ AnimateShootingStar: call PlaySound ; Move the big star down and left across the screen. - ld hl, wOAMBuffer + ld hl, wShadowOAM lb bc, $a0, $4 .bigStarLoop push hl @@ -62,7 +62,7 @@ AnimateShootingStar: jr nz, .bigStarLoop ; Clear big star OAM. - ld hl, wOAMBuffer + ld hl, wShadowOAM ld c, 4 ld de, 4 .clearOAMLoop @@ -86,7 +86,7 @@ AnimateShootingStar: ; Copy 24 instances of the small stars OAM data. ; Note that their coordinates put them off-screen. - ld de, wOAMBuffer + ld de, wShadowOAM ld a, 24 .initSmallStarsOAMLoop push af @@ -109,7 +109,7 @@ AnimateShootingStar: ld d, a push bc push hl - ld hl, wOAMBuffer + $50 + ld hl, wShadowOAMSprite20 ld c, 4 .smallStarsInnerLoop ; introduce new wave of 4 small stars OAM entries ld a, [de] @@ -143,8 +143,8 @@ AnimateShootingStar: push af ; shift the existing OAM entries down to make room for the next wave - ld hl, wOAMBuffer + $10 - ld de, wOAMBuffer + ld hl, wShadowOAMSprite04 + ld de, wShadowOAM ld bc, $50 call CopyData @@ -206,7 +206,7 @@ SmallStarsEmptyWave: MoveDownSmallStars: ld b, 8 .loop - ld hl, wOAMBuffer + $5c + ld hl, wShadowOAMSprite23 ld a, [wMoveDownSmallStarsOAMCount] ld de, -4 ld c, a diff --git a/engine/movie/title.asm b/engine/movie/title.asm index dfe057f3c..d75a52116 100644 --- a/engine/movie/title.asm +++ b/engine/movie/title.asm @@ -312,7 +312,7 @@ DoTitleScreenFunction: .BlinkClosed: ld e, 8 .LoadBlinkFrame: - ld hl, wOAMBuffer + 2 + ld hl, wShadowOAMSprite00TileID ld c, 8 .loop ld a, [hl] diff --git a/engine/movie/title_rb.asm b/engine/movie/title_rb.asm index 597684df9..0c0c121ec 100644 --- a/engine/movie/title_rb.asm +++ b/engine/movie/title_rb.asm @@ -117,6 +117,6 @@ GetTitleBallY: pop de and a ret z - ld [wOAMBuffer + $28], a + ld [wShadowOAMSprite10YCoord], a inc e ret diff --git a/engine/movie/title_yellow.asm b/engine/movie/title_yellow.asm index c70b87f94..1e5b79297 100644 --- a/engine/movie/title_yellow.asm +++ b/engine/movie/title_yellow.asm @@ -53,7 +53,7 @@ TitleScreen_PlacePikachu: hlcoord 16, 13 ld [hl], $b1 ld hl, TitleScreenPikachuEyesOAMData - ld de, wOAMBuffer + ld de, wShadowOAM ld bc, $20 call CopyData ret diff --git a/engine/movie/trade.asm b/engine/movie/trade.asm index c75030729..3617f40a8 100644 --- a/engine/movie/trade.asm +++ b/engine/movie/trade.asm @@ -318,7 +318,7 @@ Trade_AnimateBallEnteringLinkCable: xor $1 ld [wLinkCableAnimBulgeToggle], a add $7e - ld hl, wOAMBuffer + $02 + ld hl, wShadowOAMSprite00TileID ld de, 4 ld c, e .cycleLinkCableBulgeTile @@ -603,7 +603,7 @@ Trade_AnimCircledMon: xor $3c ; make link cable flash ldh [rBGP], a call UpdateGBCPal_BGP - ld hl, wOAMBuffer + $02 + ld hl, wShadowOAMSprite00TileID ld de, $4 ld c, $14 .loop @@ -623,7 +623,7 @@ Trade_WriteCircledMonOAM: call Trade_WriteCircleOAM Trade_AddOffsetsToOAMCoords: - ld hl, wOAMBuffer + ld hl, wShadowOAM ld c, $14 ; SCREEN_WIDTH? .loop ld a, [wBaseCoordY] diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm index 564ad65a3..ccc59846e 100644 --- a/engine/overworld/cut.asm +++ b/engine/overworld/cut.asm @@ -100,7 +100,7 @@ InitCutAnimOAM: ld hl, vChars1 tile $7f call LoadCutGrassAnimationTilePattern call WriteCutOrBoulderDustAnimationOAMBlock - ld hl, wOAMBuffer + $93 + ld hl, wShadowOAMSprite36Attributes ld de, 4 ld a, $30 ld c, e diff --git a/engine/overworld/cut2.asm b/engine/overworld/cut2.asm index 1f691eefc..3cbd05b4d 100644 --- a/engine/overworld/cut2.asm +++ b/engine/overworld/cut2.asm @@ -5,12 +5,12 @@ AnimCut: ld c, $8 .cutTreeLoop push bc - ld hl, wOAMBuffer + $91 + ld hl, wShadowOAMSprite36XCoord ld a, 1 ld [wCoordAdjustmentAmount], a ld c, 2 call AdjustOAMBlockXPos2 - ld hl, wOAMBuffer + $99 + ld hl, wShadowOAMSprite38XCoord ld a, -1 ld [wCoordAdjustmentAmount], a ld c, 2 @@ -34,7 +34,7 @@ AnimCut: ld c, $8 call AnimCutGrass_UpdateOAMEntries call AnimCutGrass_SwapOAMEntries - ld hl, wOAMBuffer + $90 + ld hl, wShadowOAMSprite36YCoord ld a, 2 ld [wCoordAdjustmentAmount], a ld c, 4 @@ -46,22 +46,22 @@ AnimCut: AnimCutGrass_UpdateOAMEntries: push bc - ld hl, wOAMBuffer + $91 + ld hl, wShadowOAMSprite36XCoord ld a, 1 ld [wCoordAdjustmentAmount], a ld c, 1 call AdjustOAMBlockXPos2 - ld hl, wOAMBuffer + $95 + ld hl, wShadowOAMSprite37XCoord ld a, 2 ld [wCoordAdjustmentAmount], a ld c, 1 call AdjustOAMBlockXPos2 - ld hl, wOAMBuffer + $99 + ld hl, wShadowOAMSprite38XCoord ld a, -2 ld [wCoordAdjustmentAmount], a ld c, 1 call AdjustOAMBlockXPos2 - ld hl, wOAMBuffer + $9d + ld hl, wShadowOAMSprite39XCoord ld a, -1 ld [wCoordAdjustmentAmount], a ld c, 1 @@ -77,15 +77,15 @@ AnimCutGrass_UpdateOAMEntries: ret AnimCutGrass_SwapOAMEntries: - ld hl, wOAMBuffer + $90 + ld hl, wShadowOAMSprite36 ld de, wBuffer ld bc, $8 call CopyData - ld hl, wOAMBuffer + $98 - ld de, wOAMBuffer + $90 + ld hl, wShadowOAMSprite38 + ld de, wShadowOAMSprite36 ld bc, $8 call CopyData ld hl, wBuffer - ld de, wOAMBuffer + $98 + ld de, wShadowOAMSprite38 ld bc, $8 jp CopyData diff --git a/engine/overworld/dust_smoke.asm b/engine/overworld/dust_smoke.asm index ebc80f69d..220d5794f 100644 --- a/engine/overworld/dust_smoke.asm +++ b/engine/overworld/dust_smoke.asm @@ -45,7 +45,7 @@ GetMoveBoulderDustFunctionPointer: ld h, [hl] ld l, a push hl - ld hl, wOAMBuffer + $90 + ld hl, wShadowOAMSprite36 ld d, $0 add hl, de ld e, l diff --git a/engine/overworld/emotion_bubbles.asm b/engine/overworld/emotion_bubbles.asm index 3ad714e9c..006bded35 100644 --- a/engine/overworld/emotion_bubbles.asm +++ b/engine/overworld/emotion_bubbles.asm @@ -20,11 +20,11 @@ EmotionBubble: ld [wUpdateSpritesEnabled], a ld a, [wd736] bit 6, a ; are the last 4 OAM entries reserved for a shadow or fishing rod? - ld hl, wOAMBuffer + 4 * 35 + $3 ; $8f - ld de, wOAMBuffer + 4 * 39 + $3 ; $9f + ld hl, wShadowOAMSprite35Attributes + ld de, wShadowOAMSprite39Attributes jr z, .next - ld hl, wOAMBuffer + 4 * 31 + $3 ; $7f - ld de, wOAMBuffer + 4 * 35 + $3 ; $8f + ld hl, wShadowOAMSprite31Attributes + ld de, wShadowOAMSprite35Attributes ; Copy OAM data 16 bytes forward to make room for emotion bubble OAM data at the ; start of the OAM buffer. diff --git a/engine/overworld/healing_machine.asm b/engine/overworld/healing_machine.asm index 451ea0018..3bd739b7a 100644 --- a/engine/overworld/healing_machine.asm +++ b/engine/overworld/healing_machine.asm @@ -13,7 +13,7 @@ AnimateHealingMachine: ld a, $e0 ldh [rOBP1], a call UpdateGBCPal_OBP1 - ld hl, wOAMBuffer + $84 + ld hl, wShadowOAMSprite33 ld de, PokeCenterOAMData call CopyHealingMachineOAM ld a, 4 diff --git a/engine/overworld/ledges.asm b/engine/overworld/ledges.asm index 9925c5289..efb56628a 100644 --- a/engine/overworld/ledges.asm +++ b/engine/overworld/ledges.asm @@ -62,12 +62,12 @@ LoadHoppingShadowOAM: lb bc, BANK(LedgeHoppingShadow), (LedgeHoppingShadowEnd - LedgeHoppingShadow) / $8 call CopyVideoDataDouble ld hl, LedgeHoppingShadowOAM - ld de, wOAMBuffer + 36 * 4 + ld de, wShadowOAMSprite36 ld bc, LedgeHoppingShadowOAMEnd - LedgeHoppingShadowOAM call CopyData ld a, $a0 - ld [wOAMBuffer + 38 * 4], a - ld [wOAMBuffer + 39 * 4], a + ld [wShadowOAMSprite38YCoord], a + ld [wShadowOAMSprite39YCoord], a ret LedgeHoppingShadow: diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm index d3cc22be2..008d5057b 100644 --- a/engine/overworld/player_animations.asm +++ b/engine/overworld/player_animations.asm @@ -210,19 +210,19 @@ LeaveMapThroughHoleAnim: ld a, $ff ld [wUpdateSpritesEnabled], a ; disable UpdateSprites ; shift upper half of player's sprite down 8 pixels and hide lower half - ld a, [wOAMBuffer + 0 * 4 + 2] - ld [wOAMBuffer + 2 * 4 + 2], a - ld a, [wOAMBuffer + 1 * 4 + 2] - ld [wOAMBuffer + 3 * 4 + 2], a + ld a, [wShadowOAMSprite00TileID] + ld [wShadowOAMSprite02TileID], a + ld a, [wShadowOAMSprite01TileID] + ld [wShadowOAMSprite03TileID], a ld a, $a0 - ld [wOAMBuffer + 0 * 4], a - ld [wOAMBuffer + 1 * 4], a + ld [wShadowOAMSprite00YCoord], a + ld [wShadowOAMSprite01YCoord], a ld c, 2 call DelayFrames ; hide upper half of player's sprite ld a, $a0 - ld [wOAMBuffer + 2 * 4], a - ld [wOAMBuffer + 3 * 4], a + ld [wShadowOAMSprite02YCoord], a + ld [wShadowOAMSprite03YCoord], a call GBFadeOutToWhite ld a, $1 ld [wUpdateSpritesEnabled], a ; enable UpdateSprites @@ -400,7 +400,7 @@ FishingAnim: ld b, $0 ld hl, FishingRodOAM add hl, bc - ld de, wOAMBuffer + $9c + ld de, wShadowOAMSprite39 ld bc, $4 call CopyData ld c, 100 @@ -420,7 +420,7 @@ FishingAnim: .loop ld hl, wSpritePlayerStateData1YPixels call .ShakePlayerSprite - ld hl, wOAMBuffer + $9c + ld hl, wShadowOAMSprite39 call .ShakePlayerSprite call Delay3 dec b @@ -432,7 +432,7 @@ FishingAnim: cp SPRITE_FACING_UP jr nz, .skipHidingFishingRod ld a, $a0 - ld [wOAMBuffer + $9c], a + ld [wShadowOAMSprite39YCoord], a .skipHidingFishingRod ld hl, wEmotionBubbleSpriteIndex @@ -446,7 +446,7 @@ FishingAnim: cp SPRITE_FACING_UP jr nz, .skipUnhidingFishingRod ld a, $44 - ld [wOAMBuffer + $9c], a + ld [wShadowOAMSprite39YCoord], a .skipUnhidingFishingRod ld hl, ItsABiteText diff --git a/engine/pikachu/pikachu_movement.asm b/engine/pikachu/pikachu_movement.asm index 2ca7aa2f7..87f175393 100644 --- a/engine/pikachu/pikachu_movement.asm +++ b/engine/pikachu/pikachu_movement.asm @@ -867,7 +867,7 @@ LoadPikachuShadowOAMData: push de push hl - ld bc, wOAMBuffer + 4 * 36 + ld bc, wShadowOAMSprite36 ld a, [wPikaSpriteY] ld e, a ld a, [wPikaSpriteX] diff --git a/engine/printer/printer.asm b/engine/printer/printer.asm index 18bb18a67..d75dfbde9 100644 --- a/engine/printer/printer.asm +++ b/engine/printer/printer.asm @@ -416,7 +416,7 @@ PrinterDebug: xor a ld [wPrinterConnectionOpen], a ld [wPrinterOpcode], a - ld hl, wOAMBuffer + 32 * 4 + ld hl, wShadowOAMSprite32 ld bc, 8 * 4 xor a call FillMemory diff --git a/engine/printer/printer2.asm b/engine/printer/printer2.asm index 1f8ac9750..407aee8a2 100644 --- a/engine/printer/printer2.asm +++ b/engine/printer/printer2.asm @@ -190,7 +190,7 @@ PrinterDebug_LoadGFX: lb bc, BANK(GFX_ea597), (GFX_ea597End - GFX_ea597) / 16 call CopyVideoData - ld hl, wOAMBuffer + 32 * 4 + ld hl, wShadowOAMSprite32 ld a, $8 ld c, $8 .loop @@ -212,7 +212,7 @@ INCBIN "gfx/printer/01.2bpp" GFX_ea597End: PrinterDebug_ConvertStatusFlagsToTiles: - ld hl, wOAMBuffer + 32 * 4 + 2 + ld hl, wShadowOAMSprite32TileID ld de, 4 ld a, [wPrinterStatusFlags] ld c, 8 @@ -610,7 +610,7 @@ PrinterDebug_PrepOAMForPrinting: ld bc, $20 xor a call FillMemory - ld hl, wOAMBuffer + ld hl, wShadowOAM ld c, $28 .master_loop push bc diff --git a/engine/slots/slot_machine.asm b/engine/slots/slot_machine.asm index fc7f1ee77..3918e8793 100644 --- a/engine/slots/slot_machine.asm +++ b/engine/slots/slot_machine.asm @@ -761,7 +761,7 @@ SlotMachine_UpdateBallTiles: SlotMachine_AnimWheel1: ld bc, SlotMachineWheel1 ld de, wSlotMachineWheel1Offset - ld hl, wOAMBuffer + ld hl, wShadowOAMSprite00 ld a, $30 ld [wBaseCoordX], a jr SlotMachine_AnimWheel @@ -769,7 +769,7 @@ SlotMachine_AnimWheel1: SlotMachine_AnimWheel2: ld bc, SlotMachineWheel2 ld de, wSlotMachineWheel2Offset - ld hl, wOAMBuffer + $30 + ld hl, wShadowOAMSprite12 ld a, $50 ld [wBaseCoordX], a jr SlotMachine_AnimWheel @@ -777,7 +777,7 @@ SlotMachine_AnimWheel2: SlotMachine_AnimWheel3: ld bc, SlotMachineWheel3 ld de, wSlotMachineWheel3Offset - ld hl, wOAMBuffer + $60 + ld hl, wShadowOAMSprite24 ld a, $70 ld [wBaseCoordX], a diff --git a/home/clear_sprites.asm b/home/clear_sprites.asm index 79cc99d66..6d1066fae 100644 --- a/home/clear_sprites.asm +++ b/home/clear_sprites.asm @@ -1,7 +1,7 @@ ClearSprites:: xor a - ld hl, wOAMBuffer - ld b, wOAMBufferEnd - wOAMBuffer + ld hl, wShadowOAM + ld b, wShadowOAMEnd - wShadowOAM .loop ld [hli], a dec b @@ -10,7 +10,7 @@ ClearSprites:: HideSprites:: ld a, 160 - ld hl, wOAMBuffer + ld hl, wShadowOAM ld de, 4 ld b, 40 .loop diff --git a/home/oam.asm b/home/oam.asm index 8a940d975..8be59f6ee 100644 --- a/home/oam.asm +++ b/home/oam.asm @@ -4,7 +4,7 @@ ; c = X coordinate of upper left corner of sprite ; de = base address of 4 tile number and attribute pairs WriteOAMBlock:: - ld h, HIGH(wOAMBuffer) + ld h, HIGH(wShadowOAM) swap a ; multiply by 16 ld l, a call .writeOneEntry ; upper left diff --git a/ram/wram.asm b/ram/wram.asm index 80cd15a6e..0e9d54a0e 100644 --- a/ram/wram.asm +++ b/ram/wram.asm @@ -147,12 +147,12 @@ wSpriteDataEnd:: SECTION "OAM Buffer", WRAM0 ; buffer for OAM data. Copied to OAM by DMA -wOAMBuffer:: -; wOAMBufferSprite00 - wOAMBufferSprite39 +wShadowOAM:: +; wShadowOAMSprite00 - wShadowOAMSprite39 FOR n, NUM_SPRITE_OAM_STRUCTS -wOAMBufferSprite{02d:n}:: sprite_oam_struct wOAMBufferSprite{02d:n} +wShadowOAMSprite{02d:n}:: sprite_oam_struct wShadowOAMSprite{02d:n} ENDR -wOAMBufferEnd:: +wShadowOAMEnd:: SECTION "Tilemap", WRAM0 diff --git a/scripts/VermilionDock.asm b/scripts/VermilionDock.asm index af118d18b..a0f9d63ee 100644 --- a/scripts/VermilionDock.asm +++ b/scripts/VermilionDock.asm @@ -124,7 +124,7 @@ VermilionDock_1db9b: VermilionDock_AnimSmokePuffDriftRight: push bc push de - ld hl, wOAMBuffer + 4 * $4 + 1 ; x coord + ld hl, wShadowOAMSprite04XCoord ld a, [wSSAnneSmokeDriftAmount] swap a ld c, a