Add lovebyte submissions

This commit is contained in:
Vince Weaver 2021-03-14 20:49:24 -04:00
parent 37e0362341
commit 08c9e7e90e
84 changed files with 2868 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1,42 @@
include ../../../Makefile.inc
DOS33 = ../../../utils/dos33fs-utils/dos33
TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft
LINKERSCRIPTS = ../../../linker_scripts
EMPTYDISK = ../../../empty_disk/empty.dsk
all: a2_inside.dsk
submit: a2_inside256.zip
a2_inside256.zip: A2_INSIDE a2_inside.s file_id.diz a2_inside.dsk
mkdir -p lovebyte2021_a2_inside256
cp A2_INSIDE ./lovebyte2021_a2_inside256
cp a2_inside.s ./lovebyte2021_a2_inside256
cp file_id.diz ./lovebyte2021_a2_inside256
cp a2_inside.dsk ./lovebyte2021_a2_inside256
cp a2_inside_720p.mp4 ./lovebyte2021_a2_inside256
zip -r a2_inside256.zip lovebyte2021_a2_inside256
a2_inside.dsk: HELLO A2_INSIDE
cp $(EMPTYDISK) a2_inside.dsk
$(DOS33) -y a2_inside.dsk SAVE A HELLO
$(DOS33) -y a2_inside.dsk BSAVE -a 0xC00 A2_INSIDE
###
HELLO: hello.bas
$(TOKENIZE) < hello.bas > HELLO
###
A2_INSIDE: a2_inside.o
ld65 -o A2_INSIDE a2_inside.o -C $(LINKERSCRIPTS)/apple2_c00.inc
a2_inside.o: a2_inside.s
ca65 -o a2_inside.o a2_inside.s -l a2_inside.lst
###
clean:
rm -f *~ *.o *.lst HELLO A2_INSIDE *.zip

Binary file not shown.

View File

@ -0,0 +1,240 @@
; Apple II self portrait using Boxes
; running sierpinski inside
; I heard you liked demos, so...
; by Vince `deater` Weaver <vince@deater.net> / dSr
; For LoveByte 2021
; 223 -- initial
; 220 -- update end
; 219 -- store color already multiplied by 17
; 215 -- load Y0 directly into X
; 211 -- load X1 directly into H2
; 208 -- add subroutine to read byte into A, no need to save Y
; 205 -- optimize end loop
; 197 -- only update color if changed
; 194 -- pack color in with the other 4 bytes
; 191 -- do more common stuff in load_byte
; 189 -- change how end is detected
; 260 -- add sierpinski code
; 255 -- optimize FRAME count
; 248 -- realize PLOT doesn't have to be fast
; 251 -- add pause at beginning
; would have liked to have more elaborate startup, no room
; LoveByte Rule is 252 bytes (there's a 4-byte DOS33 header)
; zero page
H2 = $2C
COLOR = $30
X0 = $F0
XX = $F1
FRAME = $F2
Y1 = $F3
; soft-switches
FULLGR = $C052
; ROM routines
PLOT = $F800 ;; PLOT AT Y,A
PLOT1 = $F80E ;; PLOT at (GBASL),Y (need MASK to be $0f or $f0)
HLINE = $F819 ;; HLINE Y,$2C at A
SETCOL = $F864 ;; COLOR=A
SETGR = $FB40 ;; init lores and clear screen
WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us
;1DEFFNP(X)=PEEK(2054+I*5+X)-32:
;GR:POKE49234,0:
;FORI=0TO29:COLOR=FNP(0):FORY=FNP(3)TOFNP(4)
;:HLINFNP(1),FNP(2)ATY:NEXTY,I:GETA
;================================
; Clear screen and setup graphics
;================================
boxes:
jsr SETGR ; set lo-res 40x40 mode
bit FULLGR ; make it 40x48
draw_box_loop:
; get color/Y0
jsr load_byte
tax ; Y0 is in X
tya ; check for end
bmi end
jsr load_byte ; Y1
sta Y1
jsr load_byte ; X0
sta X0
tya
lsr
lsr
sta COLOR
jsr load_byte ; X1
sta H2
tya
and #$C0
ora COLOR
lsr
lsr
lsr
lsr
jsr SETCOL
inner_loop:
;; HLINE Y,H2 at A
;; X left alone, carry set on exit
;; H2 left alone
;; Y and A trashed
ldy X0
txa
jsr HLINE
cpx Y1
inx
bcc inner_loop
bcs draw_box_loop
;=========================
; draw the demo
;=========================
; screen is from (11,6) - (20,23)
; so size is 9,17?
end:
; A comes in as $FF which is fine
; actually frame value doesn't matter at all
; lda #0
; sta FRAME
; pause a bit at beginning
jsr WAIT
sier_loop:
lda #100 ; Wait a bit, we're too fast
jsr WAIT
inc FRAME ; increment frame
ldx #17 ; YY
sier_yloop:
lda #9 ; XX
sta XX
sier_xloop:
txa ; get YY
clc
adc FRAME ; and add in FRAME
and XX ; and it with XX
bne black
lda FRAME ; color is based on frame
lsr ; only update every 16 lines?
lsr
lsr
lsr
bne not_zero ; but no color 0 (would be all black)
lda #3 ; how about purple instead
not_zero:
.byte $2C ; bit trick
black:
lda #$00
jsr SETCOL ; set top/bottom nibble same color
lda XX ; offset XX to tiny screen
clc
adc #11
tay ; put into Y
txa ; offset YY to tiny screen
clc
adc #6 ; put into A
jsr PLOT ; PLOT AT Y,A
dec XX
bpl sier_xloop
dex
bpl sier_yloop
bmi sier_loop
;=========================
; load byte routine
;=========================
load_byte:
inc load_byte_smc+1 ; assume we are always < 256 bytes
; so no need to wrap
load_byte_smc:
lda box_data-1
tay
and #$3f
rts
; 4 6 6 6 6
box_data:
.byte $00,$2F,$C0,$E7
.byte $01,$2B,$0A,$9B
.byte $28,$29,$43,$D4
.byte $24,$27,$43,$D6
.byte $20,$23,$45,$D7
.byte $1C,$1F,$48,$D8
.byte $23,$26,$07,$8E
.byte $24,$27,$08,$92
.byte $1F,$1F,$0D,$92
.byte $2A,$2B,$43,$54
.byte $2C,$2D,$46,$53
.byte $2C,$2D,$14,$97
.byte $08,$16,$1C,$9C
.byte $02,$1A,$49,$D8
.byte $04,$18,$0A,$95
.byte $06,$17,$0B,$14
.byte $15,$29,$22,$A2
.byte $13,$28,$22,$A4
.byte $13,$14,$5C,$63
.byte $15,$16,$5B,$61
.byte $17,$2B,$59,$E1
.byte $18,$20,$1A,$20
.byte $22,$2A,$1A,$20
.byte $1C,$1C,$5B,$60
.byte $26,$26,$5B,$60
.byte $1F,$20,$DF,$1F
.byte $29,$2A,$DF,$1F
.byte $19,$1E,$5D,$5E
.byte $23,$28,$5D,$5E
.byte $02,$03,$17,$D7
.byte $FF

View File

@ -0,0 +1,5 @@
A2_INSIDE
-
A self-portrait of an Apple II, running a demo on its screen
256-byte Demo for Apple II, Lovebyte 2021
by Deater / dSr

View File

@ -0,0 +1,8 @@
5 HOME
10 PRINT "LOVEBYTE 2021 A2_INSIDE 256B"
15 PRINT "BY DEATER / DSR"
20 PRINT CHR$(4)"CATALOG"
25 PRINT:PRINT "PRESS ANY KEY TO 'BRUN A2_INSIDE'"
30 GET A$
35 PRINT
40 PRINT CHR$(4)"BRUN A2_INSIDE"

Binary file not shown.

View File

@ -0,0 +1,46 @@
include ../../../Makefile.inc
LINKER_DIR = ../../../linker_scripts/
EMPTY_DISK = ../../../empty_disk/empty.dsk
DOS33 = ../../../utils/dos33fs-utils/dos33
TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft
all: checkers32.dsk
submit: checkers32.zip
checkers32.zip: CHECKERS checkers.s file_id.diz checkers32.dsk
mkdir -p lovebyte2021_checkers32
cp CHECKERS ./lovebyte2021_checkers32
cp checkers.s ./lovebyte2021_checkers32
cp file_id.diz ./lovebyte2021_checkers32
cp checkers32.dsk ./lovebyte2021_checkers32
cp checkers_720p.mp4 ./lovebyte2021_checkers32
zip -r checkers32.zip lovebyte2021_checkers32
checkers32.dsk: HELLO CHECKERS
cp $(EMPTY_DISK) checkers32.dsk
$(DOS33) -y checkers32.dsk SAVE A HELLO
$(DOS33) -y checkers32.dsk BSAVE -a 0x070 CHECKERS
###
CHECKERS: checkers.o
ld65 -o CHECKERS checkers.o -C $(LINKER_DIR)/apple2_70_zp.inc
checkers.o: checkers.s
ca65 -o checkers.o checkers.s -l checkers.lst
###
HELLO: hello.bas
$(TOKENIZE) < hello.bas > HELLO
####
clean:
rm -f *~ *.o *.lst HELLO CHECKERS *.zip

View File

@ -0,0 +1,12 @@
MEMORY {
ZP: start = $70, size = $80, 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;
}

View File

@ -0,0 +1,98 @@
; Checkers
; vaguely based on a scene in Hellmood's Memories
; 32 bytes, for Lovebyte 2021
; by deater (Vince Weaver) <vince@deater.net>
; 42 -- original
; 39 -- not fullscreen
; 36 -- now marches oddly
; 32 -- colors now rainbow
; Zero Page
BASL = $28
BASH = $29
H2 = $2C
COLOR = $30
X1 = $F0
X2 = $F1
Y1 = $F2
Y2 = $F3
TEMP = $FA
TEMPY = $FB
FRAME = $FC
TEMPX = $FD
; Soft Switches
KEYPRESS= $C000
KEYRESET= $C010
SET_GR = $C050 ; Enable graphics
FULLGR = $C052 ; Full screen, no text
PAGE0 = $C054 ; Page0
PAGE1 = $C055 ; Page1
LORES = $C056 ; Enable LORES graphics
; ROM routines
PLOT = $F800 ; plot, horiz=y, vert=A (A trashed, XY Saved)
SETCOL = $F864
TEXT = $FB36 ;; Set text mode
BASCALC = $FBC1
SETGR = $FB40
HOME = $FC58 ;; Clear the text screen
WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us
HLINE = $F819
.zeropage
checkers:
;===================
; init screen
jsr SETGR ; 3
; bit FULLGR ; 3
checkers_forever:
inc FRAME ; 2
ldx #39 ; 2
yloop:
ldy #39 ; 2
xloop:
; calculate color
; color = (XX-FRAME)^(A) | DB+1
; sec ; subtract frame from Y
tya
sbc FRAME
sta X2
txa
; sbc #0
eor X2
; ora #$DB ; needed for solid colors
; adc #1
jsr SETCOL
txa ; A==Y1 ; 1
jsr PLOT ; plots in (Y,A) ; 3
dey ; 1
bpl xloop ; 2
dex ; 1
bpl yloop ; 2
bmi checkers_forever ; 2

View File

@ -0,0 +1,6 @@
CHECKERS32
-
Scrolling lo-res rainbow checkerboard
32-byte Demo for Apple II, Lovebyte 2021
by Deater / dSr

View File

@ -0,0 +1,8 @@
5 HOME
10 PRINT "LOVEBYTE 2021 CHECKERS 32B"
15 PRINT "BY DEATER / DSR"
20 PRINT CHR$(4)"CATALOG"
25 PRINT:PRINT "PRESS ANY KEY TO 'BRUN CHECKERS'"
30 GET A$
35 PRINT
40 PRINT CHR$(4)"BRUN CHECKERS"

Binary file not shown.

View File

@ -0,0 +1,44 @@
include ../../../Makefile.inc
DOS33 = ../../../utils/dos33fs-utils/dos33
TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft
LINKERSCRIPTS = ../../../linker_scripts
EMPTYDISK = ../../../empty_disk/empty.dsk
all: fakepal128.dsk
submit: fakepal128.zip
fakepal128.zip: FAKEPAL fakepal.s file_id.diz fakepal128.dsk
mkdir -p lovebyte2021_fakepal128
cp FAKEPAL ./lovebyte2021_fakepal128
cp fakepal.s ./lovebyte2021_fakepal128
cp file_id.diz ./lovebyte2021_fakepal128
cp fakepal128.dsk ./lovebyte2021_fakepal128
cp fakepal_720p.mp4 ./lovebyte2021_fakepal128
zip -r fakepal128.zip lovebyte2021_fakepal128
fakepal128.dsk: HELLO FAKEPAL
cp $(EMPTYDISK) fakepal128.dsk
$(DOS33) -y fakepal128.dsk SAVE A HELLO
$(DOS33) -y fakepal128.dsk BSAVE -a 0x70 FAKEPAL
###
HELLO: hello.bas
$(TOKENIZE) < hello.bas > HELLO
###
FAKEPAL: fakepal.o
ld65 -o FAKEPAL fakepal.o -C ./apple2_70_zp.inc
fakepal.o: fakepal.s
ca65 -o fakepal.o fakepal.s -l fakepal.lst
###
clean:
rm -f *~ *.o *.lst HELLO FAKEPAL *.zip

View File

@ -0,0 +1,236 @@
; A 123-byte Apple II Lo-res Fake Palette Rotation Demo
; The Apple II has no Palette rotation hardware, so we fake it
; For Lovebyte 2021
; by Vince `deater` Weaver (vince@deater.net) / dSr
; with some help from qkumba
; 151 -- original
; 137 -- optimize generation
; 136 -- align lookup table so we can index it easier
; 130 -- optimize indexing of lookup
; 126 -- run loops backaward
; 124 -- notice X already 0 before plot
; 131 -- use GBASCALC. much faster, but 7 bytes larger
; 129 -- run loop backwards
; 128 -- set color ourselves
; 127 -- overlap color lookup with sine table
; 119 -- forgot to comment out unused
; 121 -- make it use full screen (40x48)
; 149 -- add page flipping
; 144 -- optimize a bit
; 141 -- smc DRAW_PAGE
; 139 -- from qkumba, remove php/plp
; 138 -- from qkumba, remove SAVEX
; 133 -- run from zero page
; 132 -- make lookup 8*sin+7
; 131 -- re-arrange sine table
; 128 -- call into PLOT for MASK seting
; urgh lovebyte wants 124 byte (counts header)
; 127 -- base YY<<16 by adding smc, not by shifting
; 125 -- realize that the top byte wraps so no need to and
; 124 -- re-arrange code to make an CLC unnecessary
; 123 -- qkumba noticed we can use the $FF offset directly in page flip
; zero page
GBASL = $26
GBASH = $27
MASK = $2E
COLOR = $30
;CTEMP = $68
YY = $69
; soft-switches
FULLGR = $C052
PAGE1 = $C054
; ROM routines
PLOT1 = $F80E ;; PLOT at (GBASL),Y (need MASK to be $0f or $f0)
GBASCALC= $F847 ;; take Y-coord/2 in A, put address in GBASL/H ( a trashed, C clear)
SETCOL = $F864 ;; COLOR=A*17
SETGR = $FB40
.zeropage
.globalzp colorlookup,plot_lookup_smc,draw_page_smc,frame_smc,sinetable
;================================
; Clear screen and setup graphics
;================================
plasma:
jsr SETGR ; set lo-res 40x40 mode
bit FULLGR ; make it 40x48
; color = ( 8.0 + 8*sin(x) + 8.0 + 8*sin(y) )/2
; becomes
; color = ( 16 + (sintable[xx&0xf]) + (sintable[yy&0xf])) / 2;
; we only create a 16x16 texture, which we pattern across 40x48 screen
; I've tried re-optimizing this about 10 different ways
; and it never ends up shorter
create_lookup:
ldx #15
create_yloop:
ldy #15
create_xloop:
sec
lda sinetable,X
adc sinetable,Y ; 15+sin(x)+sin(y)
lsr
lookup_smc:
sta lookup ; always starts at $d00
inc lookup_smc+1
dey
bpl create_xloop
dex
bpl create_yloop
; X and Y both $FF
create_lookup_done:
forever_loop:
cycle_colors:
; cycle colors
; instead of advancing entire frame, do slightly slower route
; instead now and just incrememnting the frame and doing the
; adjustment at plot time.
; increment frame
inc frame_smc+1
; set/flip pages
; we want to flip pages and then draw to the offscreen one
flip_pages:
; ldy #0
; iny ; y is $FF, make it 0
lda draw_page_smc+1 ; DRAW_PAGE
bne done_page
dey
done_page:
; ldx PAGE1,Y ; set display page to PAGE1 or PAGE2
ldx $BF56,Y ; PAGE1 - $FF
eor #$4 ; flip draw page between $400/$800
sta draw_page_smc+1 ; DRAW_PAGE
; plot current frame
; scan whole 40x48 screen and plot each point based on
; lookup table colors
plot_frame:
ldx #47 ; YY=47 (count backwards)
plot_yloop:
txa ; get YY into A
pha ; save X for later
lsr ; call actually wants Ycoord/2
php ; save C flag for mask handling
; ugh can't use PLOT trick as it always will draw something
; to PAGE1 even if we don't want to
jsr GBASCALC ; point GBASL/H to address in (A is ycoord/2)
; after, A is GBASL, C is clear
lda GBASH ; adjust to be PAGE1/PAGE2 ($400 or $800)
draw_page_smc:
adc #0
sta GBASH
; increment YY in top nibble of lookup for (yy<<16)+xx
; clc from above, C always 0
lda plot_lookup_smc+1
adc #$10 ; no need to mask as it will oflo and be ignored
sta plot_lookup_smc+1
;==========
ldy #39 ; XX = 39 (countdown)
; sets MASK by calling into middle of PLOT routine
; by Y being 39 draw in a spot that gets over-written
plp
jsr $f806
plot_xloop:
tya ; get XX & 0x0f
and #$f
tax
plot_lookup_smc:
lda lookup,X ; load lookup, (YY*16)+XX
clc
frame_smc:
adc #$00 ; add in frame
and #$f
lsr ; we actually only have 8 colors
tax
lda colorlookup,X ; lookup color
sta COLOR ; each nibble should be same
jsr PLOT1 ; plot at GBASL,Y (x co-ord goes in Y)
dey
bpl plot_xloop
pla ; restore YY
tax
dex
bpl plot_yloop
bmi forever_loop
colorlookup:
; blue
.byte $55,$22,$66,$77,$ff,$77,$55 ; ,$00 shared w sin table
sinetable:
; this is actually (8*sin(x))+7
; re-arranged so starts with $00 for colorlookup overlap
.byte $00,$FF
HACK: ; use the $0200 here for (HACK),Y addressing?
; in the end no way to get Y set properly
.byte $00,$02,$04
.byte $07,$0A,$0C,$0E,$0F,$0E,$0C,$0A
.byte $07,$04,$02
; make lookup happen at page boundary
.org $200
lookup:

Binary file not shown.

View File

@ -0,0 +1,6 @@
FAKEPAL
-
Lo-res Fake Palette Rotation Effect
128-byte Demo for Apple II, Lovebyte 2021
by Deater / dSr, with help from qkumba

View File

@ -0,0 +1,8 @@
5 HOME
10 PRINT "LOVEBYTE 2021 FAKEPAL 128B"
15 PRINT "BY DEATER / DSR"
20 PRINT CHR$(4)"CATALOG"
25 PRINT:PRINT "PRESS ANY KEY TO 'BRUN FAKEPAL'"
30 GET A$
35 PRINT
40 PRINT CHR$(4)"BRUN FAKEPAL"

View File

@ -0,0 +1,43 @@
include ../../../Makefile.inc
DOS33 = ../../../utils/dos33fs-utils/dos33
TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft
LINKERSCRIPTS = ../../../linker_scripts
EMPTYDISK = ../../../empty_disk/empty.dsk
all: notamoon128.dsk
submit: notamoon128.zip
notamoon128.zip: NOTAMOON notamoon.s file_id.diz notamoon128.dsk
mkdir -p lovebyte2021_notamoon128
cp NOTAMOON ./lovebyte2021_notamoon128
cp notamoon.s ./lovebyte2021_notamoon128
cp file_id.diz ./lovebyte2021_notamoon128
cp notamoon128.dsk ./lovebyte2021_notamoon128
cp notamoon_720p.mp4 ./lovebyte2021_notamoon128
zip -r notamoon128.zip lovebyte2021_notamoon128
notamoon128.dsk: HELLO NOTAMOON
cp $(EMPTYDISK) notamoon128.dsk
$(DOS33) -y notamoon128.dsk SAVE A HELLO
$(DOS33) -y notamoon128.dsk BSAVE -a 0x70 NOTAMOON
###
HELLO: hello.bas
$(TOKENIZE) < hello.bas > HELLO
###
NOTAMOON: notamoon.o
ld65 -o NOTAMOON notamoon.o -C ./apple2_70_zp.inc
notamoon.o: notamoon.s
ca65 -o notamoon.o notamoon.s -l notamoon.lst
###
clean:
rm -f *~ *.o *.lst HELLO NOTAMOON notamoon128.dsk *.zip

View File

@ -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;
}

View File

@ -0,0 +1,6 @@
NOTAMOON128
-
Mouse-text Death Star and Tie Fighters
128-byte Demo for Apple II, Lovebyte 2021
Requires an Apple IIe Enhanced or Newer
by Deater / dSr

View File

@ -0,0 +1,8 @@
5 HOME
10 PRINT "LOVEBYTE 2021 NOTAMOON 128B"
15 PRINT "BY DEATER / DSR"
20 PRINT CHR$(4)"CATALOG"
25 PRINT:PRINT "PRESS ANY KEY TO 'BRUN NOTAMOON'"
30 GET A$
35 PRINT
40 PRINT CHR$(4)"BRUN NOTAMOON"

View File

@ -0,0 +1,174 @@
; That's not a moon....
; by Vince `deater` Weaver, dSr, Lovebyte 2021
; based on the following BASIC program
; 1HOME:POKE49167,0
; 2FORX=0TO64:POKE1024+RND(1)*999,174:NEXT
; 3FORI=0TO1:COLOR=6-I:FORJ=0TO1
; 4HLIN8,10AT6+J*10+I:HLIN7,11AT8+J*6+I:HLIN6,12AT10+J*2+I:NEXTJ,I
; 6VTAB6:HTAB11:?"()"
; 7FORX=13TO37:POKE1063+X,90:POKE1064+X,91:POKE1065+X,95
; 8FORI=1TO200:NEXT:VTAB9:HTABX:?" ":NEXT
; 9GOTO7
; 167 -- initial implementation
; 170 -- smooth grey support
; 152 -- make death star data byte array
; 148 -- make death star VTAB not hardcoded
; 144 -- move to zero page
; 136 -- index into ROM for "random" numbers
; 133 -- optimize star placement
; 131 -- note when X already 0
; 130 -- optimize tie erase
; 126 -- more optimize death star drawing
; 124 -- use the DEC CV the instruction before VTAB
; need 124 for lovebyte
; zero page
CV = $25
BASL = $28
BASH = $29
SEEDL = $4E
INL = $66
INH = $67
; soft-switches
MOUSETEXT = $C00F ; (write) to enable mouse text
; rom routines
HOME = $FC58 ; Clear the text screen
WAIT = $FCA8 ; delay 1/2(26+27A+5A^2) us
VTAB = $FC22 ; calc screen position in CV, put in (BASL)
VTABZ = $FC24 ; calc screen position in A, put in (BASL)
.zeropage
.globalzp grey_smc,ds_data,star_store_smc,tie_data
;=======================
; Clear screen and setup
;=======================
sw:
jsr HOME ; clear the screen
sta MOUSETEXT ; enable mouse text
;=======================
; Display Stars
;=======================
ldx #64
star_loop:
lda $F100,X
eor $F300,X ; fake random
tay
lda $F800,X
eor $F900,X ; more fake random
and #$3
ora #$4
sta star_store_smc+2
lda #'.'|$80
star_store_smc:
sta $400,Y
dex
bne star_loop
;=======================
; Display Death Star
;=======================
; ldx #0 ; X already 0
lda #9 ; count backwards
sta CV
ds_loop:
;============================
; draw grey line
;============================
grey_line:
jsr $FC20 ; this is a DEC CV line before VTAB
; jsr VTAB ; position VTAB based on CV
sec
lda #19
sbc ds_data,X
sta grey_smc+1
ldy ds_data,X
; inx
; lda ds_data,X
; sta grey_smc+1
inx
grey_loop:
clc
tya
and #$1
adc #$56 ; make it an even grey
sta (BASL),Y
iny
grey_smc:
cpy #0
bne grey_loop
; inc CV
cpx #6
bne ds_loop
; draw reflector
lda #'('+$80 ; 5,10?
sta $68A
lda #')'+$80 ; 5,11?
sta $68B
;=======================
; Draw Tie Fighter
;=======================
tie_loop:
ldy #12
tie_move:
; draw tie
ldx #2
xloop1:
lda tie_data,X
sta $428,Y ; line 8 (vtab 9)
iny
dex
bpl xloop1
; delay a bit
lda #200
jsr WAIT
; erase
lda #$A0 ; space (the final frontier)
xloop2:
dey
sta $428,Y ; line 8 (vtab 9)
inx
cpx #2
bne xloop2
iny
cpy #38
bne tie_move
beq tie_loop
tie_data:
.byte 95,91,90
ds_data:
.byte 8;,11
.byte 7;,12
.byte 6;,13
.byte 6;,13
.byte 7;,12
.byte 8;,11

Binary file not shown.

View File

@ -0,0 +1,43 @@
include ../../../Makefile.inc
DOS33 = ../../../utils/dos33fs-utils/dos33
TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft
LINKERSCRIPTS = ../../../linker_scripts
EMPTYDISK = ../../../empty_disk/empty.dsk
all: rr.dsk
submit: rr256.zip
rr256.zip: RR rr.s file_id.diz rr.dsk rr.woz
mkdir -p lovebyte2021_rr256
cp RR ./lovebyte2021_rr256
cp rr.s ./lovebyte2021_rr256
cp file_id.diz ./lovebyte2021_rr256
cp rr.dsk ./lovebyte2021_rr256
cp rr.woz ./lovebyte2021_rr256
cp rr_flux.png ./lovebyte2021_rr256
cp rr_720p.mp4 ./lovebyte2021_rr256
zip -r rr256.zip lovebyte2021_rr256
###
rr.dsk: RR
dd if=RR of=rr.dsk bs=256 count=1
dd if=/dev/zero of=rr2.dsk bs=256 count=559
cat rr2.dsk >> rr.dsk
###
RR: rr.o
ld65 -o RR rr.o -C ./apple2_800.inc
rr.o: rr.s
ca65 -o rr.o rr.s -l rr.lst
###
clean:
rm -f *~ *.o *.lst RR rr.dsk rr2.dsk

BIN
demos/lovebyte2021/rr/RR Normal file

Binary file not shown.

View File

@ -0,0 +1,12 @@
MEMORY {
ZP: start = $00, size = $1A, type = rw;
RAM: start = $800, size = $8E00, file = %O;
}
SEGMENTS {
CODE: load = RAM, type = ro, align = $100;
RODATA: load = RAM, type = ro;
DATA: load = RAM, type = rw;
BSS: load = RAM, type = bss, define = yes;
ZEROPAGE: load = ZP, type = zp;
}

View File

@ -0,0 +1,11 @@
NeverGonna
-
A 256 byte bootsector demo for the Apple II, Lovebyte 2021
A lo-res rickroll with some simple music
by Deater / dSr
The rest of the disk, instead of being left empty,
has its magnetic flux altered so when viewed with
a disk scanner it gives the image shown in the included rr_flux.png
This uses the picturedsk util by Ben Zotto.

View File

@ -0,0 +1,22 @@
7 0 39 0 39 ; 0 background x1 x2 y1 y2
15 17 22 15 39 ; 1 grey lower
4 12 17 15 25 ; 2 left dgrey
4 21 23 15 30 ; 3 right dgrey
12 11 16 19 25 ; 4 l green
12 13 22 30 39 ; 5 l green bottom
12 21 23 22 30 ; 6 l green
3 17 19 8 14 ; 7 neck
11 18 21 3 12 ; 8 face
8 17 21 0 2 ; 9 hair
8 16 18 1 9 ; 10 hair
5 20 20 19 39 ; 11 mic
5 19 21 13 18 ; 12 mic
11 21 22 7 9 ; 13 nose
0 10 17 26 33 ; 14 l arm
11 17 20 25 30 ; 15 l hand
7 23 26 25 35 ; 16 erase r arm up
0 22 26 30 36 ; 17 r arm
11 26 29 32 35 ; 18 r hand
7 23 35 30 37 ; 19 erase r arm down
0 23 26 30 36 ; 20 r arm up
11 23 25 25 30 ; 21 r hand up

306
demos/lovebyte2021/rr/rr.s Normal file
View File

@ -0,0 +1,306 @@
; Never going to...
; by Vince `deater` Weaver <vince@deater.net> / dSr
; For LoveByte 2021
; 256 bytes -- at first
; LoveByte Rule is 252 bytes (there's a 4-byte DOS33 header)
; zero page
H2 = $2C
COLOR = $30
X0 = $F0
XX = $F1
FRAME = $F2
Y1 = $F3
; soft-switches
KEYPRESS = $C000
KEYRESET = $C010
FULLGR = $C052
; ROM routines
PLOT = $F800 ;; PLOT AT Y,A
PLOT1 = $F80E ;; PLOT at (GBASL),Y (need MASK to be $0f or $f0)
HLINE = $F819 ;; HLINE Y,$2C at A
SETCOL = $F864 ;; COLOR=A
SETGR = $FB40 ;; init lores and clear screen
WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us
;1DEFFNP(X)=PEEK(2054+I*5+X)-32:
;GR:POKE49234,0:
;FORI=0TO29:COLOR=FNP(0):FORY=FNP(3)TOFNP(4)
;:HLINFNP(1),FNP(2)ATY:NEXTY,I:GETA
;================================
; Clear screen and setup graphics
;================================
rr:
.byte $01 ; at $800, says number of sectors to load
; turn off drive motor
lda $C088,X ; turn off drive motor
; hopefully slot*16 is in X
jsr SETGR ; set lo-res 40x40 mode
draw_box_loop:
; get color/Y0
jsr load_byte
tax ; Y0 is in X
tya ; check for end
bmi end
jsr load_byte ; Y1
sta Y1
jsr load_byte ; X0
sta X0
tya
lsr
lsr
sta COLOR
jsr load_byte ; X1
sta H2
tya
and #$C0
ora COLOR
lsr
lsr
lsr
lsr
jsr SETCOL
inner_loop:
;; HLINE Y,H2 at A
;; X left alone, carry set on exit
;; H2 left alone
;; Y and A trashed
ldy X0
txa
jsr HLINE
cpx Y1
inx
bcc inner_loop
bcs draw_box_loop
end:
music_outer_loop:
lda #0
play_music_loop:
tax
try_again:
lda music_sequence,X
bmi long_duration
ldy #$40
.byte $2C ; bit trick
long_duration:
ldy #$80
sty speaker_duration
and #$f
cmp #8
bcc all_good
and #$3
beq all_done
lda #200
jsr WAIT
inx
jmp try_again
all_done:
lda KEYPRESS
bpl all_done
bit KEYRESET
jmp end
all_good:
tay
lda note_freqs,Y
sta speaker_frequency
inx
txa
; lda #0
;play_music_loop:
; tax
; lda music_sequence,X
; sta speaker_duration
; bpl play_music_continue
; cmp #$ff
; beq all_done
;play_music_continue:
; lda music_sequence+1,X
; sta speaker_frequency
; inx
; inx
; txa
;NOTE_A3 = $98 ; 152
;NOTE_B3 = $87 ; 135
;NOTE_CSHARP4 = $79 ; 121
;NOTE_D4 = $72 ; 114
;NOTE_E4 = $66 ; 102
;NOTE_FSHARP4 = $5B ; 91
NOTE_A3 = 0
NOTE_B3 = 1
NOTE_CSHARP4 = 2
NOTE_D4 = 3
NOTE_E4 = 4
NOTE_FSHARP4 = 5
; based on code from here
; http://eightbitsoundandfury.ld8.org/programming.html
; X,Y trashed
; duration also trashed
speaker_tone:
bit $C030 ; click speaker
speaker_loop:
dey ; y never set?
bne slabel1 ; duration roughly 256*?
dec speaker_duration ; (Duration)
beq done_tone
slabel1:
dex
bne speaker_loop
ldx speaker_frequency ; (Frequency)
jmp speaker_tone
done_tone:
beq play_music_loop
LONG = $80
SHORT = $00
END = $08
PAUSE = $09
music_sequence:
first:; 0000 111X
.byte SHORT|NOTE_A3, SHORT|NOTE_B3, SHORT|NOTE_D4, SHORT|NOTE_B3
.byte LONG|NOTE_FSHARP4, LONG|NOTE_FSHARP4, LONG|NOTE_E4, PAUSE
second:; 0000 1100 0X
.byte SHORT|NOTE_A3, SHORT|NOTE_B3, SHORT|NOTE_D4, SHORT|NOTE_B3
.byte LONG|NOTE_E4, LONG|NOTE_E4, SHORT|NOTE_D4, SHORT|NOTE_CSHARP4
.byte LONG|NOTE_B3, PAUSE
third:; 00 0010 1001 1XXX
.byte SHORT|NOTE_A3, SHORT|NOTE_B3, SHORT|NOTE_D4, SHORT|NOTE_B3
.byte LONG|NOTE_D4, SHORT|NOTE_E4, LONG|NOTE_CSHARP4, SHORT|NOTE_A3
.byte SHORT|NOTE_A3, LONG|NOTE_E4, LONG|NOTE_D4, PAUSE, END
;first:; 0000 111X
; .byte NOTE_A3, NOTE_B3, NOTE_D4, NOTE_B3
; .byte NOTE_FSHARP4, NOTE_FSHARP4, NOTE_E4, PAUSE
;second:; 0000 1100 0X
; .byte NOTE_A3, NOTE_B3, NOTE_D4, NOTE_B3
; .byte NOTE_E4, NOTE_E4, NOTE_D4, NOTE_CSHARP4
; .byte NOTE_B3, PAUSE
;third:; 00 0010 1001 1XXX
; .byte NOTE_A3, NOTE_B3
; .byte NOTE_D4, NOTE_B3, NOTE_D4, NOTE_E4
; .byte NOTE_CSHARP4, NOTE_A3, NOTE_A3, NOTE_E4
; .byte NOTE_D4, PAUSE, PAUSE, PAUSE
;music_duration:
; .byte $40,$40, $40,$40, $7f,$7f,$7f
; .byte $40,$40, $40,$40, $7f,$7f, $40,$40,$40
; .byte $40,$40, $40,$40, $7F, $40, $7F, $40,$40, $7F,$7F
; .byte $00
;music_frequency:
; .byte NOTE_A3,NOTE_B3,NOTE_D4,NOTE_B3, NOTE_FSHARP4,NOTE_FSHARP4,NOTE_E4
; .byte NOTE_A3,NOTE_B3,NOTE_D4,NOTE_B3, NOTE_E4,NOTE_E4,NOTE_D4,NOTE_CSHARP4,NOTE_B3
; .byte NOTE_A3,NOTE_B3,NOTE_D4,NOTE_B3, NOTE_D4,NOTE_E4,NOTE_CSHARP4,NOTE_A3,NOTE_A3,NOTE_E4,NOTE_D4
; .byte $00
;=========================
; load byte routine
;=========================
load_byte:
inc load_byte_smc+1 ; assume we are always < 256 bytes
; so no need to wrap
load_byte_smc:
lda box_data-1
tay
and #$3f
rts
; 4 6 6 6 6
box_data:
.byte $00,$27,$C0,$67
.byte $0F,$27,$D1,$D6
.byte $0F,$19,$0C,$51
.byte $0F,$1E,$15,$57
.byte $13,$19,$0B,$D0
.byte $1E,$27,$0D,$D6
.byte $16,$1E,$15,$D7
.byte $08,$0E,$D1,$13
.byte $03,$0C,$D2,$95
.byte $00,$02,$11,$95
.byte $01,$09,$10,$92
.byte $13,$27,$54,$54
.byte $0D,$12,$53,$55
.byte $07,$09,$D5,$96
.byte $1A,$21,$0A,$11
.byte $19,$1E,$D1,$94
; .byte $19,$23,$D7,$5A ; erase
; .byte $1E,$24,$16,$1A ; arm up
; .byte $20,$23,$DA,$9D ; arm up
; .byte $1E,$25,$D7,$63 ; erase
.byte $1E,$24,$17,$1A ; arm down
.byte $19,$1E,$D7,$99 ; arm down
.byte $FF
note_freqs: .byte $98,$87,$79,$72,$66,$5B
speaker_frequency:
speaker_duration = speaker_frequency+1
;.byte $00,$00,$00

Binary file not shown.

View File

@ -0,0 +1,44 @@
include ../../../Makefile.inc
DOS33 = ../../../utils/dos33fs-utils/dos33
TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft
LINKERSCRIPTS = ../../../linker_scripts
EMPTY_DISK = ../../../empty_disk/empty.dsk
all: sier64.dsk
submit: sier64.zip
sier64.zip: SIER_64 sier_64.s file_id.diz sier64.dsk
mkdir -p lovebyte2021_sier64
cp SIER_64 ./lovebyte2021_sier64
cp sier_64.s ./lovebyte2021_sier64
cp file_id.diz ./lovebyte2021_sier64
cp sier64.dsk ./lovebyte2021_sier64
cp sier_720p.mp4 ./lovebyte2021_sier64
zip -r sier64.zip lovebyte2021_sier64
sier64.dsk: HELLO SIER_64
cp $(EMPTY_DISK) sier64.dsk
$(DOS33) -y sier64.dsk SAVE A HELLO
$(DOS33) -y sier64.dsk BSAVE -a 0x300 SIER_64
###
HELLO: hello.bas
$(TOKENIZE) < hello.bas > HELLO
###
SIER_64: sier_64.o
ld65 -o SIER_64 sier_64.o -C $(LINKERSCRIPTS)/apple2_300.inc
sier_64.o: sier_64.s
ca65 -o sier_64.o sier_64.s -l sier_64.lst
###
clean:
rm -f *~ *.o *.lst HELLO SIER_64 *.zip

Binary file not shown.

View File

@ -0,0 +1,5 @@
SIER64
-
Scrolling lo-res color-change sierpinski triangle
64-byte Demo for Apple II, Lovebyte 2021
by Deater / dSr

View File

@ -0,0 +1,8 @@
5 HOME
10 PRINT "LOVEBYTE 2021 SIER 64B"
15 PRINT "BY DEATER / DSR"
20 PRINT CHR$(4)"CATALOG"
25 PRINT:PRINT "PRESS ANY KEY TO 'BRUN SIER_64'"
30 GET A$
35 PRINT
40 PRINT CHR$(4)"BRUN SIER_64"

Binary file not shown.

View File

@ -0,0 +1,89 @@
; fake sierpinski
; 64-byte Apple II demo
; with scrolling and colors
; by Vince `deater` Weaver, dSr, Lovebyte 2021
; just plot XX AND YY
; zero page
COLOR = $30
XX = $66
YY = $67
FRAME = $68
;X2 = $69
; soft-switches
FULLGR = $C052
; rom routines
PLOT = $F800 ;; PLOT AT Y,A
PLOT1 = $F80E ;; PLOT at (GBASL),Y (need MASK to be $0f or $f0)
SETCOL = $F864 ;; COLOR=A
SETGR = $FB40
;================================
; Clear screen and setup graphics
;================================
sier:
jsr SETGR ; set lo-res 40x40 mode
bit FULLGR ; make it 40x48
lda #0
sta FRAME
sier_loop:
inc FRAME
ldx #47 ; YY
sier_yloop:
lda #39
sta XX
tay
txa
jsr PLOT ; PLOT AT Y,A
; sets GBASL/GBASH and MASK
sier_xloop:
txa
clc
adc FRAME
and XX
bne black
lda FRAME ; color is based on frame
lsr
lsr
lsr
lsr
bne not_zero ; but no color 0 (would be all black)
lda #3 ; how about purple instead
not_zero:
.byte $2C ; bit trick
black:
lda #$00
jsr SETCOL ; set top/bottom nibble same color
ldy XX
txa
jsr PLOT1 ; PLOT AT (GBASL),Y
dec XX
bpl sier_xloop
dex
bpl sier_yloop
done:
bmi sier_loop

View File

@ -0,0 +1,51 @@
include ../../../Makefile.inc
DOS33 = ../../../utils/dos33fs-utils/dos33
TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft
LINKERSCRIPTS = ../../../linker_scripts
EMPTY_DISK = ../../../empty_disk/empty.dsk
all: sierzoom128.dsk
submit: sierzoom128.zip
sierzoom128.zip: SIERZOOM sierzoom.s file_id.diz sierzoom128.dsk
mkdir -p lovebyte2021_sierzoom128
cp SIERZOOM ./lovebyte2021_sierzoom128
cp sierzoom.s ./lovebyte2021_sierzoom128
cp file_id.diz ./lovebyte2021_sierzoom128
cp sierzoom128.dsk ./lovebyte2021_sierzoom128
cp sierzoom_720p.mp4 ./lovebyte2021_sierzoom128
zip -r sierzoom128.zip lovebyte2021_sierzoom128
sierzoom128.dsk: HELLO SIERZOOM
cp $(EMPTY_DISK) sierzoom128.dsk
$(DOS33) -y sierzoom128.dsk SAVE A HELLO
$(DOS33) -y -x sierzoom128.dsk SAVE I HELLO "/½½½½½½½½½½½½½½½½½½½½½½½\\"
$(DOS33) -y -x sierzoom128.dsk SAVE T HELLO "½ SIERZOOM ½"
$(DOS33) -y -x sierzoom128.dsk SAVE I HELLO "½ LOVEBYTE 2021 ½"
$(DOS33) -y -x sierzoom128.dsk SAVE T HELLO ":½½½½½½½½½½½½½½½½½½½½½½½:"
$(DOS33) -y -x sierzoom128.dsk SAVE I HELLO "½ 128B DEMO BY DEATER ½"
$(DOS33) -y -x sierzoom128.dsk SAVE T HELLO "½ - d e s i r e - ½"
$(DOS33) -y -x sierzoom128.dsk SAVE I HELLO "\\½½½½½½½½½½½½½½½½½½½½½½½/"
$(DOS33) -y sierzoom128.dsk BSAVE -a 0x60 SIERZOOM
###
HELLO: hello.bas
$(TOKENIZE) < hello.bas > HELLO
###
SIERZOOM: sierzoom.o
ld65 -o SIERZOOM sierzoom.o -C ./apple2_60_zp.inc
sierzoom.o: sierzoom.s
ca65 -o sierzoom.o sierzoom.s -l sierzoom.lst
###
clean:
rm -f *~ *.o *.lst HELLO SIERZOOM *.zip

Binary file not shown.

View File

@ -0,0 +1,12 @@
MEMORY {
ZP: start = $60, size = $90, type = rw;
RAM: start = $60, 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;
}

View File

@ -0,0 +1,5 @@
SIERZOOM128
-
Zooming Sierpinski
128-byte Demo for Apple II, Lovebyte 2021
by Deater / dSr

View File

@ -0,0 +1,6 @@
5 HOME
20 PRINT CHR$(4)"CATALOG"
25 PRINT:PRINT "PRESS ANY KEY TO 'BRUN SIERZOOM'"
30 GET A$
35 PRINT
40 PRINT CHR$(4)"BRUN SIERZOOM"

View File

@ -0,0 +1,206 @@
; sierpinski-like demo
; based on the code from Hellmood's Memories demo
; by Vince `deater` Weaver <vince@deater.net>
; for Lovebyte 2021
; the simple sierpinski you more or less just plot
; X AND Y
; Hellmood's you plot something more or less like
; COLOR = ( (Y-(X*T)) & (X+(Y*T) ) & 0xf0
; where T is an incrementing frame value
; to get speed on 6502/Apple II we change the multiplies to
; a series of 16-bit 8.8 fixed point adds
; 140 bytes -- bot demo version
; 137 bytes -- remove & jump
; 135 bytes -- init with HGR, which sets A=0
; 133 bytes -- remove ldx #0 in page flip code
; 130 bytes -- load in zero page
; 128 bytes -- init T_L, T_H as part of zero page since we live there
; 126 bytes -- shorter 16-bit increment of T_L
; 122 bytes -- use trick of jumping mid-PLOT for MASK calculation
; LoveByte requires 124 bytes
; zero page
GBASH = $27
MASK = $2E
COLOR = $30
;XX = $F7
XX_TH = $F8
XX_TL = $F9
;YY = $FA
YY_TH = $FB
YY_TL = $FC
;T_L = $FD
;T_H = $FE
SAVED = $FF
; Soft switches
FULLGR = $C052
PAGE1 = $C054
PAGE2 = $C055
LORES = $C056 ; Enable LORES graphics
; ROM routines
HGR = $F3E2
HGR2 = $F3D8
PLOT1 = $F80E ;; PLOT at (GBASL),Y (need MASK to be $0f or $f0)
GBASCALC= $F847 ;; take Y-coord/2 in A, put address in GBASL/H ( a trashed, C clear)
SETGR = $FB40
.zeropage
.globalzp T_L,T_H
;================================
; Clear screen and setup graphics
;================================
sier:
jsr HGR2 ; set FULLGR, sets A=0
; be sure to avoid code at E6 if we do this
bit LORES ; drop down to lo-res
; lda #0 ; start with multiplier 0
; sta T_L
; sta T_H
sier_outer:
ldx #0 ; YY starts at 0
stx YY_TL
stx YY_TH
sier_yloop:
; calc YY_T (8.8 fixed point add)
; save space by skipping clc as it's only a slight variation w/o
; clc
lda YY_TL
adc T_L
sta YY_TL
lda YY_TH
adc T_H
sta YY_TH
txa ; YY ; plot call needs Y/2
lsr
php
; bcc even_mask
; ldy #$f0
; .byte $2C ; bit hack
;even_mask:
; ldy #$0f
; sty MASK
jsr GBASCALC ; take Y-coord/2 in A, put address in GBASL/H ( a trashed, C clear)
lda GBASH
draw_page_smc:
adc #0
sta GBASH ; adjust for PAGE1/PAGE2 ($400/$800)
plp
jsr $f806 ; trick to calculate MASK by jumping
; into middle of PLOT routine
; reset XX to 0
ldy #0 ; XX
sty XX_TL
sty XX_TH
sier_xloop:
; want (YY-(XX*T)) & (XX+(YY*T)
; SAVED = XX+(Y*T)
; clc
tya ; XX
adc YY_TH
sta SAVED
; calc XX*T
; clc
lda XX_TL
adc T_L
sta XX_TL
lda XX_TH
adc T_H
sta XX_TH
; calc (YY-X_T)
txa ; lda YY
sec
sbc XX_TH
; want (YY-(XX*T)) & (XX+(YY*T)
and SAVED
and #$f0
beq green
black:
lda #00 ; black
.byte $2C ; bit trick
green:
lda #$CC ; green
sta COLOR
; XX value already in Y
jsr PLOT1 ; PLOT AT (GBASL),Y
iny ; XX
cpy #40
bne sier_xloop
inx ; YY
cpx #48
bne sier_yloop
; inc T
; clc
lda T_L
blah_smc:
adc #1
sta T_L
bcc no_carry
inc T_H
no_carry:
; speed up the zoom as it goes
inc blah_smc+1
; x is 48
flip_pages:
lda draw_page_smc+1 ; DRAW_PAGE
beq done_page
inx
done_page:
; X=48 ($30) PAGE1=$C054-$30=$C024
ldy $C024,X ; set display page to PAGE1 or PAGE2
eor #$4 ; flip draw page between $400/$800
sta draw_page_smc+1 ; DRAW_PAGE
jmp sier_outer ; what can we branch on?
T_L: .byte $00
T_H: .byte $00

Binary file not shown.

View File

@ -0,0 +1,46 @@
include ../../../Makefile.inc
DOS33 = ../../../utils/dos33fs-utils/dos33
TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft
EMPTYDISK = ../../../empty_disk/empty.dsk
all: tiny_pastel16.dsk
tiny_pastel16.dsk: HELLO TINY_PASTEL
cp $(EMPTYDISK) tiny_pastel16.dsk
$(DOS33) -y tiny_pastel16.dsk SAVE A HELLO
$(DOS33) -y tiny_pastel16.dsk BSAVE -a 0x70 TINY_PASTEL
###
submit: pastel16.zip
pastel16.zip: TINY_PASTEL tiny_pastel.s file_id.diz tiny_pastel16.dsk
mkdir -p lovebyte2021_tiny_pastel16
cp TINY_PASTEL ./lovebyte2021_tiny_pastel16
cp tiny_pastel.s ./lovebyte2021_tiny_pastel16
cp file_id.diz ./lovebyte2021_tiny_pastel16
cp tiny_pastel16.dsk ./lovebyte2021_tiny_pastel16
cp tiny_pastel_720p.mp4 ./lovebyte2021_tiny_pastel16
zip -r pastel16.zip lovebyte2021_tiny_pastel16
####
####
HELLO: hello.bas
$(TOKENIZE) < hello.bas > HELLO
###
TINY_PASTEL: tiny_pastel.o
ld65 -o TINY_PASTEL tiny_pastel.o -C ./apple2_70_zp.inc
tiny_pastel.o: tiny_pastel.s
ca65 -o tiny_pastel.o tiny_pastel.s -l tiny_pastel.lst
####
clean:
rm -f *~ *.o *.lst HELLO TINY_PASTEL *.zip

Binary file not shown.

View File

@ -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;
}

View File

@ -0,0 +1,5 @@
Tiny Pastel
-
Lo-res Scrolling Pastel Blocks
16-byte Intro for Apple II, Lovebyte 2021
by Deater / dSr

View File

@ -0,0 +1,8 @@
5 HOME
10 PRINT "TINY PASTEL -- A 16 BYTE APPLE II INTRO"
15 PRINT " BY DEATER / DSR"
20 PRINT CHR$(4)"CATALOG"
25 PRINT:PRINT "PRESS ANY KEY TO 'BRUN TINY_PASTEL'"
30 GET A$
35 PRINT
40 PRINT CHR$(4)"BRUN TINY_PASTEL"

View File

@ -0,0 +1,30 @@
; Tiny Pastel
; draw some scrolling pastel blocks in 16 bytes
; by Vince `deater` Weaver <vince@deater.net>, --- dSr ---
; zero page locations
; ROM calls
SETCOL = $F864 ; COLOR=A
PRHEX = $FDE3 ; print hex digit
COUT = $FDED ; output A to screen
SETGR = $FB40 ; set lo-res graphics and clear screen
.zeropage
tiny_xdraw:
bit $C050 ; switch to lo-res graphics
tiny_loop:
txa
eor $00,X ; get value from zero page
jsr SETCOL ; set bottom nibble to top
jsr COUT ; print to text screen (which is same
; as lo-res graphics screen) with scroll
inx
jmp tiny_loop ; could use bvc to save a byte
; but we can be sure here and we have
; a byte to spare

Binary file not shown.

View File

@ -0,0 +1,56 @@
include ../../../Makefile.inc
DOS33 = ../../../utils/dos33fs-utils/dos33
TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft
EMPTYDISK = ../../../empty_disk/empty.dsk
all: tiny_pipes64.dsk
tiny_pipes64.dsk: HELLO TINY_PIPES
cp $(EMPTYDISK) tiny_pipes64.dsk
$(DOS33) -y tiny_pipes64.dsk SAVE A HELLO
$(DOS33) -y -x tiny_pipes64.dsk SAVE T HELLO "/======================"
$(DOS33) -y -x tiny_pipes64.dsk SAVE T HELLO ": TINY PIPES"
$(DOS33) -y -x tiny_pipes64.dsk SAVE T HELLO "\\=====================\\"
$(DOS33) -y -x tiny_pipes64.dsk SAVE T HELLO " BY DEATER :"
$(DOS33) -y -x tiny_pipes64.dsk SAVE T HELLO "/=====================/"
$(DOS33) -y -x tiny_pipes64.dsk SAVE T HELLO ": 64 BYTE DEMO"
$(DOS33) -y -x tiny_pipes64.dsk SAVE T HELLO ": LOVEBYTE 2021"
$(DOS33) -y -x tiny_pipes64.dsk SAVE T HELLO "\\======================"
$(DOS33) -y -x tiny_pipes64.dsk SAVE T HELLO " -- d e s i r e --"
$(DOS33) -y -x tiny_pipes64.dsk SAVE T HELLO " "
$(DOS33) -y tiny_pipes64.dsk BSAVE -a 0x70 TINY_PIPES
###
submit: pipes64.zip
pipes64.zip: TINY_PIPES tiny_pipes.s file_id.diz tiny_pipes64.dsk
mkdir -p lovebyte2021_tiny_pipes64
cp TINY_PIPES ./lovebyte2021_tiny_pipes64
cp tiny_pipes.s ./lovebyte2021_tiny_pipes64
cp file_id.diz ./lovebyte2021_tiny_pipes64
cp tiny_pipes64.dsk ./lovebyte2021_tiny_pipes64
cp tiny_pipes_720p.mp4 ./lovebyte2021_tiny_pipes64
zip -r pipes64.zip lovebyte2021_tiny_pipes64
####
####
HELLO: hello.bas
$(TOKENIZE) < hello.bas > HELLO
###
TINY_PIPES: tiny_pipes.o
ld65 -o TINY_PIPES tiny_pipes.o -C ./apple2_70_zp.inc
tiny_pipes.o: tiny_pipes.s
ca65 -o tiny_pipes.o tiny_pipes.s -l tiny_pipes.lst
####
clean:
rm -f *~ *.o *.lst HELLO TINY_PIPES *.zip

Binary file not shown.

View File

@ -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;
}

View File

@ -0,0 +1,5 @@
Tiny Pipes
-
Hi-res Xor Pipes
64-byte Demo for Apple II, Lovebyte 2021
by Deater / dSr

View File

@ -0,0 +1,6 @@
5 HOME
20 PRINT CHR$(4)"CATALOG"
25 PRINT:PRINT "PRESS ANY KEY TO 'BRUN TINY_PIPES'"
30 GET A$
35 PRINT
40 PRINT CHR$(4)"BRUN TINY_PIPES"

View File

@ -0,0 +1,107 @@
; Tiny Pipes
;
; 64 Byte Apple II Demo for Lovebyte 2021
;
; by Vince `deater` Weaver <vince@deater.net> / dSr
; Roughly based on "Entropy" by Dave McKellar of Toronto
; A Two-line BASIC program Found on Beagle Brother's Apple Mechanic Disk
;
; It is XORing vector squares across the screen. Randomly the size
; is changed while doing this.
; 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)<E)*RND(1)*E*20+1: XDRAW 1 AT X,Y:
; NEXT: NEXT: NEXT: NEXT
; Optimization
; 88 bytes -- hack up the entropy code
; 83 bytes -- count down YPOS instead of up
; 73 bytes -- XPOS only up to 256
; 73 bytes -- move to zero page
; 65 bytes -- move XPOS/YPOS into X/Y, use RESTORE
; zero page locations
HGR_SHAPE = $1A
A5H = $45
XREG = $46
YREG = $47
HGR_SCALE = $E7
HGR_ROTATION = $F9
FRAME = $FC
XPOS = $FD
YPOS = $FF
; ROM calls
HGR2 = $F3D8
HPOSN = $F411
XDRAW0 = $F65D
RESTORE = $FF3F
.zeropage
pipes:
jsr HGR2 ; Hi-res graphics, no text at bottom
; Y=0, A=0 after this call
eloop:
ldy #180 ; Y=180 down to 0 STEP 6
yloop:
ldx #4 ; FOR X=4 to 278 STEP 6
xloop:
frame_smc:
lda $D000 ; 3 ; also FRAME
and #1 ; 2
sta HGR_SCALE ; 2
inc HGR_SCALE ; 2
stx XREG ; save X
sty YREG ; save Y
; setup X and Y co-ords
tya ; YPOS into A
ldy #0 ; Y always 0
; XPOS already in X
jsr HPOSN ; X= (y,x) Y=(a)
ldx #<shape_table ; point to our shape
lda #0 ; ROT=0
tay ; ldy #>shape_table
jsr XDRAW0 ; XDRAW 1 AT X,Y
; Both A and X are 0 at exit
jsr RESTORE ; restore FLAGS/X/Y/A
nextx: ; NEXT X
inc frame_smc+1
txa
clc ; 1
adc #6 ; x+=6 ; 2
tax
bne xloop ; if so, loop ; 2
nexty:
; carry always set if we get here
; sec
tya
sbc #6 ; y-=6
tay
bne yloop ; if so, loop
beq eloop
shape_table:
.byte 18,63,36,36,45,45,54,54,63,0 ; shape data (a square)

Binary file not shown.

View File

@ -0,0 +1,46 @@
include ../../../Makefile.inc
DOS33 = ../../../utils/dos33fs-utils/dos33
TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft
EMPTYDISK = ../../../empty_disk/empty.dsk
all: tiny_text8.dsk
tiny_text8.dsk: HELLO TINY_TEXT
cp $(EMPTYDISK) tiny_text8.dsk
$(DOS33) -y tiny_text8.dsk SAVE A HELLO
$(DOS33) -y tiny_text8.dsk BSAVE -a 0x70 TINY_TEXT
###
submit: text8.zip
text8.zip: TINY_TEXT tiny_text.s file_id.diz tiny_text8.dsk
mkdir -p lovebyte2021_tiny_text8
cp TINY_TEXT ./lovebyte2021_tiny_text8
cp tiny_text.s ./lovebyte2021_tiny_text8
cp file_id.diz ./lovebyte2021_tiny_text8
cp tiny_text8.dsk ./lovebyte2021_tiny_text8
cp tiny_text_720p.mp4 ./lovebyte2021_tiny_text8
zip -r text8.zip lovebyte2021_tiny_text8
####
####
HELLO: hello.bas
$(TOKENIZE) < hello.bas > HELLO
###
TINY_TEXT: tiny_text.o
ld65 -o TINY_TEXT tiny_text.o -C ./apple2_70_zp.inc
tiny_text.o: tiny_text.s
ca65 -o tiny_text.o tiny_text.s -l tiny_text.lst
####
clean:
rm -f *~ *.o *.lst HELLO TINY_TEXT *.zip

Binary file not shown.

View File

@ -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;
}

View File

@ -0,0 +1,5 @@
Tiny Text
-
Textmode Hex Scroller
8-byte Intro for Apple II, Lovebyte 2021
by Deater / dSr

View File

@ -0,0 +1,8 @@
5 HOME
10 PRINT "TINY TEXT -- AN 8 BYTE APPLE II INTRO"
15 PRINT " BY DEATER / DSR"
20 PRINT CHR$(4)"CATALOG"
25 PRINT:PRINT "PRESS ANY KEY TO 'BRUN TINY_TEXT'"
30 GET A$
35 PRINT
40 PRINT CHR$(4)"BRUN TINY_TEXT"

View File

@ -0,0 +1,32 @@
; Tiny Text
; by Vince `deater` Weaver, vince@deater.net --- d e s i r e ---
; scrolling hexadecimal numbers
; hard to do much in 8-bytes on Apple II
; zero page locations
; ROM calls
SETGR = $FB40 ; set lo-res graphics code, clear screen
PRHEX = $FDE3 ; print hex digit
COUT = $FDED ; output A to screen
COUT1 = $FDF0 ; output A to screen
; load to zero page
.zeropage
tiny_text:
tiny_loop:
lda $00,X ; get value from zero page
jsr PRHEX ; convert to hex digit and print, with scroll
; jsr COUT
inx ; move to next location
bvc tiny_loop ; branch always (depends on the V flag
; being clear, which it should be?)
; we could maybe use a proper branch code
; if we can prove the output of COUT has
; any guarantees

Binary file not shown.

View File

@ -0,0 +1,56 @@
include ../../../Makefile.inc
DOS33 = ../../../utils/dos33fs-utils/dos33
TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft
LINKER_SCRIPTS = ../../../linker_scripts
EMPTY_DISK = ../../../empty_disk/empty.dsk
all: tiny_32.dsk
tiny_32.dsk: HELLO TINY_TRIANGLES
cp $(EMPTY_DISK) tiny_32.dsk
$(DOS33) -y tiny_32.dsk SAVE A HELLO
$(DOS33) -y tiny_32.dsk BSAVE -a 0x070 TINY_TRIANGLES
$(DOS33) -y -x tiny_32.dsk SAVE A HELLO "¯½½½½½½½½½½½½½½½½½½½"
$(DOS33) -y -x tiny_32.dsk SAVE T HELLO "Ì TINY TRIANGLES ½"
$(DOS33) -y -x tiny_32.dsk SAVE A HELLO "Ï BY DEATER ½"
$(DOS33) -y -x tiny_32.dsk SAVE B HELLO "Ö 28 BYTES ½"
$(DOS33) -y -x tiny_32.dsk SAVE A HELLO "Å --dSr-- ½"
$(DOS33) -y -x tiny_32.dsk SAVE T HELLO "Â ½"
$(DOS33) -y -x tiny_32.dsk SAVE A HELLO "Ù 2021 ½"
$(DOS33) -y -x tiny_32.dsk SAVE B HELLO "Ô ½"
$(DOS33) -y -x tiny_32.dsk SAVE A HELLO "Å ½"
$(DOS33) -y -x tiny_32.dsk SAVE T HELLO "º½"
$(DOS33) -y -x tiny_32.dsk SAVE A HELLO "¯"
###
submit: tiny32.zip
tiny32.zip: TINY_TRIANGLES tiny_triangles.s file_id.diz tiny_32.dsk
mkdir -p lovebyte2021_tiny32
cp TINY_TRIANGLES ./lovebyte2021_tiny32
cp tiny_triangles.s ./lovebyte2021_tiny32
cp file_id.diz ./lovebyte2021_tiny32
cp tiny_32.dsk ./lovebyte2021_tiny32
cp tiny_triangles_720p.mp4 ./lovebyte2021_tiny32
zip -r tiny32.zip lovebyte2021_tiny32
####
HELLO: hello.bas
$(TOKENIZE) < hello.bas > HELLO
###
TINY_TRIANGLES: tiny.o
ld65 -o TINY_TRIANGLES tiny.o -C $(LINKER_SCRIPTS)/apple2_70_zp.inc
tiny.o: tiny_triangles.s
ca65 -o tiny.o tiny_triangles.s -l tiny.lst
###
clean:
rm -f *~ *.o *.lst HELLO TINY_TRIANGLES *.zip

Binary file not shown.

View File

@ -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;
}

View File

@ -0,0 +1,5 @@
Tiny Triangles
-
Hi-res Triangles
32-byte Demo for Apple II, Lovebyte 2021
by Deater / dSr

View File

@ -0,0 +1,6 @@
5 HOME
20 PRINT CHR$(4)"CATALOG"
25 PRINT:PRINT "PRESS ANY KEY TO 'BRUN TINY_TRIANGLES'"
30 GET A$
35 PRINT
40 PRINT CHR$(4)"BRUN TINY_TRIANGLES"

Binary file not shown.

View File

@ -0,0 +1,61 @@
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:
txa
; 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
ldx HGR_X
inx
; inc xx_smc+1
bne tiny_xloop
inc yy_smc+1
bne tiny_xloop
; should we over-write brk handler to restart?

View File

@ -0,0 +1,46 @@
include ../../../Makefile.inc
DOS33 = ../../../utils/dos33fs-utils/dos33
TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft
EMPTYDISK = ../../../empty_disk/empty.dsk
all: tiny_xdraw16.dsk
tiny_xdraw16.dsk: HELLO TINY_XDRAW
cp $(EMPTYDISK) tiny_xdraw16.dsk
$(DOS33) -y tiny_xdraw16.dsk SAVE A HELLO
$(DOS33) -y tiny_xdraw16.dsk BSAVE -a 0xE7 TINY_XDRAW
###
submit: xdraw16.zip
xdraw16.zip: TINY_XDRAW tiny_xdraw.s file_id.diz tiny_xdraw16.dsk
mkdir -p lovebyte2021_tiny_xdraw16
cp TINY_XDRAW ./lovebyte2021_tiny_xdraw16
cp tiny_xdraw.s ./lovebyte2021_tiny_xdraw16
cp file_id.diz ./lovebyte2021_tiny_xdraw16
cp tiny_xdraw16.dsk ./lovebyte2021_tiny_xdraw16
cp tiny_xdraw_720p.mp4 ./lovebyte2021_tiny_xdraw16
zip -r xdraw16.zip lovebyte2021_tiny_xdraw16
####
####
HELLO: hello.bas
$(TOKENIZE) < hello.bas > HELLO
###
TINY_XDRAW: tiny_xdraw.o
ld65 -o TINY_XDRAW tiny_xdraw.o -C ./apple2_e7_zp.inc
tiny_xdraw.o: tiny_xdraw.s
ca65 -o tiny_xdraw.o tiny_xdraw.s -l tiny_xdraw.lst
####
clean:
rm -f *~ *.o *.lst HELLO TINY_XDRAW *.zip

View File

@ -0,0 +1 @@
<20><><EFBFBD> <11><><01><> ]<5D><><EFBFBD>

View File

@ -0,0 +1,12 @@
MEMORY {
ZP: start = $E7, size = $90, type = rw;
RAM: start = $E7, 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;
}

View File

@ -0,0 +1,5 @@
Tiny Xdraw
-
Hi-res Xdraw Pattern
16-byte Intro for Apple II, Lovebyte 2021
by Deater / dSr

View File

@ -0,0 +1,8 @@
5 HOME
10 PRINT "TINY XDRAW -- A 16 BYTE APPLE II INTRO"
15 PRINT " BY DEATER / DSR"
20 PRINT CHR$(4)"CATALOG"
25 PRINT:PRINT "PRESS ANY KEY TO 'BRUN TINY_XDRAW'"
30 GET A$
35 PRINT
40 PRINT CHR$(4)"BRUN TINY_XDRAW"

View File

@ -0,0 +1,3 @@
CALL -151
E7: 20 D8 F3 8A 20 11 F4 A2 01 A0 F0 20 5D F6 F0 F7
E7G

View File

@ -0,0 +1,78 @@
; Tiny Tiny
; zero page locations
HGR_SHAPE = $1A
HGR_SHAPE2 = $1B
HGR_BITS = $1C
GBASL = $27
GBASH = $28
A5H = $45
XREG = $46
YREG = $47
; C0-CF should be clear
; D0-DF?? D0-D5 = HGR scratch?
HGR_DX = $D0 ; HGLIN
HGR_DX2 = $D1 ; HGLIN
HGR_DY = $D2 ; HGLIN
HGR_QUADRANT = $D3
HGR_E = $D4
HGR_E2 = $D5
HGR_X = $E0
HGR_X2 = $E1
HGR_Y = $E2
HGR_COLOR = $E4
HGR_HORIZ = $E5
HGR_SCALE = $E7
HGR_SHAPE_TABLE = $E8
HGR_SHAPE_TABLE2= $E9
HGR_COLLISIONS = $EA
HGR_ROTATION = $F9
FRAME = $FC
XPOS = $FD
YPOS = $FF
; ROM calls
HGR2 = $F3D8
HPOSN = $F411
XDRAW0 = $F65D
XDRAW1 = $F661
RESTORE = $FF3F
.zeropage
tiny_tiny:
jsr HGR2 ; Hi-res, full screen ; 3
; Y=0, A=0 after this call
lda #40
sta HGR_SCALE
tiny_loop:
inc rot_smc+1
; setup X and Y co-ords
ldy #0 ; Y always 0
ldx #140
lda #96
jsr HPOSN ; X= (y,x) Y=(a)
; saves Y/X/A to HGR_Y, HGR_X, HGR_X+1
; after, Y = X/7
; after, y = $14 = 20, always
; A=FF, X=F9
ldx #<shape_table ; point to our shape
ldy #0
rot_smc:
lda #0 ; ROT=0
jsr XDRAW0 ; XDRAW 1 AT X,Y
; Both A and X are 0 at exit
; Z flag set on exit
beq tiny_loop ; bra
shape_table:
.byte $2D,0 ; shape data
; RT RT is 00 101 101 = 2D

View File

@ -0,0 +1,49 @@
; Tiny Tiny
; zero page locations
HGR_SHAPE = $1A
A5H = $45
XREG = $46
YREG = $47
HGR_SCALE = $E7
HGR_ROTATION = $F9
FRAME = $FC
XPOS = $FD
YPOS = $FF
; ROM calls
HGR2 = $F3D8
HPOSN = $F411
XDRAW0 = $F65D
RESTORE = $FF3F
.zeropage
tiny_tiny:
jsr HGR2 ; Hi-res graphics, no text at bottom
; Y=0, A=0 after this call
lda #1
sta HGR_SCALE
tiny_loop:
; setup X and Y co-ords
ldy #0 ; Y always 0
ldx #140
lda #96
jsr HPOSN ; X= (y,x) Y=(a)
ldx #<shape_table ; point to our shape
rot_smc:
lda #0 ; ROT=0
tay ; ldy #>shape_table
jsr XDRAW0 ; XDRAW 1 AT X,Y
; Both A and X are 0 at exit
inc rot_smc+1
jmp tiny_loop
shape_table:
.byte 18,0 ; shape data

View File

@ -0,0 +1,133 @@
; Tiny Tiny
; zero page locations
HGR_SHAPE = $1A
HGR_SHAPE2 = $1B
HGR_BITS = $1C
GBASL = $26
GBASH = $27
A5H = $45
XREG = $46
YREG = $47
; C0-CF should be clear
; D0-DF?? D0-D5 = HGR scratch?
HGR_DX = $D0 ; HGLIN
HGR_DX2 = $D1 ; HGLIN
HGR_DY = $D2 ; HGLIN
HGR_QUADRANT = $D3
HGR_E = $D4
HGR_E2 = $D5
HGR_X = $E0
HGR_X2 = $E1
HGR_Y = $E2
HGR_COLOR = $E4
HGR_HORIZ = $E5
HGR_SCALE = $E7
HGR_SHAPE_TABLE = $E8
HGR_SHAPE_TABLE2= $E9
HGR_COLLISIONS = $EA
HGR_ROTATION = $F9
FRAME = $FC
XPOS = $FD
YPOS = $FF
; ROM calls
HGR2 = $F3D8
HGR = $F3E2
HPOSN = $F411
XDRAW0 = $F65D
XDRAW1 = $F661
RESTORE = $FF3F
.zeropage
.globalzp rot_smc
tiny_tiny:
jsr HGR2 ; Hi-res, full screen ; 3
; Y=0, A=0 after this call
; lda #$10
; stx HGR_SCALE ; loading so JSR ($20) is at scale ($E7)
; ldy #0 ; Y already 0
; ldx #140
; lda #96
txa
jsr HPOSN ; X= (y,x) Y=(a)
; sta GBASL
; sta GBASH
; lda #40
; sta HGR_SCALE
; lda #$46
; sta GBASH
; lda #$A8
; sta GBASL
; setup X and Y co-ords
; ldy #0 ; Y always 0
; ldx #140
; lda #96
; jsr HPOSN ; X= (y,x) Y=(a)
; saves Y/X/A to HGR_Y, HGR_X, HGR_X+1
; after, Y = X/7
; after, y = $14 = 20, always
; A=FF, X=F9
; GBASL = 46A8
tiny_loop:
inc rot_smc+1
ldx #<shape_table ; point to our shape
shape_table:
ldy #0
rot_smc:
lda #0 ; ROT=0
jsr XDRAW0 ; XDRAW 1 AT X,Y
; Both A and X are 0 at exit
; Z flag set on exit
; Y varies
beq tiny_loop ; bra
;shape_table:
; .byte $A8,0 ; shape data
; 22 00 = $D
; 30 would work
; NUP=0 UP=4
; NRT=1 RT=5
; NDN=2 DN=6
; NLT=3 LT=7
; INVALID 00 000 000 = 00
; NRT NUP 00 000 001 = 01
; NDN NUP 00 000 010 = 02
; NLT NUP 00 000 011 = 03
; UP NUP 00 000 100 = 04
; LT NUP 00 000 111 = 07
; NDN NRT 00 001 010 = 0A
; RT NRT 00 001 101 = 0D
; NUP NLT 00 011 000 = 18
; LT NLT 00 011 111 = 1F
; NUP UP 00 100 000 = 20
; UP NDN 00 100 010 = 22 ****
; NUP RT 00 101 000 = 28
; UP RT 00 101 100 = 2C
; RT RT is 00 101 101 = 2D
; LT RT is 00 101 111 = 2F ****
; NUP DN 00 110 000 = 30 ****
; DN DN 00 110 110 = 36
; NUP LT 00 111 000 = 38
; is 10 100 000 = UP NUP

View File

@ -0,0 +1,70 @@
; Tiny Tiny
; zero page locations
HGR_SHAPE = $1A
HGR_BITS = $1C
GBASL = $27
GBASH = $28
A5H = $45
XREG = $46
YREG = $47
; C0-CF should be clear
; D0-DF?? D0-D5 = HGR scratch?
HGR_DX = $D0 ; HGLIN
HGR_DX2 = $D1 ; HGLIN
HGR_DY = $D2 ; HGLIN
HGR_QUADRANT = $D3
HGR_E = $D4
HGR_E2 = $D5
HGR_X = $E0
HGR_X2 = $E1
HGR_Y = $E2
HGR_COLOR = $E4
HGR_HORIZ = $E5
HGR_SCALE = $E7
HGR_SHAPE = $E8
HGR_SHAPE2 = $E9
HGR_COLLISIONS = $EA
HGR_ROTATION = $F9
FRAME = $FC
XPOS = $FD
YPOS = $FF
; ROM calls
HGR2 = $F3D8
HPOSN = $F411
XDRAW0 = $F65D
RESTORE = $FF3F
.zeropage
tiny_tiny:
jsr HGR2 ; Hi-res, full screen ; 3
; Y=0, A=0 after this call
; lda #40
; sta HGR_SCALE
tiny_loop:
; setup X and Y co-ords
ldy #0 ; Y always 0
ldx #140
lda #96
jsr HPOSN ; X= (y,x) Y=(a)
; saves Y/X/A to HGR_Y, HGR_X, HGR_X+1
; ldx #<shape_table ; point to our shape
; ldy #0
rot_smc:
lda #0 ; ROT=0
jsr XDRAW1 ; XDRAW 1 AT X,Y
; Both A and X are 0 at exit
inc rot_smc+1
jmp tiny_loop
shape_table:
.byte $2D,0 ; shape data
; RT RT is 00 101 101 = 2D

View File

@ -0,0 +1,111 @@
; Tiny Xdraw
; repeatedly draws an image from an Apple II shape table
; can arbitrarily point to any memory location as a source of these
; some look amazing but depend on random machine state
; to be deterministic you should probably stick to
; $E7-$F0 (the program itself)
; $D000-$FFFF (the ROMs)
; shapetables are a bit complicated to explain here, but they are a
; series of bytes ending with a $00
; (note if you point to a zero, it will be interpreted as an
; action not an end)
; each byte specifies up to 3 actions, DRAW + UP DOWN LEFT RIGHT or
; NODRAW + UP DOWN LEFT RIGHT
; It is vector scaling with SCALE we hardcode to $20 and rotation
; which gets set to 0 after the first iteration, (which is
; why the first shape has arbitrary rotation and gets left)
; we are xdrawing so it will XOR with the current pixels on the screen
; NUP=0 UP=4 zz yyy xxx , does xxx yyy zz
; NRT=1 RT=5
; NDN=2 DN=6
; NLT=3 LT=7
; zero page locations
HGR_SHAPE = $1A
HGR_SHAPE2 = $1B
HGR_BITS = $1C
GBASL = $26
GBASH = $27
A5H = $45
XREG = $46
YREG = $47
; C0-CF should be clear
; D0-DF?? D0-D5 = HGR scratch?
HGR_DX = $D0 ; HGLIN
HGR_DX2 = $D1 ; HGLIN
HGR_DY = $D2 ; HGLIN
HGR_QUADRANT = $D3
HGR_E = $D4
HGR_E2 = $D5
HGR_X = $E0
HGR_X2 = $E1
HGR_Y = $E2
HGR_COLOR = $E4
HGR_HORIZ = $E5
HGR_SCALE = $E7
HGR_SHAPE_TABLE = $E8
HGR_SHAPE_TABLE2= $E9
HGR_COLLISIONS = $EA
HGR_ROTATION = $F9
FRAME = $FC
XPOS = $FD
YPOS = $FF
; ROM calls
HGR2 = $F3D8
HGR = $F3E2
HPOSN = $F411
XDRAW0 = $F65D
XDRAW1 = $F661
RESTORE = $FF3F
.zeropage
.globalzp rot_smc
tiny_xdraw:
jsr HGR2 ; Hi-res, full screen ; 3
; Y=0, A=0 after this call
; we load at $E7 which is HGR_SCALE, so HGR_SCALE gets
; the value of the above JSR instruction ($20)
; A and Y are 0 here.
; X is left behind by the boot process?
txa
jsr HPOSN ; set screen position to X= (y,x) Y=(a)
; saves X,Y,A to zero page
; after Y= orig X/7
; A and X are ??
tiny_loop:
; values for shape table
; Y X
; 00 E7 = neat
; 00 EB = OK
; 00 EF = good
; F0 01 = cool, let's go with it
ldx #$01 ; point to bottom byte of shape address
ldy #$f0 ; point to top byte of shape address
; ROT in A
; this will be 0 2nd time through loop, arbitrary otherwise
; lda #0 ; ROT=0
jsr XDRAW0 ; XDRAW 1 AT X,Y
; Both A and X are 0 at exit
; Z flag set on exit
; Y varies
beq tiny_loop ; bra