Created
April 12, 2012 00:14
-
-
Save theepicsnail/2363653 to your computer and use it in GitHub Desktop.
Fractal
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
set x,0 | |
set y,0 | |
:row | |
jsr getVal | |
set c,32 | |
shl z,4 | |
add c,z | |
bor c,0xf000 | |
set a,y | |
shl a,5 | |
bor a,x | |
set [0x8000+a],c | |
add x,1 | |
ife x,0x20 | |
set pc,nextRow | |
set pc,row | |
:nextRow | |
ife y,0x10 | |
set pc,end | |
set x,0 | |
add y,1 | |
set pc,row | |
:getVal | |
set z,2 | |
ife x,0 | |
set z,1 | |
ife y,0 | |
set z,1 | |
ife z,1;hit an edge | |
set pc,pop | |
set push,x | |
set push,y | |
set z,y | |
shl z,5 | |
bor z,x | |
set x,z | |
set y,z | |
sub x,1 | |
sub y,32 | |
set z,1 | |
ife [0x8000+y],[0x8000+x] | |
set z,0 | |
set y,pop | |
set x,pop | |
set pc,pop | |
:end sub pc,1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment