Skip to content

Commit 5eeb0c4

Browse files
Gérald DeGROOTEmateoconlechuga
authored andcommitted
Update graphx.asm (#119)
* Update graphx.asm * Update graphx.asm * Slightly optimize gfx_RotateSpriteHalf
1 parent df06bf2 commit 5eeb0c4

File tree

1 file changed

+11
-18
lines changed

1 file changed

+11
-18
lines changed

src/graphx/graphx.asm

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4156,29 +4156,22 @@ gfx_RotateSpriteHalf:
41564156
; arg1 : Pointer to sprite struct output
41574157
ld iy,0
41584158
add iy,sp
4159-
push ix
4160-
ld ix,(iy+3)
4161-
ld c,(ix+0) ; c = width
4162-
ld b,(ix+1) ; b = height
4163-
lea de,ix+2
4164-
ld ix,(iy+6)
4165-
ld (ix+0),c
4166-
ld (ix+1),b
4159+
ld hl,(iy+3)
4160+
ld c,(hl) ; c = width
4161+
inc hl
4162+
ld b,(hl) ; b = height
4163+
ld iy,(iy+6)
4164+
ld (iy+0),bc
41674165
mlt bc
4168-
lea hl,ix+1
41694166
add hl,bc
4170-
push ix
4167+
lea de,iy
4168+
push de
41714169
.loop:
4172-
ld a,(de)
4173-
ld (hl),a
41744170
inc de
4175-
dec hl
4176-
dec bc
4177-
ld a,b
4178-
or a,c
4179-
jr nz,.loop
4171+
inc de
4172+
ldd
4173+
jp pe,.loop
41804174
pop hl
4181-
pop ix
41824175
ret
41834176

41844177
;-------------------------------------------------------------------------------

0 commit comments

Comments
 (0)