Skip to content

Commit 9d3141f

Browse files
committed
Make DRAW to use the SET_PIXEL_ADDR_ATTR routine
This routine is not in ROM, and is centralised by all drawing and printing primitives.
1 parent cb7e894 commit 9d3141f

1 file changed

Lines changed: 5 additions & 18 deletions

File tree

library-asm/draw.asm

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include once <in_screen.asm>
1010

1111
#include once <cls.asm>
12+
#include once <attr.asm>
1213

1314
#include once <SP/PixelDown.asm>
1415
#include once <SP/PixelUp.asm>
@@ -36,7 +37,6 @@ __DRAW_ERROR:
3637
DRAW:
3738
;; ENTRY POINT
3839

39-
LOCAL PIXEL_ADDR
4040
LOCAL COORDS
4141
LOCAL __DRAW_SETUP1, __DRAW_START, __PLOTOVER, __PLOTINVERSE
4242

@@ -208,7 +208,7 @@ __DRAW4:
208208

209209
DY1: ; y += yi
210210
inc b
211-
call __INCY ; This address will be dyncamically updated
211+
call __INCY ; This address will be dynamically updated
212212
ld a, e ; Restores A reg.
213213
call __FASTPLOT
214214

@@ -272,7 +272,6 @@ __DRAW6_LOOP:
272272
ld (COORDS), bc
273273
ret
274274
275-
PIXEL_ADDR EQU 22ACh
276275
COORDS EQU 5C7Dh
277276

278277
__DRAW_END:
@@ -313,21 +312,9 @@ __PLOTOVER:
313312

314313
push hl
315314
push de
316-
;; gets ATTR position with offset given in SCREEN_ADDR
317-
ld a, h
318-
rrca
319-
rrca
320-
rrca
321-
and 3
322-
or 18h
323-
ld h, a
324-
ld de, (SCREEN_ADDR)
325-
add hl, de ;; Final screen addr
326-
327-
LOCAL PO_ATTR_2
328-
PO_ATTR_2 EQU 0BE4h ; Another entry to PO_ATTR
329-
call PO_ATTR_2 ; This will update attr accordingly. Beware, uses IY
330-
315+
push bc
316+
call SET_PIXEL_ADDR_ATTR
317+
pop bc
331318
pop de
332319
pop hl
333320

0 commit comments

Comments
 (0)