aboutsummaryrefslogtreecommitdiff
path: root/example.asm
diff options
context:
space:
mode:
authorJuan J. Martinez <jjm@usebox.net>2023-05-05 21:39:32 +0100
committerJuan J. Martinez <jjm@usebox.net>2023-05-05 21:40:34 +0100
commitca551c1700cf982fe96388491a096b515365894f (patch)
treee40b9a95cb1f0169c553c19da4ff52c16e73035a /example.asm
parentf10e1ea20cbadd151b20175f48ac902eac4ee0d7 (diff)
downloadtr8vm-ca551c1700cf982fe96388491a096b515365894f.tar.gz
tr8vm-ca551c1700cf982fe96388491a096b515365894f.zip
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.
Diffstat (limited to 'example.asm')
-rw-r--r--example.asm9
1 files changed, 9 insertions, 0 deletions
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