diff --git a/lib/corelib.s b/lib/corelib.s index c57a94e..1ac12e9 100644 --- a/lib/corelib.s +++ b/lib/corelib.s @@ -754,6 +754,9 @@ PUTPIXEL_4BPP: STORE.B FB_WA ; set as write and read addresses STORE.B FB_RA + LOAD PUTPIXEL_COLOR + CBRANCH.Z PUTPX_CLR ; color 0 is special case + ; create pixel data from color value in ; leftmost pixel data bits (31-28) LOADC 0 @@ -775,12 +778,29 @@ PUTPIXEL_4BPP: OR ; OR in new pixel bits STORE.B FB_IO ; write new pixel data word to vmem +PUTPX_XT: LOAD PUTPIXEL_BPSAV STOREREG BP FPADJ PUTPIXEL_FS RET +PUTPX_CLR: + LOADCP $F0000000 ; mask for leftmost pixel + STORE.B FB_SHIFTER ; shift accordingly + LOAD PUTPIXEL_X + STORE.B FB_SHIFTCOUNT + + LOAD.B FB_SHIFTER ; get shifted value + NOT ; invert for real mask + LOAD.B FB_IO ; get background pixels + AND ; clear pixel with mask + STORE.B FB_IO ; no need to OR in new pixel, just store to vmem + + BRANCH PUTPX_XT + + + ; draw a line between two points ; parameters: x0, y0, x1, y1, color .EQU DL_X0 0