diff --git a/basic/two-liners/Makefile b/basic/two-liners/Makefile index d833ac63..976e50a9 100644 --- a/basic/two-liners/Makefile +++ b/basic/two-liners/Makefile @@ -2,12 +2,21 @@ include ../../Makefile.inc DOS33 = ../../utils/dos33fs-utils/dos33 TOKENIZE = ../../utils/asoft_basic-utils/tokenize_asoft +EMPTYDISK = ../../empty_disk/empty.dsk all: entropy.dsk -entropy.dsk: ENTROPY ENTROPY.BAS - $(DOS33) -y entropy.dsk BSAVE -a 0x0C00 ENTROPY +entropy.dsk: HELLO ENTROPY.BAS ENTROPY ENTROPY_TINY + cp $(EMPTYDISK) entropy.dsk + $(DOS33) -y entropy.dsk SAVE A HELLO $(DOS33) -y entropy.dsk SAVE A ENTROPY.BAS + $(DOS33) -y entropy.dsk BSAVE -a 0x0C00 ENTROPY + $(DOS33) -y entropy.dsk BSAVE -a 0x0C00 ENTROPY_TINY + +#### + +HELLO: hello.bas + $(TOKENIZE) < hello.bas > HELLO ### @@ -17,6 +26,16 @@ ENTROPY: entropy.o entropy.o: entropy.s ca65 -o entropy.o entropy.s -l entropy.lst + +### + +ENTROPY_TINY: entropy_tiny.o + ld65 -o ENTROPY_TINY entropy_tiny.o -C ../../linker_scripts/apple2_c00.inc + +entropy_tiny.o: entropy_tiny.s + ca65 -o entropy_tiny.o entropy_tiny.s -l entropy_tiny.lst + + #### ENTROPY.BAS: entropy.bas @@ -25,4 +44,4 @@ ENTROPY.BAS: entropy.bas #### clean: - rm -f *~ *.o *.lst ENTROPY ENTROPY.BAS + rm -f *~ *.o *.lst ENTROPY ENTROPY.BAS HELLO ENTROPY_TINY diff --git a/basic/two-liners/entropy_tiny.s b/basic/two-liners/entropy_tiny.s new file mode 100644 index 00000000..8dd1aab2 --- /dev/null +++ b/basic/two-liners/entropy_tiny.s @@ -0,0 +1,215 @@ +; Entropy +; by Dave McKellar of Toronto +; Two-line BASIC program +; Found on Beagle Brother's Apple Mechanic Disk +; Converted to 6502 Assembly by Deater (Vince Weaver) vince@deater.net + +; 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 + + ; What this does: + ; if EPOS is 8,9 then value is either 1 or 2 + ; if EPOS is 10,11,12,13,14 then value is either 1, 2, or 3 + + + ; 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 + ; Both A and X are 0 at exit + +nextx: ; NEXT X + lda XPOS ; 2 + clc ; 1 + adc #6 ; x+=6 ; 2 + sta XPOS ; 2 + + ; we know that the X=4 to 278 STEP 6 loop passes through exactly 256 + ; so we can check for that by looking for overflow to zero + + bne skip ; 2 + inc XPOSH ; 2 +skip: + ; the X=4 to 278 STEP 6 loop actually ends when X is at 280, which + ; is 256+24. The lower part of the loop does not hit 24, so we + ; can check for the end by looking for the low byte at 24. + + cmp #24 ; see if less than 278 ; 2 + bne xloop ; if so, loop ; 2 + ;============ + ; 15 +nexty: ; NEXT Y + pla ; YPOS on stack + adc #5 ; y+=6 + ; carry always set coming in, so only add 5 + cmp #189 ; see if less than 189 + bcc yloop ; if so, loop + +nexte: ; NEXT E + ldx EPOS + inx ; EPOS saved at beginning of eloop + cpx #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 diff --git a/basic/two-liners/hello.bas b/basic/two-liners/hello.bas new file mode 100644 index 00000000..ad74b5e3 --- /dev/null +++ b/basic/two-liners/hello.bas @@ -0,0 +1,5 @@ + 5 HOME + 10 PRINT "ENTROPY DEMO V1.2" + 20 PRINT + 30 PRINT "YOU PROBABLY WANT TO:" + 40 PRINT " BRUN ENTROPY" diff --git a/graphics/hgr/sprite/apple2_70_zp.inc b/graphics/hgr/sprite/apple2_70_zp.inc new file mode 100644 index 00000000..9737f2d1 --- /dev/null +++ b/graphics/hgr/sprite/apple2_70_zp.inc @@ -0,0 +1,12 @@ +MEMORY { + ZP: start = $70, size = $90, type = rw; + RAM: start = $70, size = $8E00, file = %O; +} + +SEGMENTS { +#CODE: load = RAM, type = ro; +#RODATA: load = RAM, type = ro; +#DATA: load = RAM, type = rw; +#BSS: load = RAM, type = bss, define = yes; +ZEROPAGE: load = ZP, type = ro; +} diff --git a/graphics/hgr/sprite/empty.dsk b/graphics/hgr/sprite/empty.dsk deleted file mode 100644 index b34eb519..00000000 Binary files a/graphics/hgr/sprite/empty.dsk and /dev/null differ diff --git a/graphics/hgr/sprite/tiny_30.s b/graphics/hgr/sprite/tiny_30.s new file mode 100644 index 00000000..003f494c --- /dev/null +++ b/graphics/hgr/sprite/tiny_30.s @@ -0,0 +1,58 @@ +GBASL = $26 +GBASH = $27 +HGRPAGE = $E6 +HGR_BITS = $1C +HGR_X = $E0 +HGR_Y = $E2 +HGR_COLOR = $E4 + + +PAGE0 = $C054 +PAGE1 = $C055 + +HGR = $F3E2 +HGR2 = $F3D8 +HCLR = $F3F2 +HPLOT0 = $F457 ;; plot at (Y,X), (A) +WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us + +.zeropage +.globalzp xx_smc,yy_smc + +tiny: + jsr HGR2 ; clear page1 + ; A is 0 after +tiny_yloop: + +; lda #0 +; sta XX ; XX doesn't really matter where starts +; sta YY ; start at top of screen + +tiny_xloop: + lda xx_smc+1 + and yy_smc+1 + beq store_color + + lda #$7f +store_color: + sta HGR_COLOR + + ldy #0 +xx_smc: + ldx #0 +yy_smc: + lda #0 + + jsr HPLOT0 ; plot at (Y,X), (A) + ; at begin, stores A to HGR_Y + ; X to HGR_X and Y to HGR_X+1 + ; destroys X,Y,A + ; Y is XX/7 + + inc xx_smc+1 + bne tiny_xloop + + inc yy_smc+1 + bne tiny_xloop + + ; should we over-write brk handler to restart? diff --git a/textmode/mousetext/Makefile b/textmode/mousetext/Makefile index 6af6d8a6..5d3ea106 100644 --- a/textmode/mousetext/Makefile +++ b/textmode/mousetext/Makefile @@ -7,11 +7,13 @@ EMPTYDISK = ../../empty_disk/empty.dsk all: mousetext.dsk -mousetext.dsk: HELLO MT.BAS SW.BAS FLOPPY.BAS FLOPPY +mousetext.dsk: HELLO MT.BAS SW.BAS FLOPPY.BAS FLOPPY WAVE.BAS WAVE40.BAS cp $(EMPTYDISK) mousetext.dsk $(DOS33) -y mousetext.dsk SAVE A HELLO $(DOS33) -y mousetext.dsk SAVE A MT.BAS $(DOS33) -y mousetext.dsk SAVE A SW.BAS + $(DOS33) -y mousetext.dsk SAVE A WAVE.BAS + $(DOS33) -y mousetext.dsk SAVE A WAVE40.BAS $(DOS33) -y mousetext.dsk SAVE A FLOPPY.BAS $(DOS33) -y mousetext.dsk BSAVE -a 0xC00 FLOPPY @@ -32,6 +34,17 @@ SW.BAS: sw.bas ### +WAVE.BAS: wave.bas + $(TOKENIZE) < wave.bas > WAVE.BAS + +### + +WAVE40.BAS: wave40.bas + $(TOKENIZE) < wave40.bas > WAVE40.BAS + + +### + FLOPPY.BAS: floppy.bas $(TOKENIZE) < floppy.bas > FLOPPY.BAS @@ -46,4 +59,4 @@ floppy.o: floppy.s #### clean: - rm -f *~ *.o *.lst HELLO MT.BAS SW.BAS FLOPPY.BAS FLOPPY + rm -f *~ *.o *.lst HELLO MT.BAS SW.BAS FLOPPY.BAS FLOPPY WAVE.BAS WAVE40.BAS diff --git a/textmode/mousetext/wave.bas b/textmode/mousetext/wave.bas new file mode 100644 index 00000000..666e2618 --- /dev/null +++ b/textmode/mousetext/wave.bas @@ -0,0 +1,4 @@ +1?CHR$(4)"PR#3" +2?CHR$(27) +3N$=CHR$(14):I$=CHR$(15) +4?N$"._."I$"SSLLSS";:GOTO 4 diff --git a/textmode/mousetext/wave40.bas b/textmode/mousetext/wave40.bas new file mode 100644 index 00000000..365e4e53 --- /dev/null +++ b/textmode/mousetext/wave40.bas @@ -0,0 +1,4 @@ +1?CHR$(4)"PR#3" +2?CHR$(27);CHR$(17) +3N$=CHR$(14):I$=CHR$(15) +4?N$"._."I$"SSLLSS";:GOTO 4