mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-09-28 02:55:03 +00:00
hgr: solaris: trying to fit
This commit is contained in:
parent
17114d2728
commit
021d88784f
@ -7,10 +7,13 @@ EMPTYDISK = ../../../empty_disk/empty.dsk
|
||||
|
||||
all: solaris.dsk
|
||||
|
||||
solaris.dsk: HELLO SOLARIS
|
||||
solaris.dsk: HELLO SOLARIS SOLARIS2 SOLARIS3 SOLARIS4
|
||||
cp $(EMPTYDISK) solaris.dsk
|
||||
$(DOS33) -y solaris.dsk SAVE A HELLO
|
||||
$(DOS33) -y solaris.dsk BSAVE -a 0xc00 SOLARIS
|
||||
$(DOS33) -y solaris.dsk BSAVE -a 0xc00 SOLARIS2
|
||||
$(DOS33) -y solaris.dsk BSAVE -a 0xc00 SOLARIS3
|
||||
$(DOS33) -y solaris.dsk BSAVE -a 0xc00 SOLARIS4
|
||||
|
||||
###
|
||||
|
||||
@ -28,6 +31,32 @@ solaris.o: solaris.s
|
||||
|
||||
###
|
||||
|
||||
clean:
|
||||
rm -f *~ *.o *.lst HELLO SOLARIS
|
||||
|
||||
SOLARIS2: solaris2.o
|
||||
ld65 -o SOLARIS2 solaris2.o -C $(LINKERSCRIPTS)/apple2_c00.inc
|
||||
|
||||
solaris2.o: solaris2.s
|
||||
ca65 -o solaris2.o solaris2.s -l solaris2.lst
|
||||
|
||||
###
|
||||
|
||||
SOLARIS3: solaris3.o
|
||||
ld65 -o SOLARIS3 solaris3.o -C $(LINKERSCRIPTS)/apple2_c00.inc
|
||||
|
||||
solaris3.o: solaris3.s
|
||||
ca65 -o solaris3.o solaris3.s -l solaris3.lst
|
||||
|
||||
###
|
||||
|
||||
SOLARIS4: solaris4.o
|
||||
ld65 -o SOLARIS4 solaris4.o -C $(LINKERSCRIPTS)/apple2_c00.inc
|
||||
|
||||
solaris4.o: solaris4.s
|
||||
ca65 -o solaris4.o solaris4.s -l solaris4.lst
|
||||
|
||||
|
||||
|
||||
###
|
||||
|
||||
clean:
|
||||
rm -f *~ *.o *.lst HELLO SOLARIS SOLARIS2 SOLARIS3 SOLARIS4
|
||||
|
98
graphics/hgr/solaris/solaris2.s
Normal file
98
graphics/hgr/solaris/solaris2.s
Normal file
@ -0,0 +1,98 @@
|
||||
; Solaris scrolling code
|
||||
|
||||
; 235 bytes = direct port
|
||||
; 162 bytes = updated version
|
||||
; 158 bytes = offset in X
|
||||
; 156 bytes = bit trick
|
||||
; 153 bytes = eliminate count
|
||||
; 151 bytes = questionably init count to value in Y
|
||||
; 150 bytes = remove unnecessary init
|
||||
|
||||
; zero page
|
||||
GBASL = $26
|
||||
GBASH = $27
|
||||
|
||||
HGR_X = $E0
|
||||
HGR_XH = $E1
|
||||
HGR_Y = $E2
|
||||
HGR_COLOR = $E4
|
||||
HGR_PAGE = $E6
|
||||
|
||||
; soft-switches
|
||||
FULLGR = $C052
|
||||
PAGE1 = $C054
|
||||
|
||||
; ROM routines
|
||||
|
||||
HGR2 = $F3D8
|
||||
HPOSN = $F411 ; (Y,X),(A) (values stores in HGRX,XH,Y)
|
||||
; put in GBASL/GBASH
|
||||
|
||||
WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us
|
||||
|
||||
COUNT = $FE
|
||||
FRAME = $FF
|
||||
|
||||
solaris2:
|
||||
|
||||
jsr HGR2
|
||||
|
||||
outer_loop:
|
||||
sty COUNT ; reset count to 0 (first) or FF (from loop)
|
||||
|
||||
dex ; decrement offset
|
||||
txa
|
||||
and #$f ; make sure stays less than 16
|
||||
tax
|
||||
|
||||
inner_loop:
|
||||
sec
|
||||
lda #160
|
||||
sbc COUNT ; YY = 160-COUNT
|
||||
|
||||
jsr HPOSN ; calculate line addr in GBASL/H, trashes all
|
||||
|
||||
ldx HGR_X ; restore offset
|
||||
|
||||
lda lookup,X ; see if match count
|
||||
cmp COUNT
|
||||
|
||||
bne skip_color
|
||||
|
||||
clc ; needed?
|
||||
txa
|
||||
adc #16
|
||||
tax
|
||||
|
||||
lda #$00 ; draw black
|
||||
|
||||
.byte $2C
|
||||
; jmp no_color
|
||||
|
||||
skip_color:
|
||||
lda #$FF
|
||||
|
||||
no_color:
|
||||
ldy #39 ; draw horizontal line at GBASL
|
||||
inner_inner_loop:
|
||||
sta (GBASL),Y
|
||||
dey
|
||||
bpl inner_inner_loop
|
||||
|
||||
; Y is FF here
|
||||
|
||||
inc COUNT
|
||||
lda COUNT
|
||||
cmp #83
|
||||
bne inner_loop
|
||||
|
||||
beq outer_loop
|
||||
|
||||
lookup:
|
||||
.byte 2, 5, 8,11,14,16,19,21,23,25,27,29,31,32,34,36
|
||||
.byte 37,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54
|
||||
.byte 55,56,57,57,58,59,60,60,61,62,62,63,64,64,65,65
|
||||
.byte 66,66,67,67,68,68,69,69,70,70,71,71,71,72,72,73
|
||||
.byte 73,73,74,74,75,75,75,76,76,76,77,77,77,77,78,78
|
||||
.byte 78,79,79,79,79,80,80,80,80,81,81,81,81,82,82,82
|
||||
|
150
graphics/hgr/solaris/solaris3.s
Normal file
150
graphics/hgr/solaris/solaris3.s
Normal file
@ -0,0 +1,150 @@
|
||||
; Solaris scrolling code
|
||||
|
||||
; 150 bytes = from solaris2
|
||||
; 102 bytes = drop half terms from lookup table
|
||||
; 122 bytes = page flipping
|
||||
; 158 bytes = add spaceship
|
||||
|
||||
; zero page
|
||||
GBASL = $26
|
||||
GBASH = $27
|
||||
|
||||
HGR_X = $E0
|
||||
HGR_XH = $E1
|
||||
HGR_Y = $E2
|
||||
HGR_COLOR = $E4
|
||||
HGR_PAGE = $E6
|
||||
HGR_SCALE = $E7
|
||||
|
||||
; soft-switches
|
||||
FULLGR = $C052
|
||||
PAGE1 = $C054
|
||||
|
||||
; ROM routines
|
||||
|
||||
HGR = $F3E2
|
||||
HGR2 = $F3D8
|
||||
HPOSN = $F411 ; (Y,X),(A) (values stores in HGRX,XH,Y)
|
||||
; put in GBASL/GBASH
|
||||
|
||||
WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us
|
||||
|
||||
DRAW0 = $F601
|
||||
XDRAW0 = $F65D
|
||||
|
||||
COUNT = $FE
|
||||
FRAME = $FF
|
||||
|
||||
solaris2:
|
||||
|
||||
jsr HGR
|
||||
jsr HGR2
|
||||
|
||||
lda #2
|
||||
sta HGR_SCALE
|
||||
|
||||
outer_loop:
|
||||
ldy #0
|
||||
sty COUNT ; reset count to 0 (first) or FF (from loop)
|
||||
|
||||
dex ; decrement offset
|
||||
txa
|
||||
and #$7 ; make sure stays less than 16
|
||||
tax
|
||||
|
||||
inner_loop:
|
||||
sec
|
||||
lda #160
|
||||
sbc COUNT ; YY = 160-COUNT
|
||||
|
||||
jsr HPOSN ; calculate line addr in GBASL/H, trashes all
|
||||
|
||||
ldx HGR_X ; restore offset
|
||||
|
||||
lda lookup,X ; see if match count
|
||||
cmp COUNT
|
||||
|
||||
bne skip_color
|
||||
|
||||
clc ; needed?
|
||||
txa
|
||||
adc #8
|
||||
tax
|
||||
|
||||
lda #$00 ; draw black
|
||||
|
||||
.byte $2C
|
||||
; jmp no_color
|
||||
|
||||
skip_color:
|
||||
lda #$FF
|
||||
|
||||
no_color:
|
||||
ldy #39 ; draw horizontal line at GBASL
|
||||
inner_inner_loop:
|
||||
sta (GBASL),Y
|
||||
dey
|
||||
bpl inner_inner_loop
|
||||
|
||||
; Y is FF here
|
||||
|
||||
inc COUNT
|
||||
lda COUNT
|
||||
cmp #84
|
||||
bne inner_loop
|
||||
|
||||
txa
|
||||
pha
|
||||
|
||||
ldy #0 ; XPOSH always 0 for us
|
||||
ldx #135
|
||||
lda #150
|
||||
jsr HPOSN ; X= (y,x) Y=(a)
|
||||
|
||||
ldx #<ship_table
|
||||
ldy #>ship_table
|
||||
|
||||
lda #0 ; set rotation
|
||||
|
||||
jsr XDRAW0 ; XDRAW 1 AT X,Y
|
||||
; Both A and X are 0 at exit
|
||||
|
||||
pla
|
||||
tax
|
||||
|
||||
|
||||
ldy #$FF
|
||||
flip_pages:
|
||||
|
||||
; Y should be $FF here
|
||||
|
||||
lda HGR_PAGE ; will be $20/$40
|
||||
eor #$60 ; flip draw page between $2000/$4000
|
||||
sta HGR_PAGE
|
||||
|
||||
cmp #$40
|
||||
bne done_page
|
||||
dey
|
||||
done_page:
|
||||
lda PAGE1-$FE,Y ; set display page to PAGE1 or PAGE2
|
||||
|
||||
jmp outer_loop
|
||||
|
||||
lookup:
|
||||
.byte 2, 8,14,19,23,27,31,34
|
||||
.byte 37,40,43,45,47,49,51,53
|
||||
.byte 55,57,58,60,61,62,64,65
|
||||
.byte 66,67,68,69,70,71,71,72
|
||||
.byte 73,74,75,75,76,77,77,78
|
||||
.byte 78,79,79,80,80,81,81,82
|
||||
|
||||
|
||||
ship_table:
|
||||
.byte $23 ; 00 100 011 NLT UP X
|
||||
.byte $25 ; 00 100 101 RT UP X
|
||||
.byte $25 ; 00 100 101 RT UP X
|
||||
.byte $2D ; 00 101 101 RT RT X
|
||||
.byte $2E ; 00 101 110 DN RT X
|
||||
.byte $2E ; 00 101 110 DN RT X
|
||||
.byte $0E ; 00 001 110 NDN RT X
|
||||
.byte $0
|
136
graphics/hgr/solaris/solaris4.s
Normal file
136
graphics/hgr/solaris/solaris4.s
Normal file
@ -0,0 +1,136 @@
|
||||
; Solaris scrolling code
|
||||
|
||||
; 150 bytes = from solaris2
|
||||
; 102 bytes = drop half terms from lookup table
|
||||
; 122 bytes = page flipping
|
||||
; 144 bytes = got some stars going
|
||||
; 143 bytes = re-arrange color assignment
|
||||
|
||||
; zero page
|
||||
GBASL = $26
|
||||
GBASH = $27
|
||||
|
||||
HGR_X = $E0
|
||||
HGR_XH = $E1
|
||||
HGR_Y = $E2
|
||||
HGR_COLOR = $E4
|
||||
HGR_PAGE = $E6
|
||||
HGR_SCALE = $E7
|
||||
|
||||
; soft-switches
|
||||
FULLGR = $C052
|
||||
PAGE1 = $C054
|
||||
|
||||
; ROM routines
|
||||
|
||||
HGR = $F3E2
|
||||
HGR2 = $F3D8
|
||||
HPOSN = $F411 ; (Y,X),(A) (values stores in HGRX,XH,Y)
|
||||
; put in GBASL/GBASH
|
||||
|
||||
WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us
|
||||
|
||||
DRAW0 = $F601
|
||||
XDRAW0 = $F65D
|
||||
|
||||
COUNT = $FE
|
||||
FRAME = $FF
|
||||
|
||||
solaris4:
|
||||
|
||||
jsr HGR
|
||||
jsr HGR2
|
||||
|
||||
draw_stars:
|
||||
|
||||
ldx #32
|
||||
lda #1
|
||||
draw_stars_loop:
|
||||
ldy $D000,X
|
||||
stars1_smc:
|
||||
sta $2000,Y
|
||||
stars2_smc:
|
||||
sta $4000,Y
|
||||
inc stars1_smc+2
|
||||
inc stars2_smc+2
|
||||
dex
|
||||
bpl draw_stars_loop
|
||||
|
||||
|
||||
; X = FF here
|
||||
|
||||
outer_loop:
|
||||
|
||||
dex ; decrement offset
|
||||
txa
|
||||
and #$7 ; make sure stays less than 8
|
||||
tax
|
||||
|
||||
ldy #0
|
||||
; sty COUNT ; reset count to 0
|
||||
inner_loop:
|
||||
; count is in Y here
|
||||
sty COUNT
|
||||
sec
|
||||
lda #191
|
||||
sbc COUNT ; YY = 160-COUNT
|
||||
|
||||
jsr HPOSN ; calculate line addr in GBASL/H, trashes all
|
||||
|
||||
ldx HGR_X ; restore offset
|
||||
|
||||
lda #$ff ; default is white
|
||||
|
||||
ldy lookup,X ; see if match count
|
||||
cpy COUNT
|
||||
|
||||
bne skip_color
|
||||
|
||||
; clc ; needed?
|
||||
; carry always set here
|
||||
txa
|
||||
adc #7
|
||||
tax
|
||||
|
||||
lda #$00 ; draw black
|
||||
|
||||
skip_color:
|
||||
|
||||
|
||||
ldy #39 ; draw horizontal line at GBASL
|
||||
inner_inner_loop:
|
||||
sta (GBASL),Y
|
||||
dey
|
||||
bpl inner_inner_loop
|
||||
|
||||
; Y is FF here
|
||||
|
||||
ldy COUNT
|
||||
iny
|
||||
cpy #84
|
||||
bne inner_loop
|
||||
|
||||
|
||||
flip_pages:
|
||||
|
||||
; Y should be 84 here
|
||||
|
||||
lda HGR_PAGE ; will be $20/$40
|
||||
eor #$60 ; flip draw page between $2000/$4000
|
||||
sta HGR_PAGE
|
||||
|
||||
cmp #$40
|
||||
bne done_page
|
||||
dey
|
||||
done_page:
|
||||
lda PAGE1-83,Y ; set display page to PAGE1 or PAGE2
|
||||
|
||||
jmp outer_loop
|
||||
|
||||
lookup:
|
||||
.byte 2, 8,14,19,23,27,31,34
|
||||
.byte 37,40,43,45,47,49,51,53
|
||||
.byte 55,57,58,60,61,62,64,65
|
||||
.byte 66,67,68,69,70,71,71,72
|
||||
.byte 73,74,75,75,76,77,77,78
|
||||
.byte 78,79,79,80,80,81,81,82
|
118
graphics/hgr/solaris/wiggle.s
Normal file
118
graphics/hgr/solaris/wiggle.s
Normal file
@ -0,0 +1,118 @@
|
||||
; Solaris scrolling code
|
||||
|
||||
|
||||
; 256 bytes = original
|
||||
; 240 bytes = don't initialize things unnecessarily
|
||||
; 239 bytes = optimize branches
|
||||
; 235 bytes = no lookup table for log2
|
||||
|
||||
; zero page
|
||||
GBASL = $26
|
||||
GBASH = $27
|
||||
|
||||
HGR_X = $E0
|
||||
HGR_XH = $E1
|
||||
HGR_Y = $E2
|
||||
HGR_COLOR = $E4
|
||||
HGR_PAGE = $E6
|
||||
|
||||
; soft-switches
|
||||
FULLGR = $C052
|
||||
PAGE1 = $C054
|
||||
|
||||
; ROM routines
|
||||
|
||||
HGR2 = $F3D8
|
||||
HPOSN = $F411 ; (Y,X),(A) (values stores in HGRX,XH,Y)
|
||||
; put in GBASL/GBASH
|
||||
|
||||
WAIT = $FCA8 ;; delay 1/2(26+27A+5A^2) us
|
||||
|
||||
OFFSET = $FA
|
||||
INL = $FB
|
||||
INH = $FC
|
||||
YY = $FD
|
||||
MASK = $FE
|
||||
FRAME = $FF
|
||||
|
||||
;surtb3 = $1000
|
||||
;surtb4 = $1083
|
||||
|
||||
; 0 1 2 3 4 5 6 7
|
||||
; 01 02 04 08 10 20 40 80
|
||||
; 5 2 7 4 1 7 4 1 6
|
||||
; 20(13) 04(13) 80(66) 10(66) 02(66) 80(13) 10(13) 02(13) 40(66)
|
||||
|
||||
solaris:
|
||||
|
||||
jsr HGR2
|
||||
|
||||
outer_loop:
|
||||
dec FRAME
|
||||
lda FRAME
|
||||
|
||||
and #$f
|
||||
sta OFFSET
|
||||
|
||||
ldx #83
|
||||
stx YY
|
||||
inner_loop:
|
||||
|
||||
lda YY
|
||||
|
||||
jsr HPOSN
|
||||
|
||||
ldx OFFSET
|
||||
|
||||
lda lookup,X
|
||||
cmp YY
|
||||
|
||||
beq skip_color
|
||||
lda #$FF
|
||||
|
||||
clc
|
||||
lda OFFSET
|
||||
adc #16
|
||||
sta OFFSET
|
||||
|
||||
skip_color:
|
||||
|
||||
ldy #39 ; draw horizontal line at GBASL
|
||||
inner_inner_loop:
|
||||
sta (GBASL),Y
|
||||
dey
|
||||
bpl inner_inner_loop
|
||||
|
||||
inc YY
|
||||
|
||||
dex
|
||||
bne inner_loop
|
||||
|
||||
beq outer_loop
|
||||
|
||||
lookup:
|
||||
.byte 2, 5, 8,11,14,16,19,21,23,25,27,29,31,32,34,36
|
||||
.byte 37,39,40,41,43,44,45,46,47,48,49,50,51,52,53,54
|
||||
.byte 55,56,57,57,58,59,60,60,61,62,62,63,64,64,65,65
|
||||
.byte 66,66,67,67,68,68,69,69,70,70,71,71,71,72,72,73
|
||||
.byte 73,73,74,74,75,75,75,76,76,76,77,77,77,77,78,78
|
||||
.byte 78,79,79,79,79,80,80,80,80,81,81,81,81,82,82,82
|
||||
|
||||
.if 0
|
||||
.byte 2,37,55,66,73,78
|
||||
.byte 5,39,56,66,73,79
|
||||
.byte 8,40,57,67,74,79
|
||||
.byte 11,41,57,67,74,79
|
||||
.byte 14,43,58,68,75,79
|
||||
.byte 16,44,59,68,75,80
|
||||
.byte 19,45,60,69,75,80
|
||||
.byte 21,46,60,69,76,80
|
||||
.byte 23,47,61,70,76,80
|
||||
.byte 25,48,62,70,76,81
|
||||
.byte 27,49,62,71,77,81
|
||||
.byte 29,50,63,71,77,81
|
||||
.byte 31,51,64,71,77,81
|
||||
.byte 32,52,64,72,77,82
|
||||
.byte 34,53,65,72,78,82
|
||||
.byte 36,54,65,73,78,82
|
||||
.endif
|
Loading…
Reference in New Issue
Block a user