From baab639b4fb5558538de0320da41cef30330e30f Mon Sep 17 00:00:00 2001 From: John Lorentzson Date: Wed, 30 Jul 2025 23:48:32 +0200 Subject: [PATCH] Add read_pixel and clear_pixel --- host/src/routines/pixel/misc_pixel.s | 17 +++++++++++++++++ host/src/source.s | 1 + 2 files changed, 18 insertions(+) create mode 100644 host/src/routines/pixel/misc_pixel.s diff --git a/host/src/routines/pixel/misc_pixel.s b/host/src/routines/pixel/misc_pixel.s new file mode 100644 index 0000000..bb92d88 --- /dev/null +++ b/host/src/routines/pixel/misc_pixel.s @@ -0,0 +1,17 @@ +;;; -*- Mode: asm; indent-tabs-mode: t; tab-width: 8 -*- + +.proc read_pixel ; user-procedure + .include "pixel.inc" + jsr pixel_calc + and (btp_mem_pos), Y + rts +.endproc + +.proc clear_pixel ; user-procedure + .include "pixel.inc" + jsr pixel_calc + eor #$ff + and (btp_mem_pos), Y + sta (btp_mem_pos), Y + rts +.endproc diff --git a/host/src/source.s b/host/src/source.s index 99731f7..1087203 100644 --- a/host/src/source.s +++ b/host/src/source.s @@ -36,6 +36,7 @@ JMP exit .include "routines/triangle/triangle.s" .include "routines/pixel/pixel_draw.s" .include "routines/pixel/pixel_calc.s" +.include "routines/pixel/misc_pixel.s" .include "routines/text/char_draw.s" .include "routines/memory/memset.s" .include "routines/memory/clear_screen.s"