Created
April 10, 2012 21:55
-
-
Save chengsun/2354882 to your computer and use it in GitHub Desktop.
DCPU-16 munching squares
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:loop | |
set j, 0 | |
:loopn | |
set y, 0 | |
set i, 0x8000 | |
:loopy | |
set x, 0 | |
:loopx | |
xor x, y | |
set [i], [charoff] | |
ifg x, j | |
set [i], [charon] | |
xor x, y | |
add x, 1 | |
add i, 1 | |
ifn x, 32 | |
set PC, loopx | |
add y, 1 | |
ifn y, 16 | |
set PC, loopy | |
add j, 1 | |
ifn j, 32 | |
set PC, loopn | |
set PC, loop | |
:charon dat "X" | |
:charoff dat " " |
On 11/04/12 17:08, Linden Ralph wrote:
Haha, nice. When I ran it I could see some flickering in squares which looked like they should be staying still. Might be a bug in http://0x10co.de or something (that was what I used to run it). Can you see the same thing?
Cool program anyway :)
---
Reply to this email directly or view it on GitHub:
https://gist.github.com/2354882
It's because I always clear before setting, to save 2 cycles per draw,
but that causes flickering. It's trivial to work around.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Haha, nice. When I ran it I could see some flickering in squares which looked like they should be staying still. Might be a bug in http://0x10co.de or something (that was what I used to run it). Can you see the same thing?
Cool program anyway :)