VolksForth/AtariST/DRAGON1.FB

1 line
8.0 KiB
Plaintext
Raw Permalink Normal View History

2017-04-23 22:25:49 +00:00
\\ documentation for dargon demo tcas20130106start the dragon with : <pos int> DRAG or with : <1 or -1> <pos int> DRAGON DRAG clears the screen, defines the starting point and executes DRAGON. The variable STEPSIZE defines the size of steps between 1 and 3 (larger values will produce grabage) odd numbers as input values do not work DDEMO is a loop executing the DRAGON demo which can be stopped with a keypress once the 2nd dragon is fully painted (it is recommended to press a key a little in advance) \ dragon-loadscreen cas20130106 Onlyforth \needs Graphics include line_a.fb Onlyforth GEM also Graphics also decimal 1 5 +thru \ dragon s.2 03oct86we Variable angle Variable stepsize 1 stepsize ! Variable color 1 color ! Variable xcood Variable ycood \ set_pixel 03oct86we Label ?step stepsize pcrel) D2 move D1 tst 0<> IF D2 neg THEN rts Code set_pixel xcood pcrel) D3 move ycood pcrel) D4 move angle pcrel) D0 move 1 # D0 asr D0 D1 move 1 D0 andi 1 # D1 asr 1 D1 andi D0 tst 0= IF ?step bsr D2 D3 add D3 xcood R#) move THEN D0 tst 0<> IF ?step bsr D2 D4 add D4 ycood R#) move THEN D3 SP -) move D4 SP -) move color pcrel) SP -) move ;c: put_pixel ;