mist: split cabin off from channelwood

This commit is contained in:
Vince Weaver 2020-06-16 13:57:10 -04:00
parent 930f3697ef
commit 2da8748aac
26 changed files with 588 additions and 3 deletions

View File

@ -12,7 +12,7 @@ zip: mist.dsk mist_side2.dsk
zip mist.zip mist.dsk mist_side2.dsk
mist.dsk: HELLO LOADER MIST_TITLE MIST OCTAGON VIEWER \
MECHE SELENA CHANNEL STONEY
MECHE SELENA CABIN CHANNEL STONEY
cp empty.dsk mist.dsk
$(DOS33) -y mist.dsk SAVE A HELLO
$(DOS33) -y mist.dsk BSAVE -a 0x1000 LOADER
@ -21,7 +21,7 @@ mist.dsk: HELLO LOADER MIST_TITLE MIST OCTAGON VIEWER \
$(DOS33) -y mist.dsk BSAVE -a 0x2000 OCTAGON
# $(DOS33) -y mist.dsk BSAVE -a 0x2000 MECHE
# $(DOS33) -y mist.dsk BSAVE -a 0x2000 SELENA
# $(DOS33) -y mist.dsk BSAVE -a 0x2000 CHANNEL
$(DOS33) -y mist.dsk BSAVE -a 0x2000 CABIN
# $(DOS33) -y mist.dsk BSAVE -a 0x2000 VIEWER
$(DOS33) -y mist.dsk BSAVE -a 0x2000 STONEY
$(DOS33) -y mist.dsk BSAVE -a 0x9000 ./audio/link_noise.btc LINK_NOISE.BTC
@ -187,6 +187,25 @@ stoney.o: stoney.s zp.inc hardware.inc common_defines.inc \
gr_copy.s audio.s text_print.s decompress_fast_v2.s
ca65 -o stoney.o stoney.s -l stoney.lst
####
CABIN: cabin.o
ld65 -o CABIN cabin.o -C ../linker_scripts/apple2_2000.inc
cabin.o: cabin.s zp.inc hardware.inc common_defines.inc \
common_routines.inc \
graphics_cabin/cabin_graphics.inc \
common_sprites.inc \
page_sprites.inc \
leveldata_cabin.inc \
keyboard.s \
draw_pointer.s \
link_book_channel.s \
gr_copy.s audio.s text_print.s decompress_fast_v2.s
ca65 -o cabin.o cabin.s -l cabin.lst
####
CHANNEL: channel.o

246
mist/cabin.s Normal file
View File

@ -0,0 +1,246 @@
; That Cabin in the woods
; by deater (Vince Weaver) <vince@deater.net>
; Zero Page
.include "zp.inc"
.include "hardware.inc"
.include "common_defines.inc"
.include "common_routines.inc"
cabin_start:
;===================
; init screen
jsr TEXT
jsr HOME
bit KEYRESET
bit SET_GR
bit PAGE0
bit LORES
bit FULLGR
;=================
; set up location
;=================
lda #<locations
sta LOCATIONS_L
lda #>locations
sta LOCATIONS_H
lda #0
sta DRAW_PAGE
sta LEVEL_OVER
; init cursor
lda #20
sta CURSOR_X
sta CURSOR_Y
; set up initial location
jsr change_location
lda #1
sta CURSOR_VISIBLE ; visible at first
lda #0
sta ANIMATE_FRAME
game_loop:
;=================
; reset things
;=================
lda #0
sta IN_SPECIAL
sta IN_RIGHT
sta IN_LEFT
;====================================
; copy background to current page
;====================================
jsr gr_copy_to_current
;====================================
; handle special-case forground logic
;====================================
lda LOCATION
cmp #CABIN_TREE_BOOK_OPEN
beq animate_channel_book
jmp nothing_special
animate_channel_book:
lda ANIMATE_FRAME
cmp #11
bcc channel_book_good
lda #0
sta ANIMATE_FRAME
channel_book_good:
; handle animated linking book
lda ANIMATE_FRAME
asl
tay
lda channel_movie,Y
sta INL
lda channel_movie+1,Y
sta INH
lda #22
sta XPOS
lda #12
sta YPOS
jsr put_sprite_crop
lda FRAMEL
and #$f
bne done_animate_book
inc ANIMATE_FRAME
done_animate_book:
jmp nothing_special
nothing_special:
;====================================
; draw pointer
;====================================
jsr draw_pointer
;====================================
; page flip
;====================================
jsr page_flip
;====================================
; handle keypress/joystick
;====================================
jsr handle_keypress
;====================================
; inc frame count
;====================================
inc FRAMEL
bne room_frame_no_oflo
inc FRAMEH
room_frame_no_oflo:
;====================================
; check level over
;====================================
lda LEVEL_OVER
bne really_exit
jmp game_loop
really_exit:
jmp end_level
back_to_mist:
lda #DIRECTION_N
sta DIRECTION
lda #MIST_ARRIVAL_DOCK ; the dock
jmp exit_to_mist
enter_clock:
lda #DIRECTION_S
sta DIRECTION
lda #MIST_CLOCK
jmp exit_to_mist
handle_clearing:
lda DIRECTION
cmp #DIRECTION_W
beq enter_path
; else going east
lda CURSOR_X
cmp #23
bcc enter_cabin
enter_tree_path:
lda #DIRECTION_E
sta DIRECTION
lda #CHANNEL_TREE_PATH
sta LOCATION
jmp change_location
enter_cabin:
lda #DIRECTION_E
sta DIRECTION
lda #CHANNEL_CABIN_OPEN
sta LOCATION
jmp change_location
enter_path:
lda #DIRECTION_N
sta DIRECTION
lda #MIST_TREE_CORRIDOR_5
jmp exit_to_mist
exit_to_mist:
sta LOCATION
lda #$ff
sta LEVEL_OVER
lda #LOAD_MIST
sta WHICH_LOAD
rts
;==========================
; includes
;==========================
; level graphics
.include "graphics_cabin/cabin_graphics.inc"
; puzzles
; .include "channel_switches.s"
; level data
.include "leveldata_cabin.inc"
; linking books
.include "link_book_channel.s"

View File

@ -44,7 +44,11 @@ LOAD_OCTAGON = $4
LOAD_VIEWER = $5
LOAD_STONEY = $6
LOAD_CHANNEL = $7
LOAD_ENDING = $8
LOAD_CABIN = $8
LOAD_DENTIST = $9
LOAD_ARBOR = $10
LOAD_SHIPUP = $11
LOAD_ENDING = $12
@ -349,3 +353,18 @@ CHANNEL_BOOK_ROOM = 46
CHANNEL_BOOK_CLOSED = 47
CHANNEL_BOOK_OPEN = 48
; Cabin lost in woods
CABIN_OUTSIDE = 0
CABIN_OPEN = 1
CABIN_ENTRANCE = 2
CABIN_INSIDE = 3
CABIN_SAFE = 4
CABIN_CLOCK_PATH = 5
CABIN_TREE_PATH = 6
CABIN_BIG_TREE = 7
CABIN_TREE_ELEVATOR = 8
CABIN_TREE_BASEMENT = 9
CABIN_TREE_BOOK = 10
CABIN_TREE_BOOK_CLOSED = 11
CABIN_TREE_BOOK_OPEN = 12

View File

@ -0,0 +1,56 @@
#include ../Makefile.inc
PNG2RLE = ../../gr-utils/png2rle
PNG2GR = ../../gr-utils/png2gr
LZSA = ~/research/lzsa/lzsa/lzsa
all: cabin_graphics.inc
####
cabin_graphics.inc: \
clearing_e.lzsa clearing_s.lzsa clearing_w.lzsa \
clearing_e_open.lzsa \
boiler_room_e.lzsa \
boiler_e.lzsa boiler_w.lzsa \
safe_w.lzsa safe_open_w.lzsa \
clock_path_n.lzsa clock_path_s.lzsa \
tree_path_e.lzsa tree_path_w.lzsa \
tree_base_n.lzsa tree_base_s.lzsa \
tree_basement_n.lzsa tree_basement_s.lzsa \
tree_basement_book_s.lzsa \
tree_basement_book_open_s.lzsa \
tree_basement_book_closed_s.lzsa \
tree_elevator_basement_s.lzsa
echo "clearing_e_lzsa: .incbin \"clearing_e.lzsa\"" > cabin_graphics.inc
echo "clearing_s_lzsa: .incbin \"clearing_s.lzsa\"" >> cabin_graphics.inc
echo "clearing_w_lzsa: .incbin \"clearing_w.lzsa\"" >> cabin_graphics.inc
echo "clearing_e_open_lzsa: .incbin \"clearing_e_open.lzsa\"" >> cabin_graphics.inc
echo "boiler_room_e_lzsa: .incbin \"boiler_room_e.lzsa\"" >> cabin_graphics.inc
echo "boiler_e_lzsa: .incbin \"boiler_e.lzsa\"" >> cabin_graphics.inc
echo "boiler_w_lzsa: .incbin \"boiler_w.lzsa\"" >> cabin_graphics.inc
echo "safe_w_lzsa: .incbin \"safe_w.lzsa\"" >> cabin_graphics.inc
echo "safe_open_w_lzsa: .incbin \"safe_open_w.lzsa\"" >> cabin_graphics.inc
echo "clock_path_n_lzsa: .incbin \"clock_path_n.lzsa\"" >> cabin_graphics.inc
echo "clock_path_s_lzsa: .incbin \"clock_path_s.lzsa\"" >> cabin_graphics.inc
echo "tree_path_e_lzsa: .incbin \"tree_path_e.lzsa\"" >> cabin_graphics.inc
echo "tree_path_w_lzsa: .incbin \"tree_path_w.lzsa\"" >> cabin_graphics.inc
echo "tree_base_n_lzsa: .incbin \"tree_base_n.lzsa\"" >> cabin_graphics.inc
echo "tree_base_s_lzsa: .incbin \"tree_base_s.lzsa\"" >> cabin_graphics.inc
echo "tree_basement_s_lzsa: .incbin \"tree_basement_s.lzsa\"" >> cabin_graphics.inc
echo "tree_basement_n_lzsa: .incbin \"tree_basement_n.lzsa\"" >> cabin_graphics.inc
echo "tree_basement_book_s_lzsa: .incbin \"tree_basement_book_s.lzsa\"" >> cabin_graphics.inc
echo "tree_basement_book_open_s_lzsa: .incbin \"tree_basement_book_open_s.lzsa\"" >> cabin_graphics.inc
echo "tree_basement_book_closed_s_lzsa: .incbin \"tree_basement_book_closed_s.lzsa\"" >> cabin_graphics.inc
echo "tree_elevator_basement_s_lzsa: .incbin \"tree_elevator_basement_s.lzsa\"" >> cabin_graphics.inc
%.gr: %.png
$(PNG2GR) $< $@
%.lzsa: %.gr
$(LZSA) -r -f2 $< $@
####
clean:
rm -f *~ *.o *.lst *.gr *.lzsa cabin_graphics.inc

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 989 B

After

Width:  |  Height:  |  Size: 989 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 831 B

After

Width:  |  Height:  |  Size: 831 B

View File

Before

Width:  |  Height:  |  Size: 860 B

After

Width:  |  Height:  |  Size: 860 B

View File

Before

Width:  |  Height:  |  Size: 1020 B

After

Width:  |  Height:  |  Size: 1020 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

Before

Width:  |  Height:  |  Size: 858 B

After

Width:  |  Height:  |  Size: 858 B

View File

Before

Width:  |  Height:  |  Size: 867 B

After

Width:  |  Height:  |  Size: 867 B

View File

Before

Width:  |  Height:  |  Size: 891 B

After

Width:  |  Height:  |  Size: 891 B

View File

Before

Width:  |  Height:  |  Size: 885 B

After

Width:  |  Height:  |  Size: 885 B

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 1006 B

After

Width:  |  Height:  |  Size: 1006 B

245
mist/leveldata_cabin.inc Normal file
View File

@ -0,0 +1,245 @@
;===============================================
; level data for Cabin
;===============================================
locations:
.word location0, location1, location2, location3
.word location4, location5, location6, location7
.word location8, location9, location10,location11
.word location12
; CABIN_OUTSIDE -- outside in clearing
location0:
.byte $ff ; north exit
.byte CABIN_CLOCK_PATH ; south exit
.byte CABIN_OPEN ; east exit
.byte $ff ; west exit
.byte $ff ; north exit_dir
.byte DIRECTION_S ; south exit_dir
.byte DIRECTION_E ; east exit_dir
.byte $ff ; west exit_dir
.word $0000 ; north bg
.word clearing_s_lzsa ; south bg
.word clearing_e_lzsa ; east bg
.word clearing_w_lzsa ; west bg
.byte BG_SOUTH|BG_EAST|BG_WEST
.byte DIRECTION_E|DIRECTION_W ; special exit
.byte 7,33 ; special x
.byte 2,46 ; special y
.word handle_clearing-1 ; special function
; CABIN_OPEN -- outside, door open
location1:
.byte $ff ; north exit
.byte $ff ; south exit
.byte CABIN_ENTRANCE ; east exit
.byte $ff ; west exit
.byte $ff ; north exit_dir
.byte $ff ; south exit_dir
.byte DIRECTION_E ; east exit_dir
.byte $ff ; west exit_dir
.word $0000 ; north bg
.word clearing_s_lzsa ; south bg
.word clearing_e_open_lzsa ; east bg
.word clearing_w_lzsa ; west bg
.byte BG_SOUTH|BG_EAST|BG_WEST
.byte DIRECTION_E|DIRECTION_W ; special exit
.byte 7,33 ; special x
.byte 2,46 ; special y
.word handle_clearing-1 ; special function
; CABIN_ENTRANCE -- entering the cabin
location2:
.byte $ff ; north exit
.byte $ff ; south exit
.byte CABIN_INSIDE ; east exit
.byte $ff ; west exit
.byte $ff ; north exit_dir
.byte $ff ; south exit_dir
.byte DIRECTION_E ; east exit_dir
.byte $ff ; west exit_dir
.word $0000 ; north bg
.word $0000 ; south bg
.word boiler_room_e_lzsa ; east bg
.word $0000 ; west bg
.byte BG_EAST
.byte $ff
; CABIN_INSIDE -- inside the cabin
location3:
.byte $ff ; north exit
.byte $ff ; south exit
.byte $ff ; east exit
.byte CABIN_OUTSIDE ; west exit
.byte $ff ; north exit_dir
.byte $ff ; south exit_dir
.byte $ff ; east exit_dir
.byte DIRECTION_W ; west exit_dir
.word $0000 ; north bg
.word $0000 ; south bg
.word boiler_e_lzsa ; east bg
.word boiler_w_lzsa ; west bg
.byte BG_EAST|BG_WEST
.byte $ff
; CABIN_SAFE -- looking at safe
location4:
.byte $ff ; north exit
.byte $ff ; south exit
.byte $ff ; east exit
.byte CABIN_INSIDE ; west exit
.byte $ff ; north exit_dir
.byte $ff ; south exit_dir
.byte $ff ; east exit_dir
.byte DIRECTION_W ; west exit_dir
.word $0000 ; north bg
.word $0000 ; south bg
.word $000 ; east bg
.word safe_w_lzsa ; west bg
.byte BG_WEST
.byte $ff
; CABIN_CLOCK_PATH -- path to clock
location5:
.byte CABIN_OUTSIDE ; north exit
.byte $ff ; south exit
.byte $ff ; east exit
.byte $ff ; west exit
.byte DIRECTION_E ; north exit_dir
.byte $ff ; south exit_dir
.byte $ff ; east exit_dir
.byte $ff ; west exit_dir
.word clock_path_n_lzsa ; north bg
.word clock_path_s_lzsa ; south bg
.word $0000 ; east bg
.word $0000 ; west bg
.byte BG_NORTH|BG_SOUTH
.byte DIRECTION_S ; special exit
.byte 9,29 ; special x
.byte 2,46 ; special y
.word enter_clock-1 ; special function
; CABIN_TREE_PATH -- path to tree
location6:
.byte $ff ; north exit
.byte $ff ; south exit
.byte CABIN_BIG_TREE ; east exit
.byte CABIN_OUTSIDE ; west exit
.byte $ff ; north exit_dir
.byte $ff ; south exit_dir
.byte DIRECTION_N ; east exit_dir
.byte DIRECTION_W ; west exit_dir
.word $0000 ; north bg
.word $0000 ; south bg
.word tree_path_e_lzsa ; east bg
.word tree_path_w_lzsa ; west bg
.byte BG_EAST|BG_WEST
.byte $ff
; CABIN_BIG_TREE -- at the big tree
location7:
.byte CABIN_TREE_ELEVATOR ; north exit
.byte CABIN_TREE_PATH ; south exit
.byte $ff ; east exit
.byte $ff ; west exit
.byte DIRECTION_S ; north exit_dir
.byte DIRECTION_W ; south exit_dir
.byte $ff ; east exit_dir
.byte $ff ; west exit_dir
.word tree_base_n_lzsa ; north bg
.word tree_base_s_lzsa ; south bg
.word $0000 ; east bg
.word $0000 ; west bg
.byte BG_NORTH|BG_SOUTH
.byte $ff
; CABIN_TREE_ELEVATOR -- in the tree elevator
location8:
.byte $ff ; north exit
.byte CABIN_TREE_BASEMENT ; south exit
.byte $ff ; east exit
.byte $ff ; west exit
.byte $ff ; north exit_dir
.byte DIRECTION_S ; south exit_dir
.byte $ff ; east exit_dir
.byte $ff ; west exit_dir
.word $0000 ; north bg
.word tree_elevator_basement_s_lzsa ; south bg
.word $0000 ; east bg
.word $0000 ; west bg
.byte BG_SOUTH
.byte $ff
; CABIN_TREE_BASEMENT -- in the tree basement
location9:
.byte CABIN_BIG_TREE ; north exit
.byte CABIN_TREE_BOOK ; south exit
.byte $ff ; east exit
.byte $ff ; west exit
.byte DIRECTION_S ; north exit_dir
.byte DIRECTION_S ; south exit_dir
.byte $ff ; east exit_dir
.byte $ff ; west exit_dir
.word tree_basement_n_lzsa ; north bg
.word tree_basement_s_lzsa ; south bg
.word $0000 ; east bg
.word $0000 ; west bg
.byte BG_SOUTH|BG_NORTH
.byte $ff
; CABIN_TREE_BOOK -- tree basement book
location10:
.byte $ff ; north exit
.byte CABIN_TREE_BOOK_CLOSED ; south exit
.byte $ff ; east exit
.byte $ff ; west exit
.byte $ff ; north exit_dir
.byte DIRECTION_S ; south exit_dir
.byte $ff ; east exit_dir
.byte $ff ; west exit_dir
.word $0000 ; north bg
.word tree_basement_book_s_lzsa ; south bg
.word $0000 ; east bg
.word $0000 ; west bg
.byte BG_SOUTH
.byte $ff
; CABIN_TREE_BOOK_CLOSED -- tree basement book closed
location11:
.byte $ff ; north exit
.byte CABIN_TREE_BOOK_OPEN ; south exit
.byte $ff ; east exit
.byte $ff ; west exit
.byte $ff ; north exit_dir
.byte DIRECTION_S ; south exit_dir
.byte $ff ; east exit_dir
.byte $ff ; west exit_dir
.word $0000 ; north bg
.word tree_basement_book_closed_s_lzsa ; south bg
.word $0000 ; east bg
.word $0000 ; west bg
.byte BG_SOUTH
.byte $ff
; CABIN_TREE_BOOK_OPEN -- tree basement book open
location12:
.byte $ff ; north exit
.byte CABIN_TREE_BASEMENT ; south exit
.byte $ff ; east exit
.byte $ff ; west exit
.byte $ff ; north exit_dir
.byte DIRECTION_S ; south exit_dir
.byte $ff ; east exit_dir
.byte $ff ; west exit_dir
.word $0000 ; north bg
.word tree_basement_book_open_s_lzsa ; south bg
.word $0000 ; east bg
.word $0000 ; west bg
.byte BG_SOUTH
.byte DIRECTION_S ; special exit
.byte 21,31 ; special x
.byte 10,24 ; special y
.word channel_link_book-1