Sprite drawing bug.

This commit is contained in:
Randy Thiemann 2023-10-13 08:37:21 +02:00
parent eab34d8f0b
commit 6368948e45
1 changed files with 23 additions and 4 deletions

View File

@ -1,3 +1,7 @@
IF !DEF(SPRITES_ASM)
DEF SPRITES_ASM EQU 1
SECTION "Shadow OAM", WRAM0, ALIGN[8] SECTION "Shadow OAM", WRAM0, ALIGN[8]
UNION UNION
wShadowOAM:: ds 160 wShadowOAM:: ds 160
@ -84,12 +88,18 @@ ApplyNext::
ld hl, sPieceXOffsets ld hl, sPieceXOffsets
ld de, sPieceYOffsets ld de, sPieceYOffsets
cp 0 cp 0
jp z, .skipoffn jr z, .skipoffn
.getoffn .getoffn
inc hl inc hl
inc hl
inc hl
inc hl
inc de
inc de
inc de
inc de inc de
dec a dec a
jp nz, .getoffn jr nz, .getoffn
.skipoffn .skipoffn
ld a, [hl+] ld a, [hl+]
add a, NEXT_BASE_X add a, NEXT_BASE_X
@ -144,12 +154,18 @@ ApplyHold::
ld hl, sPieceXOffsets ld hl, sPieceXOffsets
ld de, sPieceYOffsets ld de, sPieceYOffsets
cp 0 cp 0
jp z, .skipoffh jr z, .skipoffh
.getoffh .getoffh
inc hl inc hl
inc hl
inc hl
inc hl
inc de
inc de
inc de
inc de inc de
dec a dec a
jp nz, .getoffh jr nz, .getoffh
.skipoffh .skipoffh
ld a, [hl+] ld a, [hl+]
add a, HOLD_BASE_X add a, HOLD_BASE_X
@ -320,3 +336,6 @@ SetNumberSpritePositions::
ld [hl], a ld [hl], a
add a, 8 add a, 8
ret ret
ENDC