mirror of https://github.com/pret/pokecrystal.git
wVirtualOAM -> wShadowOAM and hTransferVirtualOAM -> hTransferShadowOAM (#971)
This commit is contained in:
parent
ef9b9bb437
commit
145d8dd5c2
|
@ -40,7 +40,7 @@ DEF SPRITEOAMSTRUCT_XCOORD rb ; 1
|
|||
DEF SPRITEOAMSTRUCT_TILE_ID rb ; 2
|
||||
DEF SPRITEOAMSTRUCT_ATTRIBUTES rb ; 3
|
||||
DEF SPRITEOAMSTRUCT_LENGTH EQU _RS
|
||||
DEF NUM_SPRITE_OAM_STRUCTS EQU 40 ; see wVirtualOAM
|
||||
DEF NUM_SPRITE_OAM_STRUCTS EQU 40 ; see wShadowOAM
|
||||
|
||||
DEF SPRITE_GFX_LIST_CAPACITY EQU 32 ; see wUsedSprites
|
||||
|
||||
|
|
|
@ -9025,7 +9025,7 @@ CopyBackpic:
|
|||
ret
|
||||
|
||||
.LoadTrainerBackpicAsOAM:
|
||||
ld hl, wVirtualOAMSprite00
|
||||
ld hl, wShadowOAMSprite00
|
||||
xor a
|
||||
ldh [hMapObjectIndex], a
|
||||
ld b, 6
|
||||
|
|
|
@ -57,7 +57,7 @@ BattleIntroSlidingPics:
|
|||
ret
|
||||
|
||||
.subfunction3
|
||||
ld hl, wVirtualOAMSprite00XCoord
|
||||
ld hl, wShadowOAMSprite00XCoord
|
||||
ld c, $12 ; 18
|
||||
ld de, SPRITEOAMSTRUCT_LENGTH
|
||||
.loop3
|
||||
|
|
|
@ -26,7 +26,7 @@ ShowPlayerMonsRemaining:
|
|||
ld [hl], a
|
||||
ld a, 8
|
||||
ld [wPlaceBallsDirection], a
|
||||
ld hl, wVirtualOAMSprite00
|
||||
ld hl, wShadowOAMSprite00
|
||||
jp LoadTrainerHudOAM
|
||||
|
||||
ShowOTTrainerMonsRemaining:
|
||||
|
@ -41,7 +41,7 @@ ShowOTTrainerMonsRemaining:
|
|||
ld [hl], 4 * 8
|
||||
ld a, -8
|
||||
ld [wPlaceBallsDirection], a
|
||||
ld hl, wVirtualOAMSprite00 + PARTY_LENGTH * SPRITEOAMSTRUCT_LENGTH
|
||||
ld hl, wShadowOAMSprite00 + PARTY_LENGTH * SPRITEOAMSTRUCT_LENGTH
|
||||
jp LoadTrainerHudOAM
|
||||
|
||||
StageBallTilesData:
|
||||
|
@ -187,7 +187,7 @@ LinkBattle_TrainerHuds:
|
|||
ld [hl], 8 * 8
|
||||
ld a, 8
|
||||
ld [wPlaceBallsDirection], a
|
||||
ld hl, wVirtualOAMSprite00
|
||||
ld hl, wShadowOAMSprite00
|
||||
call LoadTrainerHudOAM
|
||||
|
||||
ld hl, wOTPartyMon1HP
|
||||
|
@ -197,7 +197,7 @@ LinkBattle_TrainerHuds:
|
|||
ld a, 10 * 8
|
||||
ld [hli], a
|
||||
ld [hl], 13 * 8
|
||||
ld hl, wVirtualOAMSprite00 + PARTY_LENGTH * SPRITEOAMSTRUCT_LENGTH
|
||||
ld hl, wShadowOAMSprite00 + PARTY_LENGTH * SPRITEOAMSTRUCT_LENGTH
|
||||
jp LoadTrainerHudOAM
|
||||
|
||||
LoadTrainerHudOAM:
|
||||
|
|
|
@ -245,7 +245,7 @@ BattleAnim_ClearOAM:
|
|||
jr z, .delete
|
||||
|
||||
; Instead of deleting the sprites, make them all use PAL_BATTLE_OB_ENEMY
|
||||
ld hl, wVirtualOAMSprite00Attributes
|
||||
ld hl, wShadowOAMSprite00Attributes
|
||||
ld c, NUM_SPRITE_OAM_STRUCTS
|
||||
.loop
|
||||
ld a, [hl]
|
||||
|
@ -260,8 +260,8 @@ endr
|
|||
ret
|
||||
|
||||
.delete
|
||||
ld hl, wVirtualOAM
|
||||
ld c, wVirtualOAMEnd - wVirtualOAM
|
||||
ld hl, wShadowOAM
|
||||
ld c, wShadowOAMEnd - wShadowOAM
|
||||
xor a
|
||||
.loop2
|
||||
ld [hli], a
|
||||
|
@ -1477,10 +1477,10 @@ BattleAnim_UpdateOAM_All:
|
|||
jr nz, .loop
|
||||
ld a, [wBattleAnimOAMPointerLo]
|
||||
ld l, a
|
||||
ld h, HIGH(wVirtualOAM)
|
||||
ld h, HIGH(wShadowOAM)
|
||||
.loop2
|
||||
ld a, l
|
||||
cp LOW(wVirtualOAMEnd)
|
||||
cp LOW(wShadowOAMEnd)
|
||||
jr nc, .done
|
||||
xor a
|
||||
ld [hli], a
|
||||
|
|
|
@ -106,7 +106,7 @@ BattleAnimOAMUpdate:
|
|||
ld l, a
|
||||
ld a, [wBattleAnimOAMPointerLo]
|
||||
ld e, a
|
||||
ld d, HIGH(wVirtualOAM)
|
||||
ld d, HIGH(wShadowOAM)
|
||||
|
||||
.loop
|
||||
; Y Coord
|
||||
|
@ -179,7 +179,7 @@ BattleAnimOAMUpdate:
|
|||
inc de
|
||||
ld a, e
|
||||
ld [wBattleAnimOAMPointerLo], a
|
||||
cp LOW(wVirtualOAMEnd)
|
||||
cp LOW(wShadowOAMEnd)
|
||||
jr nc, .exit_set_carry
|
||||
dec c
|
||||
jr nz, .loop
|
||||
|
|
|
@ -1026,7 +1026,7 @@ DebugColor_PlaceCursor:
|
|||
|
||||
ld b, $70 ; initial tile id
|
||||
ld c, 5 ; initial palette
|
||||
ld hl, wVirtualOAM
|
||||
ld hl, wShadowOAM
|
||||
ld de, wDebugRedChannel
|
||||
call .placesprite
|
||||
ld de, wDebugGreenChannel
|
||||
|
|
|
@ -55,7 +55,7 @@ CelebiShrineEvent:
|
|||
ret
|
||||
|
||||
.RestorePlayerSprite_DespawnLeaves:
|
||||
ld hl, wVirtualOAMSprite00TileID
|
||||
ld hl, wShadowOAMSprite00TileID
|
||||
xor a
|
||||
ld c, 4
|
||||
.OAMloop:
|
||||
|
@ -66,8 +66,8 @@ endr
|
|||
inc a
|
||||
dec c
|
||||
jr nz, .OAMloop
|
||||
ld hl, wVirtualOAMSprite04
|
||||
ld bc, wVirtualOAMEnd - wVirtualOAMSprite04
|
||||
ld hl, wShadowOAMSprite04
|
||||
ld bc, wShadowOAMEnd - wShadowOAMSprite04
|
||||
xor a
|
||||
call ByteFill
|
||||
ret
|
||||
|
|
|
@ -64,8 +64,8 @@ ShakeHeadbuttTree:
|
|||
xor a
|
||||
ldh [hBGMapMode], a
|
||||
farcall ClearSpriteAnims
|
||||
ld hl, wVirtualOAMSprite36
|
||||
ld bc, wVirtualOAMEnd - wVirtualOAMSprite36
|
||||
ld hl, wShadowOAMSprite36
|
||||
ld bc, wShadowOAMEnd - wShadowOAMSprite36
|
||||
xor a
|
||||
call ByteFill
|
||||
ld de, Font
|
||||
|
@ -369,7 +369,7 @@ FlyToAnim:
|
|||
ret
|
||||
|
||||
.RestorePlayerSprite_DespawnLeaves:
|
||||
ld hl, wVirtualOAMSprite00TileID
|
||||
ld hl, wShadowOAMSprite00TileID
|
||||
xor a
|
||||
ld c, 4
|
||||
.OAMloop
|
||||
|
@ -380,8 +380,8 @@ endr
|
|||
inc a
|
||||
dec c
|
||||
jr nz, .OAMloop
|
||||
ld hl, wVirtualOAMSprite04
|
||||
ld bc, wVirtualOAMEnd - wVirtualOAMSprite04
|
||||
ld hl, wShadowOAMSprite04
|
||||
ld bc, wShadowOAMEnd - wShadowOAMSprite04
|
||||
xor a
|
||||
call ByteFill
|
||||
ret
|
||||
|
|
|
@ -91,14 +91,14 @@ ENDM
|
|||
ret
|
||||
|
||||
.PC_LoadBallsOntoMachine:
|
||||
ld hl, wVirtualOAMSprite32
|
||||
ld hl, wShadowOAMSprite32
|
||||
ld de, .PC_ElmsLab_OAM
|
||||
call .PlaceHealingMachineTile
|
||||
call .PlaceHealingMachineTile
|
||||
jr .LoadBallsOntoMachine
|
||||
|
||||
.HOF_LoadBallsOntoMachine:
|
||||
ld hl, wVirtualOAMSprite32
|
||||
ld hl, wShadowOAMSprite32
|
||||
ld de, .HOF_OAM
|
||||
|
||||
.LoadBallsOntoMachine:
|
||||
|
|
|
@ -557,7 +557,7 @@ CardFlip_CopyToBox:
|
|||
ret
|
||||
|
||||
CardFlip_CopyOAM:
|
||||
ld de, wVirtualOAMSprite00
|
||||
ld de, wShadowOAMSprite00
|
||||
ld a, [hli]
|
||||
.loop
|
||||
push af
|
||||
|
|
|
@ -258,7 +258,7 @@ AnimateSlotReelIcons: ; unreferenced
|
|||
inc [hl]
|
||||
and $7
|
||||
ret nz
|
||||
ld hl, wVirtualOAMSprite16TileID
|
||||
ld hl, wShadowOAMSprite16TileID
|
||||
ld c, NUM_SPRITE_OAM_STRUCTS - 16
|
||||
.loop
|
||||
ld a, [hl]
|
||||
|
@ -667,7 +667,7 @@ Slots_InitReelTiles:
|
|||
ld bc, wReel1
|
||||
ld hl, REEL_OAM_ADDR
|
||||
add hl, bc
|
||||
ld de, wVirtualOAMSprite16
|
||||
ld de, wShadowOAMSprite16
|
||||
ld [hl], e
|
||||
inc hl
|
||||
ld [hl], d
|
||||
|
@ -685,7 +685,7 @@ Slots_InitReelTiles:
|
|||
ld bc, wReel2
|
||||
ld hl, REEL_OAM_ADDR
|
||||
add hl, bc
|
||||
ld de, wVirtualOAMSprite24
|
||||
ld de, wShadowOAMSprite24
|
||||
ld [hl], e
|
||||
inc hl
|
||||
ld [hl], d
|
||||
|
@ -703,7 +703,7 @@ Slots_InitReelTiles:
|
|||
ld bc, wReel3
|
||||
ld hl, REEL_OAM_ADDR
|
||||
add hl, bc
|
||||
ld de, wVirtualOAMSprite32
|
||||
ld de, wShadowOAMSprite32
|
||||
ld [hl], e
|
||||
inc hl
|
||||
ld [hl], d
|
||||
|
|
|
@ -520,7 +520,7 @@ RedrawUnownPuzzlePieces:
|
|||
ld hl, .OAM_NotHoldingPiece
|
||||
|
||||
.load
|
||||
ld de, wVirtualOAMSprite00
|
||||
ld de, wShadowOAMSprite00
|
||||
.loop
|
||||
ld a, [hli]
|
||||
cp -1
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
WriteOAMDMACodeToHRAM::
|
||||
ld c, LOW(hTransferVirtualOAM)
|
||||
ld c, LOW(hTransferShadowOAM)
|
||||
ld b, OAMDMACodeEnd - OAMDMACode
|
||||
ld hl, OAMDMACode
|
||||
.copy
|
||||
|
@ -14,9 +14,9 @@ OAMDMACode:
|
|||
; This code is defined in ROM, but
|
||||
; copied to and called from HRAM.
|
||||
LOAD "OAM DMA", HRAM
|
||||
hTransferVirtualOAM::
|
||||
hTransferShadowOAM::
|
||||
; initiate DMA
|
||||
ld a, HIGH(wVirtualOAM)
|
||||
ld a, HIGH(wShadowOAM)
|
||||
ldh [rDMA], a
|
||||
; wait for DMA to finish
|
||||
ld a, NUM_SPRITE_OAM_STRUCTS
|
||||
|
|
|
@ -21,7 +21,7 @@ PlaySpriteAnimations:
|
|||
push bc
|
||||
push af
|
||||
|
||||
ld a, LOW(wVirtualOAM)
|
||||
ld a, LOW(wShadowOAM)
|
||||
ld [wCurSpriteOAMAddr], a
|
||||
call DoNextFrameForAllSprites
|
||||
|
||||
|
@ -57,11 +57,11 @@ DoNextFrameForAllSprites:
|
|||
|
||||
ld a, [wCurSpriteOAMAddr]
|
||||
ld l, a
|
||||
ld h, HIGH(wVirtualOAM)
|
||||
ld h, HIGH(wShadowOAM)
|
||||
|
||||
.loop2 ; Clear (wVirtualOAM + [wCurSpriteOAMAddr] --> wVirtualOAMEnd)
|
||||
.loop2 ; Clear (wShadowOAM + [wCurSpriteOAMAddr] --> wShadowOAMEnd)
|
||||
ld a, l
|
||||
cp LOW(wVirtualOAMEnd)
|
||||
cp LOW(wShadowOAMEnd)
|
||||
jr nc, .done
|
||||
xor a
|
||||
ld [hli], a
|
||||
|
@ -96,11 +96,11 @@ DoNextFrameForFirst16Sprites:
|
|||
|
||||
ld a, [wCurSpriteOAMAddr]
|
||||
ld l, a
|
||||
ld h, HIGH(wVirtualOAMSprite16)
|
||||
ld h, HIGH(wShadowOAMSprite16)
|
||||
|
||||
.loop2 ; Clear (wVirtualOAM + [wCurSpriteOAMAddr] --> Sprites + $40)
|
||||
.loop2 ; Clear (wShadowOAM + [wCurSpriteOAMAddr] --> Sprites + $40)
|
||||
ld a, l
|
||||
cp LOW(wVirtualOAMSprite16)
|
||||
cp LOW(wShadowOAMSprite16)
|
||||
jr nc, .done
|
||||
xor a
|
||||
ld [hli], a
|
||||
|
@ -246,7 +246,7 @@ UpdateAnimFrame:
|
|||
push bc
|
||||
ld a, [wCurSpriteOAMAddr]
|
||||
ld e, a
|
||||
ld d, HIGH(wVirtualOAM)
|
||||
ld d, HIGH(wShadowOAM)
|
||||
ld a, [hli]
|
||||
ld c, a ; number of objects
|
||||
.loop
|
||||
|
@ -295,7 +295,7 @@ UpdateAnimFrame:
|
|||
inc de
|
||||
ld a, e
|
||||
ld [wCurSpriteOAMAddr], a
|
||||
cp LOW(wVirtualOAMEnd)
|
||||
cp LOW(wShadowOAMEnd)
|
||||
jr nc, .reached_the_end
|
||||
dec c
|
||||
jr nz, .loop
|
||||
|
@ -570,7 +570,7 @@ AnimateEndOfExpBar:
|
|||
ret
|
||||
|
||||
.AnimateFrame:
|
||||
ld hl, wVirtualOAMSprite00
|
||||
ld hl, wShadowOAMSprite00
|
||||
ld c, 8 ; number of animated circles
|
||||
.anim_loop
|
||||
ld a, c
|
||||
|
|
|
@ -1642,7 +1642,7 @@ DoNameCardSwap:
|
|||
.SlideNameCardUpOffScreen:
|
||||
ld c, 16
|
||||
.loop
|
||||
ld hl, wVirtualOAMSprite00YCoord
|
||||
ld hl, wShadowOAMSprite00YCoord
|
||||
ld b, 8
|
||||
.dec_y_loop
|
||||
dec [hl]
|
||||
|
@ -1651,7 +1651,7 @@ rept SPRITEOAMSTRUCT_LENGTH
|
|||
endr
|
||||
dec b
|
||||
jr nz, .dec_y_loop
|
||||
ld hl, wVirtualOAMSprite08YCoord
|
||||
ld hl, wShadowOAMSprite08YCoord
|
||||
ld b, 8
|
||||
.inc_y_loop
|
||||
inc [hl]
|
||||
|
@ -1836,7 +1836,7 @@ InitNameCardLayout:
|
|||
ld [hl], $3c
|
||||
hlcoord 17, 15
|
||||
ld [hl], $3e
|
||||
ld de, wVirtualOAMSprite00
|
||||
ld de, wShadowOAMSprite00
|
||||
ld hl, .NameCardOAMData
|
||||
ld bc, 16 * SPRITEOAMSTRUCT_LENGTH
|
||||
call CopyBytes
|
||||
|
|
|
@ -101,8 +101,8 @@ ResetWRAM:
|
|||
ret
|
||||
|
||||
_ResetWRAM:
|
||||
ld hl, wVirtualOAM
|
||||
ld bc, wOptions - wVirtualOAM
|
||||
ld hl, wShadowOAM
|
||||
ld bc, wOptions - wShadowOAM
|
||||
xor a
|
||||
call ByteFill
|
||||
|
||||
|
@ -922,7 +922,7 @@ Intro_PlacePlayerSprite:
|
|||
ld hl, vTiles0
|
||||
call Request2bpp
|
||||
|
||||
ld hl, wVirtualOAMSprite00
|
||||
ld hl, wShadowOAMSprite00
|
||||
ld de, .sprites
|
||||
ld a, [de]
|
||||
inc de
|
||||
|
|
|
@ -478,7 +478,7 @@ TrainerCard_Page2_3_OAMUpdate:
|
|||
ld d, a
|
||||
ld a, [de]
|
||||
ld c, a
|
||||
ld de, wVirtualOAMSprite00
|
||||
ld de, wShadowOAMSprite00
|
||||
ld b, NUM_JOHTO_BADGES
|
||||
.loop
|
||||
srl c
|
||||
|
|
|
@ -340,7 +340,7 @@ EvolutionAnimation:
|
|||
inc a
|
||||
and $7
|
||||
ld b, a
|
||||
ld hl, wVirtualOAMSprite00Attributes
|
||||
ld hl, wShadowOAMSprite00Attributes
|
||||
ld c, NUM_SPRITE_OAM_STRUCTS
|
||||
.loop6
|
||||
ld a, [hl]
|
||||
|
|
|
@ -302,7 +302,7 @@ DrawTitleGraphic:
|
|||
ret
|
||||
|
||||
InitializeBackground:
|
||||
ld hl, wVirtualOAMSprite00
|
||||
ld hl, wShadowOAMSprite00
|
||||
ld d, -$22
|
||||
ld e, $0
|
||||
ld c, 5
|
||||
|
@ -342,7 +342,7 @@ AnimateTitleCrystal:
|
|||
|
||||
; Stop at y=6
|
||||
; y is really from the bottom of the sprite, which is two tiles high
|
||||
ld hl, wVirtualOAMSprite00YCoord
|
||||
ld hl, wShadowOAMSprite00YCoord
|
||||
ld a, [hl]
|
||||
cp 6 + 2 * TILE_WIDTH
|
||||
ret z
|
||||
|
|
|
@ -48,7 +48,7 @@ UnusedTitleScreen: ; unreferenced
|
|||
jr nz, .copy
|
||||
|
||||
ld hl, UnusedTitleFG_OAM
|
||||
ld de, wVirtualOAMSprite00
|
||||
ld de, wShadowOAMSprite00
|
||||
ld bc, SPRITEOAMSTRUCT_LENGTH * NUM_SPRITE_OAM_STRUCTS
|
||||
call CopyBytes
|
||||
|
||||
|
|
|
@ -2754,7 +2754,7 @@ _UpdateSprites::
|
|||
cp b
|
||||
ret nc
|
||||
ld l, a
|
||||
ld h, HIGH(wVirtualOAM)
|
||||
ld h, HIGH(wShadowOAM)
|
||||
ld de, SPRITEOAMSTRUCT_LENGTH
|
||||
ld a, b
|
||||
ld c, SCREEN_HEIGHT_PX + 2 * TILE_WIDTH
|
||||
|
@ -2965,11 +2965,11 @@ InitSprites:
|
|||
ld l, a
|
||||
ldh a, [hUsedSpriteIndex]
|
||||
ld c, a
|
||||
ld b, HIGH(wVirtualOAM)
|
||||
ld b, HIGH(wShadowOAM)
|
||||
ld a, [hli]
|
||||
ldh [hUsedSpriteTile], a
|
||||
add c
|
||||
cp LOW(wVirtualOAMEnd)
|
||||
cp LOW(wShadowOAMEnd)
|
||||
jr nc, .full
|
||||
.addsprite
|
||||
ldh a, [hCurSpriteYPixel]
|
||||
|
|
|
@ -2109,7 +2109,7 @@ Pokedex_UpdateSearchResultsCursorOAM:
|
|||
db -1
|
||||
|
||||
Pokedex_LoadCursorOAM:
|
||||
ld de, wVirtualOAMSprite00
|
||||
ld de, wShadowOAMSprite00
|
||||
.loop
|
||||
ld a, [hl]
|
||||
cp -1
|
||||
|
|
|
@ -41,7 +41,7 @@ AnimateDexSearchSlowpoke:
|
|||
DoDexSearchSlowpokeFrame:
|
||||
ld a, [wDexSearchSlowpokeFrame]
|
||||
ld hl, .SlowpokeSpriteData
|
||||
ld de, wVirtualOAMSprite00
|
||||
ld de, wShadowOAMSprite00
|
||||
.loop
|
||||
ld a, [hli]
|
||||
cp -1
|
||||
|
|
|
@ -2442,8 +2442,8 @@ Pokedex_GetArea:
|
|||
|
||||
.copy_sprites
|
||||
hlcoord 0, 0
|
||||
ld de, wVirtualOAM
|
||||
ld bc, wVirtualOAMEnd - wVirtualOAM
|
||||
ld de, wShadowOAM
|
||||
ld bc, wShadowOAMEnd - wShadowOAM
|
||||
call CopyBytes
|
||||
ret
|
||||
|
||||
|
@ -2476,7 +2476,7 @@ Pokedex_GetArea:
|
|||
ld e, a
|
||||
farcall FindNest ; load nest landmarks into wTilemap[0,0]
|
||||
decoord 0, 0
|
||||
ld hl, wVirtualOAMSprite00
|
||||
ld hl, wShadowOAMSprite00
|
||||
.nestloop
|
||||
ld a, [de]
|
||||
and a
|
||||
|
@ -2503,9 +2503,9 @@ Pokedex_GetArea:
|
|||
jr .nestloop
|
||||
|
||||
.done_nest
|
||||
ld hl, wVirtualOAM
|
||||
ld hl, wShadowOAM
|
||||
decoord 0, 0
|
||||
ld bc, wVirtualOAMEnd - wVirtualOAM
|
||||
ld bc, wShadowOAMEnd - wShadowOAM
|
||||
call CopyBytes
|
||||
ret
|
||||
|
||||
|
@ -2518,7 +2518,7 @@ Pokedex_GetArea:
|
|||
ld c, e
|
||||
ld b, d
|
||||
ld de, .PlayerOAM
|
||||
ld hl, wVirtualOAMSprite00
|
||||
ld hl, wShadowOAMSprite00
|
||||
.ShowPlayerLoop:
|
||||
ld a, [de]
|
||||
cp $80
|
||||
|
@ -2547,8 +2547,8 @@ Pokedex_GetArea:
|
|||
jr .ShowPlayerLoop
|
||||
|
||||
.clear_oam
|
||||
ld hl, wVirtualOAMSprite04
|
||||
ld bc, wVirtualOAMEnd - wVirtualOAMSprite04
|
||||
ld hl, wShadowOAMSprite04
|
||||
ld bc, wShadowOAMEnd - wShadowOAMSprite04
|
||||
xor a
|
||||
call ByteFill
|
||||
ret
|
||||
|
@ -2585,8 +2585,8 @@ Pokedex_GetArea:
|
|||
ret
|
||||
|
||||
.clear
|
||||
ld hl, wVirtualOAM
|
||||
ld bc, wVirtualOAMEnd - wVirtualOAM
|
||||
ld hl, wShadowOAM
|
||||
ld bc, wShadowOAMEnd - wShadowOAM
|
||||
xor a
|
||||
call ByteFill
|
||||
scf
|
||||
|
|
|
@ -1460,7 +1460,7 @@ BillsPC_UpdateSelectionCursor:
|
|||
|
||||
.place_cursor
|
||||
ld hl, .OAM
|
||||
ld de, wVirtualOAMSprite00
|
||||
ld de, wShadowOAMSprite00
|
||||
.loop
|
||||
ld a, [hl]
|
||||
cp -1
|
||||
|
@ -1508,7 +1508,7 @@ endr
|
|||
|
||||
BillsPC_UpdateInsertCursor:
|
||||
ld hl, .OAM
|
||||
ld de, wVirtualOAMSprite00
|
||||
ld de, wShadowOAMSprite00
|
||||
.loop
|
||||
ld a, [hl]
|
||||
cp -1
|
||||
|
|
|
@ -25,7 +25,7 @@ _SwitchPartyMons:
|
|||
ld a, " "
|
||||
call ByteFill
|
||||
pop af
|
||||
ld hl, wVirtualOAMSprite00
|
||||
ld hl, wShadowOAMSprite00
|
||||
ld bc, 4 * SPRITEOAMSTRUCT_LENGTH
|
||||
call AddNTimes
|
||||
ld de, SPRITEOAMSTRUCT_LENGTH
|
||||
|
|
|
@ -470,15 +470,15 @@ GetMapMusic_MaybeSpecial::
|
|||
PlaceBCDNumberSprite:: ; unreferenced
|
||||
; Places a BCD number at the upper center of the screen.
|
||||
ld a, 4 * TILE_WIDTH
|
||||
ld [wVirtualOAMSprite38YCoord], a
|
||||
ld [wVirtualOAMSprite39YCoord], a
|
||||
ld [wShadowOAMSprite38YCoord], a
|
||||
ld [wShadowOAMSprite39YCoord], a
|
||||
ld a, 10 * TILE_WIDTH
|
||||
ld [wVirtualOAMSprite38XCoord], a
|
||||
ld [wShadowOAMSprite38XCoord], a
|
||||
ld a, 11 * TILE_WIDTH
|
||||
ld [wVirtualOAMSprite39XCoord], a
|
||||
ld [wShadowOAMSprite39XCoord], a
|
||||
xor a
|
||||
ld [wVirtualOAMSprite38Attributes], a
|
||||
ld [wVirtualOAMSprite39Attributes], a
|
||||
ld [wShadowOAMSprite38Attributes], a
|
||||
ld [wShadowOAMSprite39Attributes], a
|
||||
ld a, [wUnusedBCDNumber]
|
||||
cp 100
|
||||
jr nc, .max
|
||||
|
@ -488,17 +488,17 @@ PlaceBCDNumberSprite:: ; unreferenced
|
|||
swap a
|
||||
and $f
|
||||
add "0"
|
||||
ld [wVirtualOAMSprite38TileID], a
|
||||
ld [wShadowOAMSprite38TileID], a
|
||||
ld a, b
|
||||
and $f
|
||||
add "0"
|
||||
ld [wVirtualOAMSprite39TileID], a
|
||||
ld [wShadowOAMSprite39TileID], a
|
||||
ret
|
||||
|
||||
.max
|
||||
ld a, "9"
|
||||
ld [wVirtualOAMSprite38TileID], a
|
||||
ld [wVirtualOAMSprite39TileID], a
|
||||
ld [wShadowOAMSprite38TileID], a
|
||||
ld [wShadowOAMSprite39TileID], a
|
||||
ret
|
||||
|
||||
CheckSFX::
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
ClearSprites::
|
||||
; Erase OAM data
|
||||
ld hl, wVirtualOAM
|
||||
ld b, wVirtualOAMEnd - wVirtualOAM
|
||||
ld hl, wShadowOAM
|
||||
ld b, wShadowOAMEnd - wShadowOAM
|
||||
xor a
|
||||
.loop
|
||||
ld [hli], a
|
||||
|
@ -11,7 +11,7 @@ ClearSprites::
|
|||
|
||||
HideSprites::
|
||||
; Set all OAM y-positions to 160 to hide them offscreen
|
||||
ld hl, wVirtualOAMSprite00YCoord
|
||||
ld hl, wShadowOAMSprite00YCoord
|
||||
ld de, SPRITEOAMSTRUCT_LENGTH
|
||||
ld b, NUM_SPRITE_OAM_STRUCTS
|
||||
ld a, SCREEN_WIDTH_PX
|
||||
|
|
|
@ -109,7 +109,7 @@ VBlank0::
|
|||
ldh a, [hOAMUpdate]
|
||||
and a
|
||||
jr nz, .done_oam
|
||||
call hTransferVirtualOAM
|
||||
call hTransferShadowOAM
|
||||
.done_oam
|
||||
|
||||
; vblank-sensitive operations are done
|
||||
|
@ -183,7 +183,7 @@ VBlank1::
|
|||
call UpdateBGMap
|
||||
call Serve2bppRequest_VBlank
|
||||
|
||||
call hTransferVirtualOAM
|
||||
call hTransferShadowOAM
|
||||
|
||||
.done
|
||||
xor a
|
||||
|
@ -269,7 +269,7 @@ VBlank3::
|
|||
call UpdateBGMap
|
||||
call Serve2bppRequest_VBlank
|
||||
|
||||
call hTransferVirtualOAM
|
||||
call hTransferShadowOAM
|
||||
.done
|
||||
|
||||
xor a
|
||||
|
@ -323,7 +323,7 @@ VBlank4::
|
|||
call UpdateBGMap
|
||||
call Serve2bppRequest
|
||||
|
||||
call hTransferVirtualOAM
|
||||
call hTransferShadowOAM
|
||||
|
||||
call UpdateJoypad
|
||||
|
||||
|
|
|
@ -533,7 +533,7 @@ Function8942b:
|
|||
Function89448:
|
||||
; Clears the sprite array
|
||||
push af
|
||||
ld hl, wVirtualOAM
|
||||
ld hl, wShadowOAM
|
||||
ld d, 24 * SPRITEOAMSTRUCT_LENGTH
|
||||
xor a
|
||||
.loop
|
||||
|
@ -1813,7 +1813,7 @@ Function89b97:
|
|||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
ld de, wVirtualOAMSprite00
|
||||
ld de, wShadowOAMSprite00
|
||||
.asm_89bb4
|
||||
ld a, [hli]
|
||||
cp $ff
|
||||
|
@ -1900,7 +1900,7 @@ Function89c44:
|
|||
pop de
|
||||
ret
|
||||
.asm_89c4f
|
||||
ld hl, wVirtualOAMSprite00
|
||||
ld hl, wShadowOAMSprite00
|
||||
push de
|
||||
ld a, b
|
||||
ld [hli], a ; y
|
||||
|
@ -2008,7 +2008,7 @@ Function89cdf:
|
|||
ld c, a
|
||||
ld e, $2
|
||||
ld a, $2
|
||||
ld hl, wVirtualOAMSprite00
|
||||
ld hl, wShadowOAMSprite00
|
||||
.asm_89cee
|
||||
push af
|
||||
push bc
|
||||
|
@ -2427,7 +2427,7 @@ Function89f77:
|
|||
|
||||
Function89f9a:
|
||||
dec a
|
||||
ld hl, wVirtualOAM
|
||||
ld hl, wShadowOAM
|
||||
and a
|
||||
ret z
|
||||
.asm_89fa0
|
||||
|
@ -3132,7 +3132,7 @@ asm_8a529:
|
|||
ld [hli], a
|
||||
ld a, $ff
|
||||
ld [hli], a
|
||||
ld hl, wVirtualOAM
|
||||
ld hl, wShadowOAM
|
||||
xor a
|
||||
ld bc, 8 * SPRITEOAMSTRUCT_LENGTH
|
||||
call ByteFill
|
||||
|
|
|
@ -6738,7 +6738,7 @@ Function10306e:
|
|||
ld a, $01
|
||||
ldh [hOAMUpdate], a
|
||||
call ClearSprites
|
||||
ld de, wVirtualOAM
|
||||
ld de, wShadowOAM
|
||||
call Function1030cd
|
||||
xor a
|
||||
ldh [hOAMUpdate], a
|
||||
|
|
|
@ -20,7 +20,7 @@ Function115dc3:
|
|||
xor a
|
||||
ld [wc305], a
|
||||
ld a, $a0
|
||||
ld hl, wVirtualOAMSprite31
|
||||
ld hl, wShadowOAMSprite31
|
||||
ld bc, 8 * SPRITEOAMSTRUCT_LENGTH
|
||||
call ByteFill
|
||||
ret
|
||||
|
@ -30,7 +30,7 @@ Function115dd3:
|
|||
and a
|
||||
ret z
|
||||
ld a, $a0
|
||||
ld hl, wVirtualOAMSprite31
|
||||
ld hl, wShadowOAMSprite31
|
||||
ld bc, 8 * SPRITEOAMSTRUCT_LENGTH
|
||||
call ByteFill
|
||||
call Function115e22
|
||||
|
@ -46,7 +46,7 @@ Function115dd3:
|
|||
ld d, a
|
||||
push de
|
||||
pop hl
|
||||
ld de, wVirtualOAMSprite31
|
||||
ld de, wShadowOAMSprite31
|
||||
ld a, [wc307]
|
||||
ld c, a
|
||||
ld a, [wc308]
|
||||
|
@ -345,7 +345,7 @@ Function11619d:
|
|||
cp $2
|
||||
jr c, .asm_1161b4
|
||||
ld a, $a0
|
||||
ld hl, wVirtualOAM
|
||||
ld hl, wShadowOAM
|
||||
ld bc, 25 * SPRITEOAMSTRUCT_LENGTH
|
||||
call ByteFill
|
||||
|
||||
|
@ -549,7 +549,7 @@ Function1162f2:
|
|||
ld e, a
|
||||
ld a, [hli]
|
||||
sub e
|
||||
ld de, wVirtualOAMSprite09
|
||||
ld de, wShadowOAMSprite09
|
||||
.asm_116321
|
||||
push af
|
||||
ld a, [hli]
|
||||
|
@ -590,7 +590,7 @@ Function1162f2:
|
|||
ld e, a
|
||||
ld a, [hli]
|
||||
sub e
|
||||
ld de, wVirtualOAMSprite00
|
||||
ld de, wShadowOAMSprite00
|
||||
.asm_11635a
|
||||
push af
|
||||
ld a, [hli]
|
||||
|
@ -629,7 +629,7 @@ Function11636e:
|
|||
ld a, $1
|
||||
ldh [rSVBK], a
|
||||
ld a, $a0
|
||||
ld hl, wVirtualOAM
|
||||
ld hl, wShadowOAM
|
||||
ld bc, 16 * SPRITEOAMSTRUCT_LENGTH
|
||||
call ByteFill
|
||||
ld a, $90
|
||||
|
@ -655,7 +655,7 @@ Function1163c0:
|
|||
ld a, $1
|
||||
ldh [rSVBK], a
|
||||
ld a, $a0
|
||||
ld hl, wVirtualOAM
|
||||
ld hl, wShadowOAM
|
||||
ld bc, 16 * SPRITEOAMSTRUCT_LENGTH
|
||||
call ByteFill
|
||||
call DelayFrame
|
||||
|
|
|
@ -6663,7 +6663,7 @@ Function11b31b:
|
|||
db $39 ; 13
|
||||
|
||||
Function11b397:
|
||||
ld de, wVirtualOAMSprite00
|
||||
ld de, wShadowOAMSprite00
|
||||
.loop
|
||||
ld a, [hl]
|
||||
cp $ff
|
||||
|
@ -6719,7 +6719,7 @@ Function11b3b6: ; unreferenced
|
|||
jr .loop
|
||||
|
||||
Function11b3d9:
|
||||
ld de, wVirtualOAMSprite28
|
||||
ld de, wShadowOAMSprite28
|
||||
push de
|
||||
ld a, [wc7d2]
|
||||
dec a
|
||||
|
|
|
@ -535,7 +535,7 @@ Function16cb2e:
|
|||
ret z
|
||||
call Function16cb40
|
||||
ld hl, Unknown_16cb86
|
||||
ld de, wVirtualOAM
|
||||
ld de, wShadowOAM
|
||||
call Function16cb5d
|
||||
ret
|
||||
|
||||
|
|
|
@ -529,7 +529,7 @@ String_17a9b2:
|
|||
db "@"
|
||||
|
||||
Function17a9cb:
|
||||
ld de, wVirtualOAM
|
||||
ld de, wShadowOAM
|
||||
ld hl, $d088
|
||||
bit 6, [hl]
|
||||
jr nz, .bit_6_set
|
||||
|
|
|
@ -299,12 +299,12 @@ wMobileWRAMEnd::
|
|||
|
||||
SECTION "Sprites", WRAM0
|
||||
|
||||
wVirtualOAM::
|
||||
; wVirtualOAMSprite00 - wVirtualOAMSprite39
|
||||
wShadowOAM::
|
||||
; wShadowOAMSprite00 - wShadowOAMSprite39
|
||||
for n, NUM_SPRITE_OAM_STRUCTS
|
||||
wVirtualOAMSprite{02d:n}:: sprite_oam_struct wVirtualOAMSprite{02d:n}
|
||||
wShadowOAMSprite{02d:n}:: sprite_oam_struct wShadowOAMSprite{02d:n}
|
||||
endr
|
||||
wVirtualOAMEnd::
|
||||
wShadowOAMEnd::
|
||||
|
||||
|
||||
SECTION "Tilemap", WRAM0
|
||||
|
|
Loading…
Reference in New Issue