mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-01-29 05:34:29 +00:00
509 lines
7.8 KiB
ArmAsm
509 lines
7.8 KiB
ArmAsm
; Driven Demo, Startup
|
|
|
|
;
|
|
; by deater (Vince Weaver) <vince@deater.net>
|
|
|
|
;.include "zp.inc"
|
|
;.include "hardware.inc"
|
|
;.include "qload.inc"
|
|
;.include "music.inc"
|
|
|
|
DEBUG=0
|
|
|
|
driven_start:
|
|
;=====================
|
|
; initializations
|
|
;=====================
|
|
|
|
jsr hardware_detect
|
|
|
|
jsr hgr_make_tables
|
|
|
|
|
|
;===================
|
|
; restart?
|
|
;===================
|
|
restart:
|
|
lda #0
|
|
sta DRAW_PAGE
|
|
|
|
|
|
;========================
|
|
; fake BIOS
|
|
;========================
|
|
|
|
; lda #13 ; load FAKE_BIOS
|
|
; sta WHICH_LOAD
|
|
|
|
; jsr load_file
|
|
|
|
; run fake boot / fake bios
|
|
|
|
; jsr $6000
|
|
|
|
;==================================
|
|
; load music into the language card
|
|
; into $D000 set 1
|
|
;==================================
|
|
|
|
; read/write RAM, use $d000 bank1
|
|
bit $C083
|
|
bit $C083
|
|
|
|
lda #1 ; load MUSIC from disk
|
|
sta WHICH_LOAD
|
|
|
|
jsr load_file
|
|
|
|
lda #0
|
|
sta DONE_PLAYING
|
|
|
|
lda #1
|
|
sta LOOP
|
|
|
|
; patch mockingboard
|
|
|
|
lda SOUND_STATUS
|
|
beq skip_mbp1
|
|
|
|
jsr mockingboard_patch ; patch to work in slots other than 4?
|
|
|
|
skip_mbp1:
|
|
|
|
;=======================
|
|
; Set up 50Hz interrupt
|
|
;========================
|
|
|
|
jsr mockingboard_init
|
|
jsr mockingboard_setup_interrupt
|
|
|
|
;============================
|
|
; Init the Mockingboard
|
|
;============================
|
|
|
|
jsr reset_ay_both
|
|
jsr clear_ay_both
|
|
|
|
;==================
|
|
; init song
|
|
;==================
|
|
|
|
jsr pt3_init_song
|
|
|
|
dont_enable_mc:
|
|
|
|
skip_all_checks:
|
|
|
|
.if 0
|
|
;====================================
|
|
;====================================
|
|
; Pre-Load some programs into AUX MEM
|
|
;====================================
|
|
;====================================
|
|
; 4 - 9
|
|
|
|
sta $C008 ; use MAIN zero-page/stack/language card
|
|
|
|
;=============================
|
|
; want to load 4..9
|
|
|
|
lda #4
|
|
sta COUNT
|
|
|
|
load_program_loop:
|
|
;============================
|
|
; load next program to MAIN $6000
|
|
|
|
; load from disk
|
|
|
|
lda COUNT ; which one
|
|
sta WHICH_LOAD
|
|
jsr load_file
|
|
|
|
; copy to proper AUX location
|
|
|
|
ldx COUNT
|
|
lda aux_dest,X ; load AUX dest
|
|
pha
|
|
|
|
ldy #$60 ; MAIN src $6000
|
|
|
|
lda length_array,X ; number of pages
|
|
tax ; in X
|
|
pla ; restore AUX dest to A
|
|
|
|
jsr copy_main_aux
|
|
|
|
inc COUNT
|
|
lda COUNT
|
|
cmp #10
|
|
bne load_program_loop
|
|
|
|
.endif
|
|
;=======================
|
|
;=======================
|
|
; Load intro
|
|
;=======================
|
|
;=======================
|
|
|
|
; load from disk
|
|
|
|
lda #2 ; INTRO
|
|
sta WHICH_LOAD
|
|
jsr load_file
|
|
|
|
;=======================
|
|
;=======================
|
|
; Run intro
|
|
;=======================
|
|
;=======================
|
|
|
|
cli ; start music
|
|
|
|
jsr $8000
|
|
|
|
;=======================
|
|
;=======================
|
|
; Run Atrus
|
|
;=======================
|
|
;=======================
|
|
|
|
sei ; stop music interrupts
|
|
jsr mute_ay_both
|
|
jsr clear_ay_both ; stop from making noise
|
|
|
|
; load dni
|
|
|
|
lda #5 ; Atrus
|
|
sta WHICH_LOAD
|
|
jsr load_file
|
|
|
|
|
|
; restart music
|
|
|
|
cli ; start interrupts (music)
|
|
|
|
;======================
|
|
; run atrus
|
|
|
|
jsr $8000
|
|
|
|
;=======================
|
|
;=======================
|
|
; Load GRAPHICS
|
|
;=======================
|
|
;=======================
|
|
|
|
sei ; stop music interrupts
|
|
jsr mute_ay_both
|
|
jsr clear_ay_both ; stop from making noise
|
|
|
|
; load dni
|
|
|
|
lda #6 ; GRAPHICS
|
|
sta WHICH_LOAD
|
|
jsr load_file
|
|
|
|
|
|
; restart music
|
|
|
|
cli ; start interrupts (music)
|
|
|
|
; Run GRAPHICS
|
|
|
|
jsr $6000
|
|
|
|
;=======================
|
|
;=======================
|
|
; Load Credits
|
|
;=======================
|
|
;=======================
|
|
|
|
sei ; stop music interrupts
|
|
jsr mute_ay_both
|
|
jsr clear_ay_both ; stop from making noise
|
|
|
|
; load credits
|
|
|
|
lda #3 ; CREDITS
|
|
sta WHICH_LOAD
|
|
jsr load_file
|
|
|
|
|
|
; restart music
|
|
|
|
cli ; start interrupts (music)
|
|
|
|
; Run Credits
|
|
|
|
|
|
jsr $8000
|
|
.if 0
|
|
;==========================
|
|
;==========================
|
|
; Run 4-9, copy from AUX
|
|
;==========================
|
|
;==========================
|
|
|
|
;=======================
|
|
; run GORILLA (#4)
|
|
;=======================
|
|
; copy GORILLA from AUX $7000 to MAIN $8000
|
|
|
|
lda #$70 ; AUX src $7000
|
|
ldy #$80 ; MAIN dest $8000
|
|
ldx #32 ; 16 pages
|
|
jsr copy_aux_main
|
|
|
|
.if DEBUG=1
|
|
; debug gorilla music
|
|
lda #25
|
|
sta current_pattern_smc+1
|
|
jsr pt3_set_pattern
|
|
.endif
|
|
|
|
; run gorilla
|
|
|
|
jsr $8000
|
|
|
|
;=======================
|
|
; run LEAVES (#5)
|
|
;=======================
|
|
; copy LEAVES from AUX $5000 to MAIN $8000
|
|
|
|
lda #$50 ; AUX src $5000
|
|
ldy #$80 ; MAIN dest $8000
|
|
ldx #32 ; 16 pages
|
|
jsr copy_aux_main
|
|
|
|
.if DEBUG=1
|
|
; debug leaves music
|
|
lda #30
|
|
sta current_pattern_smc+1
|
|
jsr pt3_set_pattern
|
|
.endif
|
|
|
|
; run leaves
|
|
|
|
jsr $8000
|
|
|
|
|
|
;=======================
|
|
; run LENS/ROTOZOOM (#6)
|
|
;=======================
|
|
; copy LENS from AUX $4000 to MAIN $6000
|
|
|
|
lda #$40 ; AUX src $4000
|
|
ldy #$60 ; MAIN dest $6000
|
|
ldx #16 ; 16 pages
|
|
jsr copy_aux_main
|
|
|
|
.if DEBUG=1
|
|
; debug lens music
|
|
lda #34
|
|
sta current_pattern_smc+1
|
|
jsr pt3_set_pattern
|
|
.endif
|
|
|
|
; run lens
|
|
|
|
jsr $6000
|
|
|
|
|
|
;=======================
|
|
; run PLASMA (#7)
|
|
;=======================
|
|
; copy PLASMA from AUX $3000 to MAIN $8000
|
|
|
|
lda #$30 ; AUX src $3000
|
|
ldy #$80 ; MAIN dest $8000
|
|
ldx #16 ; 16 pages
|
|
jsr copy_aux_main
|
|
|
|
.if DEBUG=1
|
|
; debug plasma music
|
|
lda #47
|
|
sta current_pattern_smc+1
|
|
jsr pt3_set_pattern
|
|
.endif
|
|
|
|
; run plasma
|
|
|
|
jsr $8000
|
|
|
|
;=======================
|
|
; run PLASMACUBE (#8)
|
|
;=======================
|
|
; copy PLASMACUBE from AUX $2000 to MAIN $8000
|
|
|
|
lda #$20 ; AUX src $2000
|
|
ldy #$80 ; MAIN dest $8000
|
|
ldx #16 ; 16 pages
|
|
jsr copy_aux_main
|
|
|
|
.if DEBUG=1
|
|
; debug plasmacube music
|
|
lda #52
|
|
sta current_pattern_smc+1
|
|
jsr pt3_set_pattern
|
|
.endif
|
|
|
|
; run plasmacube
|
|
|
|
jsr $8000
|
|
|
|
;=======================
|
|
; run DOTS (#9)
|
|
;=======================
|
|
; copy DOTS from AUX $1000 to MAIN $8000
|
|
|
|
lda #$10 ; AUX src $1000
|
|
ldy #$80 ; MAIN dest $8000
|
|
ldx #16 ; 16 pages
|
|
jsr copy_aux_main
|
|
|
|
.if DEBUG=1
|
|
; debug dots music
|
|
lda #60
|
|
sta current_pattern_smc+1
|
|
jsr pt3_set_pattern
|
|
.endif
|
|
; run dots
|
|
|
|
jsr $8000
|
|
|
|
|
|
;=======================
|
|
;=======================
|
|
; Load 10-12 to RAM
|
|
;=======================
|
|
;=======================
|
|
|
|
; disable music
|
|
|
|
sei
|
|
|
|
jsr mute_ay_both ; stop from making noise
|
|
|
|
;=============================
|
|
; want to load 10..12
|
|
|
|
lda #10
|
|
sta COUNT
|
|
|
|
load_program_loop2:
|
|
;============================
|
|
; load next program to MAIN $6000
|
|
|
|
; load from disk
|
|
|
|
lda COUNT ; which one
|
|
sta WHICH_LOAD
|
|
jsr load_file
|
|
|
|
; copy to proper AUX location
|
|
|
|
ldx COUNT
|
|
lda aux_dest,X ; load AUX dest
|
|
pha
|
|
|
|
ldy #$60 ; MAIN src $6000
|
|
|
|
lda length_array,X ; number of pages
|
|
tax ; in X
|
|
pla ; restore AUX dest to A
|
|
|
|
jsr copy_main_aux
|
|
|
|
inc COUNT
|
|
lda COUNT
|
|
cmp #13
|
|
bne load_program_loop2
|
|
|
|
|
|
;==========================
|
|
;==========================
|
|
; Run 10-12
|
|
;==========================
|
|
;==========================
|
|
|
|
; restart music
|
|
|
|
jsr unmute_ay_both ; restart
|
|
cli
|
|
|
|
;=======================
|
|
; run SPHERES
|
|
;============================================
|
|
; copy SPHERES from AUX $8000 to MAIN $8000
|
|
|
|
lda #$80 ; AUX src $8000
|
|
ldy #$80 ; MAIN dest $8000
|
|
ldx #16 ; 16 pages
|
|
jsr copy_aux_main
|
|
|
|
.if DEBUG=1
|
|
; debug spheres music
|
|
lda #68
|
|
sta current_pattern_smc+1
|
|
jsr pt3_set_pattern
|
|
.endif
|
|
|
|
jsr $8000
|
|
|
|
;=======================
|
|
; run OCEAN
|
|
;=======================
|
|
; copy OCEAN from AUX $2000 to MAIN $6000
|
|
|
|
lda #$20 ; AUX src $1000
|
|
ldy #$60 ; MAIN dest $6000
|
|
ldx #96 ; 16 pages
|
|
jsr copy_aux_main
|
|
|
|
.if DEBUG=1
|
|
; debug ocean music
|
|
lda #72
|
|
sta current_pattern_smc+1
|
|
jsr pt3_set_pattern
|
|
.endif
|
|
|
|
jsr $6000
|
|
|
|
;=======================
|
|
; run POLAR
|
|
;=======================
|
|
; copy POLAR from AUX $1000 to MAIN $8000
|
|
|
|
lda #$10 ; AUX src $1000
|
|
ldy #$80 ; MAIN dest $8000
|
|
ldx #16 ; 16 pages
|
|
jsr copy_aux_main
|
|
|
|
.if DEBUG=1
|
|
; setup music ocean=pattern24 (3:07) pattern#47
|
|
; lda #76
|
|
; sta current_pattern_smc+1
|
|
; jsr pt3_set_pattern
|
|
.endif
|
|
|
|
; run polar
|
|
|
|
jsr $8000
|
|
|
|
.endif
|
|
|
|
forever:
|
|
jmp forever
|
|
|
|
;.align $100
|
|
.include "wait_keypress.s"
|
|
.include "zx02_optim.s"
|
|
|
|
.include "gs_interrupt.s"
|
|
|
|
|
|
.include "pt3_lib_mockingboard_patch.s"
|
|
|
|
.include "hardware_detect.s"
|