From ca551c1700cf982fe96388491a096b515365894f Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Fri, 5 May 2023 21:39:32 +0100 Subject: Use the MSB of the index to mark a transparent color Because we use 1 byte to store 4bpp, we don't need a mask and we can encode a "transparent" color in the bits we don't use. --- example.asm | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'example.asm') diff --git a/example.asm b/example.asm index 73aa9a5..2ab0ee7 100644 --- a/example.asm +++ b/example.asm @@ -75,7 +75,16 @@ draw_sprite: line: push x ld x, [a : x] + + ; any color with index > 15 + ; is transparent + cmp x, 16 + bnc + jmp transparent + ld [b : y], x + +transparent: pop x inc x -- cgit v1.2.3