mist: split off top level of channelwood to NIBEL

This commit is contained in:
Vince Weaver 2020-06-28 00:07:58 -04:00
parent bef68b99a9
commit 66fa2d16dd
16 changed files with 359 additions and 149 deletions

View File

@ -27,13 +27,14 @@ mist.dsk: HELLO LOADER MIST_TITLE MIST OCTAGON VIEWER \
$(DOS33) -y mist.dsk BSAVE -a 0xe00 SAVE0
$(DOS33) -y mist.dsk BSAVE -a 0x9000 ./audio/link_noise.btc LINK_NOISE.BTC
mist_side2.dsk: HELLO_DISK2 MECHE SELENA CHANNEL VIEWER ARBOR
mist_side2.dsk: HELLO_DISK2 MECHE SELENA CHANNEL VIEWER ARBOR NIBEL
cp empty.dsk mist_side2.dsk
$(DOS33) -y mist_side2.dsk SAVE A HELLO_DISK2 HELLO
# $(DOS33) -y mist_side2.dsk BSAVE -a 0x2000 MECHE
# $(DOS33) -y mist_side2.dsk BSAVE -a 0x2000 SELENA
$(DOS33) -y mist_side2.dsk BSAVE -a 0x2000 CHANNEL
$(DOS33) -y mist_side2.dsk BSAVE -a 0x2000 ARBOR
$(DOS33) -y mist_side2.dsk BSAVE -a 0x2000 NIBEL
$(DOS33) -y mist_side2.dsk BSAVE -a 0x2000 VIEWER
# $(DOS33) -y mist_side2.dsk BSAVE -a 0x9000 ./audio/link_noise.btc LINK_NOISE.BTC
@ -271,6 +272,19 @@ arbor.o: arbor.s zp.inc hardware.inc common_defines.inc \
leveldata_arbor.inc \
arbor_switches.s
ca65 -o arbor.o arbor.s -l arbor.lst
####
NIBEL: nibel.o
ld65 -o NIBEL nibel.o -C ../linker_scripts/apple2_2000.inc
nibel.o: nibel.s zp.inc hardware.inc common_defines.inc \
common_routines.inc \
graphics_nibel/nibel_graphics.inc \
leveldata_nibel.inc \
nibel_switches.s
ca65 -o nibel.o nibel.s -l nibel.lst
####
graphics_island/mist_graphics.inc:
@ -283,4 +297,4 @@ clean:
rm -f *~ *.o *.lst HELLO HELLO_DISK2 \
LOADER MIST_TITLE \
MIST OCTAGON \
MECHE SELENA STONEY CHANNEL ARBOR
MECHE SELENA STONEY CHANNEL ARBOR NIBEL

View File

@ -76,20 +76,16 @@ elevator2_handle:
; check for water power
lda LOCATION
cmp #ARBOR_INSIDE_ELEV2_CLOSED
beq elev2_goto_top
elev2_goto_bottom:
lda #ARBOR_INSIDE_ELEV2_CLOSED
bne done_elev2_handle
elev2_goto_top:
lda #ARBOR_IN_ELEV2_TOP_CLOSED
done_elev2_handle:
lda #NIBEL_IN_ELEV2_TOP_CLOSED
sta LOCATION
jmp change_location
lda #LOAD_NIBEL
sta WHICH_LOAD
lda #$ff
sta LEVEL_OVER
rts
;=========================
@ -100,18 +96,7 @@ done_elev2_handle:
elevator2_close_door:
lda LOCATION
cmp #ARBOR_INSIDE_ELEV2_OPEN
bne elev2_close_top
elev2_close_bottom:
lda #ARBOR_INSIDE_ELEV2_CLOSED
bne done_elev2_close_door
elev2_close_top:
lda #ARBOR_IN_ELEV2_TOP_CLOSED
done_elev2_close_door:
sta LOCATION
jmp change_location
@ -306,9 +291,9 @@ bottom_gate_open:
ldy #LOCATION_WEST_BG
lda #<steps_bottom_open_w_lzsa
sta location32,Y ; ARBOR_STEPS_BOTTOM
sta location30,Y ; ARBOR_STEPS_BOTTOM
lda #>steps_bottom_open_w_lzsa
sta location32+1,Y ; ARBOR_STEPS_BOTTOM
sta location30+1,Y ; ARBOR_STEPS_BOTTOM
jmp bottom_gate_done
@ -316,9 +301,9 @@ bottom_gate_closed:
ldy #LOCATION_WEST_BG
lda #<steps_bottom_closed_w_lzsa
sta location32,Y ; ARBOR_STEPS_BOTTOM
sta location30,Y ; ARBOR_STEPS_BOTTOM
lda #>steps_bottom_closed_w_lzsa
sta location32+1,Y ; ARBOR_STEPS_BOTTOM
sta location30+1,Y ; ARBOR_STEPS_BOTTOM
bottom_gate_done:

View File

@ -48,7 +48,8 @@ LOAD_CABIN = 8
LOAD_DENTIST = 9
LOAD_ARBOR = 10
LOAD_SHIPUP = 11
LOAD_ENDING = 12
LOAD_NIBEL = 12
LOAD_ENDING = 13
@ -386,12 +387,14 @@ ARBOR_DOORS = 23
ARBOR_DOORS_ELEV2_OPEN = 24
ARBOR_INSIDE_ELEV2_OPEN = 25
ARBOR_INSIDE_ELEV2_CLOSED= 26
ARBOR_IN_ELEV2_TOP_CLOSED= 27
ARBOR_IN_ELEV2_TOP_OPEN= 28
ARBOR_STEPS_TOP = 29
ARBOR_STEPS2 = 30
ARBOR_STEPS1 = 31
ARBOR_STEPS_BOTTOM = 32
ARBOR_OUTSIDE_ELEV2_OPEN= 33
ARBOR_OUTSIDE_ELEV2_CLOSED= 34
ARBOR_STEPS_TOP = 27
ARBOR_STEPS2 = 28
ARBOR_STEPS1 = 29
ARBOR_STEPS_BOTTOM = 30
; NIBEL, up in the clouds
NIBEL_IN_ELEV2_TOP_CLOSED= 0
NIBEL_IN_ELEV2_TOP_OPEN= 1
NIBEL_OUTSIDE_ELEV2_OPEN= 2
NIBEL_OUTSIDE_ELEV2_CLOSED= 3

View File

@ -5,47 +5,47 @@
opendir_filename =$1039
; audio.c
play_audio =$133e
play_audio =$1346
; decompress_fast_v2.s
decompress_lzsa2_fast =$144f
getsrc_smc =$1545
decompress_lzsa2_fast =$1457
getsrc_smc =$154d
; draw_pointer.s
draw_pointer =$1552
draw_pointer =$155a
; end_level.s
end_level =$1695
end_level =$169d
; gr_copy.s
gr_copy_to_current =$16b7
gr_copy_to_current =$16bf
; gr_fast_clear.s
clear_all =$181b
clear_all_color =$1840
clear_all =$1823
clear_all_color =$1848
; gr_offsets.s
gr_offsets =$185e
gr_offsets =$1866
; gr_page_flip.s
page_flip =$188e
page_flip =$1896
; gr_putsprite_crop.s
put_sprite_crop =$18a8
put_sprite_crop =$18b0
; keyboard.s
handle_keypress =$19e4
change_location =$1ac5
handle_keypress =$19ec
change_location =$1acd
; text_print.s
move_and_print =$1b5d
move_and_print =$1b65
; page_sprites.inc
blue_page_sprite =$1d2b
red_page_sprite =$1d77
white_page_sprite =$1d8d
blue_page_small_sprite =$1da3
red_page_small_sprite =$1dab
blue_page_sprite =$1d33
red_page_sprite =$1d7f
white_page_sprite =$1d95
blue_page_small_sprite =$1dab
red_page_small_sprite =$1db3
; audio files
linking_noise = $9000

View File

@ -33,8 +33,6 @@ arbor_graphics.inc: \
doors_e.lzsa doors_closed_w.lzsa doors_open_w.lzsa \
doors_elev2_open_w.lzsa doors_open_elev2_closed_w.lzsa \
inside_elevator2_open.lzsa inside_elevator2_closed.lzsa \
elevator2_open_top.lzsa elevator2_closed_top.lzsa \
outside_elevator2_e.lzsa outside_elevator2_open_w.lzsa outside_elevator2_closed_w.lzsa \
steps_top_e.lzsa steps_top_w.lzsa \
steps1_e.lzsa steps1_w.lzsa \
steps2_e.lzsa steps2_w.lzsa \
@ -97,11 +95,6 @@ arbor_graphics.inc: \
echo "doors_open_elev2_closed_w_lzsa: .incbin \"doors_open_elev2_closed_w.lzsa\"" >> arbor_graphics.inc
echo "inside_elevator2_open_lzsa: .incbin \"inside_elevator2_open.lzsa\"" >> arbor_graphics.inc
echo "inside_elevator2_closed_lzsa: .incbin \"inside_elevator2_closed.lzsa\"" >> arbor_graphics.inc
echo "elevator2_open_top_lzsa: .incbin \"elevator2_open_top.lzsa\"" >> arbor_graphics.inc
echo "elevator2_closed_top_lzsa: .incbin \"elevator2_closed_top.lzsa\"" >> arbor_graphics.inc
echo "outside_elevator2_e_lzsa: .incbin \"outside_elevator2_e.lzsa\"" >> arbor_graphics.inc
echo "outside_elevator2_open_w_lzsa: .incbin \"outside_elevator2_open_w.lzsa\"" >> arbor_graphics.inc
echo "outside_elevator2_closed_w_lzsa: .incbin \"outside_elevator2_closed_w.lzsa\"" >> arbor_graphics.inc
echo "steps_top_e_lzsa: .incbin \"steps_top_e.lzsa\"" >> arbor_graphics.inc
echo "steps_top_w_lzsa: .incbin \"steps_top_w.lzsa\"" >> arbor_graphics.inc
echo "steps1_w_lzsa: .incbin \"steps1_w.lzsa\"" >> arbor_graphics.inc
@ -121,4 +114,4 @@ arbor_graphics.inc: \
####
clean:
rm -f *~ *.o *.lst *.gr *.lzsa channel_graphics.inc
rm -f *~ *.o *.lst *.gr *.lzsa arbor_graphics.inc

View File

@ -0,0 +1,29 @@
#include ../Makefile.inc
PNG2RLE = ../../gr-utils/png2rle
PNG2GR = ../../gr-utils/png2gr
LZSA = ~/research/lzsa/lzsa/lzsa
all: nibel_graphics.inc
####
nibel_graphics.inc: \
elevator2_open_top.lzsa elevator2_closed_top.lzsa \
outside_elevator2_e.lzsa outside_elevator2_open_w.lzsa outside_elevator2_closed_w.lzsa
echo "elevator2_open_top_lzsa: .incbin \"elevator2_open_top.lzsa\"" > nibel_graphics.inc
echo "elevator2_closed_top_lzsa: .incbin \"elevator2_closed_top.lzsa\"" >> nibel_graphics.inc
echo "outside_elevator2_e_lzsa: .incbin \"outside_elevator2_e.lzsa\"" >> nibel_graphics.inc
echo "outside_elevator2_open_w_lzsa: .incbin \"outside_elevator2_open_w.lzsa\"" >> nibel_graphics.inc
echo "outside_elevator2_closed_w_lzsa: .incbin \"outside_elevator2_closed_w.lzsa\"" >> nibel_graphics.inc
%.gr: %.png
$(PNG2GR) $< $@
%.lzsa: %.gr
$(LZSA) -r -f2 $< $@
####
clean:
rm -f *~ *.o *.lst *.gr *.lzsa nibel_graphics.inc

View File

Before

Width:  |  Height:  |  Size: 9.8 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

View File

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -10,9 +10,7 @@ locations:
.word location16,location17,location18,location19
.word location20,location21,location22,location23
.word location24,location25,location26,location27
.word location28,location29,location30,location31
.word location32,location33,location34
.word location28,location29,location30
; ARBOR_INSIDE_ELEV1 -- arrival in elevator1
location0:
@ -497,49 +495,8 @@ location26:
.byte 28,36 ; special y
.word elevator2_handle-1 ; special function
; ARBOR_IN_ELEV2_TOP_CLOSED -- inside elevator2 at top, door closed
location27:
.byte $ff ; north exit
.byte $ff ; south exit
.byte ARBOR_IN_ELEV2_TOP_OPEN ; 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 elevator2_closed_top_lzsa ; east bg
.word $0000 ; west bg
.byte BG_EAST
.byte DIRECTION_E ; special exit
.byte 28,34 ; special x
.byte 28,36 ; special y
.word elevator2_handle-1 ; special function
; ARBOR_IN_ELEV2_TOP_OPEN -- inside elevator2 at top, door open
location28:
.byte $ff ; north exit
.byte $ff ; south exit
.byte ARBOR_OUTSIDE_ELEV2_CLOSED ; 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 elevator2_open_top_lzsa ; east bg
.word $0000 ; west bg
.byte BG_EAST
.byte DIRECTION_E ; special exit
.byte 10,17 ; special x
.byte 6,46 ; special y
.word elevator2_close_door-1 ; special function
; ARBOR_STEPS_TOP -- top of steps
location29:
location27:
.byte $ff ; north exit
.byte $ff ; south exit
.byte ARBOR_DOORS ; east exit
@ -556,7 +513,7 @@ location29:
.byte $ff
; ARBOR_STEPS2 -- down steps
location30:
location28:
.byte $ff ; north exit
.byte $ff ; south exit
.byte ARBOR_STEPS_TOP ; east exit
@ -573,7 +530,7 @@ location30:
.byte $ff
; ARBOR_STEPS1 -- down steps further
location31:
location29:
.byte $ff ; north exit
.byte $ff ; south exit
.byte ARBOR_STEPS2 ; east exit
@ -590,7 +547,7 @@ location31:
.byte $ff
; ARBOR_STEPS_BOTTOM -- bottom of steps
location32:
location30:
.byte $ff ; north exit
.byte $ff ; south exit
.byte ARBOR_STEPS1 ; east exit
@ -610,37 +567,3 @@ location32:
.word stair_gate-1 ; special function
; ARBOR_OUTSIDE_ELEV2_OPEN -- outside of elevator2 at top, door open
location33:
.byte $ff ; north exit
.byte $ff ; south exit
.byte $ff ; east exit
.byte ARBOR_IN_ELEV2_TOP_OPEN ; west exit
.byte $ff ; north exit_dir
.byte $ff ; south exit_dir
.byte DIRECTION_E ; east exit_dir
.byte DIRECTION_E ; west exit_dir
.word $0000 ; north bg
.word $0000 ; south bg
.word outside_elevator2_e_lzsa ; east bg
.word outside_elevator2_open_w_lzsa ; west bg
.byte BG_EAST|BG_WEST
.byte $ff
; ARBOR_OUTSIDE_ELEV2_CLOSED -- outside of elevator2 at top, door closed
location34:
.byte $ff ; north exit
.byte $ff ; south exit
.byte $ff ; east exit
.byte ARBOR_OUTSIDE_ELEV2_OPEN ; west exit
.byte $ff ; north exit_dir
.byte $ff ; south exit_dir
.byte DIRECTION_E ; east exit_dir
.byte DIRECTION_W ; west exit_dir
.word $0000 ; north bg
.word $0000 ; south bg
.word outside_elevator2_e_lzsa ; east bg
.word outside_elevator2_closed_w_lzsa ; west bg
.byte BG_EAST|BG_WEST
.byte $ff

81
mist/leveldata_nibel.inc Normal file
View File

@ -0,0 +1,81 @@
;===============================================
; level data for Nibel clouds
;===============================================
locations:
.word location0, location1, location2, location3
; NIBEL_IN_ELEV2_TOP_CLOSED -- inside elevator2 at top, door closed
location0:
.byte $ff ; north exit
.byte $ff ; south exit
.byte NIBEL_IN_ELEV2_TOP_OPEN ; 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 elevator2_closed_top_lzsa ; east bg
.word $0000 ; west bg
.byte BG_EAST
.byte DIRECTION_E ; special exit
.byte 28,34 ; special x
.byte 28,36 ; special y
.word elevator2_handle-1 ; special function
; NIBEL_IN_ELEV2_TOP_OPEN -- inside elevator2 at top, door open
location1:
.byte $ff ; north exit
.byte $ff ; south exit
.byte NIBEL_OUTSIDE_ELEV2_CLOSED ; 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 elevator2_open_top_lzsa ; east bg
.word $0000 ; west bg
.byte BG_EAST
.byte DIRECTION_E ; special exit
.byte 10,17 ; special x
.byte 6,46 ; special y
.word elevator2_close_door-1 ; special function
; NIBEL_OUTSIDE_ELEV2_OPEN -- outside of elevator2 at top, door open
location2:
.byte $ff ; north exit
.byte $ff ; south exit
.byte $ff ; east exit
.byte NIBEL_IN_ELEV2_TOP_OPEN ; west exit
.byte $ff ; north exit_dir
.byte $ff ; south exit_dir
.byte DIRECTION_E ; east exit_dir
.byte DIRECTION_E ; west exit_dir
.word $0000 ; north bg
.word $0000 ; south bg
.word outside_elevator2_e_lzsa ; east bg
.word outside_elevator2_open_w_lzsa ; west bg
.byte BG_EAST|BG_WEST
.byte $ff
; NIBEL_OUTSIDE_ELEV2_CLOSED -- outside of elevator2 at top, door closed
location3:
.byte $ff ; north exit
.byte $ff ; south exit
.byte $ff ; east exit
.byte NIBEL_OUTSIDE_ELEV2_OPEN ; west exit
.byte $ff ; north exit_dir
.byte $ff ; south exit_dir
.byte DIRECTION_E ; east exit_dir
.byte DIRECTION_W ; west exit_dir
.word $0000 ; north bg
.word $0000 ; south bg
.word outside_elevator2_e_lzsa ; east bg
.word outside_elevator2_closed_w_lzsa ; west bg
.byte BG_EAST|BG_WEST
.byte $ff

View File

@ -144,7 +144,8 @@ filenames:
.word intro_filename
.word mist_filename,meche_filename,selena_filename,octagon_filename
.word viewer_filename,stoney_filename,channel_filename,cabin_filename
.word dentist_filename,arbor_filename,shipup_filename,ending_filename
.word dentist_filename,arbor_filename,shipup_filename,nibel_filename
.word ending_filename
intro_filename:
.byte "MIST_TITLE",0
@ -170,6 +171,8 @@ arbor_filename:
.byte "ARBOR",0
shipup_filename:
.byte "SHIPUP",0
nibel_filename:
.byte "NIBEL",0
ending_filename:
.byte "ENDING",0

135
mist/nibel.s Normal file
View File

@ -0,0 +1,135 @@
; The third level of Channely Wood
; Nibelheim, home in the clouds
; by deater (Vince Weaver) <vince@deater.net>
; Zero Page
.include "zp.inc"
.include "hardware.inc"
.include "common_defines.inc"
.include "common_routines.inc"
nibel_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 #CHANNEL_BOOK_OPEN
; beq animate_mist_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
;==========================
; includes
;==========================
; level graphics
.include "graphics_nibel/nibel_graphics.inc"
; puzzles
.include "nibel_switches.s"
; level data
.include "leveldata_nibel.inc"

44
mist/nibel_switches.s Normal file
View File

@ -0,0 +1,44 @@
;=============================
;=============================
; elevator2 handle pulled
;=============================
;=============================
; FIXME: check for water power
; FIXME: animate
elevator2_handle:
; click speaker
bit SPEAKER
; check for water power
lda #ARBOR_INSIDE_ELEV2_CLOSED
sta LOCATION
lda #LOAD_ARBOR
sta WHICH_LOAD
lda #$ff
sta LEVEL_OVER
rts
;=========================
;=========================
; close elevator2 door
;=========================
;=========================
elevator2_close_door:
lda #NIBEL_IN_ELEV2_TOP_CLOSED
sta LOCATION
jmp change_location