mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-09-28 17:55:04 +00:00
flyer: convert to asm
This commit is contained in:
parent
bd193974fe
commit
28128c4820
46
demos/l/flyer_512/Makefile
Normal file
46
demos/l/flyer_512/Makefile
Normal 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: flyer_512.dsk
|
||||
|
||||
flyer_512.dsk: HELLO FLYER
|
||||
cp $(EMPTYDISK) flyer_512.dsk
|
||||
$(DOS33) -y flyer_512.dsk SAVE A HELLO
|
||||
$(DOS33) -y flyer_512.dsk BSAVE -a 0x800 FLYER
|
||||
|
||||
###
|
||||
|
||||
submit: text8.zip
|
||||
|
||||
text8.zip: FLYER flyer.s file_id.diz flyer_512.dsk
|
||||
mkdir -p lovebyte2021_flyer_512
|
||||
cp FLYER ./lovebyte2021_flyer_512
|
||||
cp flyer.s ./lovebyte2021_flyer_512
|
||||
cp file_id.diz ./lovebyte2021_flyer_512
|
||||
cp flyer_512.dsk ./lovebyte2021_flyer_512
|
||||
cp flyer_720p.mp4 ./lovebyte2021_flyer_512
|
||||
zip -r text8.zip lovebyte2021_flyer_512
|
||||
|
||||
####
|
||||
|
||||
|
||||
####
|
||||
|
||||
HELLO: hello.bas
|
||||
$(TOKENIZE) < hello.bas > HELLO
|
||||
|
||||
###
|
||||
|
||||
FLYER: flyer.o
|
||||
ld65 -o FLYER flyer.o -C ./apple2_800.inc
|
||||
|
||||
flyer.o: flyer.s
|
||||
ca65 -o flyer.o flyer.s -l flyer.lst
|
||||
|
||||
####
|
||||
|
||||
clean:
|
||||
rm -f *~ *.o *.lst HELLO FLYER *.zip
|
12
demos/l/flyer_512/apple2_800.inc
Normal file
12
demos/l/flyer_512/apple2_800.inc
Normal 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;
|
||||
}
|
5
demos/l/flyer_512/file_id.diz
Normal file
5
demos/l/flyer_512/file_id.diz
Normal file
@ -0,0 +1,5 @@
|
||||
Tiny Text
|
||||
-
|
||||
Textmode Hex Scroller
|
||||
8-byte Intro for Apple II, Lovebyte 2021
|
||||
by Deater / dSr
|
197
demos/l/flyer_512/flyer.s
Normal file
197
demos/l/flyer_512/flyer.s
Normal file
@ -0,0 +1,197 @@
|
||||
; Flyer
|
||||
|
||||
; by Vince `deater` Weaver, vince@deater.net --- d e s i r e ---
|
||||
|
||||
; zero page locations
|
||||
|
||||
HGR_COLOR = $E4
|
||||
HGR_PAGE = $E6
|
||||
HGR_SCALE = $E7
|
||||
HGR_ROTATION = $F9
|
||||
HORIZON_Y = $FD
|
||||
HORIZON_LINE = $FE
|
||||
FRAME = $FF
|
||||
|
||||
; soft-switches
|
||||
PAGE1 = $C054
|
||||
PAGE2 = $C055
|
||||
|
||||
; ROM calls
|
||||
HGR2 = $F3D8
|
||||
HCLR = $F3F2 ; clear current page to 0
|
||||
BKGND0 = $F3F4 ; clear current page to A
|
||||
HPOSN = $F411 ; move to (Y,X), (A)
|
||||
HPLOT0 = $F457 ; plot at (Y,X), (A)
|
||||
HGLIN = $F53A ; line to (X,A), (Y)
|
||||
XDRAW0 = $F65D
|
||||
|
||||
flyer:
|
||||
jsr HGR2 ; HGR2 HGR_PAGE=$40
|
||||
lda #0
|
||||
sta FRAME
|
||||
|
||||
; ROT=0
|
||||
animate_loop:
|
||||
clc
|
||||
lda #96
|
||||
adc FRAME
|
||||
sta HORIZON_LINE ; S=96+J
|
||||
|
||||
; flip draw page $20/$40
|
||||
lda HGR_PAGE
|
||||
eor #$60
|
||||
sta HGR_PAGE
|
||||
|
||||
cmp #$20
|
||||
beq flip_page2
|
||||
|
||||
flip_page1:
|
||||
bit PAGE1
|
||||
jmp done_flip
|
||||
flip_page2:
|
||||
bit PAGE2
|
||||
done_flip:
|
||||
|
||||
; clear screen
|
||||
jsr HCLR
|
||||
|
||||
|
||||
;===============
|
||||
; draw mountain
|
||||
; FIXME: we in theory only have to do this once
|
||||
; as we never over-write it
|
||||
|
||||
; color = blue (6)
|
||||
|
||||
lda #$D5
|
||||
sta HGR_COLOR
|
||||
|
||||
; HPLOT 0,96 TO 140,80
|
||||
ldy #0
|
||||
ldx #0
|
||||
lda #96
|
||||
jsr HPLOT0 ; plot at (Y,X), (A)
|
||||
|
||||
ldx #0
|
||||
lda #140
|
||||
ldy #80
|
||||
jsr HGLIN ; line to (X,A),(Y)
|
||||
|
||||
; HPLOT TO 279,96
|
||||
|
||||
ldx #1
|
||||
lda #23
|
||||
ldy #96
|
||||
jsr HGLIN
|
||||
|
||||
; color = green (1)
|
||||
lda #$2A
|
||||
sta HGR_COLOR
|
||||
|
||||
horizon_lines_loop:
|
||||
lsr HORIZON_LINE ; S=S/2:Y=96+S
|
||||
clc
|
||||
lda #96
|
||||
adc HORIZON_LINE
|
||||
sta HORIZON_Y
|
||||
|
||||
; HPLOT 0,Y TO 279,Y
|
||||
ldy #0
|
||||
ldx #0
|
||||
lda HORIZON_Y
|
||||
jsr HPLOT0 ; plot at (Y,X), (A)
|
||||
|
||||
ldx #1
|
||||
lda #23
|
||||
ldy HORIZON_Y
|
||||
jsr HGLIN ; line to (X,A),(Y)
|
||||
|
||||
|
||||
;================
|
||||
; draw wicket
|
||||
; XDRAW 1 AT 140,Y
|
||||
|
||||
lda HORIZON_LINE
|
||||
lsr
|
||||
lsr ; SCALE=1+S/5
|
||||
clc
|
||||
adc #1
|
||||
sta HGR_SCALE
|
||||
|
||||
|
||||
|
||||
ldy #0
|
||||
ldx #140
|
||||
lda HORIZON_Y
|
||||
jsr xdraw
|
||||
|
||||
lda HORIZON_LINE
|
||||
bne horizon_lines_loop ; IF S>1 THEN 8
|
||||
|
||||
|
||||
;===================
|
||||
; draw ship
|
||||
; XDRAW 1 AT 140+16*SIN(H),180
|
||||
|
||||
lda #2
|
||||
sta HGR_SCALE ; SCALE=2
|
||||
|
||||
lda FRAME
|
||||
and #$f
|
||||
clc
|
||||
adc 140
|
||||
|
||||
ldy #0
|
||||
tax
|
||||
lda #180
|
||||
jsr xdraw
|
||||
|
||||
; H=H+0.3
|
||||
|
||||
|
||||
; J=(J+12)*(J<84)
|
||||
lda FRAME
|
||||
cmp #84
|
||||
bcs reset_frame
|
||||
|
||||
clc
|
||||
adc #12
|
||||
bne done_frame
|
||||
|
||||
reset_frame:
|
||||
lda #0
|
||||
done_frame:
|
||||
sta FRAME
|
||||
jmp animate_loop
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;=======================
|
||||
; xdraw
|
||||
;=======================
|
||||
xdraw:
|
||||
; setup X and Y co-ords
|
||||
|
||||
; ldy #0 ; XPOSH always 0 for us
|
||||
; ldx XPOS
|
||||
; lda YPOS
|
||||
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
|
||||
|
||||
rts
|
||||
|
||||
|
||||
|
||||
ship_table:
|
||||
.byte "#%%-...",0
|
8
demos/l/flyer_512/hello.bas
Normal file
8
demos/l/flyer_512/hello.bas
Normal 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"
|
Loading…
Reference in New Issue
Block a user