diff --git a/mist/Makefile b/mist/Makefile index 8ecbbb18..b2bef1d6 100644 --- a/mist/Makefile +++ b/mist/Makefile @@ -25,7 +25,7 @@ mist.dsk: HELLO LOADER MIST_TITLE MIST OCTAGON VIEWER \ $(DOS33) -y mist.dsk BSAVE -a 0x2000 D\'NI $(DOS33) -y mist.dsk BSAVE -a 0xe00 SAVE0 $(DOS33) -y mist.dsk BSAVE -a 0x2000 SHIP - $(DOS33) -y mist.dsk BSAVE -a 0x9000 ./audio/link_noise.btc LINK_NOISE.BTC +# $(DOS33) -y mist.dsk BSAVE -a 0x9000 ./audio/link_noise.btc LINK_NOISE.BTC mist_side2.dsk: HELLO_DISK2 CHANNEL ARBOR NIBEL CABIN cp empty.dsk mist_side2.dsk diff --git a/mist/TODO b/mist/TODO index ecefa78a..2df27a4c 100644 --- a/mist/TODO +++ b/mist/TODO @@ -6,20 +6,11 @@ For release 1.0 -- joystick support -- ^T to toggle sound -+ SHIP -- split off of STONEY - + MIST - -- white page appears - -- view back from clock puzzle - -- open door to clock puzzle - -+ CABIN - -- safe puzzle - -- boiler - -- up/down in tree + -- make sure gear opening looks OK with new art + -- open door to clock puzzle? + OCTAGON - -- marker switches update map -- code book -- red book seen when in fireplace -- books destroyed at end @@ -48,16 +39,14 @@ For release 1.0 -- add good ending linking book to MYST -+ DENTIST - -- marker switch - -- can go both directions when leaving - Done: ++ CABIN ++ DENTIST + MECHE + MIST_TITLE + VIEWER + ARBOR - ++ SHIP ================================ TODO Maybe future: @@ -120,4 +109,11 @@ Ending: + Atrus at end -- hires? VIEWER -+ Add alternate top-of-steps backgrouns if ship is up ++ Add alternate top-of-steps backgrounds if ship is up + +CABIN ++ Make match go out gradually when leav ++ Make boiler puzzle a bit closer to actual (it has a warm up + time in the real game) ++ Allow looking down from whole ride up the tree, not just at top + diff --git a/mist/channel.s b/mist/channel.s index 33bb853e..c547659c 100644 --- a/mist/channel.s +++ b/mist/channel.s @@ -190,23 +190,6 @@ toggle_faucet: ;========================== ; includes ;========================== -.if 0 - .include "gr_copy.s" - .include "gr_offsets.s" - .include "gr_pageflip.s" - .include "gr_putsprite_crop.s" - .include "text_print.s" - .include "gr_fast_clear.s" - .include "decompress_fast_v2.s" - .include "keyboard.s" - .include "draw_pointer.s" - .include "end_level.s" - .include "audio.s" - .include "common_sprites.inc" - .include "page_sprites.inc" - - -.endif ; level graphics .include "graphics_channel/channel_graphics.inc" diff --git a/mist/common_routines.inc b/mist/common_routines.inc index 196918d6..2957ff80 100644 --- a/mist/common_routines.inc +++ b/mist/common_routines.inc @@ -4,54 +4,51 @@ ; loader.s opendir_filename =$1042 -; audio.c -play_audio =$1369 +; linking_noise.s +play_link_noise =$147a ; decompress_fast_v2.s -decompress_lzsa2_fast =$147a -getsrc_smc =$1570 +decompress_lzsa2_fast =$1496 +getsrc_smc =$158c ; draw_pointer.s -draw_pointer =$157d +draw_pointer =$1599 ; end_level.s -end_level =$16e9 +end_level =$1705 ; gr_copy.s -gr_copy_to_current =$170b +gr_copy_to_current =$1727 ; gr_fast_clear.s -clear_bottom =$1831 -clear_all =$186f -clear_all_color =$1894 +clear_bottom =$184d +clear_all =$188b +clear_all_color =$18b0 ; gr_offsets.s -gr_offsets =$18b2 +gr_offsets =$18ce ; gr_page_flip.s -page_flip =$18e2 +page_flip =$18fe ; gr_putsprite_crop.s -put_sprite_crop =$18fc -psc_smc1 =$191f -psc_smc2 =$19b7 +put_sprite_crop =$1918 +psc_smc1 =$193b +psc_smc2 =$19d3 ; keyboard.s -handle_keypress =$1a38 -change_direction =$1ae0 -change_location =$1b19 +handle_keypress =$1a54 +change_direction =$1afc +change_location =$1b35 ; text_print.s -move_and_print =$1bb1 -ps_smc1 =$1bde +move_and_print =$1bcd +ps_smc1 =$1bfa ; page_sprites.inc -blue_page_sprite =$1cc6 -red_page_sprite =$1cdc -white_page_sprite =$1cf2 -blue_page_small_sprite =$1d08 -red_page_small_sprite =$1d10 +blue_page_sprite =$1ce2 +red_page_sprite =$1cf8 +white_page_sprite =$1d0e +blue_page_small_sprite =$1d24 +red_page_small_sprite =$1d2c -; audio files -linking_noise = $9000 -LINKING_NOISE_LENGTH = 43 diff --git a/mist/decompress_fast_v2.s b/mist/decompress_fast_v2.s index 5cefddcb..fb2f24ad 100644 --- a/mist/decompress_fast_v2.s +++ b/mist/decompress_fast_v2.s @@ -1,4 +1,6 @@ ; note -- modified by Vince Weaver to assemble with ca65 +; in this case, A = page to decompress to +; getsrc_smc+1, getsrc_smc+2 is src location ; ----------------------------------------------------------------------------- ; Decompress raw LZSA2 block. diff --git a/mist/generate_common.c b/mist/generate_common.c index 28a52b0b..e5cbe7f0 100644 --- a/mist/generate_common.c +++ b/mist/generate_common.c @@ -46,8 +46,12 @@ int main(int argc, char **argv) { find_address("opendir_filename"); printf("\n"); - printf("; audio.c\n"); - find_address("play_audio"); +// printf("; audio.s\n"); +// find_address("play_audio"); +// printf("\n"); + + printf("; linking_noise.s\n"); + find_address("play_link_noise"); printf("\n"); printf("; decompress_fast_v2.s\n"); @@ -106,9 +110,9 @@ int main(int argc, char **argv) { find_address("red_page_small_sprite"); printf("\n"); - printf("; audio files\n"); - printf("linking_noise = $9000\n"); - printf("LINKING_NOISE_LENGTH = 43\n"); +// printf("; audio files\n"); +// printf("linking_noise = $9000\n"); +// printf("LINKING_NOISE_LENGTH = 43\n"); fclose(fff); diff --git a/mist/hello.bas b/mist/hello.bas index b0220159..b83104b1 100644 --- a/mist/hello.bas +++ b/mist/hello.bas @@ -4,9 +4,11 @@ 40 PRINT "CONTROLS: " 42 PRINT " MOVE CURSOR : ARROWS OR WASD" 44 PRINT " FORWARD/ACTION : ENTER" -45 PRINT " JOYSTICK (TODO): CONTROL-J" -46 PRINT " LOAD GAME : CONTROL-L" -48 PRINT " SAVE (TODO) : CONTROL-S" +46 PRINT +50 PRINT " JOYSTICK (TODO): CONTROL-J" +53 PRINT " LOAD GAME : CONTROL-L" +56 PRINT " SAVE (TODO) : CONTROL-S" +58 PRINT " TOGGLE SOUND : CONTROL-T" 60 PRINT:PRINT 70 PRINT "BASED ON MYST BY CYAN INC" 80 PRINT "APPLE II PORT: VINCE WEAVER" diff --git a/mist/init_state.s b/mist/init_state.s index 086e211c..958d2023 100644 --- a/mist/init_state.s +++ b/mist/init_state.s @@ -6,7 +6,6 @@ init_state: ; global game state lda #0 - sta SOUND_DISABLED sta JOYSTICK_ENABLED ; game state in saves init diff --git a/mist/lc_detect.s b/mist/lc_detect.s new file mode 100644 index 00000000..3123a6ae --- /dev/null +++ b/mist/lc_detect.s @@ -0,0 +1,40 @@ +; Code from TotalReplay by 4am and qkumba + +;------------------------------------------------------------------------------ +; Has64K +; Checks whether computer has functioning language card (64K) +; +; in: none +; out: C clear if 64K detected +; C set if 64K not detected +; all other flags and registers clobbered +; ROM in memory (not LC RAM bank) +;------------------------------------------------------------------------------ + +detect_language_card: + + ; enable language card + ; READ_RAM1_WRITE_RAM1 + + bit $C08B + bit $C08B + + lda #$AA ; test #1 for $D0 page + sta $D000 + eor $D000 + bne no_lc + lsr $D000 ; test #2 for $D0 page + lda #$55 + eor $D000 + bne no_lc + clc + bcc done_detect + +no_lc: + sec + +done_detect: + ; READ_ROM_NO_WRITE + bit $C08A + + rts diff --git a/mist/link_book_channel.s b/mist/link_book_channel.s index 9b524a69..0b8553e4 100644 --- a/mist/link_book_channel.s +++ b/mist/link_book_channel.s @@ -14,24 +14,9 @@ channel_link_book: jsr page_flip ;==================================== - ; load linking audio (12k) to $9000 + ; play link noise -; lda #linking_filename -; sta OUTH - -; jsr opendir_filename - - - ; play sound effect? - -; lda #linking_noise -; sta BTC_H -; ldx #LINKING_NOISE_LENGTH ; 45 pages long??? -; jsr play_audio + jsr play_link_noise lda #CHANNEL_ARRIVAL sta LOCATION diff --git a/mist/link_book_meche.s b/mist/link_book_meche.s index d5ebde5b..dc5efdd8 100644 --- a/mist/link_book_meche.s +++ b/mist/link_book_meche.s @@ -13,25 +13,9 @@ meche_link_book: jsr clear_all jsr page_flip - ;==================================== - ; load linking audio (12k) to $9000 + ; play sound effect - lda #linking_filename - sta OUTH - - jsr opendir_filename - - - ; play sound effect? - - lda #linking_noise - sta BTC_H - ldx #LINKING_NOISE_LENGTH ; 45 pages long??? - jsr play_audio + jsr play_link_noise lda #MECHE_ARRIVAL sta LOCATION diff --git a/mist/link_book_mist.s b/mist/link_book_mist.s index 8e77aeb9..f10036b9 100644 --- a/mist/link_book_mist.s +++ b/mist/link_book_mist.s @@ -13,21 +13,10 @@ mist_link_book: jsr clear_all jsr page_flip - ; play sound effect? + ; play sound effect - lda #linking_noise - sta BTC_H + jsr play_link_noise - ldy #0 - lda (BTC_L),Y - cmp #$55 ; hack - bne skip_audio - - ldx #LINKING_NOISE_LENGTH ; 45 pages long??? - jsr play_audio -skip_audio: lda #OCTAGON_CEILING sta LOCATION diff --git a/mist/link_book_mist_dock.s b/mist/link_book_mist_dock.s index 1c1cb1e4..35043cef 100644 --- a/mist/link_book_mist_dock.s +++ b/mist/link_book_mist_dock.s @@ -13,51 +13,16 @@ mist_link_book: jsr clear_all jsr page_flip -.if 0 - ; play sound effect? - lda #linking_noise - sta BTC_H - ldx #LINKING_NOISE_LENGTH ; 45 pages long??? - jsr play_audio + ; play sound effect + + jsr play_link_noise lda #MIST_ARRIVAL_DOCK sta LOCATION lda #LOAD_MIST ; start at Mist sta WHICH_LOAD -.endif - -.if 0 - lda #MECHE_INSIDE_GEAR - sta LOCATION - lda #LOAD_MECHE - sta WHICH_LOAD - lda #DIRECTION_E - sta DIRECTION -.endif - -.if 0 - lda #MECHE_ROTATE_CONTROLS - sta LOCATION - lda #LOAD_MECHE - sta WHICH_LOAD - lda #DIRECTION_E - sta DIRECTION -.endif - -.if 0 - lda #SELENA_WALKWAY1 - sta LOCATION - lda #LOAD_SELENA - sta WHICH_LOAD - lda #DIRECTION_N - sta DIRECTION -.endif - - lda #$ff sta LEVEL_OVER diff --git a/mist/link_book_stoney.s b/mist/link_book_stoney.s index 1cb4d24f..7075fdbc 100644 --- a/mist/link_book_stoney.s +++ b/mist/link_book_stoney.s @@ -14,26 +14,10 @@ stoney_link_book: jsr page_flip ;==================================== - ; load linking audio (12k) to $9000 + ; play link noise -.if 0 - lda #linking_filename - sta OUTH + jsr play_link_noise - jsr opendir_filename - - - ; play sound effect? - - lda #linking_noise - sta BTC_H - ldx #LINKING_NOISE_LENGTH ; 45 pages long??? - jsr play_audio -.endif lda #STONEY_ARRIVAL sta LOCATION diff --git a/mist/linking_noise.s b/mist/linking_noise.s new file mode 100644 index 00000000..f4b775c8 --- /dev/null +++ b/mist/linking_noise.s @@ -0,0 +1,34 @@ +linking_noise = $d000 +LINKING_NOISE_LENGTH = 43 + + ;============================ + ; play the linking noise + ;============================ +play_link_noise: + lda SOUND_STATUS + bmi done_link_noise + + ; only avail if language card + and #SOUND_IN_LC + beq done_link_noise + + ; switch in language card + ; read RAM, no write, $d000 bank 1 + + bit $C088 + + ; call the btc player + + lda #linking_noise + sta BTC_H + ldx #LINKING_NOISE_LENGTH ; 45 pages long??? + jsr play_audio + + ; restore rom, no write, $d000 bank 1 + + bit $c08A + +done_link_noise: + rts diff --git a/mist/loader.s b/mist/loader.s index bca63179..78c2d02e 100644 --- a/mist/loader.s +++ b/mist/loader.s @@ -746,6 +746,7 @@ sectbl: .byte $00,$0d,$0b,$09,$07,$05,$03,$01,$0e,$0c,$0a,$08,$06,$04,$02,$0f .include "audio.s" + .include "linking_noise.s" .include "decompress_fast_v2.s" .include "draw_pointer.s" .include "end_level.s" diff --git a/mist/mist_title.s b/mist/mist_title.s index 85e70380..841e5eaf 100644 --- a/mist/mist_title.s +++ b/mist/mist_title.s @@ -48,17 +48,43 @@ reload_everything: jsr decompress_lzsa2_fast + ;=================================== + ; detect if we have a language card + ; and load sound into it if possible + ;=================================== - ;==================================== - ; load linking audio (12k) to $9000 + lda #0 + sta SOUND_STATUS ; clear out, sound enabled - lda #linking_filename - sta OUTH + jsr detect_language_card + bcs no_language_card - jsr opendir_filename + ; update sound status + lda SOUND_STATUS + ora #SOUND_IN_LC + sta SOUND_STATUS + ; load sounds into LC + + ; read ram, write ram, use $d000 bank1 + bit $C08B + bit $C08B + + lda #linking_noise_compressed + sta getsrc_smc+2 + + lda #$D0 ; decompress to $D000 + + jsr decompress_lzsa2_fast + +blah: + + ; read rom, nowrite, use $d000 bank1 + bit $C08A + +no_language_card: ;==================================== ; wait for keypress or a few seconds @@ -202,24 +228,13 @@ really_exit: ;========================== ; includes ;========================== -.if 0 - .include "gr_copy.s" - .include "gr_offsets.s" - .include "gr_pageflip.s" - .include "gr_putsprite_crop.s" - .include "text_print.s" - .include "gr_fast_clear.s" - .include "decompress_fast_v2.s" - .include "keyboard.s" - .include "draw_pointer.s" - .include "end_level.s" - .include "audio.s" -.endif + .include "init_state.s" .include "graphics_title/title_graphics.inc" + .include "lc_detect.s" ; puzzles @@ -231,9 +246,9 @@ really_exit: .include "leveldata_title.inc" -linking_filename: - .byte "LINK_NOISE.BTC",0 - file: .incbin "graphics_title/mist_title.lzsa" + +linking_noise_compressed: +.incbin "audio/link_noise.btc.lzsa" diff --git a/mist/organ_puzzle.s b/mist/organ_puzzle.s index 3df74252..9359bef0 100644 --- a/mist/organ_puzzle.s +++ b/mist/organ_puzzle.s @@ -56,25 +56,11 @@ dome_press_second: jsr page_flip ;==================================== - ; load linking audio (12k) to $9000 -.if 0 - lda #linking_filename - sta OUTH + ; play link noise - jsr opendir_filename + jsr play_link_noise - ; play sound effect - - lda #linking_noise - sta BTC_H - ldx #LINKING_NOISE_LENGTH ; 45 pages long??? - jsr play_audio -.endif ; be sure rocket settings are same if we come back jsr save_rocket_state diff --git a/mist/selena.s b/mist/selena.s index d82e3a41..9336b72f 100644 --- a/mist/selena.s +++ b/mist/selena.s @@ -390,22 +390,6 @@ keypad_press: ; includes ;========================== -.if 0 - .include "gr_copy.s" - .include "gr_offsets.s" - .include "gr_pageflip.s" - .include "gr_putsprite_crop.s" - .include "text_print.s" - .include "gr_fast_clear.s" - .include "decompress_fast_v2.s" - .include "keyboard.s" - .include "draw_pointer.s" - .include "end_level.s" - .include "audio.s" - .include "common_sprites.inc" - .include "page_sprites.inc" -.endif - ; level graphics .include "graphics_selena/selena_graphics.inc" @@ -426,8 +410,5 @@ keypad_press: -;.align $100 -;audio_link_noise: -;.incbin "audio/link_noise.btc" diff --git a/mist/simple_sounds.s b/mist/simple_sounds.s index 7ac3fe17..0c8f9b6b 100644 --- a/mist/simple_sounds.s +++ b/mist/simple_sounds.s @@ -1,8 +1,12 @@ + ;============================ + ; click the speaker + ;============================ + ; FIXME: make it last longer? click_speaker: - lda SOUND_DISABLED - bne done_click + lda SOUND_STATUS + bmi done_click bit $c030 done_click: rts @@ -11,8 +15,8 @@ done_click: ; BEEP (inlined) ;=========================== beep: - lda SOUND_DISABLED - bne done_beep + lda SOUND_STATUS + bmi done_beep ldy #235 sty tone_smc+1 diff --git a/mist/zp.inc b/mist/zp.inc index 3db45588..9f5cb6ba 100644 --- a/mist/zp.inc +++ b/mist/zp.inc @@ -218,7 +218,10 @@ END_OF_SAVE = $C9 JOYSTICK_ENABLED= $DD -SOUND_DISABLED = $DE +SOUND_STATUS = $DE + SOUND_DISABLED = $80 + SOUND_IN_LC = $01 ; $01 sound effects in language card + GRID_PAGE = $DF ANIMATE_FRAME = $E0 LEVEL_OVER = $E1