mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-01-17 03:30:28 +00:00
mist: split up the code a bit
This commit is contained in:
parent
7d1fb17aa8
commit
b0fc5b881b
@ -50,6 +50,10 @@ mist.o: mist.s zp.inc hardware.inc \
|
||||
common_sprites.inc \
|
||||
leveldata_island.inc \
|
||||
clock_bridge_puzzle.s clock_sprites.inc \
|
||||
link_book_mist.s \
|
||||
letter_cat.s \
|
||||
marker_switch.s \
|
||||
brother_books.s \
|
||||
gr_copy.s audio.s text_print.s decompress_fast_v2.s
|
||||
ca65 -o mist.o mist.s -l mist.lst
|
||||
|
||||
|
96
mist/brother_books.s
Normal file
96
mist/brother_books.s
Normal file
@ -0,0 +1,96 @@
|
||||
|
||||
;===========================
|
||||
; open the red book
|
||||
;===========================
|
||||
red_book:
|
||||
|
||||
bit KEYRESET
|
||||
lda #0
|
||||
sta FRAMEL
|
||||
|
||||
red_book_loop:
|
||||
|
||||
lda #<red_book_static_lzsa
|
||||
sta LZSA_SRC_LO
|
||||
lda #>red_book_static_lzsa
|
||||
sta LZSA_SRC_HI
|
||||
lda #$c ; load to page $c00
|
||||
jsr decompress_lzsa2_fast
|
||||
|
||||
jsr gr_copy_to_current
|
||||
|
||||
jsr page_flip
|
||||
|
||||
lda #120
|
||||
jsr WAIT
|
||||
|
||||
lda #<red_book_static2_lzsa
|
||||
sta LZSA_SRC_LO
|
||||
lda #>red_book_static2_lzsa
|
||||
sta LZSA_SRC_HI
|
||||
lda #$c ; load to page $c00
|
||||
jsr decompress_lzsa2_fast
|
||||
|
||||
jsr gr_copy_to_current
|
||||
|
||||
jsr page_flip
|
||||
|
||||
lda #120
|
||||
jsr WAIT
|
||||
|
||||
|
||||
inc FRAMEL
|
||||
lda FRAMEL
|
||||
cmp #5
|
||||
bne done_sir
|
||||
|
||||
;; annoying brother
|
||||
|
||||
|
||||
lda #<red_book_open_lzsa
|
||||
sta LZSA_SRC_LO
|
||||
lda #>red_book_open_lzsa
|
||||
sta LZSA_SRC_HI
|
||||
lda #$c ; load to page $c00
|
||||
jsr decompress_lzsa2_fast
|
||||
|
||||
jsr gr_copy_to_current
|
||||
|
||||
jsr page_flip
|
||||
|
||||
lda #<audio_red_page
|
||||
sta BTC_L
|
||||
lda #>audio_red_page
|
||||
sta BTC_H
|
||||
ldx #21 ; 21 pages long???
|
||||
jsr play_audio
|
||||
|
||||
|
||||
; lda #100
|
||||
; jsr WAIT
|
||||
|
||||
|
||||
done_sir:
|
||||
|
||||
lda KEYPRESS
|
||||
bpl red_book_loop
|
||||
|
||||
red_book_done:
|
||||
|
||||
bit KEYRESET
|
||||
|
||||
; restore bg
|
||||
|
||||
lda #<red_book_shelf_lzsa
|
||||
sta LZSA_SRC_LO
|
||||
lda #>red_book_shelf_lzsa
|
||||
sta LZSA_SRC_HI
|
||||
lda #$c ; load to page $c00
|
||||
jsr decompress_lzsa2_fast
|
||||
|
||||
|
||||
rts
|
||||
|
||||
|
||||
|
||||
|
86
mist/letter_cat.s
Normal file
86
mist/letter_cat.s
Normal file
@ -0,0 +1,86 @@
|
||||
; Catherine,
|
||||
; I've left for you a message
|
||||
; of utmost importance in
|
||||
; our fore-chamber beside
|
||||
; the dock. Enter the number
|
||||
; of Marker Switches on
|
||||
; this island into the imager
|
||||
; to retrieve the message.
|
||||
; Yours,
|
||||
; Atrus
|
||||
|
||||
letter:
|
||||
; 01234567890123456789
|
||||
.byte 9,1," CATHERINE, ",0
|
||||
.byte 9,3," I THINK SOME WEIRD ",0
|
||||
.byte 9,5," GUY IS OUT ROAMING ",0
|
||||
.byte 9,7," AROUND OUR ISLAND! ",0
|
||||
.byte 9,9," MAYBE HE CAN SOLVE ",0
|
||||
.byte 9,11," ALL OF OUR DEEP ",0
|
||||
.byte 9,13," FAMILY PROBLEMS ",0
|
||||
.byte 9,15," WHILE I MESS ",0
|
||||
.byte 9,17," WITH MY BOOKS. ",0
|
||||
.byte 9,19," YOURS, ",0
|
||||
.byte 9,21," ATRUS ",0
|
||||
|
||||
clear_line:
|
||||
.byte 9,0, " ",0
|
||||
|
||||
;================
|
||||
; read the letter
|
||||
|
||||
read_letter:
|
||||
; jsr TEXT
|
||||
; jsr HOME
|
||||
bit KEYRESET
|
||||
|
||||
bit SET_TEXT
|
||||
|
||||
jsr clear_all
|
||||
|
||||
; clear
|
||||
|
||||
ldx #0
|
||||
clear_line_loop:
|
||||
lda #<clear_line
|
||||
sta OUTL
|
||||
lda #>clear_line
|
||||
sta OUTH
|
||||
|
||||
|
||||
stx clear_line+1
|
||||
jsr move_and_print
|
||||
inx
|
||||
cpx #24
|
||||
bne clear_line_loop
|
||||
|
||||
|
||||
lda #<letter
|
||||
sta OUTL
|
||||
lda #>letter
|
||||
sta OUTH
|
||||
|
||||
ldx #0
|
||||
letter_loop:
|
||||
jsr move_and_print
|
||||
|
||||
inx
|
||||
cpx #12
|
||||
bne letter_loop
|
||||
|
||||
jsr page_flip
|
||||
|
||||
wait_done_letter:
|
||||
lda KEYPRESS
|
||||
bpl wait_done_letter
|
||||
bit KEYRESET
|
||||
|
||||
; turn graphics back on
|
||||
|
||||
bit SET_GR
|
||||
; bit PAGE0
|
||||
; bit FULLGR
|
||||
|
||||
rts
|
||||
|
||||
|
@ -60,7 +60,7 @@ location0:
|
||||
.byte DIRECTION_N ; special exit
|
||||
.byte 21,31 ; special x
|
||||
.byte 10,24 ; special y
|
||||
.word myst_link_book-1 ; special function
|
||||
.word mist_link_book-1 ; special function
|
||||
|
||||
|
||||
; dock
|
||||
|
19
mist/link_book_mist.s
Normal file
19
mist/link_book_mist.s
Normal file
@ -0,0 +1,19 @@
|
||||
;=============================
|
||||
; mist_link_book
|
||||
;=============================
|
||||
mist_link_book:
|
||||
|
||||
; play sound effect?
|
||||
|
||||
lda #<audio_link_noise
|
||||
sta BTC_L
|
||||
lda #>audio_link_noise
|
||||
sta BTC_H
|
||||
ldx #43 ; 45 pages long???
|
||||
jsr play_audio
|
||||
|
||||
lda #1
|
||||
sta LOCATION
|
||||
jsr change_location
|
||||
rts
|
||||
|
12
mist/marker_switch.s
Normal file
12
mist/marker_switch.s
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
|
||||
click_switch:
|
||||
|
||||
; click
|
||||
|
||||
bit $C030
|
||||
bit $C030
|
||||
|
||||
rts
|
||||
|
||||
|
228
mist/mist.s
228
mist/mist.s
@ -400,29 +400,6 @@ handle_special:
|
||||
pha
|
||||
rts
|
||||
|
||||
;=============================
|
||||
; myst_link_book
|
||||
;=============================
|
||||
myst_link_book:
|
||||
|
||||
; play sound effect?
|
||||
|
||||
lda #<audio_link_noise
|
||||
sta BTC_L
|
||||
lda #>audio_link_noise
|
||||
sta BTC_H
|
||||
ldx #43 ; 45 pages long???
|
||||
jsr play_audio
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
lda #1
|
||||
sta LOCATION
|
||||
jsr change_location
|
||||
rts
|
||||
|
||||
|
||||
;=============================
|
||||
; change direction
|
||||
@ -553,198 +530,6 @@ done_turning:
|
||||
|
||||
|
||||
|
||||
; Catherine,
|
||||
; I've left for you a message
|
||||
; of utmost importance in
|
||||
; our fore-chamber beside
|
||||
; the dock. Enter the number
|
||||
; of Marker Switches on
|
||||
; this island into the imager
|
||||
; to retrieve the message.
|
||||
; Yours,
|
||||
; Atrus
|
||||
|
||||
letter:
|
||||
; 01234567890123456789
|
||||
.byte 9,1," CATHERINE, ",0
|
||||
.byte 9,3," I THINK SOME WEIRD ",0
|
||||
.byte 9,5," GUY IS OUT ROAMING ",0
|
||||
.byte 9,7," AROUND OUR ISLAND! ",0
|
||||
.byte 9,9," MAYBE HE CAN SOLVE ",0
|
||||
.byte 9,11," ALL OF OUR DEEP ",0
|
||||
.byte 9,13," FAMILY PROBLEMS ",0
|
||||
.byte 9,15," WHILE I MESS ",0
|
||||
.byte 9,17," WITH MY BOOKS. ",0
|
||||
.byte 9,19," YOURS, ",0
|
||||
.byte 9,21," ATRUS ",0
|
||||
|
||||
clear_line:
|
||||
.byte 9,0, " ",0
|
||||
|
||||
;================
|
||||
; read the letter
|
||||
|
||||
read_letter:
|
||||
; jsr TEXT
|
||||
; jsr HOME
|
||||
bit KEYRESET
|
||||
|
||||
bit SET_TEXT
|
||||
|
||||
jsr clear_all
|
||||
|
||||
; clear
|
||||
|
||||
ldx #0
|
||||
clear_line_loop:
|
||||
lda #<clear_line
|
||||
sta OUTL
|
||||
lda #>clear_line
|
||||
sta OUTH
|
||||
|
||||
|
||||
stx clear_line+1
|
||||
jsr move_and_print
|
||||
inx
|
||||
cpx #24
|
||||
bne clear_line_loop
|
||||
|
||||
|
||||
lda #<letter
|
||||
sta OUTL
|
||||
lda #>letter
|
||||
sta OUTH
|
||||
|
||||
ldx #0
|
||||
letter_loop:
|
||||
jsr move_and_print
|
||||
|
||||
inx
|
||||
cpx #12
|
||||
bne letter_loop
|
||||
|
||||
jsr page_flip
|
||||
|
||||
wait_done_letter:
|
||||
lda KEYPRESS
|
||||
bpl wait_done_letter
|
||||
bit KEYRESET
|
||||
|
||||
; turn graphics back on
|
||||
|
||||
bit SET_GR
|
||||
; bit PAGE0
|
||||
; bit FULLGR
|
||||
|
||||
rts
|
||||
|
||||
|
||||
click_switch:
|
||||
|
||||
; click
|
||||
|
||||
bit $C030
|
||||
bit $C030
|
||||
|
||||
rts
|
||||
|
||||
|
||||
;===========================
|
||||
; open the red book
|
||||
;===========================
|
||||
red_book:
|
||||
|
||||
bit KEYRESET
|
||||
lda #0
|
||||
sta FRAMEL
|
||||
|
||||
red_book_loop:
|
||||
|
||||
lda #<red_book_static_lzsa
|
||||
sta LZSA_SRC_LO
|
||||
lda #>red_book_static_lzsa
|
||||
sta LZSA_SRC_HI
|
||||
lda #$c ; load to page $c00
|
||||
jsr decompress_lzsa2_fast
|
||||
|
||||
jsr gr_copy_to_current
|
||||
|
||||
jsr page_flip
|
||||
|
||||
lda #120
|
||||
jsr WAIT
|
||||
|
||||
lda #<red_book_static2_lzsa
|
||||
sta LZSA_SRC_LO
|
||||
lda #>red_book_static2_lzsa
|
||||
sta LZSA_SRC_HI
|
||||
lda #$c ; load to page $c00
|
||||
jsr decompress_lzsa2_fast
|
||||
|
||||
jsr gr_copy_to_current
|
||||
|
||||
jsr page_flip
|
||||
|
||||
lda #120
|
||||
jsr WAIT
|
||||
|
||||
|
||||
inc FRAMEL
|
||||
lda FRAMEL
|
||||
cmp #5
|
||||
bne done_sir
|
||||
|
||||
;; annoying brother
|
||||
|
||||
|
||||
lda #<red_book_open_lzsa
|
||||
sta LZSA_SRC_LO
|
||||
lda #>red_book_open_lzsa
|
||||
sta LZSA_SRC_HI
|
||||
lda #$c ; load to page $c00
|
||||
jsr decompress_lzsa2_fast
|
||||
|
||||
jsr gr_copy_to_current
|
||||
|
||||
jsr page_flip
|
||||
|
||||
lda #<audio_red_page
|
||||
sta BTC_L
|
||||
lda #>audio_red_page
|
||||
sta BTC_H
|
||||
ldx #21 ; 21 pages long???
|
||||
jsr play_audio
|
||||
|
||||
|
||||
; lda #100
|
||||
; jsr WAIT
|
||||
|
||||
|
||||
done_sir:
|
||||
|
||||
lda KEYPRESS
|
||||
bpl red_book_loop
|
||||
|
||||
red_book_done:
|
||||
|
||||
bit KEYRESET
|
||||
|
||||
; restore bg
|
||||
|
||||
lda #<red_book_shelf_lzsa
|
||||
sta LZSA_SRC_LO
|
||||
lda #>red_book_shelf_lzsa
|
||||
sta LZSA_SRC_HI
|
||||
lda #$c ; load to page $c00
|
||||
jsr decompress_lzsa2_fast
|
||||
|
||||
|
||||
rts
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;==========================
|
||||
; includes
|
||||
;==========================
|
||||
@ -765,6 +550,17 @@ red_book_done:
|
||||
; puzzles
|
||||
|
||||
.include "clock_bridge_puzzle.s"
|
||||
.include "marker_switch.s"
|
||||
.include "brother_books.s"
|
||||
|
||||
; linking books
|
||||
|
||||
.include "link_book_mist.s"
|
||||
|
||||
; letters
|
||||
|
||||
.include "letter_cat.s"
|
||||
|
||||
|
||||
.include "common_sprites.inc"
|
||||
|
||||
@ -772,6 +568,8 @@ red_book_done:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;.align $100
|
||||
audio_red_page:
|
||||
.incbin "audio/red_page.btc"
|
||||
|
Loading…
x
Reference in New Issue
Block a user