dos33fsprogs/demos/applebot_demo/botdemo.s

174 lines
2.9 KiB
ArmAsm
Raw Normal View History

2020-11-11 03:07:19 +00:00
; Play music while showing AppleIIbot programs
; by deater (Vince Weaver) <vince@deater.net>
; Zero Page
.include "zp.inc"
.include "hardware.inc"
2020-11-15 03:45:18 +00:00
STROUT = $db3a
2020-11-17 20:33:00 +00:00
NONE = 0
DO_LOAD = 1
DO_LIST = 2
DO_RUN = 3
DO_CREDITS = 4
DONE = 5
2020-11-11 03:07:19 +00:00
2020-11-16 05:12:56 +00:00
;==========================================
; we are loaded at $6000
;
; since we are now decompressed here after load
; we don't have to worry about running into DOS3.3 at $9600
;
; we shouldn't need to set HIMEM as we don't use many vars
; and variable memory starts right after the program
2020-11-11 03:07:19 +00:00
bot_demo:
;===================
2020-11-16 05:12:56 +00:00
; PT3 player Setup
2020-11-11 03:07:19 +00:00
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
2020-11-16 05:12:56 +00:00
;===================
2020-11-11 03:07:19 +00:00
jsr TEXT
2020-11-16 05:12:56 +00:00
jsr SETGR
2020-11-20 05:22:19 +00:00
jsr HOME
2020-11-16 05:12:56 +00:00
; bit SET_GR
; bit TEXTGR
2020-11-11 03:07:19 +00:00
bit KEYRESET
;===================
; init vars
2020-11-16 05:12:56 +00:00
;===================
2020-11-11 03:07:19 +00:00
;=============================
2020-11-16 05:12:56 +00:00
; Load title screen
;=============================
2020-11-15 03:45:18 +00:00
lda #<bg_rle
sta GBASL
lda #>bg_rle
sta GBASH
lda #$c
jsr load_rle_gr
2020-11-11 03:07:19 +00:00
2020-11-16 05:12:56 +00:00
;==============================
; wipe it to page1 gr
;==============================
2020-11-11 03:07:19 +00:00
2020-11-16 05:12:56 +00:00
jsr do_wipe
2020-11-11 03:07:19 +00:00
2020-11-15 03:45:18 +00:00
;=============================
; mockingboard where available
2020-11-16 05:12:56 +00:00
;=============================
2020-11-15 03:45:18 +00:00
2020-11-16 05:12:56 +00:00
jsr mock_anim
2020-11-11 03:07:19 +00:00
;==============================
;==============================
;==============================
; command loop
;==============================
;==============================
;==============================
2020-11-16 05:12:56 +00:00
command_loop:
; check if irq handler has set trigger because we hit limit
2020-11-11 03:07:19 +00:00
lda trigger
beq not_trigger
lda #0 ; reset trigger
2020-11-11 03:07:19 +00:00
sta trigger
lda command ; load current command (also set in irq)
cmp #DONE ; if done, just loop forever
2020-11-16 05:12:56 +00:00
beq command_loop
2020-11-11 03:07:19 +00:00
cmp #DO_LIST ; if command is list
2020-11-11 03:07:19 +00:00
bne not_do_list
jmp do_list ; then do it
2020-11-11 03:07:19 +00:00
not_do_list:
cmp #DO_LOAD ; if command is load
2020-11-11 03:07:19 +00:00
bne not_do_load
jsr do_load ; then do it
2020-11-11 03:07:19 +00:00
jmp not_trigger
not_do_load:
cmp #DO_RUN ; if command is run
2020-11-17 20:33:00 +00:00
bne not_do_run
2020-11-11 03:07:19 +00:00
jmp do_run ; then do it
2020-11-11 03:07:19 +00:00
2020-11-17 20:33:00 +00:00
not_do_run:
; cmp #DO_CREDITS
; bne not_trigger
; jmp switch_to_credits
2020-11-11 03:07:19 +00:00
not_trigger:
2020-11-16 05:12:56 +00:00
jmp command_loop
2020-11-11 03:07:19 +00:00
command: .byte $00
which: .byte $00
2020-11-18 03:05:43 +00:00
timeout: .byte 8 ; original timeout
2020-11-11 03:07:19 +00:00
trigger: .byte $00
original_stack: .byte $00
2020-11-15 03:45:18 +00:00
.include "gr_unrle.s"
.include "gr_offsets.s"
.include "bg.inc"
2020-11-11 03:07:19 +00:00
.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"
2020-11-16 02:43:16 +00:00
.include "commands.s"
.include "timeline.inc"
2020-11-15 03:45:18 +00:00
.include "wipe.s"
2020-11-16 05:12:56 +00:00
.include "mock_anim.s"
2020-11-17 18:11:41 +00:00
.include "credits.s"
2020-11-11 03:07:19 +00:00
.include "nozp.inc"
PT3_LOC = song
.align $100
song:
2020-11-20 05:22:19 +00:00
.incbin "music/mAZE_-_The_Upbeated_Eaten_Apple.pt3"