botdemo: add soem more

This commit is contained in:
Vince Weaver 2020-11-10 22:07:19 -05:00
parent ffc852641f
commit 010e0ff9c9
9 changed files with 395 additions and 25 deletions

View File

@ -11,7 +11,7 @@ appleiibot.dsk: E2.BAS FLAME.BAS FLAME2.BAS \
RASTER4.BAS RASTER5.BAS PUMPKIN.BAS PUMPKIN_SMALL.BAS LADY.BAS \
A2.BAS FOURAM.BAS FLOPPY.BAS QR.BAS A2_4EVER.BAS RLE.BAS RLE2.BAS \
RLEASM.BAS HORIZON.BAS FLYER.BAS STAR.BAS HYPER.BAS FASTAR.BAS \
FASTAR2.BAS FASTAR2
FASTAR2.BAS FASTAR2 BIN.BAS
cp empty.dsk appleiibot.dsk
$(DOS33) -y appleiibot.dsk BSAVE -a 0x0300 LOAD
$(DOS33) -y appleiibot.dsk BSAVE -a 0x0C00 FASTAR2
@ -49,6 +49,7 @@ appleiibot.dsk: E2.BAS FLAME.BAS FLAME2.BAS \
$(DOS33) -y appleiibot.dsk SAVE A HYPER.BAS
$(DOS33) -y appleiibot.dsk SAVE A FASTAR.BAS
$(DOS33) -y appleiibot.dsk SAVE A FASTAR2.BAS
$(DOS33) -y appleiibot.dsk SAVE A BIN.BAS
###
@ -126,6 +127,12 @@ NYAN.BAS: nyan.bas
E2.BAS: entropy_small.bas
$(TOKENIZE) < entropy_small.bas > E2.BAS
####
BIN.BAS: bin.bas
$(TOKENIZE) < bin.bas > BIN.BAS
####

View File

@ -30,33 +30,15 @@ HCOLOR = $F6F0 ; color in X (must be 0..7)
sta XH
ldx #0
jmp check_bounds
populate_loop:
; Z = XXYY YYYY
; C=Z*.125
; A=A+(A-64)*C
; B=B+(B-64)*C
; check to see if out of bounds
lda XH
bmi redo_point
lda YH
bpl all_good
redo_point:
; store a break in the lines
lda #0
sta $1000,X
sta $1100,X
sta Z ; needed?
inx
jsr rand16
sta XH
jsr rand16
sta YH
all_good:
; X is in NUM1 for this
@ -112,7 +94,19 @@ do_mult:
lda RESULT+2 ; hight
sta NUM1+1
; add to AA
; add to X; subtract if minus
lda MINUS
beq not_minus
sec
lda #00
sbc NUM1
sta NUM1
lda #00
sbc NUM1+1
sta NUM1+1
not_minus:
clc
lda XL
adc NUM1
@ -128,6 +122,30 @@ do_mult:
adc #$8
sta Z
; check to see if out of bounds
check_bounds:
lda XH
bmi redo_point
lda YH
bpl all_good
redo_point:
; store a break in the lines
lda #0
sta $1000,X
sta $1100,X
sta Z ; needed?
inx
jsr rand16
sta XH
jsr rand16
sta YH
all_good:
; write out
lda XH

BIN
bot_demo/FLYER.BAS Normal file

Binary file not shown.

View File

@ -8,6 +8,7 @@ all: bot_demo.dsk
bot_demo.dsk: HELLO BOTDEMO
cp empty.dsk bot_demo.dsk
$(DOS33) -y bot_demo.dsk BSAVE -a 0x6000 BOTDEMO
$(DOS33) -y bot_demo.dsk BSAVE -a 0x6000 BOTDEMO MYSTERY
$(DOS33) -y bot_demo.dsk SAVE A HELLO

BIN
bot_demo/NYAN.BAS Normal file

Binary file not shown.

BIN
bot_demo/QR.BAS Normal file

Binary file not shown.

6
bot_demo/TODO Normal file
View File

@ -0,0 +1,6 @@
+ music
+ title screen
+ closing screen/credits
+ titles with border around them?
+ "In Mockingboard Sound" (where available)

167
bot_demo/botdemo.s Normal file
View File

@ -0,0 +1,167 @@
; Play music while showing AppleIIbot programs
; by deater (Vince Weaver) <vince@deater.net>
; Zero Page
.include "zp.inc"
.include "hardware.inc"
DONE = 0
DO_LOAD = 1
DO_LIST = 2
DO_RUN = 3
bot_demo:
;===================
; init some stuff
; we have from $6000 to $9600 (DOS 3.3)
; which is $3600 = 12 + 1.5 = 13.5k
; we don't need to set HIMEM as we don't use many vars
; and variable memory starts right after the program it seems
;===================
; PT3 Setup
lda #0
sta DONE_PLAYING
lda #1
sta LOOP
jsr mockingboard_detect
bcc mockingboard_not_found
setup_interrupt:
jsr mockingboard_init
jsr mockingboard_setup_interrupt
jsr reset_ay_both
jsr clear_ay_both
jsr pt3_init_song
start_interrupts:
tsx
stx original_stack
cli
mockingboard_not_found:
;===================
; init screen
jsr TEXT
jsr HOME
bit KEYRESET
; GR part
; bit PAGE1
; bit LORES ; 4
; bit SET_GR ; 4
; bit FULLGR ; 4
;===================
; init vars
; lda #0
; sta DRAW_PAGE
; lda #4
; sta DISP_PAGE
;=============================
; Load desire 1st
; lda #<desire_rle
; sta GBASL
; lda #>desire_rle
; sta GBASH
; lda #$c
; jsr load_rle_gr
; jsr gr_copy_to_current ; copy to page1
; jsr page_flip
; jsr wait_until_keypress
; jsr do_list
; jsr do_list
done:
lda trigger
beq not_trigger
lda #0
sta trigger
lda command
cmp #DONE
beq done
cmp #DO_LIST
bne not_do_list
jmp do_list
not_do_list:
cmp #DO_LOAD
bne not_do_load
jsr do_load
jmp not_trigger
not_do_load:
cmp #DO_RUN
bne not_trigger
jmp do_run
not_trigger:
jmp done
todo_list:
.byte DO_LOAD,1
.byte DO_LIST,4
.byte DO_RUN,10 ; flyer
.byte DO_LOAD,1
.byte DO_LIST,4
.byte DO_RUN,20 ; nyan
.byte DO_LOAD,1
.byte DO_LIST,5
.byte DO_RUN,15 ; qr
.byte DONE,$FF
command: .byte $00
which: .byte $00
timeout: .byte $01
trigger: .byte $00
original_stack: .byte $00
; .include "gr_unrle.s"
; .include "gr_unrle_large.s"
; .include "gr_offsets.s"
; .include "gr_copy.s"
; .include "gr_copy_large.s"
; .include "gr_pageflip.s"
.include "pt3_lib_core.s"
.include "pt3_lib_init.s"
.include "pt3_lib_mockingboard_setup.s"
.include "interrupt_handler.s"
; if you're self patching, detect has to be after interrupt_handler.s
.include "pt3_lib_mockingboard_detect.s"
.include "load.s"
.include "nozp.inc"
PT3_LOC = song
.align $100
song:
.incbin "../pt3_player/music/DF.PT3"

View File

@ -1,9 +1,12 @@
TXTTAB = $67
PRGEND = $AF
VARTAB = $69
CURLIN = $75
ERRFLG = $D8
TXTPTR = $B8
CHRGET = $00B1
SCRTCH = $D64B
RESTART = $D43C
INLIN2 = $D52E
PARSE_INPUT_LINE = $d559
@ -14,6 +17,10 @@ load_file:
;=================
; run list command
do_list:
bit SET_TEXT
bit PAGE0
jsr HOME
lda #<list_string
sta cti_smc+1
lda #>list_string
@ -22,14 +29,34 @@ do_list:
jmp run_command
; want to list from 0 to ffff
;LINNUM = $50
; lda #$00
; sta LINNUM
; sta LINNUM+1
;
; jsr $D61A ; FINDLIN, gets line in LOWTR
;
; lda #$ff
; sta LINNUM
; sta LINNUM+1
;
; jsr $d6da ; LIST_0
; jsr $d6cc ; LIST_0
;
; rts
;=================
; run run command
; a do-run-run, a do-run-run
do_run:
jsr HOME
lda #<run_string
sta cti_smc
lda #>run_string
sta cti_smc+1
lda #>run_string
sta cti_smc+2
jsr copy_to_input
jmp run_command
@ -90,3 +117,147 @@ run_command:
jsr PARSE_INPUT_LINE
jmp TRACE_
;============================
;============================
; do_load
;============================
;============================
do_load:
jsr SCRTCH ; runs "NEW"
; messes with stack :(
lda which_file
asl
asl
tax
lda file_list,X
sta get_size_smc1+1
lda file_list+1,X
sta get_size_smc1+2
clc
lda file_list,X
adc #1
sta get_size_smc2+1
lda file_list+1,X
adc #0
sta get_size_smc2+2
clc
lda file_list,X
adc #2
sta do_load_smc1+1
lda file_list+1,X
adc #0
sta do_load_smc1+2
lda #<($801)
sta do_load_smc2+1
lda #>($801)
sta do_load_smc2+2
get_size_smc1:
lda $dede
sta file_size
get_size_smc2:
lda $dede
sta file_size+1
; always is 0?
lda #0
sta $800
do_load_loop:
do_load_smc1:
lda $dede
do_load_smc2:
sta $0800
inc do_load_smc1+1
bne no_load1_oflo
inc do_load_smc1+2
no_load1_oflo:
inc do_load_smc2+1
bne no_load2_oflo
inc do_load_smc2+2
no_load2_oflo:
lda do_load_smc1+1
cmp file_list+2,X
bne do_load_loop
lda do_load_smc1+2
cmp file_list+3,X
bne do_load_loop
; done with file list, increment
inc which_file
; update all the values
; this is actually from the DOS3.3 code, roughly starting at $A413
; add length to SOP / ASSOP
; TXTTAB $67 -- start of program
; need to add the size and store it in PRGEND $AF and VARTAB $69
clc
lda file_size
ldy file_size+1
adc TXTTAB
tax
tya
adc TXTTAB+1 ; A:X is now end of basic prog
; skip the error check
sta PRGEND+1
sta VARTAB+1
stx PRGEND
stx VARTAB
rts
file_size: .word $dede
which_file: .byte $0
file_list:
.word flyer,flyer_end
.word nyan,nyan_end
.word qr,qr_end
title_list:
.word flyer_title
.word nyan_title
.word qr_title
flyer_title:
.byte 8,10,"HI-RES SHAPETABLE FLYER",0
nyan_title:
.byte 8,10,"HI-RES ANIMATED NYAN CAT",0
qr_title:
.byte 0,10,"MYSTERY BAR CODE WILL NEVER LET YOU DOWN",0
flyer:
.incbin "FLYER.BAS"
flyer_end:
nyan:
.incbin "NYAN.BAS"
nyan_end:
qr:
.incbin "QR.BAS"
qr_end: