You're right! I tried to be too smart when sampling addresses in a single 16 bits quantity.
This new version is almost like your code except for using SYS_Random to shuffle the entropy on each try.
That cost me five bytes to setup. Somehow I save two bytes in the final loop: 79+5-2=82 bytes.
Code: Select all
gcl0x
[do
\SYS_Random_34 _sysFn=
[do 34!! $f8& \sysArgs4. 160- if>=0loop $7, $78& \sysArgs5. if=0loop]
1 x= $6; [if<0 $ff x= _sysArgs4 7+ _sysArgs4=]
\SYS_VDrawBits_134 _sysFn= $3f00 _sysArgs0=
1 [do \sysArgs2. 1<< b= 134!! _sysArgs4 x+ \sysArgs4. <b, if<>0loop]
loop]
Code: Select all
...
LDI #7
_LAB #4
ADDW sysArgs4
ST sysArg4
; ------ Draw loop ------
_LAB #3
LD line
BEQ #1
ST sysArg2
LSLW
ST line
SYS #134
LD sign
BRA #4