Skip to content

Commit 5a4cc95

Browse files
authored
Fix drawing unclipped sprites with odd width
1 parent 8e984ee commit 5a4cc95

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/graphx/graphx.asm

+3-3
Original file line numberDiff line numberDiff line change
@@ -2079,14 +2079,14 @@ _Sprite_NoClip:
20792079
ld (SprNcJrStep-1),a \.r
20802080
ld a,lcdWidth/2
20812081
sub a,c
2082-
ld iyl,a ; (lcdWidth-spriteWidth)/2
2082+
ld iyl,a ; (lcdWidth/2)-(spriteWidth/2)
20832083
ld a,(hl) ; spriteHeight
20842084
inc hl
20852085
jr SprNcLpStart
20862086
SprNcLpOddW:
2087-
inc de ; needed if sprite width is odd
2087+
dec de ; needed if sprite width is odd
20882088
SprNcLpEvenW:
2089-
ld c,iyl ; (lcdWidth-spriteWidth)/2
2089+
ld c,iyl ; (lcdWidth/2)-(spriteWidth/2)
20902090
ex de,hl
20912091
add hl,bc
20922092
add hl,bc

0 commit comments

Comments
 (0)