Log In  


Cart #masking_demo_emalan-0 | 2025-09-12 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
1

Simple, interactive demo of a custom masking technique I was playing around with for fun.
A good example of an application of bitwise logic in computer science!

← and → to change the background fill to emulate changing opacity
(x) [x] to toggle masking effect
(o) [z] to show only the mask layer

The pulsing background is drawn into screen memory at 0x6000.
Shapes and background fill for the mask layer are drawn into memory at 0x8000 with color 15.
Four bytes each from 0x6000 – 0x7FFF and 0x8000 – 0x9FFF are compared with a bitwise AND operation (band()) and the result is written directly to screen memory.
There's not a lot to it besides that, but I thought it looked cool and wanted to share.

1



[Please log in to post a comment]