hgr: gears
This commit is contained in:
parent
e8b63d7aeb
commit
dac0557a5c
|
@ -27,7 +27,8 @@ appleiibot.dsk: E2.BAS FLAME.BAS FLAME2.BAS HELLO \
|
|||
OOZE.BAS HORIZ_STAR.BAS PLANET.BAS SECRET_COLLECT.BAS PLANET_GR.BAS \
|
||||
BOXES.BAS SOLARIS.BAS SOLARIS2.BAS ASPLODE.BAS SOLARIS3.BAS \
|
||||
TARGET.BAS ELITE.BAS MYSTERY.BAS OFFICE.BAS GR_XOR.BAS \
|
||||
LARGE_XOR.BAS PAR_XOR.BAS PAR_HGR.BAS SIER_XOR.BAS PATTERN_LOGO.BAS
|
||||
LARGE_XOR.BAS PAR_XOR.BAS PAR_HGR.BAS SIER_XOR.BAS PATTERN_LOGO.BAS \
|
||||
GEARS.BAS DSR_LORES.BAS
|
||||
cp $(EMPTY_DISK)/empty_lots_of_dirents.dsk appleiibot.dsk
|
||||
# cp empty.dsk appleiibot.dsk
|
||||
# $(DOS33) -y appleiibot.dsk BSAVE -a 0x0300 LOAD
|
||||
|
@ -147,6 +148,8 @@ appleiibot.dsk: E2.BAS FLAME.BAS FLAME2.BAS HELLO \
|
|||
$(DOS33) -y appleiibot.dsk SAVE A PAR_HGR.BAS
|
||||
$(DOS33) -y appleiibot.dsk SAVE A SIER_XOR.BAS
|
||||
$(DOS33) -y appleiibot.dsk SAVE A PATTERN_LOGO.BAS
|
||||
$(DOS33) -y appleiibot.dsk SAVE A GEARS.BAS
|
||||
$(DOS33) -y appleiibot.dsk SAVE A DSR_LORES.BAS
|
||||
|
||||
|
||||
####
|
||||
|
@ -824,6 +827,16 @@ SIER_XOR.BAS: sier_xor.bas
|
|||
PATTERN_LOGO.BAS: pattern_logo.bas
|
||||
$(TOKENIZE) < pattern_logo.bas > PATTERN_LOGO.BAS
|
||||
|
||||
####
|
||||
|
||||
GEARS.BAS: gears.bas
|
||||
$(TOKENIZE) < gears.bas > GEARS.BAS
|
||||
|
||||
####
|
||||
|
||||
DSR_LORES.BAS: dsr_lores.bas
|
||||
$(TOKENIZE) < dsr_lores.bas > DSR_LORES.BAS
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
1FORI=0TO132:POKE883+I,4*PEEK(2125+I)-204+(PEEK(2258+I/3)-35)/4^(I-INT(I/3)*3):NEXT
|
||||
2&"-ho<GcS2T^X>Q:7fZkV;XBY<PAe4n>Hc[%X6]8;/n[`X3Zq;Hp[:SrWq`FTb2`CG_3[3[*[4JpJ/:]+]3[r;Hp\r;3qec1l4br7lmgdcr,clgjq7T30=r>;^;<X7=FL@@'CO3[+E^5K<WD/%[$DT,,69G*`%GL3C(3$#S-%>OM_\6%4PS&
|
|
@ -0,0 +1,2 @@
|
|||
1FORI=0TO137:POKE1013+I,4*PEEK(2126+I)-204+(PEEK(2264+I/3)-35)/4^(I-INT(I/3)*3):NEXT
|
||||
2&"-hoY4T`QqUM]1:7p[;:I4S1[l]L:7piq[3:I&aq/foY4Tl[3UM]1:7o]RVN4[;;I4[%Xm]L;/nlq[7:I4>HcZr;]r>Db]r;]jDD,RqnO4nO4Yqo2nO2nO.ZQW3]/:JfbqdkK;@3<>3[4V=5#'C*'13[S4&=5'$#$[$D&'#0#4&CC%%0-+;34M/(+
|
|
@ -0,0 +1,53 @@
|
|||
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: both.dsk
|
||||
|
||||
both.dsk: HELLO DSR_LORES PROOF PROOF2
|
||||
cp $(EMPTY_DISK) both.dsk
|
||||
$(DOS33) -y both.dsk SAVE A HELLO
|
||||
$(DOS33) -y both.dsk BSAVE -a 0x373 DSR_LORES
|
||||
$(DOS33) -y both.dsk BSAVE -a 0xC00 PROOF
|
||||
$(DOS33) -y both.dsk BSAVE -a 0xC00 PROOF2
|
||||
|
||||
|
||||
###
|
||||
|
||||
DSR_LORES: dsr_lores.o
|
||||
ld65 -o DSR_LORES dsr_lores.o -C $(LINKER_DIR)/apple2_373.inc
|
||||
|
||||
dsr_lores.o: dsr_lores.s
|
||||
ca65 -o dsr_lores.o dsr_lores.s -l dsr_lores.lst
|
||||
|
||||
###
|
||||
|
||||
PROOF: proof.o
|
||||
ld65 -o PROOF proof.o -C $(LINKER_DIR)/apple2_c00.inc
|
||||
|
||||
proof.o: proof.s
|
||||
ca65 -o proof.o proof.s -l proof.lst
|
||||
|
||||
###
|
||||
|
||||
PROOF2: proof2.o
|
||||
ld65 -o PROOF2 proof2.o -C $(LINKER_DIR)/apple2_c00.inc
|
||||
|
||||
proof2.o: proof2.s
|
||||
ca65 -o proof2.o proof2.s -l proof2.lst
|
||||
|
||||
###
|
||||
|
||||
HELLO: hello.bas
|
||||
$(TOKENIZE) < hello.bas > HELLO
|
||||
|
||||
####
|
||||
|
||||
|
||||
clean:
|
||||
rm -f *~ *.o *.lst HELLO DSR_LORES PROOF PROOF2
|
||||
|
|
@ -0,0 +1,192 @@
|
|||
; dsr rotate lores
|
||||
|
||||
; by deater (Vince Weaver) <vince@deater.net>
|
||||
|
||||
; 147 bytes -- original attempt
|
||||
; 145 bytes -- hires address tables in zero page
|
||||
; 143 bytes -- optimize table init some more
|
||||
; 138 bytes -- swap X and Y in lores code
|
||||
; 136 bytes -- remove unnecessary compare
|
||||
; 135 bytes -- realize with shift, hclr is unneccesary
|
||||
; 134 bytes -- optimize Y usage in inner loop
|
||||
; 132 bytes -- don't need to init rotate?
|
||||
; 135 bytes -- bot jump
|
||||
|
||||
; Zero Page
|
||||
GBASL = $26
|
||||
GBASH = $27
|
||||
COLOR = $30
|
||||
|
||||
HGR_X = $E0
|
||||
HGR_Y = $E2
|
||||
HGR_COLOR = $E4
|
||||
HGR_HORIZ = $E5
|
||||
HGR_PAGE = $E6
|
||||
HGR_SCALE = $E7
|
||||
ROTATION = $FA
|
||||
COUNT = $FC
|
||||
YY = $FD
|
||||
BB = $FE
|
||||
XX = $FF
|
||||
|
||||
; Soft Switches
|
||||
|
||||
SET_GR = $C050
|
||||
SET_TEXT = $C051
|
||||
FULLGR = $C052
|
||||
TEXTGR = $C053
|
||||
|
||||
PAGE1 = $C054 ; Page1
|
||||
PAGE2 = $C055 ; Page2
|
||||
LORES = $C056 ; Enable LORES graphics
|
||||
HIRES = $C057 ; Enable HIRES graphics
|
||||
|
||||
|
||||
; ROM routines
|
||||
|
||||
HGR = $F3E2
|
||||
HGR2 = $F3D8
|
||||
HCLR = $F3F2
|
||||
HPLOT0 = $F457 ; plot at (Y,X), (A)
|
||||
WAIT = $FCA8 ; delay 1/2(26+27A+5A^2) us
|
||||
HPOSN = $F411 ; (Y,X),(A) (valued stores in HGRX,XH,Y)
|
||||
PLOT = $F800 ;; PLOT AT Y,A
|
||||
SETCOL = $F864 ;; COLOR=A
|
||||
XDRAW0 = $F65D
|
||||
|
||||
|
||||
hgr_lookup_h = $40 ; $40-$70
|
||||
hgr_lookup_l = $70 ; $70-$A0
|
||||
|
||||
;hgr_lookup_h = $1000
|
||||
;hgr_lookup_l = $1100
|
||||
|
||||
|
||||
dsr_rotate:
|
||||
|
||||
;===================
|
||||
; init screen
|
||||
|
||||
jsr HGR ; clear PAGE1
|
||||
; A,Y are 0?
|
||||
bit FULLGR
|
||||
|
||||
;===================
|
||||
; init vars
|
||||
|
||||
; sta ROTATION ; start at 0
|
||||
; not needed if don't care start?
|
||||
|
||||
ldx #4
|
||||
stx HGR_SCALE
|
||||
|
||||
;===================
|
||||
; int tables
|
||||
|
||||
ldx #47
|
||||
init_loop:
|
||||
txa
|
||||
jsr HPOSN ; important part is A=ycoord
|
||||
ldx HGR_Y ; A value stored in HGR_Y
|
||||
lda GBASL
|
||||
sta hgr_lookup_l,X
|
||||
lda GBASH
|
||||
sta hgr_lookup_h,X
|
||||
dex
|
||||
bpl init_loop
|
||||
|
||||
|
||||
bit LORES
|
||||
|
||||
|
||||
big_loop:
|
||||
|
||||
;=====================================
|
||||
; draw dsr
|
||||
draw_dsr:
|
||||
|
||||
ldy #0 ; Y 0 here from HCLR
|
||||
ldx #15
|
||||
lda #20
|
||||
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 ??
|
||||
|
||||
ldx #<shape_dsr ; point to bottom byte of shape address
|
||||
ldy #>shape_dsr ; point to top byte of shape address
|
||||
|
||||
; ROT in A
|
||||
lda ROTATION ; ROT=0
|
||||
jsr XDRAW0 ; XDRAW 1 AT X,Y
|
||||
; Both A and X are 0 at exit
|
||||
; Z flag set on exit
|
||||
|
||||
;===============================
|
||||
; copy to lores
|
||||
; X654 3210 X654 3210
|
||||
|
||||
|
||||
|
||||
ldy #47
|
||||
sty YY ; set y-coord to 47
|
||||
lsier_outer:
|
||||
ldx YY ; a bit of a wash
|
||||
lda hgr_lookup_l,X
|
||||
sta hgr_scrn_smc+1
|
||||
lda hgr_lookup_h,X
|
||||
sta hgr_scrn_smc+2
|
||||
|
||||
ldx #0
|
||||
ldy #0 ; COUNT
|
||||
|
||||
lsier_inner:
|
||||
|
||||
lda #6
|
||||
sta BB
|
||||
|
||||
lsier_inner_inner:
|
||||
|
||||
hgr_scrn_smc:
|
||||
lsr $2000,X ; note this also clears screen
|
||||
lda #0
|
||||
bcs no_color
|
||||
|
||||
lda YY ; get Y-coord into A
|
||||
no_color:
|
||||
jsr SETCOL
|
||||
|
||||
lda YY ; y-coord in A
|
||||
; x-coord already in Y
|
||||
|
||||
jsr PLOT ; plot at Y,A
|
||||
|
||||
iny ; increment count
|
||||
cpy #40 ; if hit 40, done
|
||||
beq done_line
|
||||
|
||||
dec BB ; decrement byte count
|
||||
bpl lsier_inner_inner ; if <7 then keep shifting
|
||||
|
||||
inx ; increment hires-x value
|
||||
bne lsier_inner ; bra
|
||||
|
||||
done_line:
|
||||
dec YY ; decrement y-coord
|
||||
bpl lsier_outer ; until less than 0
|
||||
|
||||
end:
|
||||
inc ROTATION
|
||||
inc ROTATION
|
||||
jmp big_loop
|
||||
|
||||
shape_dsr:
|
||||
.byte $2d,$36,$ff,$3f
|
||||
.byte $24,$ad,$22,$24,$94,$21,$2c,$4d
|
||||
.byte $91,$3f,$36,$00
|
||||
|
||||
|
||||
|
||||
; $3F5 - 130 = $373
|
||||
for_bot:
|
||||
jmp dsr_rotate
|
|
@ -0,0 +1,2 @@
|
|||
5 HOME
|
||||
40 PRINT CHR$(4)"CATALOG"
|
|
@ -0,0 +1,146 @@
|
|||
; Parallax Sierpinski/xor boxes HGR
|
||||
|
||||
; by deater (Vince Weaver) <vince@deater.net>
|
||||
|
||||
|
||||
; Zero Page
|
||||
GBASL = $26
|
||||
GBASH = $27
|
||||
|
||||
HGR_X = $E0
|
||||
HGR_Y = $E2
|
||||
HGR_COLOR = $E4
|
||||
HGR_HORIZ = $E5
|
||||
HGR_PAGE = $E6
|
||||
XX = $FF
|
||||
|
||||
; Soft Switches
|
||||
|
||||
SET_GR = $C050
|
||||
SET_TEXT = $C051
|
||||
FULLGR = $C052
|
||||
TEXTGR = $C053
|
||||
|
||||
PAGE1 = $C054 ; Page1
|
||||
PAGE2 = $C055 ; Page2
|
||||
LORES = $C056 ; Enable LORES graphics
|
||||
HIRES = $C057 ; Enable HIRES graphics
|
||||
|
||||
|
||||
; ROM routines
|
||||
|
||||
HGR = $F3E2
|
||||
HGR2 = $F3D8
|
||||
HCLR = $F3F2
|
||||
HPLOT0 = $F457 ; plot at (Y,X), (A)
|
||||
WAIT = $FCA8 ; delay 1/2(26+27A+5A^2) us
|
||||
HPOSN = $F411 ; (Y,X),(A) (valued stores in HGRX,XH,Y)
|
||||
PLOT = $F800 ;; PLOT AT Y,A
|
||||
SETCOL = $F864 ;; COLOR=A
|
||||
|
||||
|
||||
hgr_lookup_h = $1000
|
||||
hgr_lookup_l = $1100
|
||||
div4_lookup = $90
|
||||
|
||||
parallax:
|
||||
|
||||
;===================
|
||||
; init screen
|
||||
|
||||
jsr HGR ; clear PAGE1
|
||||
bit FULLGR
|
||||
|
||||
;===================
|
||||
; int tables
|
||||
|
||||
ldx #191
|
||||
init_loop:
|
||||
txa
|
||||
pha
|
||||
jsr HPOSN
|
||||
pla
|
||||
tax
|
||||
lda GBASL
|
||||
sta hgr_lookup_l,X
|
||||
lda GBASH
|
||||
; and #$1F ; 20 30 001X 40 50 010X
|
||||
sta hgr_lookup_h,X
|
||||
|
||||
dex
|
||||
cpx #$ff
|
||||
bne init_loop
|
||||
|
||||
draw_sier:
|
||||
|
||||
ldx #47
|
||||
sier_outer:
|
||||
lda hgr_lookup_l,X
|
||||
sta GBASL
|
||||
lda hgr_lookup_h,X
|
||||
sta GBASH
|
||||
|
||||
stx XX
|
||||
ldy #39
|
||||
sier_inner:
|
||||
|
||||
tya
|
||||
and XX
|
||||
beq not_zero
|
||||
|
||||
lda #00
|
||||
beq zero
|
||||
not_zero:
|
||||
lda #$7f
|
||||
zero:
|
||||
sta (GBASL),Y
|
||||
|
||||
dey
|
||||
bpl sier_inner
|
||||
|
||||
dex
|
||||
cpx #$ff
|
||||
bne sier_outer
|
||||
|
||||
;===============================
|
||||
; copy to lores
|
||||
|
||||
bit LORES
|
||||
|
||||
|
||||
ldx #47
|
||||
lsier_outer:
|
||||
lda hgr_lookup_l,X
|
||||
sta hgr_scrn_smc+1
|
||||
lda hgr_lookup_h,X
|
||||
sta hgr_scrn_smc+2
|
||||
|
||||
stx XX
|
||||
ldy #39
|
||||
lsier_inner:
|
||||
|
||||
hgr_scrn_smc:
|
||||
lda $2000,Y
|
||||
jsr SETCOL ; color is A
|
||||
|
||||
tya
|
||||
pha
|
||||
|
||||
txa
|
||||
|
||||
jsr PLOT ; plot at Y,A
|
||||
|
||||
pla
|
||||
tay
|
||||
|
||||
dey
|
||||
bpl lsier_inner
|
||||
|
||||
dex
|
||||
cpx #$ff
|
||||
bne lsier_outer
|
||||
|
||||
|
||||
|
||||
end:
|
||||
jmp end
|
|
@ -0,0 +1,179 @@
|
|||
; Parallax Sierpinski/xor boxes HGR
|
||||
|
||||
; by deater (Vince Weaver) <vince@deater.net>
|
||||
|
||||
|
||||
; Zero Page
|
||||
GBASL = $26
|
||||
GBASH = $27
|
||||
|
||||
HGR_X = $E0
|
||||
HGR_Y = $E2
|
||||
HGR_COLOR = $E4
|
||||
HGR_HORIZ = $E5
|
||||
HGR_PAGE = $E6
|
||||
COUNT = $FC
|
||||
AA = $FD
|
||||
BB = $FE
|
||||
XX = $FF
|
||||
|
||||
; Soft Switches
|
||||
|
||||
SET_GR = $C050
|
||||
SET_TEXT = $C051
|
||||
FULLGR = $C052
|
||||
TEXTGR = $C053
|
||||
|
||||
PAGE1 = $C054 ; Page1
|
||||
PAGE2 = $C055 ; Page2
|
||||
LORES = $C056 ; Enable LORES graphics
|
||||
HIRES = $C057 ; Enable HIRES graphics
|
||||
|
||||
|
||||
; ROM routines
|
||||
|
||||
HGR = $F3E2
|
||||
HGR2 = $F3D8
|
||||
HCLR = $F3F2
|
||||
HPLOT0 = $F457 ; plot at (Y,X), (A)
|
||||
WAIT = $FCA8 ; delay 1/2(26+27A+5A^2) us
|
||||
HPOSN = $F411 ; (Y,X),(A) (valued stores in HGRX,XH,Y)
|
||||
PLOT = $F800 ;; PLOT AT Y,A
|
||||
SETCOL = $F864 ;; COLOR=A
|
||||
|
||||
|
||||
hgr_lookup_h = $1000
|
||||
hgr_lookup_l = $1100
|
||||
div4_lookup = $90
|
||||
|
||||
parallax:
|
||||
|
||||
;===================
|
||||
; init screen
|
||||
|
||||
jsr HGR ; clear PAGE1
|
||||
bit FULLGR
|
||||
|
||||
;===================
|
||||
; int tables
|
||||
|
||||
ldx #191
|
||||
init_loop:
|
||||
txa
|
||||
pha
|
||||
jsr HPOSN
|
||||
pla
|
||||
tax
|
||||
lda GBASL
|
||||
sta hgr_lookup_l,X
|
||||
lda GBASH
|
||||
; and #$1F ; 20 30 001X 40 50 010X
|
||||
sta hgr_lookup_h,X
|
||||
|
||||
dex
|
||||
cpx #$ff
|
||||
bne init_loop
|
||||
|
||||
draw_sier:
|
||||
|
||||
ldx #47
|
||||
sier_outer:
|
||||
lda hgr_lookup_l,X
|
||||
sta GBASL
|
||||
lda hgr_lookup_h,X
|
||||
sta GBASH
|
||||
|
||||
stx XX
|
||||
ldy #39
|
||||
sier_inner:
|
||||
|
||||
tya
|
||||
and XX
|
||||
beq not_zero
|
||||
|
||||
lda #00
|
||||
beq zero
|
||||
not_zero:
|
||||
lda #$7f
|
||||
zero:
|
||||
sta (GBASL),Y
|
||||
|
||||
dey
|
||||
bpl sier_inner
|
||||
|
||||
dex
|
||||
cpx #$ff
|
||||
bne sier_outer
|
||||
|
||||
;===============================
|
||||
; copy to lores
|
||||
|
||||
|
||||
; X654 3210 X654 3210
|
||||
|
||||
bit LORES
|
||||
|
||||
|
||||
ldx #47
|
||||
lsier_outer:
|
||||
lda hgr_lookup_l,X
|
||||
sta hgr_scrn_smc+1
|
||||
lda hgr_lookup_h,X
|
||||
sta hgr_scrn_smc+2
|
||||
|
||||
ldy #0
|
||||
sty COUNT
|
||||
lsier_inner:
|
||||
|
||||
|
||||
hgr_scrn_smc:
|
||||
lda $2000,Y
|
||||
sta AA
|
||||
|
||||
lda #6
|
||||
sta BB
|
||||
|
||||
lsier_inner_inner:
|
||||
|
||||
lsr AA
|
||||
bcc zero2
|
||||
|
||||
lda #$f
|
||||
bne notzero2
|
||||
zero2:
|
||||
lda #$0
|
||||
notzero2:
|
||||
jsr SETCOL ; color is A
|
||||
|
||||
tya
|
||||
pha
|
||||
|
||||
ldy COUNT
|
||||
txa
|
||||
|
||||
jsr PLOT ; plot at Y,A
|
||||
|
||||
pla
|
||||
tay
|
||||
|
||||
inc COUNT
|
||||
lda COUNT
|
||||
cmp #40
|
||||
beq done
|
||||
|
||||
dec BB
|
||||
bpl lsier_inner_inner
|
||||
|
||||
iny
|
||||
jmp lsier_inner
|
||||
|
||||
done:
|
||||
|
||||
dex
|
||||
cpx #$ff
|
||||
bne lsier_outer
|
||||
|
||||
|
||||
|
||||
end:
|
||||
jmp end
|
|
@ -15,7 +15,7 @@ paralax.dsk: HELLO BOXES PAR WEIRD WEIRD2 SIER SIER_FAST
|
|||
$(DOS33) -y paralax.dsk BSAVE -a 0x3f5 PAR
|
||||
$(DOS33) -y paralax.dsk BSAVE -a 0xc00 WEIRD
|
||||
$(DOS33) -y paralax.dsk BSAVE -a 0xc00 WEIRD2
|
||||
$(DOS33) -y paralax.dsk BSAVE -a 0xc00 SIER
|
||||
$(DOS33) -y paralax.dsk BSAVE -a 0x3f5 SIER
|
||||
$(DOS33) -y paralax.dsk BSAVE -a 0xc00 SIER_FAST
|
||||
|
||||
###
|
||||
|
@ -56,7 +56,7 @@ weird2.o: weird2.s
|
|||
###
|
||||
|
||||
SIER: sier.o
|
||||
ld65 -o SIER sier.o -C $(LINKER_DIR)/apple2_c00.inc
|
||||
ld65 -o SIER sier.o -C $(LINKER_DIR)/apple2_3f5.inc
|
||||
|
||||
sier.o: sier.s
|
||||
ca65 -o sier.o sier.s -l sier.lst
|
||||
|
|
|
@ -7,16 +7,18 @@ EMPTYDISK = ../../../empty_disk/empty.dsk
|
|||
|
||||
all: gear.dsk
|
||||
|
||||
gear.dsk: HELLO APPLE.BAS GEAR.BAS APPLE2 GEAR LINE32 PATTERN PATTERN_LOGO
|
||||
gear.dsk: HELLO APPLE.BAS GEAR.BAS \
|
||||
APPLE2 GEAR LINE32 PATTERN PATTERN_LOGO SQUARE_WAVE
|
||||
cp $(EMPTYDISK) gear.dsk
|
||||
$(DOS33) -y gear.dsk SAVE A HELLO
|
||||
$(DOS33) -y gear.dsk SAVE A GEAR.BAS
|
||||
$(DOS33) -y gear.dsk SAVE A APPLE.BAS
|
||||
$(DOS33) -y gear.dsk BSAVE -a 0xc00 GEAR
|
||||
$(DOS33) -y gear.dsk BSAVE -a 0x3f5 GEAR
|
||||
$(DOS33) -y gear.dsk BSAVE -a 0xc00 APPLE2
|
||||
$(DOS33) -y gear.dsk BSAVE -a 0xc00 LINE32
|
||||
$(DOS33) -y gear.dsk BSAVE -a 0xc00 PATTERN
|
||||
$(DOS33) -y gear.dsk BSAVE -a 0x3f5 PATTERN_LOGO
|
||||
$(DOS33) -y gear.dsk BSAVE -a 0xc00 SQUARE_WAVE
|
||||
|
||||
###
|
||||
|
||||
|
@ -37,13 +39,22 @@ APPLE.BAS: apple.bas
|
|||
###
|
||||
|
||||
GEAR: gear.o
|
||||
ld65 -o GEAR gear.o -C $(LINKERSCRIPTS)/apple2_c00.inc
|
||||
ld65 -o GEAR gear.o -C $(LINKERSCRIPTS)/apple2_3f5.inc
|
||||
|
||||
gear.o: gear.s
|
||||
ca65 -o gear.o gear.s -l gear.lst
|
||||
|
||||
###
|
||||
|
||||
SQUARE_WAVE: square_wave.o
|
||||
ld65 -o SQUARE_WAVE square_wave.o -C $(LINKERSCRIPTS)/apple2_c00.inc
|
||||
|
||||
square_wave.o: square_wave.s
|
||||
ca65 -o square_wave.o square_wave.s -l square_wave.lst
|
||||
|
||||
|
||||
###
|
||||
|
||||
APPLE2: apple2.o
|
||||
ld65 -o APPLE2 apple2.o -C $(LINKERSCRIPTS)/apple2_c00.inc
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
10 HIMEM:8142
|
||||
20 POKE 232,206:POKE 233,31
|
||||
30 FOR L=8142 TO 8175: READ B:POKE L,B:NEXT L
|
||||
35 HGR:ROT=0:SCALE=2
|
||||
35 HGR:ROT=0:SCALE=10
|
||||
40 FOR I=1 TO 1: XDRAW I AT I*10,100:NEXT I
|
||||
90 END
|
||||
100 DATA 1,0,4,0,39,44,53,142,36,44
|
||||
|
|
|
@ -29,11 +29,24 @@ HGR_SHAPE_TABLE = $E8
|
|||
HGR_SHAPE_TABLE2= $E9
|
||||
HGR_COLLISIONS = $EA
|
||||
HGR_ROTATION = $F9
|
||||
ROTATION = $FA
|
||||
SMALLER = $FB
|
||||
FRAME = $FC
|
||||
FRAMEH = $FD
|
||||
XPOS = $FE
|
||||
YPOS = $FF
|
||||
|
||||
|
||||
; Soft Switches
|
||||
PAGE1 = $C054 ; Page1
|
||||
PAGE2 = $C055 ; Page2
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
; ROM calls
|
||||
HGR2 = $F3D8
|
||||
HGR = $F3E2
|
||||
|
@ -41,118 +54,139 @@ HPOSN = $F411
|
|||
DRAW0 = $F601
|
||||
XDRAW0 = $F65D
|
||||
XDRAW1 = $F661
|
||||
WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us
|
||||
RESTORE = $FF3F
|
||||
|
||||
|
||||
gear:
|
||||
|
||||
|
||||
jsr HGR2 ; Hi-res, full screen ; 3
|
||||
jsr HGR ; Hi-res, full screen ; 3
|
||||
; Y=0, A=0 after this call
|
||||
|
||||
lda #10
|
||||
lda #8
|
||||
sta HGR_SCALE
|
||||
sty SMALLER
|
||||
|
||||
; A and Y are 0 here.
|
||||
; X is left behind by the boot process?
|
||||
|
||||
sty HGR_COLLISIONS
|
||||
;============================
|
||||
; scene 1
|
||||
|
||||
tya
|
||||
tax ; load X with 0
|
||||
; ldy #0
|
||||
; ldx #00
|
||||
; lda #00
|
||||
ldx #110
|
||||
lda #10
|
||||
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 ??
|
||||
pattern_loop:
|
||||
ldy #32
|
||||
jsr draw_gear
|
||||
|
||||
ldx #<pattern_table ; point to bottom byte of shape address
|
||||
ldy #>pattern_table ; point to top byte of shape address
|
||||
ldy #0
|
||||
ldx #235
|
||||
lda #100
|
||||
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 ??
|
||||
|
||||
|
||||
inc SMALLER
|
||||
|
||||
ldy #16
|
||||
jsr draw_gear
|
||||
|
||||
dec SMALLER
|
||||
|
||||
|
||||
;===================
|
||||
; scene2
|
||||
|
||||
jsr HGR2
|
||||
|
||||
lda #8
|
||||
sta HGR_SCALE
|
||||
|
||||
ldy #0
|
||||
ldx #110
|
||||
lda #10
|
||||
jsr HPOSN ; set screen position to X= (y,x) Y=(a)
|
||||
|
||||
lda #<gear2_table
|
||||
sta which_smc+1
|
||||
|
||||
ldy #32
|
||||
jsr draw_gear
|
||||
|
||||
|
||||
ldy #0
|
||||
ldx #235
|
||||
lda #100
|
||||
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 ??
|
||||
|
||||
|
||||
inc SMALLER
|
||||
|
||||
ldy #16
|
||||
jsr draw_gear
|
||||
|
||||
|
||||
;===================
|
||||
; rotate
|
||||
|
||||
blah:
|
||||
bit PAGE1
|
||||
lda #255
|
||||
jsr WAIT
|
||||
|
||||
bit PAGE2
|
||||
lda #255
|
||||
jsr WAIT
|
||||
|
||||
jmp blah
|
||||
|
||||
|
||||
;===============================
|
||||
;===============================
|
||||
;===============================
|
||||
;===============================
|
||||
draw_gear:
|
||||
sty ROTATION
|
||||
gear1_loop:
|
||||
|
||||
inc rot_smc+1
|
||||
inc rot_smc+1
|
||||
lda SMALLER
|
||||
beq not_smaller
|
||||
inc rot_smc+1
|
||||
inc rot_smc+1
|
||||
not_smaller:
|
||||
|
||||
which_smc:
|
||||
ldx #<gear1_table ; point to bottom byte of shape address
|
||||
ldy #>gear1_table ; point to top byte of shape address
|
||||
|
||||
; ROT in A
|
||||
|
||||
; this will be 0 2nd time through loop, arbitrary otherwise
|
||||
rot_smc:
|
||||
lda #1 ; ROT=0
|
||||
jsr XDRAW0 ; XDRAW 1 AT X,Y
|
||||
; Both A and X are 0 at exit
|
||||
; Z flag set on exit
|
||||
; Y varies
|
||||
|
||||
lda HGR_COLLISIONS
|
||||
bne pattern_loop
|
||||
|
||||
oog:
|
||||
|
||||
lda #$7f
|
||||
sta HGR_COLOR
|
||||
|
||||
lda #10
|
||||
sta HGR_SCALE
|
||||
|
||||
lda #3
|
||||
sta FRAME
|
||||
logo_loop1:
|
||||
|
||||
inc xsmc+1
|
||||
inc ysmc+1
|
||||
|
||||
jsr draw_logo
|
||||
|
||||
dec FRAME
|
||||
bne logo_loop1
|
||||
|
||||
lda #$00
|
||||
sta HGR_COLOR
|
||||
|
||||
lda #3
|
||||
sta FRAME
|
||||
logo_loop2:
|
||||
|
||||
jsr draw_logo
|
||||
|
||||
inc xsmc+1
|
||||
inc ysmc+1
|
||||
|
||||
dec FRAME
|
||||
bne logo_loop2
|
||||
|
||||
blah:
|
||||
beq blah
|
||||
|
||||
;===============
|
||||
; draw shape table logo
|
||||
draw_logo:
|
||||
ldy #0
|
||||
xsmc:
|
||||
ldx #96
|
||||
ysmc:
|
||||
lda #150
|
||||
jsr HPOSN ; set screen position to X= (y,x) Y=(a)
|
||||
dec ROTATION
|
||||
bne gear1_loop
|
||||
rts
|
||||
|
||||
|
||||
ldx #<apple_table ; point to bottom byte of shape address
|
||||
ldy #>apple_table ; point to top byte of shape address
|
||||
|
||||
; ROT in A
|
||||
|
||||
; this will be 0 2nd time through loop, arbitrary otherwise
|
||||
lda #52 ; ROT=0
|
||||
jmp DRAW0 ; XDRAW 1 AT X,Y
|
||||
; Both A and X are 0 at exit
|
||||
; Z flag set on exit
|
||||
; Y varies
|
||||
|
||||
|
||||
|
||||
|
||||
pattern_table:
|
||||
.byte $04,$00
|
||||
|
||||
apple_table:
|
||||
.byte $27,$2c,$35,$8e,$24,$2c
|
||||
.byte $35,$be,$09,$24,$2c,$35,$be,$09
|
||||
.byte $20,$24,$8c,$12,$2d,$3c,$37,$2e
|
||||
.byte $0d,$25,$24,$4f,$39,$36,$2e,$00
|
||||
gear1_table:
|
||||
.byte 37,53,0
|
||||
gear2_table:
|
||||
.byte $2c,$2e,$00
|
||||
;gear3_table:
|
||||
;.byte $24,$2d,$36,$2d,$00
|
||||
|
|
|
@ -0,0 +1,95 @@
|
|||
; Pattern Logo
|
||||
|
||||
; by Vince `deater` Weaver
|
||||
|
||||
; 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
|
||||
FRAMEH = $FD
|
||||
XPOS = $FE
|
||||
YPOS = $FF
|
||||
|
||||
; ROM calls
|
||||
HGR2 = $F3D8
|
||||
HGR = $F3E2
|
||||
HPOSN = $F411
|
||||
DRAW0 = $F601
|
||||
XDRAW0 = $F65D
|
||||
XDRAW1 = $F661
|
||||
RESTORE = $FF3F
|
||||
|
||||
|
||||
gear:
|
||||
|
||||
|
||||
jsr HGR2 ; Hi-res, full screen ; 3
|
||||
; Y=0, A=0 after this call
|
||||
|
||||
lda #10
|
||||
sta HGR_SCALE
|
||||
|
||||
; A and Y are 0 here.
|
||||
; X is left behind by the boot process?
|
||||
|
||||
sty HGR_COLLISIONS
|
||||
|
||||
tya
|
||||
tax ; load X with 0
|
||||
; ldy #0
|
||||
; ldx #00
|
||||
; lda #00
|
||||
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 ??
|
||||
pattern_loop:
|
||||
|
||||
ldx #<pattern_table ; point to bottom byte of shape address
|
||||
ldy #>pattern_table ; point to top byte of shape address
|
||||
|
||||
; ROT in A
|
||||
|
||||
; this will be 0 2nd time through loop, arbitrary otherwise
|
||||
lda #1 ; ROT=0
|
||||
jsr XDRAW0 ; XDRAW 1 AT X,Y
|
||||
; Both A and X are 0 at exit
|
||||
; Z flag set on exit
|
||||
; Y varies
|
||||
|
||||
lda HGR_COLLISIONS
|
||||
bne pattern_loop
|
||||
|
||||
|
||||
blah:
|
||||
jmp blah
|
||||
|
||||
|
||||
|
||||
pattern_table:
|
||||
.byte 37,53,0
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
MEMORY {
|
||||
ZP: start = $00, size = $1A, type = rw;
|
||||
RAM: start = $371, 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 = zp;
|
||||
}
|
Loading…
Reference in New Issue