dbsprite is the wrong macro for WriteOAMBlock data (#472)

This commit is contained in:
Vortyne 2024-09-29 18:54:41 -04:00 committed by GitHub
parent 9a2f1b2170
commit 1aa3fb24ec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 59 additions and 40 deletions

View file

@ -309,7 +309,7 @@ Trade_AnimateBallEnteringLinkCable:
.moveBallInsideLinkCableLoop .moveBallInsideLinkCableLoop
push bc push bc
xor a xor a
ld de, Trade_BallInsideLinkCableOAM ld de, Trade_BallInsideLinkCableOAMBlock
call WriteOAMBlock call WriteOAMBlock
ld a, [wLinkCableAnimBulgeToggle] ld a, [wLinkCableAnimBulgeToggle]
xor $1 xor $1
@ -345,9 +345,11 @@ Trade_AnimateBallEnteringLinkCable:
ldh [hAutoBGTransferEnabled], a ldh [hAutoBGTransferEnabled], a
ret ret
Trade_BallInsideLinkCableOAM: Trade_BallInsideLinkCableOAMBlock:
dbsprite 0, 15, 0, 6, $7e, OAM_HFLIP db $7e, 0
dbsprite 8, 15, 0, 6, $7e, OAM_HFLIP | OAM_VFLIP db $7e, OAM_HFLIP
db $7e, OAM_VFLIP
db $7e, OAM_HFLIP | OAM_VFLIP
Trade_ShowEnemyMon: Trade_ShowEnemyMon:
ld a, TRADE_BALL_TILT_ANIM ld a, TRADE_BALL_TILT_ANIM
@ -616,7 +618,7 @@ Trade_AnimCircledMon:
Trade_WriteCircledMonOAM: Trade_WriteCircledMonOAM:
farcall WriteMonPartySpriteOAMBySpecies farcall WriteMonPartySpriteOAMBySpecies
call Trade_WriteCircleOAM call Trade_WriteCircleOAMBlock
Trade_AddOffsetsToOAMCoords: Trade_AddOffsetsToOAMCoords:
ld hl, wShadowOAM ld hl, wShadowOAM
@ -670,11 +672,11 @@ Trade_AnimMonMoveVertical:
jr nz, .loop jr nz, .loop
ret ret
Trade_WriteCircleOAM: Trade_WriteCircleOAMBlock:
; Writes the OAM blocks for the circle around the traded mon as it passes ; Writes the OAM blocks for the circle around the traded mon as it passes
; the link cable. ; the link cable.
ld hl, Trade_CircleOAMPointers ld hl, Trade_CircleOAMBlocks
ld c, $4 ld c, 4
xor a xor a
.loop .loop
push bc push bc
@ -697,33 +699,41 @@ Trade_WriteCircleOAM:
jr nz, .loop jr nz, .loop
ret ret
MACRO trade_circle_oam MACRO trade_circle_oam_block
; oam block pointer, upper-left x coord, upper-left y coord
dw \1 dw \1
db \2, \3 db \2, \3
ENDM ENDM
Trade_CircleOAMPointers: Trade_CircleOAMBlocks:
; oam pointer, upper-left x coord, upper-left y coord trade_circle_oam_block .OAMBlock0, 8, 8
trade_circle_oam Trade_CircleOAM0, $08, $08 trade_circle_oam_block .OAMBlock1, 24, 8
trade_circle_oam Trade_CircleOAM1, $18, $08 trade_circle_oam_block .OAMBlock2, 8, 24
trade_circle_oam Trade_CircleOAM2, $08, $18 trade_circle_oam_block .OAMBlock3, 24, 24
trade_circle_oam Trade_CircleOAM3, $18, $18
Trade_CircleOAM0: .OAMBlock0:
dbsprite 2, 7, 0, 0, ICON_TRADEBUBBLE << 2 + 1, OAM_OBP1 db ICON_TRADEBUBBLE << 2 + 0, OAM_OBP1
dbsprite 2, 7, 0, 2, ICON_TRADEBUBBLE << 2 + 3, OAM_OBP1 db ICON_TRADEBUBBLE << 2 + 1, OAM_OBP1
db ICON_TRADEBUBBLE << 2 + 2, OAM_OBP1
db ICON_TRADEBUBBLE << 2 + 3, OAM_OBP1
Trade_CircleOAM1: .OAMBlock1:
dbsprite 6, 7, 0, 1, ICON_TRADEBUBBLE << 2 + 0, OAM_OBP1 | OAM_HFLIP db ICON_TRADEBUBBLE << 2 + 1, OAM_OBP1 | OAM_HFLIP
dbsprite 6, 7, 0, 3, ICON_TRADEBUBBLE << 2 + 2, OAM_OBP1 | OAM_HFLIP db ICON_TRADEBUBBLE << 2 + 0, OAM_OBP1 | OAM_HFLIP
db ICON_TRADEBUBBLE << 2 + 3, OAM_OBP1 | OAM_HFLIP
db ICON_TRADEBUBBLE << 2 + 2, OAM_OBP1 | OAM_HFLIP
Trade_CircleOAM2: .OAMBlock2:
dbsprite 10, 7, 0, 2, ICON_TRADEBUBBLE << 2 + 3, OAM_OBP1 | OAM_VFLIP db ICON_TRADEBUBBLE << 2 + 2, OAM_OBP1 | OAM_VFLIP
dbsprite 10, 7, 0, 0, ICON_TRADEBUBBLE << 2 + 1, OAM_OBP1 | OAM_VFLIP db ICON_TRADEBUBBLE << 2 + 3, OAM_OBP1 | OAM_VFLIP
db ICON_TRADEBUBBLE << 2 + 0, OAM_OBP1 | OAM_VFLIP
db ICON_TRADEBUBBLE << 2 + 1, OAM_OBP1 | OAM_VFLIP
Trade_CircleOAM3: .OAMBlock3:
dbsprite 14, 7, 0, 3, ICON_TRADEBUBBLE << 2 + 2, OAM_OBP1 | OAM_HFLIP | OAM_VFLIP db ICON_TRADEBUBBLE << 2 + 3, OAM_OBP1 | OAM_HFLIP | OAM_VFLIP
dbsprite 14, 7, 0, 1, ICON_TRADEBUBBLE << 2 + 0, OAM_OBP1 | OAM_HFLIP | OAM_VFLIP db ICON_TRADEBUBBLE << 2 + 2, OAM_OBP1 | OAM_HFLIP | OAM_VFLIP
db ICON_TRADEBUBBLE << 2 + 1, OAM_OBP1 | OAM_HFLIP | OAM_VFLIP
db ICON_TRADEBUBBLE << 2 + 0, OAM_OBP1 | OAM_HFLIP | OAM_VFLIP
; a = species ; a = species
Trade_LoadMonSprite: Trade_LoadMonSprite:

View file

@ -119,12 +119,15 @@ LoadCutGrassAnimationTilePattern:
WriteCutOrBoulderDustAnimationOAMBlock: WriteCutOrBoulderDustAnimationOAMBlock:
call GetCutOrBoulderDustAnimationOffsets call GetCutOrBoulderDustAnimationOffsets
ld a, $9 ld a, $9
ld de, CutOrBoulderDustAnimationTilesAndAttributes ld de, .OAMBlock
jp WriteOAMBlock jp WriteOAMBlock
CutOrBoulderDustAnimationTilesAndAttributes: .OAMBlock:
dbsprite 2, -1, 0, 4, $fd, OAM_OBP1 ; tile ID, attributes
dbsprite 2, -1, 0, 6, $ff, OAM_OBP1 db $fc, OAM_OBP1
db $fd, OAM_OBP1
db $fe, OAM_OBP1
db $ff, OAM_OBP1
GetCutOrBoulderDustAnimationOffsets: GetCutOrBoulderDustAnimationOffsets:
ld hl, wSpritePlayerStateData1YPixels ld hl, wSpritePlayerStateData1YPixels

View file

@ -51,7 +51,7 @@ EmotionBubble:
add $8 add $8
ld c, a ld c, a
ld de, EmotionBubblesOAM ld de, EmotionBubblesOAMBlock
xor a xor a
call WriteOAMBlock call WriteOAMBlock
ld c, 60 ld c, 60
@ -67,9 +67,12 @@ EmotionBubblesPointerTable:
dw QuestionEmote dw QuestionEmote
dw HappyEmote dw HappyEmote
EmotionBubblesOAM: EmotionBubblesOAMBlock:
dbsprite 0, -1, 0, 0, $f9, 0 ; tile ID, attributes
dbsprite 0, -1, 0, 2, $fb, 0 db $f8, 0
db $f9, 0
db $fa, 0
db $fb, 0
EmotionBubbles: EmotionBubbles:
ShockEmote: INCBIN "gfx/emotes/shock.2bpp" ShockEmote: INCBIN "gfx/emotes/shock.2bpp"

View file

@ -63,7 +63,7 @@ LoadHoppingShadowOAM:
call CopyVideoDataDouble call CopyVideoDataDouble
ld a, $9 ld a, $9
lb bc, $54, $48 ; b, c = y, x coordinates of shadow lb bc, $54, $48 ; b, c = y, x coordinates of shadow
ld de, LedgeHoppingShadowOAM ld de, LedgeHoppingShadowOAMBlock
call WriteOAMBlock call WriteOAMBlock
ret ret
@ -71,6 +71,9 @@ LedgeHoppingShadow:
INCBIN "gfx/overworld/shadow.1bpp" INCBIN "gfx/overworld/shadow.1bpp"
LedgeHoppingShadowEnd: LedgeHoppingShadowEnd:
LedgeHoppingShadowOAM: LedgeHoppingShadowOAMBlock:
dbsprite 2, -1, 0, 7, $ff, OAM_HFLIP ; tile ID, attributes
dbsprite 8, -1, 0, 7, $ff, OAM_HFLIP | OAM_VFLIP db $ff, OAM_OBP1
db $ff, OAM_HFLIP
db $ff, OAM_VFLIP
db $ff, OAM_HFLIP | OAM_VFLIP

View file

@ -155,7 +155,7 @@ VermilionDock_EmitSmokePuff:
ret ret
VermilionDockOAMBlock: VermilionDockOAMBlock:
; tile id, attribute ; tile ID, attributes
db $fc, $10 db $fc, $10
db $fd, $10 db $fd, $10
db $fe, $10 db $fe, $10