; Entropy ; by Dave McKellar of Toronto ; Two-line BASIC program ; Found on Beagle Brother's Apple Mechanic Disk ; Converted to 6502 Assembly by Vince Weaver ; 24001 ROT=0:FOR I=1 TO 15: READ A,B: POKE A,B: NEXT: DATA ; 232,252,233,29,7676,1,7678,4,7679,0,7680,18,7681,63, ; 7682,36,7683,36,7684,45,7685,45,7686,54,7687,54,7688,63, ; 7689,0 ; 24002 FOR I=1 TO 99: HGR2: FOR E=.08 TO .15 STEP .01: ; FOR Y=4 to 189 STEP 6: FOR X=4 to 278 STEP 6: ; SCALE=(RND(1)=RND then SCALE=1, skip ahead ; SCALE=RND(1)*E*20+1 ; EPOS is E*100, so RND(1)*(EPOS/10)*2+1 ; put random value in FAC ; ldx #1 ; RND(1), Force 1, this set from earlier jsr RND+6 ; skip arg parsing in RND lda EPOS jsr FLOAT ; convert value in A to float in FAC jsr DIV10 ; FAC=FAC/10 ldy #>RND_EXP ; point (Y,A) to RND value lda #shape_table lda #0 ; ROT=0 jsr XDRAW0 ; XDRAW 1 AT X,Y nextx: ; NEXT X lda XPOS ; 2 clc ; 1 adc #6 ; x+=6 ; 2 sta XPOS ; 2 tax ; save in X for later ; 1 lda #0 ; inc high bit if we wrap past 256 ; 2 adc XPOSH ; 2 sta XPOSH ; 2 beq xloop ; if high byte zero, not at end ; 2 cpx #22 ; see if less than 278 ; 2 bcc xloop ; if so, loop ; 2 ;============ ; 20 nexty: ; NEXT Y pla ; lda YPOS ; y+=6 adc #5 ; carry always set coming in, so only add 5 ; sta YPOS pha cmp #189 ; see if less than 189 bcc yloop ; if so, loop nexte: ; NEXT E pla inc EPOS lda EPOS cmp #15 bcc eloop ; branch if <15 bcs entropy shape_table: ; .byte 1,0 ; 1 shape ; .byte 4,0 ; offset at 4 bytes .byte 18,63,36,36,45,45,54,54,63,0 ; data