This is a shader thingy with a few variables and palettes to play around with.
It's all ready to go, but I might introduce dithering into the palettes in the future.
Left / Right changes the active value, and modify values when a value is chosen.
Button 1 activates and deactivates modifying values.
Button 2 changes the palette.
It has a few quirks:
- The timer makes the image jerk a bit after 32000 seconds when it loops around.
- Due to the way the pattern is drawn onto the spritesheet, a lot of the patterns will look weird and cut off. This drawing method made it run way faster though.
- Floating point inaccuracies mess the printed values up a bit sometimes.
Have fun! :>
I am looking at the code of this. Really interesting technique, really shader-like. =)
One specific question: At the begin of the drawing-function you use rectfill(0,0,127,127,1) instead of cls().
Is there any specific reason for this (maybe performance-wise), or just a matter of taste / mood?
You know, I just benchmarked them. CLS() is slower:
- RECTFILL() clears 16 pixels per cycle, assuming a ~4.24MHz clock where "x=1" is one cycle.
- CLS() clears 12 pixels per cycle.
That's... weird.
Edit: For anyone curious, MEMSET(0x6000,0,0x2000) is slightly faster than RECTFILL, probably because it doesn't do an outer loop for rows, but it's basically the same.
[Please log in to post a comment]