Skip to content

Commit aa3a26e

Browse files
committed
optimized gfx_SetCharData
1 parent e3f7971 commit aa3a26e

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/graphx/graphx.asm

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3994,13 +3994,17 @@ gfx_SetCharData:
39943994
; arg0 : Pointer to character data; if null returns current data
39953995
; Returns:
39963996
; Pointer to character data if null, otherwise pointer to next character
3997-
ld iy, 0
3998-
add iy, sp
3997+
ld hl, 6
3998+
add hl, sp
3999+
ld de, (hl) ; de -> custom_character_data
4000+
dec hl
4001+
dec hl
4002+
dec hl
4003+
ld a, (hl)
39994004
sbc hl, hl ; ld hl, 0
4000-
ld de, (iy + 6) ; de -> custom_character_data
40014005
sbc hl, de ; sets z flag if NULL
40024006
add hl, de
4003-
ld l, (iy + 3) ; hl = index
4007+
ld l, a ; hl = index
40044008
add hl, hl
40054009
add hl, hl
40064010
add hl, hl

0 commit comments

Comments
 (0)