2019-08-31 03:45:50 +00:00
|
|
|
; Demosplash 2019
|
|
|
|
; by Vince "Deater" Weaver <vince@deater.net>
|
|
|
|
|
|
|
|
.include "zp.inc"
|
|
|
|
.include "hardware.inc"
|
|
|
|
|
2019-10-09 01:57:48 +00:00
|
|
|
demosplash2019:
|
2019-09-04 19:46:10 +00:00
|
|
|
|
2019-08-31 03:45:50 +00:00
|
|
|
;=========================
|
|
|
|
; set up sound
|
|
|
|
;=========================
|
2019-10-02 04:25:04 +00:00
|
|
|
lda #0
|
|
|
|
sta DONE_PLAYING
|
2019-08-31 03:45:50 +00:00
|
|
|
|
2019-10-02 04:25:04 +00:00
|
|
|
jsr mockingboard_init
|
|
|
|
jsr pt3_setup_interrupt
|
|
|
|
jsr reset_ay_both
|
|
|
|
jsr clear_ay_both
|
|
|
|
jsr pt3_init_song
|
2019-08-31 03:45:50 +00:00
|
|
|
|
2019-11-07 16:44:05 +00:00
|
|
|
;====================================
|
|
|
|
; turn on language card
|
|
|
|
; enable read/write, use 1st 4k bank
|
|
|
|
; lda $C08B
|
|
|
|
; lda $C08B
|
2019-11-03 01:05:11 +00:00
|
|
|
|
|
|
|
;====================================
|
|
|
|
; generate 4 patterns worth of music
|
2019-11-07 16:44:05 +00:00
|
|
|
; at address $D000-$FC00
|
2019-11-03 01:05:11 +00:00
|
|
|
|
2019-11-07 16:44:05 +00:00
|
|
|
; page offset
|
2019-11-03 01:05:11 +00:00
|
|
|
lda #0
|
|
|
|
sta FRAME_PAGE
|
|
|
|
|
2019-11-07 16:44:05 +00:00
|
|
|
; offset within page
|
2019-11-03 01:05:11 +00:00
|
|
|
lda #0
|
|
|
|
sta FRAME_OFFSET
|
|
|
|
|
|
|
|
frame_decode_loop:
|
|
|
|
jsr pt3_make_frame
|
|
|
|
|
|
|
|
jsr pt3_write_frame
|
|
|
|
|
|
|
|
inc FRAME_OFFSET
|
2019-11-07 16:44:05 +00:00
|
|
|
|
|
|
|
lda FRAME_OFFSET
|
|
|
|
cmp #59 ; FIXME: make this depend on song
|
|
|
|
; hardcoding for 59 for our song
|
2019-11-03 01:05:11 +00:00
|
|
|
bne frame_decode_loop
|
|
|
|
|
2019-11-07 16:44:05 +00:00
|
|
|
; add 11 to all of the output pointers
|
|
|
|
.if 0
|
|
|
|
clc
|
|
|
|
lda r0_wrsmc+2
|
|
|
|
adc #$b
|
|
|
|
sta r0_wrsmc+2
|
2019-11-03 01:05:11 +00:00
|
|
|
|
2019-11-07 16:44:05 +00:00
|
|
|
lda r1_wrsmc+2
|
|
|
|
adc #$b
|
|
|
|
sta r1_wrsmc+2
|
2019-11-03 01:05:11 +00:00
|
|
|
|
2019-11-07 16:44:05 +00:00
|
|
|
lda r2_wrsmc+2
|
|
|
|
adc #$b
|
|
|
|
sta r2_wrsmc+2
|
|
|
|
|
|
|
|
lda r4_wrsmc+2
|
|
|
|
adc #$b
|
|
|
|
sta r4_wrsmc+2
|
|
|
|
|
|
|
|
lda r13_wrsmc+2
|
|
|
|
adc #$b
|
|
|
|
sta r13_wrsmc+2
|
|
|
|
|
|
|
|
lda r6_wrsmc+2
|
|
|
|
adc #$b
|
|
|
|
sta r6_wrsmc+2
|
2019-11-03 01:05:11 +00:00
|
|
|
|
2019-11-07 16:44:05 +00:00
|
|
|
lda r7_wrsmc+2
|
|
|
|
adc #$b
|
|
|
|
sta r7_wrsmc+2
|
2019-11-03 01:05:11 +00:00
|
|
|
|
2019-11-07 16:44:05 +00:00
|
|
|
lda r8_wrsmc+2
|
|
|
|
adc #$b
|
|
|
|
sta r8_wrsmc+2
|
|
|
|
|
|
|
|
lda r9_wrsmc+2
|
|
|
|
adc #$b
|
|
|
|
sta r9_wrsmc+2
|
|
|
|
|
|
|
|
lda r11_wrsmc+2
|
|
|
|
adc #$b
|
|
|
|
sta r11_wrsmc+2
|
|
|
|
|
|
|
|
lda r12_wrsmc+2
|
|
|
|
adc #$b
|
|
|
|
sta r12_wrsmc+2
|
|
|
|
.endif
|
|
|
|
|
|
|
|
inc FRAME_PAGE
|
|
|
|
lda FRAME_PAGE
|
2019-11-03 01:05:11 +00:00
|
|
|
|
2019-11-07 16:44:05 +00:00
|
|
|
cmp #4
|
2019-11-03 01:05:11 +00:00
|
|
|
bne frame_decode_loop
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
sta FRAME_OFFSET
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-09-04 19:46:10 +00:00
|
|
|
; lda #1
|
|
|
|
; sta LOOP
|
2019-08-31 03:45:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
;===========================
|
|
|
|
; Enable graphics
|
|
|
|
;===========================
|
|
|
|
|
|
|
|
bit LORES
|
|
|
|
bit SET_GR
|
|
|
|
bit FULLGR
|
|
|
|
bit KEYRESET
|
|
|
|
|
|
|
|
;===========================
|
|
|
|
; Setup pages (is this necessary?)
|
|
|
|
;===========================
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
sta DRAW_PAGE
|
|
|
|
lda #1
|
|
|
|
sta DISP_PAGE
|
|
|
|
|
|
|
|
|
2019-10-02 04:25:04 +00:00
|
|
|
;===========================
|
|
|
|
; apple II intro
|
|
|
|
;============================
|
2019-08-31 03:45:50 +00:00
|
|
|
|
2019-11-03 01:05:11 +00:00
|
|
|
nop
|
|
|
|
nop
|
|
|
|
nop
|
|
|
|
|
|
|
|
|
2019-11-07 05:06:19 +00:00
|
|
|
jsr appleII_intro
|
2019-08-31 03:45:50 +00:00
|
|
|
|
2019-11-03 01:05:11 +00:00
|
|
|
|
|
|
|
;===========================
|
|
|
|
; missing scene
|
2019-08-31 03:45:50 +00:00
|
|
|
;===========================
|
|
|
|
|
2019-11-03 01:05:11 +00:00
|
|
|
; nop
|
|
|
|
; nop
|
|
|
|
; nop
|
2019-08-31 03:45:50 +00:00
|
|
|
|
2019-11-03 01:05:11 +00:00
|
|
|
jsr missing_intro
|
|
|
|
|
|
|
|
|
|
|
|
;========================
|
|
|
|
; start irq music
|
|
|
|
;========================
|
2019-08-31 03:45:50 +00:00
|
|
|
|
2019-11-07 16:44:05 +00:00
|
|
|
nop
|
|
|
|
; cli ; enable interrupts
|
2019-08-31 03:45:50 +00:00
|
|
|
|
2019-10-09 01:57:48 +00:00
|
|
|
;===========================
|
2019-11-06 02:20:11 +00:00
|
|
|
; opening book scene
|
2019-11-03 01:05:11 +00:00
|
|
|
;============================
|
2019-11-06 04:56:51 +00:00
|
|
|
nop
|
|
|
|
nop
|
|
|
|
nop
|
2019-11-07 05:06:19 +00:00
|
|
|
jsr open_book
|
2019-10-09 01:57:48 +00:00
|
|
|
|
|
|
|
;===========================
|
|
|
|
; starbase scene
|
|
|
|
;===========================
|
|
|
|
|
2019-11-07 05:06:19 +00:00
|
|
|
; nop
|
|
|
|
; nop
|
|
|
|
; nop
|
2019-11-06 04:40:29 +00:00
|
|
|
|
2019-11-07 05:06:19 +00:00
|
|
|
jsr starbase
|
2019-10-07 04:12:36 +00:00
|
|
|
|
2019-11-05 15:16:59 +00:00
|
|
|
;============================
|
|
|
|
; disable irq music
|
|
|
|
|
|
|
|
sei
|
|
|
|
|
|
|
|
|
2019-10-09 03:04:26 +00:00
|
|
|
;===========================
|
|
|
|
; escape scene
|
|
|
|
;===========================
|
|
|
|
|
2019-11-06 04:56:51 +00:00
|
|
|
; nop
|
|
|
|
; nop
|
|
|
|
; nop
|
|
|
|
jsr escape
|
2019-10-09 03:04:26 +00:00
|
|
|
|
2019-10-07 04:12:36 +00:00
|
|
|
;===========================
|
|
|
|
; book scene
|
|
|
|
;===========================
|
|
|
|
|
2019-11-06 04:56:51 +00:00
|
|
|
; nop
|
|
|
|
; nop
|
|
|
|
; nop
|
2019-11-06 04:40:29 +00:00
|
|
|
jsr end_book
|
2019-11-03 01:05:11 +00:00
|
|
|
|
|
|
|
;===========================
|
|
|
|
; credits
|
|
|
|
;===========================
|
2019-10-02 04:03:00 +00:00
|
|
|
|
2019-11-03 01:05:11 +00:00
|
|
|
jsr credits
|
2019-10-02 04:03:00 +00:00
|
|
|
|
2019-08-31 03:45:50 +00:00
|
|
|
; wait wait wait
|
|
|
|
|
2019-10-02 04:03:00 +00:00
|
|
|
; jsr wait_until_keypressed
|
|
|
|
;repeat_ending:
|
|
|
|
; jmp repeat_ending
|
2019-08-31 03:45:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;======================
|
|
|
|
; wait until keypressed
|
|
|
|
;======================
|
|
|
|
wait_until_keypressed:
|
|
|
|
lda KEYPRESS
|
|
|
|
bpl wait_until_keypressed
|
|
|
|
bit KEYRESET
|
2019-11-06 04:56:51 +00:00
|
|
|
; rts
|
|
|
|
jmp demosplash2019
|
2019-08-31 03:45:50 +00:00
|
|
|
|
2019-09-04 19:46:10 +00:00
|
|
|
; Apple II intro
|
|
|
|
.include "appleII_intro.s"
|
2019-11-03 01:05:11 +00:00
|
|
|
|
|
|
|
.align $100
|
2019-09-04 19:46:10 +00:00
|
|
|
.include "vapor_lock.s"
|
|
|
|
.include "delay_a.s"
|
|
|
|
.include "gr_unrle.s"
|
|
|
|
.include "gr_copy.s"
|
2019-11-03 01:05:11 +00:00
|
|
|
.include "gr_offsets.s"
|
2019-09-04 19:46:10 +00:00
|
|
|
|
2019-11-06 04:56:51 +00:00
|
|
|
;.include "text_print.s"
|
2019-10-02 04:03:00 +00:00
|
|
|
.include "gr_pageflip.s"
|
2019-11-06 04:09:00 +00:00
|
|
|
.include "gr_clear_bottom.s"
|
|
|
|
|
2019-10-12 17:51:02 +00:00
|
|
|
.align $100
|
2019-10-12 14:47:38 +00:00
|
|
|
.include "gr_fast_clear.s"
|
2019-11-05 03:47:52 +00:00
|
|
|
.include "gr_overlay.s"
|
|
|
|
.include "gr_run_sequence.s"
|
2019-11-03 01:05:11 +00:00
|
|
|
.align $100
|
|
|
|
.include "movement_table.s"
|
|
|
|
.include "font.s"
|
|
|
|
.align $100
|
|
|
|
.include "offsets_table.s"
|
2019-08-31 03:45:50 +00:00
|
|
|
|
2019-10-08 12:27:00 +00:00
|
|
|
; missing
|
|
|
|
.include "missing.s"
|
|
|
|
|
2019-11-06 02:20:11 +00:00
|
|
|
; missing
|
|
|
|
.include "open_book.s"
|
|
|
|
|
2019-10-02 04:03:00 +00:00
|
|
|
; Starbase
|
|
|
|
.include "starbase.s"
|
|
|
|
|
2019-10-09 03:04:26 +00:00
|
|
|
; escape
|
2019-11-06 04:56:51 +00:00
|
|
|
.include "escape.s"
|
2019-10-09 03:04:26 +00:00
|
|
|
|
2019-11-06 02:20:11 +00:00
|
|
|
; reading
|
|
|
|
.include "reading.s"
|
2019-10-07 04:12:36 +00:00
|
|
|
|
2019-11-03 01:05:11 +00:00
|
|
|
; credits
|
|
|
|
.include "credits.s"
|
|
|
|
|
2019-10-02 04:25:04 +00:00
|
|
|
; Music player
|
|
|
|
.include "pt3_lib_core.s"
|
|
|
|
.include "pt3_lib_init.s"
|
|
|
|
.include "pt3_lib_mockingboard.s"
|
2019-08-31 03:45:50 +00:00
|
|
|
.include "interrupt_handler.s"
|
2019-11-03 01:05:11 +00:00
|
|
|
.include "pt3_lib_play_frame.s"
|
|
|
|
.include "pt3_lib_write_frame.s"
|
2019-11-03 16:23:53 +00:00
|
|
|
|
2019-11-03 01:05:11 +00:00
|
|
|
.include "create_update_type1.s"
|
2019-11-03 16:23:53 +00:00
|
|
|
.include "create_update_type2.s"
|
2019-08-31 03:45:50 +00:00
|
|
|
|
2019-11-03 01:05:11 +00:00
|
|
|
; Pictures (no need to align)
|
2019-11-04 02:58:21 +00:00
|
|
|
.include "appleII_40_96.inc"
|
2019-11-06 02:20:11 +00:00
|
|
|
.include "graphics/book_open/book_open.inc"
|
2019-11-05 03:47:52 +00:00
|
|
|
.include "graphics/starbase/starbase.inc"
|
|
|
|
.include "graphics/starbase/ship_flames.inc"
|
|
|
|
.include "graphics/starbase/star_wipe.inc"
|
2019-11-06 19:59:26 +00:00
|
|
|
;.include "earth.inc"
|
2019-11-03 16:23:53 +00:00
|
|
|
.include "book_40_48d.inc"
|
2019-11-02 19:47:58 +00:00
|
|
|
.include "credits_bg.inc"
|
|
|
|
|
2019-08-31 03:45:50 +00:00
|
|
|
|
|
|
|
PT3_LOC = song
|
|
|
|
|
|
|
|
; must be page aligned
|
|
|
|
.align 256
|
|
|
|
song:
|
2019-11-03 01:05:11 +00:00
|
|
|
.incbin "dya_space_demo2.pt3"
|
2019-11-07 03:25:11 +00:00
|
|
|
|
|
|
|
end_of_line:
|