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-11-13 03:29:49 +00:00
|
|
|
;==================================================
|
2019-11-10 01:17:07 +00:00
|
|
|
; clear zp
|
2019-11-13 03:29:49 +00:00
|
|
|
; shouldn't have to do this, but uninit memory bugs
|
|
|
|
;==================================================
|
2019-11-10 01:17:07 +00:00
|
|
|
lda #0
|
2019-11-16 17:11:00 +00:00
|
|
|
ldy #$20
|
2019-11-10 01:17:07 +00:00
|
|
|
zp_clear_loop:
|
|
|
|
sta $0,y
|
|
|
|
iny
|
|
|
|
bne zp_clear_loop
|
|
|
|
|
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-11-08 03:04:25 +00:00
|
|
|
sta FRAME_PLAY_OFFSET
|
|
|
|
sta FRAME_PLAY_PAGE
|
2019-11-08 06:18:02 +00:00
|
|
|
sta FRAME_OFFSET
|
|
|
|
sta FRAME_PAGE
|
2019-11-08 03:04:25 +00:00
|
|
|
jsr update_pt3_play
|
2019-11-08 06:18:02 +00:00
|
|
|
jsr pt3_set_pages
|
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
|
2019-11-07 17:06:13 +00:00
|
|
|
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 22:05:53 +00:00
|
|
|
jsr pt3_write_lc_4
|
2019-11-03 01:05:11 +00:00
|
|
|
|
2019-11-09 02:14:46 +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
|
|
|
|
|
2019-11-16 01:31:17 +00:00
|
|
|
jmp main_body
|
|
|
|
|
|
|
|
|
|
|
|
; Pictures (no need to align)
|
|
|
|
.include "appleII_40_96.inc"
|
|
|
|
.include "k_40_48d.inc"
|
|
|
|
.include "graphics/book_open/book_open.inc"
|
|
|
|
.include "graphics/starbase/starbase.inc"
|
|
|
|
.include "graphics/starbase/ship_flames.inc"
|
|
|
|
.include "graphics/starbase/star_wipe.inc"
|
|
|
|
|
|
|
|
; Apple II intro
|
|
|
|
.include "appleII_intro.s"
|
|
|
|
|
|
|
|
; missing
|
|
|
|
.include "missing.s"
|
|
|
|
|
|
|
|
; missing
|
|
|
|
.include "open_book.s"
|
|
|
|
|
|
|
|
; Starbase
|
|
|
|
.include "starbase.s"
|
|
|
|
|
|
|
|
; UP UNTIL THIS POINT CAN BE WIPED BY SOUND AT END
|
|
|
|
|
|
|
|
main_body:
|
2019-10-02 04:25:04 +00:00
|
|
|
;===========================
|
|
|
|
; apple II intro
|
|
|
|
;============================
|
2019-08-31 03:45:50 +00:00
|
|
|
|
2019-11-09 01:07:02 +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-09 02:01:57 +00:00
|
|
|
; nop
|
|
|
|
; nop
|
|
|
|
; nop
|
|
|
|
jsr missing_intro
|
2019-11-03 01:05:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
;========================
|
|
|
|
; start irq music
|
|
|
|
;========================
|
2019-08-31 03:45:50 +00:00
|
|
|
|
2019-11-09 02:01:57 +00:00
|
|
|
; nop
|
2019-11-09 01:07:02 +00:00
|
|
|
|
2019-11-09 02:01:57 +00:00
|
|
|
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-08 05:47:34 +00:00
|
|
|
|
2019-11-09 02:01:57 +00:00
|
|
|
; nop
|
|
|
|
; nop
|
|
|
|
; nop
|
2019-11-09 01:07:02 +00:00
|
|
|
|
2019-11-09 02:01:57 +00:00
|
|
|
jsr open_book
|
2019-10-09 01:57:48 +00:00
|
|
|
|
|
|
|
;===========================
|
|
|
|
; starbase scene
|
|
|
|
;===========================
|
|
|
|
|
2019-11-09 02:01:57 +00:00
|
|
|
; nop
|
|
|
|
; nop
|
|
|
|
; nop
|
2019-11-09 01:07:02 +00:00
|
|
|
|
2019-11-09 02:01:57 +00:00
|
|
|
jsr starbase
|
2019-10-07 04:12:36 +00:00
|
|
|
|
2019-11-05 15:16:59 +00:00
|
|
|
;============================
|
|
|
|
; disable irq music
|
|
|
|
|
2019-11-09 02:01:57 +00:00
|
|
|
; nop
|
|
|
|
sei
|
2019-11-05 15:16:59 +00:00
|
|
|
|
|
|
|
|
2019-10-09 03:04:26 +00:00
|
|
|
;===========================
|
|
|
|
; escape scene
|
|
|
|
;===========================
|
|
|
|
|
2019-11-06 04:56:51 +00:00
|
|
|
jsr escape
|
2019-10-09 03:04:26 +00:00
|
|
|
|
2019-10-07 04:12:36 +00:00
|
|
|
;===========================
|
|
|
|
; book scene
|
|
|
|
;===========================
|
|
|
|
|
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
|
2019-11-08 05:47:34 +00:00
|
|
|
repeat_ending:
|
|
|
|
jmp repeat_ending
|
2019-08-31 03:45:50 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;======================
|
|
|
|
; wait until keypressed
|
|
|
|
;======================
|
2019-11-16 03:17:49 +00:00
|
|
|
;wait_until_keypressed:
|
|
|
|
; lda KEYPRESS
|
|
|
|
; bpl wait_until_keypressed
|
|
|
|
; bit KEYRESET
|
|
|
|
; rts
|
2019-11-08 05:47:34 +00:00
|
|
|
|
2019-11-15 17:31:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
; FIXME: put at end after music?
|
2019-11-08 18:58:33 +00:00
|
|
|
;.include "earth.inc"
|
|
|
|
.include "book_40_48d.inc"
|
|
|
|
.include "credits_bg.inc"
|
|
|
|
|
2019-08-31 03:45:50 +00:00
|
|
|
|
2019-11-16 03:43:44 +00:00
|
|
|
.include "delay_a.s" ; critical
|
2019-11-03 01:05:11 +00:00
|
|
|
|
2019-11-15 03:56:08 +00:00
|
|
|
; things that are exactly 1 page in size
|
2019-11-03 01:05:11 +00:00
|
|
|
.align $100
|
2019-11-15 03:56:08 +00:00
|
|
|
.include "offsets_table.s"
|
|
|
|
.include "movement_table.s"
|
2019-11-16 03:43:44 +00:00
|
|
|
random_values:
|
|
|
|
.incbin "random.data"
|
|
|
|
.include "offsets_table2.s"
|
2019-11-15 03:56:08 +00:00
|
|
|
.include "font.s"
|
|
|
|
; things that need to not cross pages
|
2019-09-04 19:46:10 +00:00
|
|
|
.include "vapor_lock.s"
|
|
|
|
.include "gr_copy.s"
|
2019-11-16 03:43:44 +00:00
|
|
|
.include "gr_unrle.s"
|
2019-11-03 01:05:11 +00:00
|
|
|
.include "gr_offsets.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-11-15 03:56:08 +00:00
|
|
|
;.align $100
|
|
|
|
.include "gr_overlay.s" ; not critical
|
2019-10-12 14:47:38 +00:00
|
|
|
.include "gr_fast_clear.s"
|
2019-11-15 03:56:08 +00:00
|
|
|
.include "gr_run_sequence.s" ; not critical
|
2019-08-31 03:45:50 +00:00
|
|
|
|
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-07 22:05:53 +00:00
|
|
|
.include "pt3_lib_write_lc.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-08 18:58:33 +00:00
|
|
|
|
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:
|