wOAMBuffer -> wShadowOAM (#370)

This commit is contained in:
Colton G. Rushton 2022-07-09 18:18:18 -03:00 committed by GitHub
parent b045ac4f16
commit cc46b0e510
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 105 additions and 105 deletions

View file

@ -17,7 +17,7 @@ DEF HP_BAR_GREEN EQU 0
DEF HP_BAR_YELLOW EQU 1 DEF HP_BAR_YELLOW EQU 1
DEF HP_BAR_RED EQU 2 DEF HP_BAR_RED EQU 2
; wOAMBuffer ; wShadowOAM
DEF NUM_SPRITE_OAM_STRUCTS EQU 40 DEF NUM_SPRITE_OAM_STRUCTS EQU 40
; hAutoBGTransferEnabled ; hAutoBGTransferEnabled

View file

@ -147,7 +147,7 @@ DrawFrameBlock:
jr z, .resetFrameBlockDestAddr jr z, .resetFrameBlockDestAddr
call AnimationCleanOAM call AnimationCleanOAM
.resetFrameBlockDestAddr .resetFrameBlockDestAddr
ld hl, wOAMBuffer ; OAM buffer ld hl, wShadowOAM
ld a, l ld a, l
ld [wFBDestAddr + 1], a ld [wFBDestAddr + 1], a
ld a, h ld a, h
@ -583,7 +583,7 @@ PlaySubanimation:
call GetMoveSound call GetMoveSound
call PlaySound call PlaySound
.skipPlayingSound .skipPlayingSound
ld hl, wOAMBuffer ; base address of OAM buffer ld hl, wShadowOAM
ld a, l ld a, l
ld [wFBDestAddr + 1], a ld [wFBDestAddr + 1], a
ld a, h ld a, h
@ -855,7 +855,7 @@ TradeShakePokeball:
; if it's the end of the animation, make the ball jump up ; if it's the end of the animation, make the ball jump up
ld de, BallMoveDistances1 ld de, BallMoveDistances1
.loop .loop
ld hl, wOAMBuffer ; OAM buffer ld hl, wShadowOAM
ld bc, 4 ld bc, 4
.innerLoop .innerLoop
ld a, [de] ld a, [de]
@ -885,7 +885,7 @@ BallMoveDistances1:
TradeJumpPokeball: TradeJumpPokeball:
ld de, BallMoveDistances2 ld de, BallMoveDistances2
.loop .loop
ld hl, wOAMBuffer ; OAM buffer ld hl, wShadowOAM
ld bc, 4 ld bc, 4
.innerLoop .innerLoop
ld a, [de] ld a, [de]
@ -925,8 +925,8 @@ BallMoveDistances2:
; this function copies the current musical note graphic ; this function copies the current musical note graphic
; so that there are two musical notes flying towards the defending pokemon ; so that there are two musical notes flying towards the defending pokemon
DoGrowlSpecialEffects: DoGrowlSpecialEffects:
ld hl, wOAMBuffer ; OAM buffer ld hl, wShadowOAM
ld de, wOAMBuffer + $10 ld de, wShadowOAMSprite04
ld bc, $10 ld bc, $10
call CopyData ; copy the musical note graphic call CopyData ; copy the musical note graphic
ld a, [wSubAnimCounter] ld a, [wSubAnimCounter]
@ -1136,7 +1136,7 @@ AnimationWaterDropletsEverywhere:
ret ret
_AnimationWaterDroplets: _AnimationWaterDroplets:
ld hl, wOAMBuffer ld hl, wShadowOAM
.loop .loop
ld a, [wBaseCoordY] ld a, [wBaseCoordY]
ld [hli], a ; Y ld [hli], a ; Y
@ -1264,7 +1264,7 @@ ShakeEnemyHUD_WritePlayerMonPicOAM:
ld [wBaseCoordX], a ld [wBaseCoordX], a
ld a, $30 ld a, $30
ld [wBaseCoordY], a ld [wBaseCoordY], a
ld hl, wOAMBuffer ld hl, wShadowOAM
ld d, 0 ld d, 0
ld c, 7 ld c, 7
.loop .loop
@ -1498,7 +1498,7 @@ AnimationSpiralBallsInward:
.loop .loop
push hl push hl
ld c, 3 ld c, 3
ld de, wOAMBuffer ld de, wShadowOAM
.innerLoop .innerLoop
ld a, [hl] ld a, [hl]
cp $ff cp $ff
@ -1637,7 +1637,7 @@ _AnimationShootBallsUpward:
call LoadAnimationTileset call LoadAnimationTileset
pop bc pop bc
ld d, $7a ; ball tile ld d, $7a ; ball tile
ld hl, wOAMBuffer ld hl, wShadowOAM
push bc push bc
ld a, [wBaseCoordY] ld a, [wBaseCoordY]
ld e, a ld e, a
@ -1651,7 +1651,7 @@ _AnimationShootBallsUpward:
ld [wNumShootingBalls], a ld [wNumShootingBalls], a
.loop .loop
push bc push bc
ld hl, wOAMBuffer ld hl, wShadowOAM
.innerLoop .innerLoop
ld a, [wBaseCoordY] ld a, [wBaseCoordY]
add 8 add 8
@ -2080,7 +2080,7 @@ InitMultipleObjectsOAM:
xor a xor a
ld e, a ld e, a
ld [wBaseCoordX], a ld [wBaseCoordX], a
ld hl, wOAMBuffer ld hl, wShadowOAM
.loop .loop
call BattleAnimWriteOAMEntry call BattleAnimWriteOAMEntry
dec c dec c
@ -2336,7 +2336,7 @@ AnimationFallingObjects:
call InitMultipleObjectsOAM call InitMultipleObjectsOAM
call FallingObjects_InitXCoords call FallingObjects_InitXCoords
call FallingObjects_InitMovementData call FallingObjects_InitMovementData
ld hl, wOAMBuffer ld hl, wShadowOAM
ld [hl], 0 ld [hl], 0
.loop .loop
ld hl, wFallingObjectsMovementData ld hl, wFallingObjectsMovementData
@ -2363,7 +2363,7 @@ AnimationFallingObjects:
dec c dec c
jr nz, .innerLoop jr nz, .innerLoop
call Delay3 call Delay3
ld hl, wOAMBuffer ld hl, wShadowOAM
ld a, [hl] ; Y ld a, [hl] ; Y
cp 104 ; has the top falling object reached 104 yet? cp 104 ; has the top falling object reached 104 yet?
jr nz, .loop ; keep moving the falling objects down until it does jr nz, .loop ; keep moving the falling objects down until it does
@ -2372,7 +2372,7 @@ AnimationFallingObjects:
FallingObjects_UpdateOAMEntry: FallingObjects_UpdateOAMEntry:
; Increases Y by 2 pixels and adjusts X and X flip based on the falling object's ; Increases Y by 2 pixels and adjusts X and X flip based on the falling object's
; movement byte. ; movement byte.
ld hl, wOAMBuffer ld hl, wShadowOAM
add hl, de add hl, de
ld a, [hl] ld a, [hl]
inc a inc a
@ -2433,7 +2433,7 @@ FallingObjects_UpdateMovementByte:
ret ret
FallingObjects_InitXCoords: FallingObjects_InitXCoords:
ld hl, wOAMBuffer + $01 ld hl, wShadowOAMSprite00XCoord
ld de, FallingObjects_InitialXCoords ld de, FallingObjects_InitialXCoords
ld a, [wNumFallingObjects] ld a, [wNumFallingObjects]
ld c, a ld c, a

View file

@ -26,7 +26,7 @@ BattleTransition:
jr nz, .loop1 jr nz, .loop1
; Clear OAM except for the blocks used by the player and enemy trainer sprites. ; Clear OAM except for the blocks used by the player and enemy trainer sprites.
ld hl, wOAMBuffer + $10 ld hl, wShadowOAMSprite04
ld c, 9 ld c, 9
.loop2 .loop2
ld a, b ld a, b

View file

@ -105,7 +105,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 ; 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: SlidePlayerHeadLeft:
push bc push bc
ld hl, wOAMBuffer + $01 ld hl, wShadowOAMSprite00XCoord
ld c, $15 ; number of OAM entries ld c, $15 ; number of OAM entries
ld de, $4 ; size of OAM entry ld de, $4 ; size of OAM entry
.loop .loop
@ -6327,7 +6327,7 @@ LoadPlayerBackPic:
ASSERT BANK(RedPicBack) == BANK(OldManPicBack) ASSERT BANK(RedPicBack) == BANK(OldManPicBack)
call UncompressSpriteFromDE call UncompressSpriteFromDE
predef ScaleSpriteByTwo predef ScaleSpriteByTwo
ld hl, wOAMBuffer ld hl, wShadowOAM
xor a xor a
ldh [hOAMTile], a ; initial tile number ldh [hOAMTile], a ; initial tile number
ld b, $7 ; 7 columns ld b, $7 ; 7 columns

View file

@ -27,7 +27,7 @@ SetupOwnPartyPokeballs:
ld [hl], a ld [hl], a
ld a, 8 ld a, 8
ld [wHUDPokeballGfxOffsetX], a ld [wHUDPokeballGfxOffsetX], a
ld hl, wOAMBuffer ld hl, wShadowOAM
jp WritePokeballOAMData jp WritePokeballOAMData
SetupEnemyPartyPokeballs: SetupEnemyPartyPokeballs:
@ -41,7 +41,7 @@ SetupEnemyPartyPokeballs:
ld [hl], $20 ld [hl], $20
ld a, -8 ld a, -8
ld [wHUDPokeballGfxOffsetX], a ld [wHUDPokeballGfxOffsetX], a
ld hl, wOAMBuffer + PARTY_LENGTH * 4 ld hl, wShadowOAMSprite06
jp WritePokeballOAMData jp WritePokeballOAMData
SetupPokeballs: SetupPokeballs:
@ -174,7 +174,7 @@ SetupPlayerAndEnemyPokeballs:
ld [hl], $40 ld [hl], $40
ld a, 8 ld a, 8
ld [wHUDPokeballGfxOffsetX], a ld [wHUDPokeballGfxOffsetX], a
ld hl, wOAMBuffer ld hl, wShadowOAM
call WritePokeballOAMData call WritePokeballOAMData
ld hl, wEnemyMons ld hl, wEnemyMons
ld de, wEnemyPartyCount ld de, wEnemyPartyCount
@ -183,7 +183,7 @@ SetupPlayerAndEnemyPokeballs:
ld a, $50 ld a, $50
ld [hli], a ld [hli], a
ld [hl], $68 ld [hl], $68
ld hl, wOAMBuffer + $18 ld hl, wShadowOAMSprite06
jp WritePokeballOAMData jp WritePokeballOAMData
; four tiles: pokeball, black pokeball (status ailment), crossed out pokeball (fainted) and pokeball slot (no mon) ; four tiles: pokeball, black pokeball (status ailment), crossed out pokeball (fainted) and pokeball slot (no mon)

View file

@ -58,7 +58,7 @@ CopyMonPicFromBGToSpriteVRAM:
ld [wBaseCoordY], a ld [wBaseCoordY], a
ld a, $70 ld a, $70
ld [wBaseCoordX], a ld [wBaseCoordX], a
ld hl, wOAMBuffer ld hl, wShadowOAM
lb bc, 6, 6 lb bc, 6, 6
ld d, $8 ld d, $8
.oamLoop .oamLoop

View file

@ -42,7 +42,7 @@ DisplayDiploma::
; Move the player 33 pixels right and set the priority bit so he appears ; Move the player 33 pixels right and set the priority bit so he appears
; behind the background layer. ; behind the background layer.
ld hl, wOAMBuffer + $01 ld hl, wShadowOAMSprite00XCoord
lb bc, $80, $28 lb bc, $80, $28
.adjustPlayerGfxLoop .adjustPlayerGfxLoop
ld a, [hl] ; X ld a, [hl] ; X

View file

@ -43,7 +43,7 @@ GetAnimationSpeed:
.resetSprites .resetSprites
push bc push bc
ld hl, wMonPartySpritesSavedOAM ld hl, wMonPartySpritesSavedOAM
ld de, wOAMBuffer ld de, wShadowOAM
ld bc, $60 ld bc, $60
call CopyData call CopyData
pop bc pop bc
@ -51,7 +51,7 @@ GetAnimationSpeed:
jr .incTimer jr .incTimer
.animateSprite .animateSprite
push bc push bc
ld hl, wOAMBuffer + $02 ; OAM tile id ld hl, wShadowOAMSprite00TileID
ld bc, $10 ld bc, $10
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
call AddNTimes call AddNTimes
@ -236,7 +236,7 @@ WriteMonPartySpriteOAM:
; make a copy at wMonPartySpritesSavedOAM. ; make a copy at wMonPartySpritesSavedOAM.
push af push af
ld c, $10 ld c, $10
ld h, HIGH(wOAMBuffer) ld h, HIGH(wShadowOAM)
ldh a, [hPartyMonIndex] ldh a, [hPartyMonIndex]
swap a swap a
ld l, a ld l, a
@ -252,7 +252,7 @@ WriteMonPartySpriteOAM:
; Make a copy of the OAM buffer with the first animation frame written so that ; 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. ; we can flip back to it from the second frame by copying it back.
.makeCopy .makeCopy
ld hl, wOAMBuffer ld hl, wShadowOAM
ld de, wMonPartySpritesSavedOAM ld de, wMonPartySpritesSavedOAM
ld bc, $60 ld bc, $60
jp CopyData jp CopyData

View file

@ -16,7 +16,7 @@ DMARoutine:
LOAD "OAM DMA", HRAM LOAD "OAM DMA", HRAM
hDMARoutine:: hDMARoutine::
; initiate DMA ; initiate DMA
ld a, HIGH(wOAMBuffer) ld a, HIGH(wShadowOAM)
ldh [rDMA], a ldh [rDMA], a
; wait for DMA to finish ; wait for DMA to finish
ld a, $28 ld a, $28

View file

@ -1,6 +1,6 @@
PrepareOAMData:: PrepareOAMData::
; Determine OAM data for currently visible ; Determine OAM data for currently visible
; sprites and write it to wOAMBuffer. ; sprites and write it to wShadowOAM.
ld a, [wUpdateSpritesEnabled] ld a, [wUpdateSpritesEnabled]
dec a dec a
@ -79,7 +79,7 @@ PrepareOAMData::
ldh a, [hOAMBufferOffset] ldh a, [hOAMBufferOffset]
ld e, a ld e, a
ld d, HIGH(wOAMBuffer) ld d, HIGH(wShadowOAM)
.tileLoop .tileLoop
ldh a, [hSpriteScreenY] ; temp for sprite Y position ldh a, [hSpriteScreenY] ; temp for sprite Y position
@ -147,7 +147,7 @@ PrepareOAMData::
; Clear unused OAM. ; Clear unused OAM.
ldh a, [hOAMBufferOffset] ldh a, [hOAMBufferOffset]
ld l, a ld l, a
ld h, HIGH(wOAMBuffer) ld h, HIGH(wShadowOAM)
ld de, $4 ld de, $4
ld b, $a0 ld b, $a0
ld a, [wd736] ld a, [wd736]

View file

@ -1175,7 +1175,7 @@ ItemUseMedicine:
xor a xor a
ld [wBattleMonStatus], a ; remove the status ailment in the in-battle pokemon data ld [wBattleMonStatus], a ; remove the status ailment in the in-battle pokemon data
.calculateHPBarCoords .calculateHPBarCoords
ld hl, wOAMBuffer + $90 ld hl, wShadowOAMSprite36
ld bc, 2 * SCREEN_WIDTH ld bc, 2 * SCREEN_WIDTH
inc d inc d
.calculateHPBarCoordsLoop .calculateHPBarCoordsLoop

View file

@ -16,7 +16,7 @@ DisplayTownMap:
hlcoord 1, 0 hlcoord 1, 0
ld de, wcd6d ld de, wcd6d
call PlaceString call PlaceString
ld hl, wOAMBuffer ld hl, wShadowOAM
ld de, wTileMapBackup ld de, wTileMapBackup
ld bc, $10 ld bc, $10
call CopyData call CopyData
@ -47,7 +47,7 @@ DisplayTownMap:
call TownMapCoordsToOAMCoords call TownMapCoordsToOAMCoords
ld a, $4 ld a, $4
ld [wOAMBaseTile], a ld [wOAMBaseTile], a
ld hl, wOAMBuffer + $10 ld hl, wShadowOAMSprite04
call WriteTownMapSpriteOAM ; town map cursor sprite call WriteTownMapSpriteOAM ; town map cursor sprite
pop hl pop hl
ld de, wcd6d ld de, wcd6d
@ -60,7 +60,7 @@ DisplayTownMap:
hlcoord 1, 0 hlcoord 1, 0
ld de, wcd6d ld de, wcd6d
call PlaceString call PlaceString
ld hl, wOAMBuffer + $10 ld hl, wShadowOAMSprite04
ld de, wTileMapBackup + 16 ld de, wTileMapBackup + 16
ld bc, $10 ld bc, $10
call CopyData call CopyData
@ -362,7 +362,7 @@ DrawPlayerOrBirdSprite:
inc de inc de
cp "@" cp "@"
jr nz, .loop jr nz, .loop
ld hl, wOAMBuffer ld hl, wShadowOAM
ld de, wTileMapBackup ld de, wTileMapBackup
ld bc, $a0 ld bc, $a0
jp CopyData jp CopyData
@ -370,7 +370,7 @@ DrawPlayerOrBirdSprite:
DisplayWildLocations: DisplayWildLocations:
farcall FindWildLocationsOfMon farcall FindWildLocationsOfMon
call ZeroOutDuplicatesInList call ZeroOutDuplicatesInList
ld hl, wOAMBuffer ld hl, wShadowOAM
ld de, wTownMapCoords ld de, wTownMapCoords
.loop .loop
ld a, [de] ld a, [de]
@ -410,7 +410,7 @@ DisplayWildLocations:
ld b, $0 ld b, $0
call DrawPlayerOrBirdSprite call DrawPlayerOrBirdSprite
.done .done
ld hl, wOAMBuffer ld hl, wShadowOAM
ld de, wTileMapBackup ld de, wTileMapBackup
ld bc, $a0 ld bc, $a0
jp CopyData jp CopyData
@ -439,9 +439,9 @@ TownMapCoordsToOAMCoords:
WritePlayerOrBirdSpriteOAM: WritePlayerOrBirdSpriteOAM:
ld a, [wOAMBaseTile] ld a, [wOAMBaseTile]
and a and a
ld hl, wOAMBuffer + $90 ; for player sprite ld hl, wShadowOAMSprite36 ; for player sprite
jr z, WriteTownMapSpriteOAM jr z, WriteTownMapSpriteOAM
ld hl, wOAMBuffer + $80 ; for bird sprite ld hl, wShadowOAMSprite32 ; for bird sprite
WriteTownMapSpriteOAM: WriteTownMapSpriteOAM:
push hl push hl
@ -600,13 +600,13 @@ TownMapSpriteBlinkingAnimation::
jr nz, .done jr nz, .done
; show sprites when the counter reaches 50 ; show sprites when the counter reaches 50
ld hl, wTileMapBackup ld hl, wTileMapBackup
ld de, wOAMBuffer ld de, wShadowOAM
ld bc, $90 ld bc, $90
call CopyData call CopyData
xor a xor a
jr .done jr .done
.hideSprites .hideSprites
ld hl, wOAMBuffer ld hl, wShadowOAM
ld b, $24 ld b, $24
ld de, $4 ld de, $4
.hideSpritesLoop .hideSpritesLoop

View file

@ -677,7 +677,7 @@ SwitchPartyMon_ClearGfx:
dec c dec c
jr nz, .clearMonBGLoop jr nz, .clearMonBGLoop
pop af pop af
ld hl, wOAMBuffer ld hl, wShadowOAM
ld bc, $10 ld bc, $10
call AddNTimes call AddNTimes
ld de, $4 ld de, $4

View file

@ -158,7 +158,7 @@ AnimateIntroNidorino:
jr AnimateIntroNidorino jr AnimateIntroNidorino
UpdateIntroNidorinoOAM: UpdateIntroNidorinoOAM:
ld hl, wOAMBuffer ld hl, wShadowOAM
ld a, [wIntroNidorinoBaseTile] ld a, [wIntroNidorinoBaseTile]
ld d, a ld d, a
.loop .loop
@ -177,7 +177,7 @@ UpdateIntroNidorinoOAM:
ret ret
InitIntroNidorinoOAM: InitIntroNidorinoOAM:
ld hl, wOAMBuffer ld hl, wShadowOAM
ld d, 0 ld d, 0
.loop .loop
push bc push bc

View file

@ -16,11 +16,11 @@ LoadShootingStarGraphics:
lb bc, BANK(FallingStar), (FallingStarEnd - FallingStar) / $10 lb bc, BANK(FallingStar), (FallingStarEnd - FallingStar) / $10
call CopyVideoData call CopyVideoData
ld hl, GameFreakLogoOAMData ld hl, GameFreakLogoOAMData
ld de, wOAMBuffer + $60 ld de, wShadowOAMSprite24
ld bc, GameFreakLogoOAMDataEnd - GameFreakLogoOAMData ld bc, GameFreakLogoOAMDataEnd - GameFreakLogoOAMData
call CopyData call CopyData
ld hl, GameFreakShootingStarOAMData ld hl, GameFreakShootingStarOAMData
ld de, wOAMBuffer ld de, wShadowOAM
ld bc, GameFreakShootingStarOAMDataEnd - GameFreakShootingStarOAMData ld bc, GameFreakShootingStarOAMDataEnd - GameFreakShootingStarOAMData
jp CopyData jp CopyData
@ -30,7 +30,7 @@ AnimateShootingStar:
call PlaySound call PlaySound
; Move the big star down and left across the screen. ; Move the big star down and left across the screen.
ld hl, wOAMBuffer ld hl, wShadowOAM
lb bc, $a0, $4 lb bc, $a0, $4
.bigStarLoop .bigStarLoop
push hl push hl
@ -60,7 +60,7 @@ AnimateShootingStar:
jr nz, .bigStarLoop jr nz, .bigStarLoop
; Clear big star OAM. ; Clear big star OAM.
ld hl, wOAMBuffer ld hl, wShadowOAM
ld c, 4 ld c, 4
ld de, 4 ld de, 4
.clearOAMLoop .clearOAMLoop
@ -83,7 +83,7 @@ AnimateShootingStar:
; Copy 24 instances of the small stars OAM data. ; Copy 24 instances of the small stars OAM data.
; Note that their coordinates put them off-screen. ; Note that their coordinates put them off-screen.
ld de, wOAMBuffer ld de, wShadowOAM
ld a, 24 ld a, 24
.initSmallStarsOAMLoop .initSmallStarsOAMLoop
push af push af
@ -106,7 +106,7 @@ AnimateShootingStar:
ld d, a ld d, a
push bc push bc
push hl push hl
ld hl, wOAMBuffer + $50 ld hl, wShadowOAMSprite20
ld c, 4 ld c, 4
.smallStarsInnerLoop ; introduce new wave of 4 small stars OAM entries .smallStarsInnerLoop ; introduce new wave of 4 small stars OAM entries
ld a, [de] ld a, [de]
@ -131,8 +131,8 @@ AnimateShootingStar:
push af push af
; shift the existing OAM entries down to make room for the next wave ; shift the existing OAM entries down to make room for the next wave
ld hl, wOAMBuffer + $10 ld hl, wShadowOAMSprite04
ld de, wOAMBuffer ld de, wShadowOAM
ld bc, $50 ld bc, $50
call CopyData call CopyData
@ -186,7 +186,7 @@ SmallStarsEmptyWave:
MoveDownSmallStars: MoveDownSmallStars:
ld b, 8 ld b, 8
.loop .loop
ld hl, wOAMBuffer + $5c ld hl, wShadowOAMSprite23
ld a, [wMoveDownSmallStarsOAMCount] ld a, [wMoveDownSmallStarsOAMCount]
ld de, -4 ld de, -4
ld c, a ld c, a

View file

@ -93,7 +93,7 @@ DisplayTitleScreen:
call DrawPlayerCharacter call DrawPlayerCharacter
; put a pokeball in the player's hand ; put a pokeball in the player's hand
ld hl, wOAMBuffer + $28 ld hl, wShadowOAMSprite10
ld a, $74 ld a, $74
ld [hl], a ld [hl], a
@ -322,7 +322,7 @@ DrawPlayerCharacter:
call ClearSprites call ClearSprites
xor a xor a
ld [wPlayerCharacterOAMTile], a ld [wPlayerCharacterOAMTile], a
ld hl, wOAMBuffer ld hl, wShadowOAM
lb de, $60, $5a lb de, $60, $5a
ld b, 7 ld b, 7
.loop .loop

View file

@ -115,6 +115,6 @@ GetTitleBallY:
pop de pop de
and a and a
ret z ret z
ld [wOAMBuffer + $28], a ld [wShadowOAMSprite10YCoord], a
inc e inc e
ret ret

View file

@ -315,7 +315,7 @@ Trade_AnimateBallEnteringLinkCable:
xor $1 xor $1
ld [wLinkCableAnimBulgeToggle], a ld [wLinkCableAnimBulgeToggle], a
add $7e add $7e
ld hl, wOAMBuffer + $02 ld hl, wShadowOAMSprite00TileID
ld de, 4 ld de, 4
ld c, e ld c, e
.cycleLinkCableBulgeTile .cycleLinkCableBulgeTile
@ -599,7 +599,7 @@ Trade_AnimCircledMon:
ldh a, [rBGP] ldh a, [rBGP]
xor $3c ; make link cable flash xor $3c ; make link cable flash
ldh [rBGP], a ldh [rBGP], a
ld hl, wOAMBuffer + $02 ld hl, wShadowOAMSprite00TileID
ld de, $4 ld de, $4
ld c, $14 ld c, $14
.loop .loop
@ -619,7 +619,7 @@ Trade_WriteCircledMonOAM:
call Trade_WriteCircleOAM call Trade_WriteCircleOAM
Trade_AddOffsetsToOAMCoords: Trade_AddOffsetsToOAMCoords:
ld hl, wOAMBuffer ld hl, wShadowOAM
ld c, $14 ld c, $14
.loop .loop
ld a, [wBaseCoordY] ld a, [wBaseCoordY]

View file

@ -99,7 +99,7 @@ InitCutAnimOAM:
ld hl, vChars1 tile $7f ld hl, vChars1 tile $7f
call LoadCutGrassAnimationTilePattern call LoadCutGrassAnimationTilePattern
call WriteCutOrBoulderDustAnimationOAMBlock call WriteCutOrBoulderDustAnimationOAMBlock
ld hl, wOAMBuffer + $93 ld hl, wShadowOAMSprite36Attributes
ld de, 4 ld de, 4
ld a, $30 ld a, $30
ld c, e ld c, e

View file

@ -5,12 +5,12 @@ AnimCut:
ld c, $8 ld c, $8
.cutTreeLoop .cutTreeLoop
push bc push bc
ld hl, wOAMBuffer + $91 ld hl, wShadowOAMSprite36XCoord
ld a, 1 ld a, 1
ld [wCoordAdjustmentAmount], a ld [wCoordAdjustmentAmount], a
ld c, 2 ld c, 2
call AdjustOAMBlockXPos2 call AdjustOAMBlockXPos2
ld hl, wOAMBuffer + $99 ld hl, wShadowOAMSprite38XCoord
ld a, -1 ld a, -1
ld [wCoordAdjustmentAmount], a ld [wCoordAdjustmentAmount], a
ld c, 2 ld c, 2
@ -33,7 +33,7 @@ AnimCut:
ld c, $8 ld c, $8
call AnimCutGrass_UpdateOAMEntries call AnimCutGrass_UpdateOAMEntries
call AnimCutGrass_SwapOAMEntries call AnimCutGrass_SwapOAMEntries
ld hl, wOAMBuffer + $90 ld hl, wShadowOAMSprite36YCoord
ld a, 2 ld a, 2
ld [wCoordAdjustmentAmount], a ld [wCoordAdjustmentAmount], a
ld c, 4 ld c, 4
@ -45,22 +45,22 @@ AnimCut:
AnimCutGrass_UpdateOAMEntries: AnimCutGrass_UpdateOAMEntries:
push bc push bc
ld hl, wOAMBuffer + $91 ld hl, wShadowOAMSprite36XCoord
ld a, 1 ld a, 1
ld [wCoordAdjustmentAmount], a ld [wCoordAdjustmentAmount], a
ld c, 1 ld c, 1
call AdjustOAMBlockXPos2 call AdjustOAMBlockXPos2
ld hl, wOAMBuffer + $95 ld hl, wShadowOAMSprite37XCoord
ld a, 2 ld a, 2
ld [wCoordAdjustmentAmount], a ld [wCoordAdjustmentAmount], a
ld c, 1 ld c, 1
call AdjustOAMBlockXPos2 call AdjustOAMBlockXPos2
ld hl, wOAMBuffer + $99 ld hl, wShadowOAMSprite38XCoord
ld a, -2 ld a, -2
ld [wCoordAdjustmentAmount], a ld [wCoordAdjustmentAmount], a
ld c, 1 ld c, 1
call AdjustOAMBlockXPos2 call AdjustOAMBlockXPos2
ld hl, wOAMBuffer + $9d ld hl, wShadowOAMSprite39XCoord
ld a, -1 ld a, -1
ld [wCoordAdjustmentAmount], a ld [wCoordAdjustmentAmount], a
ld c, 1 ld c, 1
@ -75,15 +75,15 @@ AnimCutGrass_UpdateOAMEntries:
ret ret
AnimCutGrass_SwapOAMEntries: AnimCutGrass_SwapOAMEntries:
ld hl, wOAMBuffer + $90 ld hl, wShadowOAMSprite36
ld de, wBuffer ld de, wBuffer
ld bc, $8 ld bc, $8
call CopyData call CopyData
ld hl, wOAMBuffer + $98 ld hl, wShadowOAMSprite38
ld de, wOAMBuffer + $90 ld de, wShadowOAMSprite36
ld bc, $8 ld bc, $8
call CopyData call CopyData
ld hl, wBuffer ld hl, wBuffer
ld de, wOAMBuffer + $98 ld de, wShadowOAMSprite38
ld bc, $8 ld bc, $8
jp CopyData jp CopyData

View file

@ -43,7 +43,7 @@ GetMoveBoulderDustFunctionPointer:
ld h, [hl] ld h, [hl]
ld l, a ld l, a
push hl push hl
ld hl, wOAMBuffer + $90 ld hl, wShadowOAMSprite36
ld d, $0 ld d, $0
add hl, de add hl, de
ld e, l ld e, l

View file

@ -17,11 +17,11 @@ EmotionBubble:
ld [wUpdateSpritesEnabled], a ld [wUpdateSpritesEnabled], a
ld a, [wd736] ld a, [wd736]
bit 6, a ; are the last 4 OAM entries reserved for a shadow or fishing rod? bit 6, a ; are the last 4 OAM entries reserved for a shadow or fishing rod?
ld hl, wOAMBuffer + 4 * 35 + $3 ; $8f ld hl, wShadowOAMSprite35Attributes
ld de, wOAMBuffer + 4 * 39 + $3 ; $9f ld de, wShadowOAMSprite39Attributes
jr z, .next jr z, .next
ld hl, wOAMBuffer + 4 * 31 + $3 ; $7f ld hl, wShadowOAMSprite31Attributes
ld de, wOAMBuffer + 4 * 35 + $3 ; $8f ld de, wShadowOAMSprite35Attributes
; Copy OAM data 16 bytes forward to make room for emotion bubble OAM data at the ; Copy OAM data 16 bytes forward to make room for emotion bubble OAM data at the
; start of the OAM buffer. ; start of the OAM buffer.

View file

@ -12,7 +12,7 @@ AnimateHealingMachine:
push af push af
ld a, $e0 ld a, $e0
ldh [rOBP1], a ldh [rOBP1], a
ld hl, wOAMBuffer + $84 ld hl, wShadowOAMSprite33
ld de, PokeCenterOAMData ld de, PokeCenterOAMData
call CopyHealingMachineOAM call CopyHealingMachineOAM
ld a, 4 ld a, 4

View file

@ -205,19 +205,19 @@ LeaveMapThroughHoleAnim:
ld a, $ff ld a, $ff
ld [wUpdateSpritesEnabled], a ; disable UpdateSprites ld [wUpdateSpritesEnabled], a ; disable UpdateSprites
; shift upper half of player's sprite down 8 pixels and hide lower half ; shift upper half of player's sprite down 8 pixels and hide lower half
ld a, [wOAMBuffer + 0 * 4 + 2] ld a, [wShadowOAMSprite00TileID]
ld [wOAMBuffer + 2 * 4 + 2], a ld [wShadowOAMSprite02TileID], a
ld a, [wOAMBuffer + 1 * 4 + 2] ld a, [wShadowOAMSprite01TileID]
ld [wOAMBuffer + 3 * 4 + 2], a ld [wShadowOAMSprite03TileID], a
ld a, $a0 ld a, $a0
ld [wOAMBuffer + 0 * 4], a ld [wShadowOAMSprite00YCoord], a
ld [wOAMBuffer + 1 * 4], a ld [wShadowOAMSprite01YCoord], a
ld c, 2 ld c, 2
call DelayFrames call DelayFrames
; hide upper half of player's sprite ; hide upper half of player's sprite
ld a, $a0 ld a, $a0
ld [wOAMBuffer + 2 * 4], a ld [wShadowOAMSprite02YCoord], a
ld [wOAMBuffer + 3 * 4], a ld [wShadowOAMSprite03YCoord], a
call GBFadeOutToWhite call GBFadeOutToWhite
ld a, $1 ld a, $1
ld [wUpdateSpritesEnabled], a ; enable UpdateSprites ld [wUpdateSpritesEnabled], a ; enable UpdateSprites
@ -392,7 +392,7 @@ FishingAnim:
ld b, $0 ld b, $0
ld hl, FishingRodOAM ld hl, FishingRodOAM
add hl, bc add hl, bc
ld de, wOAMBuffer + $9c ld de, wShadowOAMSprite39
ld bc, $4 ld bc, $4
call CopyData call CopyData
ld c, 100 ld c, 100
@ -412,7 +412,7 @@ FishingAnim:
.loop .loop
ld hl, wSpritePlayerStateData1YPixels ld hl, wSpritePlayerStateData1YPixels
call .ShakePlayerSprite call .ShakePlayerSprite
ld hl, wOAMBuffer + $9c ld hl, wShadowOAMSprite39
call .ShakePlayerSprite call .ShakePlayerSprite
call Delay3 call Delay3
dec b dec b
@ -424,7 +424,7 @@ FishingAnim:
cp SPRITE_FACING_UP cp SPRITE_FACING_UP
jr nz, .skipHidingFishingRod jr nz, .skipHidingFishingRod
ld a, $a0 ld a, $a0
ld [wOAMBuffer + $9c], a ld [wShadowOAMSprite39YCoord], a
.skipHidingFishingRod .skipHidingFishingRod
ld hl, wEmotionBubbleSpriteIndex ld hl, wEmotionBubbleSpriteIndex
@ -438,7 +438,7 @@ FishingAnim:
cp SPRITE_FACING_UP cp SPRITE_FACING_UP
jr nz, .skipUnhidingFishingRod jr nz, .skipUnhidingFishingRod
ld a, $44 ld a, $44
ld [wOAMBuffer + $9c], a ld [wShadowOAMSprite39YCoord], a
.skipUnhidingFishingRod .skipUnhidingFishingRod
ld hl, ItsABiteText ld hl, ItsABiteText

View file

@ -757,7 +757,7 @@ SlotMachine_UpdateBallTiles:
SlotMachine_AnimWheel1: SlotMachine_AnimWheel1:
ld bc, SlotMachineWheel1 ld bc, SlotMachineWheel1
ld de, wSlotMachineWheel1Offset ld de, wSlotMachineWheel1Offset
ld hl, wOAMBuffer ld hl, wShadowOAMSprite00
ld a, $30 ld a, $30
ld [wBaseCoordX], a ld [wBaseCoordX], a
jr SlotMachine_AnimWheel jr SlotMachine_AnimWheel
@ -765,7 +765,7 @@ SlotMachine_AnimWheel1:
SlotMachine_AnimWheel2: SlotMachine_AnimWheel2:
ld bc, SlotMachineWheel2 ld bc, SlotMachineWheel2
ld de, wSlotMachineWheel2Offset ld de, wSlotMachineWheel2Offset
ld hl, wOAMBuffer + $30 ld hl, wShadowOAMSprite12
ld a, $50 ld a, $50
ld [wBaseCoordX], a ld [wBaseCoordX], a
jr SlotMachine_AnimWheel jr SlotMachine_AnimWheel
@ -773,7 +773,7 @@ SlotMachine_AnimWheel2:
SlotMachine_AnimWheel3: SlotMachine_AnimWheel3:
ld bc, SlotMachineWheel3 ld bc, SlotMachineWheel3
ld de, wSlotMachineWheel3Offset ld de, wSlotMachineWheel3Offset
ld hl, wOAMBuffer + $60 ld hl, wShadowOAMSprite24
ld a, $70 ld a, $70
ld [wBaseCoordX], a ld [wBaseCoordX], a

View file

@ -1,7 +1,7 @@
ClearSprites:: ClearSprites::
xor a xor a
ld hl, wOAMBuffer ld hl, wShadowOAM
ld b, wOAMBufferEnd - wOAMBuffer ld b, wShadowOAMEnd - wShadowOAM
.loop .loop
ld [hli], a ld [hli], a
dec b dec b
@ -10,7 +10,7 @@ ClearSprites::
HideSprites:: HideSprites::
ld a, 160 ld a, 160
ld hl, wOAMBuffer ld hl, wShadowOAM
ld de, 4 ld de, 4
ld b, 40 ld b, 40
.loop .loop

View file

@ -4,7 +4,7 @@
; c = X coordinate of upper left corner of sprite ; c = X coordinate of upper left corner of sprite
; de = base address of 4 tile number and attribute pairs ; de = base address of 4 tile number and attribute pairs
WriteOAMBlock:: WriteOAMBlock::
ld h, HIGH(wOAMBuffer) ld h, HIGH(wShadowOAM)
swap a ; multiply by 16 swap a ; multiply by 16
ld l, a ld l, a
call .writeOneEntry ; upper left call .writeOneEntry ; upper left

View file

@ -143,12 +143,12 @@ wSpriteDataEnd::
SECTION "OAM Buffer", WRAM0 SECTION "OAM Buffer", WRAM0
; buffer for OAM data. Copied to OAM by DMA ; buffer for OAM data. Copied to OAM by DMA
wOAMBuffer:: wShadowOAM::
; wOAMBufferSprite00 - wOAMBufferSprite39 ; wShadowOAMSprite00 - wShadowOAMSprite39
FOR n, NUM_SPRITE_OAM_STRUCTS 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 ENDR
wOAMBufferEnd:: wShadowOAMEnd::
SECTION "Tilemap", WRAM0 SECTION "Tilemap", WRAM0

View file

@ -124,7 +124,7 @@ VermilionDock_1db9b:
VermilionDock_AnimSmokePuffDriftRight: VermilionDock_AnimSmokePuffDriftRight:
push bc push bc
push de push de
ld hl, wOAMBuffer + 4 * $4 + 1 ; x coord ld hl, wShadowOAMSprite04XCoord
ld a, [wSSAnneSmokeDriftAmount] ld a, [wSSAnneSmokeDriftAmount]
swap a swap a
ld c, a ld c, a