From 61af85ae502fca6277e9449f1dd4a16424e14791 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Sun, 28 Oct 2018 11:50:10 -0400 Subject: [PATCH] megademo: start adding sound into each subscene --- megademo/c64_opener.s | 13 +++++++------ megademo/megademo.s | 19 +++++++++++++++++-- megademo/zp.inc | 2 ++ 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/megademo/c64_opener.s b/megademo/c64_opener.s index 8569cf0f..5211d1b6 100644 --- a/megademo/c64_opener.s +++ b/megademo/c64_opener.s @@ -138,8 +138,9 @@ c64_done_screen: ; -24 done_blinding ; -7 check if past time ; -46 cursor blink + ; -1038 play music ;================================== - ; = 4379 + ; = 3341 ; run the 2Hz counter, overflow at 30 60Hz frames @@ -262,7 +263,6 @@ c64_wait_blinding: c64_done_blinding: - ;======================= ; see if done ;======================= @@ -323,16 +323,17 @@ cursor_off: ;============ ; 38 - cursor_done: -; Try X=96 Y=9 cycles=4375 R4 + jsr play_music ; 6+1032 + + ; Try X=110 Y=6 cycles=3337 R4 nop nop - ldy #9 ; 2 -loopcoE:ldx #96 ; 2 + ldy #6 ; 2 +loopcoE:ldx #110 ; 2 loopcoF:dex ; 2 bne loopcoF ; 2nt/3 dey ; 2 diff --git a/megademo/megademo.s b/megademo/megademo.s index 4ac52ee6..9d762511 100644 --- a/megademo/megademo.s +++ b/megademo/megademo.s @@ -5,6 +5,11 @@ .include "zp.inc" .include "hardware.inc" +; external routines + +play_music=$1000 +mockingboard_init=$1100 + megademo_start: ; this should end up at $4000 @@ -22,6 +27,16 @@ megademo_start: ; this should end up at $4000 apple_iie: + ;================== + ; Init mockingboard + ;================== + + lda #0 + sta MB_FRAME + sta MB_PATTERN + + jsr mockingboard_init + ;=================== ; set graphics mode ;=================== @@ -78,8 +93,8 @@ apple_iie: ; Game over ;================== ; we never get here -game_over_man: - jmp game_over_man +;game_over_man: +; jmp game_over_man .include "lz4_decode.s" diff --git a/megademo/zp.inc b/megademo/zp.inc index 7e282550..4c4ad4b4 100644 --- a/megademo/zp.inc +++ b/megademo/zp.inc @@ -112,6 +112,8 @@ MB_ADDRL = $91 MB_ADDRH = $92 DONE_PLAYING = $93 MB_CHUNK_OFFSET = $94 +MB_FRAME = $94 +MB_PATTERN = $95 CHUNKSIZE = $95 LZ4_DONE = $96 DECODE_ERROR = $97