mist: re-enable linking noise if you have a language card (64k of RAM)

This commit is contained in:
Vince Weaver 2020-07-16 18:52:04 -04:00
parent 20637b309e
commit 5544dec969
21 changed files with 193 additions and 239 deletions

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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.

View File

@ -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);

View File

@ -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"

View File

@ -6,7 +6,6 @@ init_state:
; global game state
lda #0
sta SOUND_DISABLED
sta JOYSTICK_ENABLED
; game state in saves init

40
mist/lc_detect.s Normal file
View File

@ -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

View File

@ -14,24 +14,9 @@ channel_link_book:
jsr page_flip
;====================================
; load linking audio (12k) to $9000
; play link noise
; lda #<linking_filename
; sta OUTL
; lda #>linking_filename
; sta OUTH
; jsr opendir_filename
; play sound effect?
; lda #<linking_noise
; sta BTC_L
; 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

View File

@ -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 OUTL
lda #>linking_filename
sta OUTH
jsr opendir_filename
; play sound effect?
lda #<linking_noise
sta BTC_L
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

View File

@ -13,21 +13,10 @@ mist_link_book:
jsr clear_all
jsr page_flip
; play sound effect?
; play sound effect
lda #<linking_noise
sta BTC_L
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

View File

@ -13,51 +13,16 @@ mist_link_book:
jsr clear_all
jsr page_flip
.if 0
; play sound effect?
lda #<linking_noise
sta BTC_L
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

View File

@ -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 OUTL
lda #>linking_filename
sta OUTH
jsr play_link_noise
jsr opendir_filename
; play sound effect?
lda #<linking_noise
sta BTC_L
lda #>linking_noise
sta BTC_H
ldx #LINKING_NOISE_LENGTH ; 45 pages long???
jsr play_audio
.endif
lda #STONEY_ARRIVAL
sta LOCATION

34
mist/linking_noise.s Normal file
View File

@ -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_L
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

View File

@ -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"

View File

@ -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 OUTL
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+1
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"

View File

@ -56,25 +56,11 @@ dome_press_second:
jsr page_flip
;====================================
; load linking audio (12k) to $9000
.if 0
lda #<linking_filename
sta OUTL
lda #>linking_filename
sta OUTH
; play link noise
jsr opendir_filename
jsr play_link_noise
; play sound effect
lda #<linking_noise
sta BTC_L
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

View File

@ -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"

View File

@ -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

View File

@ -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