update some graphics examples

This commit is contained in:
Vince Weaver 2021-03-01 11:47:52 -05:00
parent d5b7c3cc6e
commit 3c91576c90
6 changed files with 33 additions and 25 deletions

View File

@ -1,13 +1,14 @@
; Checkers, based on the code in Hellmood's Memories ; Checkers
; vaguely based on a scene in Hellmood's Memories
; 42 bytes ; 32 bytes, for Lovebyte 2021
; could be shorter if you're not picky about colors
; by deater (Vince Weaver) <vince@deater.net> ; by deater (Vince Weaver) <vince@deater.net>
; 42 -- original ; 42 -- original
; 39 -- not fullscreen ; 39 -- not fullscreen
; 36 -- now marches oddly ; 36 -- now marches oddly
; 32 -- colors now rainbow
; Zero Page ; Zero Page
BASL = $28 BASL = $28
@ -55,8 +56,7 @@ checkers:
; init screen ; init screen
jsr SETGR ; 3 jsr SETGR ; 3
; bit FULLGR ; 3 ; bit FULLGR ; 3
;====
; 6
checkers_forever: checkers_forever:
inc FRAME ; 2 inc FRAME ; 2
@ -79,7 +79,8 @@ xloop:
; sbc #0 ; sbc #0
eor X2 eor X2
; ora #$DB
; ora #$DB ; needed for solid colors
; adc #1 ; adc #1
jsr SETCOL jsr SETCOL

Binary file not shown.

View File

@ -1,4 +1,10 @@
; do a (hopefully fast) plasma type demo ; 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 ; 151 -- original
; 137 -- optimize generation ; 137 -- optimize generation
@ -22,11 +28,14 @@
; 132 -- make lookup 8*sin+7 ; 132 -- make lookup 8*sin+7
; 131 -- re-arrange sine table ; 131 -- re-arrange sine table
; 128 -- call into PLOT for MASK seting ; 128 -- call into PLOT for MASK seting
; urgh lovebyte wants 124 byte (counts header)
; 127 -- base YY<<16 by adding smc, not by shifting ; 127 -- base YY<<16 by adding smc, not by shifting
; 125 -- realize that the top byte wraps so no need to and ; 125 -- realize that the top byte wraps so no need to and
; 124 -- re-arrange code to make an CLC unnecessary ; 124 -- re-arrange code to make an CLC unnecessary
; 123 -- qkumba noticed we can use the $FF offset directly in page flip
; urgh lovebyte wants 124 byte (counts header)
; zero page ; zero page
GBASL = $26 GBASL = $26
@ -115,13 +124,15 @@ flip_pages:
; ldy #0 ; ldy #0
iny ; y is $FF, make it 0 ; iny ; y is $FF, make it 0
lda draw_page_smc+1 ; DRAW_PAGE lda draw_page_smc+1 ; DRAW_PAGE
beq done_page bne done_page
iny dey
done_page: done_page:
ldx PAGE1,Y ; set display page to PAGE1 or PAGE2 ; ldx PAGE1,Y ; set display page to PAGE1 or PAGE2
ldx $BF56,Y ; PAGE1 - $FF
eor #$4 ; flip draw page between $400/$800 eor #$4 ; flip draw page between $400/$800
sta draw_page_smc+1 ; DRAW_PAGE sta draw_page_smc+1 ; DRAW_PAGE

View File

@ -3,11 +3,12 @@ include ../../../Makefile.inc
DOS33 = ../../../utils/dos33fs-utils/dos33 DOS33 = ../../../utils/dos33fs-utils/dos33
TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft
LINKERSCRIPTS = ../../../linker_scripts LINKERSCRIPTS = ../../../linker_scripts
EMPTY_DISK = ../../../empty_disk/empty.dsk
all: sier.dsk all: sier.dsk
sier.dsk: HELLO SIER SIER_TINY SIER_64 sier.dsk: HELLO SIER SIER_TINY SIER_64
cp empty.dsk sier.dsk cp $(EMPTY_DISK) sier.dsk
$(DOS33) -y sier.dsk SAVE A HELLO $(DOS33) -y sier.dsk SAVE A HELLO
$(DOS33) -y sier.dsk BSAVE -a 0x36C SIER $(DOS33) -y sier.dsk BSAVE -a 0x36C SIER
$(DOS33) -y sier.dsk BSAVE -a 0x300 SIER_TINY $(DOS33) -y sier.dsk BSAVE -a 0x300 SIER_TINY

Binary file not shown.

View File

@ -1,6 +1,7 @@
; fake sierpinski ; fake sierpinski
; 64-byte Apple II demo
; scrolling and colors ; with scrolling and colors
; by Vince `deater` Weaver, dSr, Lovebyte 2021 ; by Vince `deater` Weaver, dSr, Lovebyte 2021
@ -55,30 +56,24 @@ sier_xloop:
clc clc
adc FRAME adc FRAME
; sta X2
; lda XX
; adc FRAME
; and X2
and XX and XX
bne black bne black
; lda #$11 ; red lda FRAME ; color is based on frame
lda FRAME
lsr lsr
lsr lsr
lsr lsr
lsr lsr
bne not_zero bne not_zero ; but no color 0 (would be all black)
lda #3 lda #3 ; how about purple instead
not_zero: not_zero:
.byte $2C ; bit trick .byte $2C ; bit trick
black: black:
lda #$00 lda #$00
; sta COLOR
jsr SETCOL jsr SETCOL ; set top/bottom nibble same color
ldy XX ldy XX
txa txa