mist: you are prompted to switch disks again

need to add code to validate you're on the right one
This commit is contained in:
Vince Weaver 2020-09-01 20:01:05 -04:00
parent 3209a4e0d3
commit cf938aeab7
3 changed files with 82 additions and 85 deletions

View File

@ -2,53 +2,53 @@
; external routines
; loader.s
opendir_filename =$1263
opendir_filename =$120e
; linking_noise.s
play_link_noise =$13e2
play_link_noise =$13e7
; decompress_fast_v2.s
decompress_lzsa2_fast =$13fe
getsrc_smc =$14f4
decompress_lzsa2_fast =$1403
getsrc_smc =$14f9
; draw_pointer.s
draw_pointer =$1501
draw_pointer =$1506
; end_level.s
end_level =$166f
end_level =$1674
; gr_copy.s
gr_copy_to_current =$1691
gr_copy_to_current =$1696
; gr_fast_clear.s
clear_bottom =$17b7
clear_all =$17f5
clear_all_color =$181a
clear_bottom =$17bc
clear_all =$17fa
clear_all_color =$181f
; gr_offsets.s
gr_offsets =$1838
gr_offsets =$183d
; gr_page_flip.s
page_flip =$1868
page_flip =$186d
; gr_putsprite_crop.s
put_sprite_crop =$1882
psc_smc1 =$18a5
psc_smc2 =$193d
put_sprite_crop =$1887
psc_smc1 =$18aa
psc_smc2 =$1942
; keyboard.s
handle_keypress =$19be
change_direction =$1a82
change_location =$1abb
handle_keypress =$19c3
change_direction =$1a87
change_location =$1ac0
; text_print.s
move_and_print =$1b53
ps_smc1 =$1b80
move_and_print =$1b58
ps_smc1 =$1b85
; page_sprites.inc
blue_page_sprite =$1c68
red_page_sprite =$1c7e
white_page_sprite =$1c94
blue_page_small_sprite =$1caa
red_page_small_sprite =$1cb2
blue_page_sprite =$1c6d
red_page_sprite =$1c83
white_page_sprite =$1c99
blue_page_small_sprite =$1caf
red_page_small_sprite =$1cb7

View File

@ -13,40 +13,68 @@ qload_start:
lda #LOAD_TITLE ; load title
sta WHICH_LOAD
lda #1
sta CURRENT_DISK ; current disk number
main_game_loop:
jsr load_file
jmp main_game_loop
which_disk:
.byte '1' ; MIST_TITLE
.byte '1' ; MIST
.byte '3' ; MECHE
.byte '3' ; SELENA
.byte '1' ; OCTAGON
.byte '1' ; VIEWER
.byte '3' ; STONEY
.byte '2' ; CHANNEL
.byte '2' ; CABIN
.byte '1' ; DENTIST
.byte '2' ; ARBOR
.byte '2' ; NIBEL
.byte '1' ; SHIP
.byte '2' ; GENERATOR
.byte '1' ; D'NI
.byte '3' ; SUB
opendir_filename:
rts
; FIXME: have to keep these in sync
driveoff =$1122
load_new = $119D
load_address=$11CB
load_track=load_address+1
load_sector=load_address+2
load_length=load_address+3
;====================================
; loads file specified by WHICH_LOAD
;====================================
load_file:
ldx WHICH_LOAD
lda which_disk_array,X
cmp CURRENT_DISK
bne change_disk
lda load_address_array,X
sta load_address
lda track_array,X
sta load_track
lda sector_array,X
sta load_sector
lda length_array,X
sta load_length
jmp load_new
;===================================================
;===================================================
; file not found
; change disk
;===================================================
;===================================================
file_not_found:
change_disk:
mlsmc07:lda $c0e8 ; turn off drive motor?
; turn off disk drive light
jsr driveoff
jsr TEXT
jsr HOME
@ -66,54 +94,25 @@ quick_print:
jmp quick_print
quick_print_done:
; rts
; jsr quick_print
fnf_keypress:
lda KEYPRESS
bpl fnf_keypress
bit KEYRESET
; jmp which_load_loop
; FIXME: actually verify proper file
ldx WHICH_LOAD
lda which_disk_array,X
sta CURRENT_DISK
jmp load_file
; offset for disk number is 19
error_string:
.byte "PLEASE INSERT DISK 1, PRESS RETURN",0
opendir_filename:
rts
load_new = $119D
load_address=$11CB
load_track=load_address+1
load_sector=load_address+2
load_length=load_address+3
;====================================
; loads file specified by WHICH_LOAD
;====================================
load_file:
ldx WHICH_LOAD
lda load_address_array,X
sta load_address
lda track_array,X
sta load_track
lda sector_array,X
sta load_sector
lda length_array,X
sta load_length
jmp load_new
which_disk_array:
.byte 1,1,3,3 ; MIST_TITLE,MIST,MECHE,SELENA
.byte 1,1,3,2 ; OCTAGON,VIEWER,STONEY,CHANNEL
@ -146,8 +145,6 @@ length_array:
; .include "qkumba_popwr.s"
.include "audio.s"
.include "linking_noise.s"
.include "decompress_fast_v2.s"
@ -167,4 +164,4 @@ length_array:
qload_end:
.assert (<qload_end - <qload_start)>14, error, "loader too big"
.assert (<qload_end - <qload_start) > 14, error, "loader too big"

View File

@ -286,7 +286,7 @@ END_OF_SAVE = $D9
CURRENT_DISK = $DC
JOYSTICK_ENABLED= $DD
SOUND_STATUS = $DE
SOUND_DISABLED = $80