diff --git a/mist/Makefile b/mist/Makefile index 485bbaea..dc521dbb 100644 --- a/mist/Makefile +++ b/mist/Makefile @@ -12,8 +12,7 @@ zip: mist.dsk mist_side2.dsk mist_side3.dsk zip mist.zip mist.dsk mist_side2.dsk mist_side3.dsk mist.dsk: HELLO LOADER MIST_TITLE MIST OCTAGON VIEWER \ - MECHE SELENA CABIN CHANNEL STONEY DENTIST \ - D\'NI SAVE0 SHIP + DENTIST D\'NI SAVE0 SHIP cp empty.dsk mist.dsk $(DOS33) -y mist.dsk SAVE A HELLO $(DOS33) -y mist.dsk BSAVE -a 0x1000 LOADER @@ -37,13 +36,14 @@ mist_side2.dsk: HELLO_DISK2 CHANNEL ARBOR NIBEL CABIN -mist_side3.dsk: HELLO_DISK2 MECHE SELENA STONEY GENERATOR +mist_side3.dsk: HELLO_DISK2 MECHE SELENA STONEY GENERATOR SUB cp empty.dsk mist_side3.dsk $(DOS33) -y mist_side3.dsk SAVE A HELLO_DISK2 HELLO $(DOS33) -y mist_side3.dsk BSAVE -a 0x2000 MECHE $(DOS33) -y mist_side3.dsk BSAVE -a 0x2000 SELENA $(DOS33) -y mist_side3.dsk BSAVE -a 0x2000 STONEY $(DOS33) -y mist_side3.dsk BSAVE -a 0x2000 GENERATOR + $(DOS33) -y mist_side3.dsk BSAVE -a 0x2000 SUB ### @@ -207,6 +207,22 @@ selena.o: selena.s zp.inc hardware.inc common_defines.inc \ gr_copy.s audio.s text_print.s decompress_fast_v2.s ca65 -o selena.o selena.s -l selena.lst +#### + +SUB: sub.o + ld65 -o SUB sub.o -C ../linker_scripts/apple2_2000.inc + +sub.o: sub.s zp.inc hardware.inc common_defines.inc \ + common_routines.inc \ + graphics_sub/sub_graphics.inc \ + common_sprites.inc \ + leveldata_sub.inc \ + link_book_mist.s \ + end_level.s \ + keyboard.s \ + draw_pointer.s \ + gr_copy.s audio.s text_print.s decompress_fast_v2.s + ca65 -o sub.o sub.s -l sub.lst #### diff --git a/mist/common_defines.inc b/mist/common_defines.inc index 9c2a03c6..1ed911a6 100644 --- a/mist/common_defines.inc +++ b/mist/common_defines.inc @@ -51,6 +51,7 @@ LOAD_NIBEL = 11 LOAD_SHIP = 12 LOAD_GENERATOR = 13 LOAD_DNI = 14 +LOAD_SUB = 15 ;================================ ; Level definitions @@ -213,49 +214,52 @@ SELENA_WALKWAY1 = 3 SELENA_SPACESHIP_DOOR = 4 SELENA_WALKWAY4 = 5 SELENA_BUNKER = 6 -SELENA_SUB_ROOM = 7 -SELENA_BOOK_ROOM = 8 -SELENA_BOOK_CLOSED = 9 -SELENA_BOOK_OPEN = 10 -SELENA_WATER_TURN = 11 -SELENA_WATER_PATH = 12 -SELENA_WATER = 13 -SELENA_TOWER_VIEW = 14 -SELENA_CHASM_PATH = 15 -SELENA_CHASM = 16 -SELENA_CLOCK_PATH = 17 -SELENA_CLOCK = 18 -SELENA_CLOCK_CLOSE = 19 -SELENA_CLOCK_BEFORE = 20 -SELENA_CRYSTAL_TURN = 21 -SELENA_CRYSTAL_STEPS = 22 -SELENA_CRYSTAL_PATH = 23 -SELENA_CRYSTALS = 24 -SELENA_CRYSTAL_CLOSE = 25 -SELENA_SPACESHIP_PATH = 26 -SELENA_BEFORE_CRYSTALS = 27 -SELENA_TUNNEL_STEPS = 28 -SELENA_TUNNEL_PATH = 29 -SELENA_TUNNEL_MAINLAND = 30 -SELENA_TUNNEL_MAIN_CLOSE= 31 -SELENA_TUNNEL_MAIN_TOP = 32 -SELENA_TUNNEL_MAIN_MID = 33 -SELENA_TUNNEL_BASEMENT = 34 -SELENA_TUNNEL = 35 -SELENA_ANTENNA_BASEMENT = 36 -SELENA_ANTENNA_MID = 37 -SELENA_ANTENNA_TOP = 38 -SELENA_ANTENNA_TUNNEL = 39 -SELENA_ANTENNA_STEPS = 40 -SELENA_ANTENNA = 41 -SELENA_ANTENNA_OPEN = 42 -SELENA_ANTENNA_CLOSE = 43 -SELENA_BOOK_HALLWAY = 44 -SELENA_INSIDE_SUB = 45 -SELENA_SUB_HALLWAY = 46 -SELENA_BUNKER_ENTRY = 47 -SELENA_BUNKER_OPEN = 48 -SELENA_BUNKER_KEYPAD = 49 +SELENA_WATER_TURN = 7 +SELENA_WATER_PATH = 8 +SELENA_WATER = 9 +SELENA_TOWER_VIEW = 10 +SELENA_CHASM_PATH = 11 +SELENA_CHASM = 12 +SELENA_CLOCK_PATH = 13 +SELENA_CLOCK = 14 +SELENA_CLOCK_CLOSE = 15 +SELENA_CLOCK_BEFORE = 16 +SELENA_CRYSTAL_TURN = 17 +SELENA_CRYSTAL_STEPS = 18 +SELENA_CRYSTAL_PATH = 19 +SELENA_CRYSTALS = 20 +SELENA_CRYSTAL_CLOSE = 21 +SELENA_SPACESHIP_PATH = 22 +SELENA_BEFORE_CRYSTALS = 23 +SELENA_TUNNEL_STEPS = 24 +SELENA_TUNNEL_PATH = 25 +SELENA_TUNNEL_MAINLAND = 26 +SELENA_TUNNEL_MAIN_CLOSE= 27 +SELENA_TUNNEL_MAIN_TOP = 28 +SELENA_TUNNEL_MAIN_MID = 29 +SELENA_TUNNEL_BASEMENT = 30 +SELENA_TUNNEL = 31 +SELENA_ANTENNA_BASEMENT = 32 +SELENA_ANTENNA_MID = 33 +SELENA_ANTENNA_TOP = 34 +SELENA_ANTENNA_TUNNEL = 35 +SELENA_ANTENNA_STEPS = 36 +SELENA_ANTENNA = 37 +SELENA_ANTENNA_OPEN = 38 +SELENA_ANTENNA_CLOSE = 39 +SELENA_BUNKER_OPEN = 40 +SELENA_BUNKER_KEYPAD = 41 + +; Submarine on Selena +SUB_BUNKER_ENTRY = 0 +SUB_HALLWAY = 1 +SUB_ROOM = 2 +SUB_INSIDE_SUB = 3 +SUB_BOOK_HALLWAY = 4 +SUB_BOOK_ROOM = 5 +SUB_BOOK_CLOSED = 6 +SUB_BOOK_OPEN = 7 + ; Viewer Room diff --git a/mist/common_routines.inc b/mist/common_routines.inc index 0021b513..3458a9c9 100644 --- a/mist/common_routines.inc +++ b/mist/common_routines.inc @@ -5,50 +5,50 @@ opendir_filename =$1042 ; linking_noise.s -play_link_noise =$1591 +play_link_noise =$1598 ; decompress_fast_v2.s -decompress_lzsa2_fast =$15ad -getsrc_smc =$16a3 +decompress_lzsa2_fast =$15b4 +getsrc_smc =$16aa ; draw_pointer.s -draw_pointer =$16b0 +draw_pointer =$16b7 ; end_level.s -end_level =$181e +end_level =$1825 ; gr_copy.s -gr_copy_to_current =$1840 +gr_copy_to_current =$1847 ; gr_fast_clear.s -clear_bottom =$1966 -clear_all =$19a4 -clear_all_color =$19c9 +clear_bottom =$196d +clear_all =$19ab +clear_all_color =$19d0 ; gr_offsets.s -gr_offsets =$19e7 +gr_offsets =$19ee ; gr_page_flip.s -page_flip =$1a17 +page_flip =$1a1e ; gr_putsprite_crop.s -put_sprite_crop =$1a31 -psc_smc1 =$1a54 -psc_smc2 =$1aec +put_sprite_crop =$1a38 +psc_smc1 =$1a5b +psc_smc2 =$1af3 ; keyboard.s -handle_keypress =$1b6d -change_direction =$1c31 -change_location =$1c6a +handle_keypress =$1b74 +change_direction =$1c38 +change_location =$1c71 ; text_print.s -move_and_print =$1d02 -ps_smc1 =$1d2f +move_and_print =$1d09 +ps_smc1 =$1d36 ; page_sprites.inc -blue_page_sprite =$1e17 -red_page_sprite =$1e2d -white_page_sprite =$1e43 -blue_page_small_sprite =$1e59 -red_page_small_sprite =$1e61 +blue_page_sprite =$1e1e +red_page_sprite =$1e34 +white_page_sprite =$1e4a +blue_page_small_sprite =$1e60 +red_page_small_sprite =$1e68 diff --git a/mist/graphics_selena/Makefile b/mist/graphics_selena/Makefile index a3196a94..80c6ffb5 100644 --- a/mist/graphics_selena/Makefile +++ b/mist/graphics_selena/Makefile @@ -18,9 +18,6 @@ selena_graphics.inc: \ spaceship_door_s.lzsa \ walkway4_n.lzsa walkway4_s.lzsa \ bunker_n.lzsa bunker_s.lzsa bunker_e.lzsa \ - subroom_s.lzsa subroom_n.lzsa \ - book_table_n.lzsa book_table_s.lzsa \ - book_mist_open_s.lzsa book_mist_closed_s.lzsa \ water_turn_n.lzsa water_turn_s.lzsa water_turn_w.lzsa \ water_path_e.lzsa water_path_w.lzsa \ water_note_n.lzsa water_note_e.lzsa water_note_w.lzsa water_note_s.lzsa \ @@ -48,12 +45,8 @@ selena_graphics.inc: \ tunnel_e.lzsa tunnel_w.lzsa tunnel_basement.lzsa \ tunnel_note_n.lzsa \ tunnel_main_n.lzsa tunnel_main_s.lzsa \ - book_hallway_n.lzsa book_hallway_s.lzsa \ - inside_sub_e.lzsa inside_sub_w.lzsa \ bunker_keypad_e.lzsa \ - bunker_open_e.lzsa \ - bunker_entry_e.lzsa bunker_entry_w.lzsa \ - sub_hallway_e.lzsa sub_hallway_w.lzsa + bunker_open_e.lzsa echo "controls_e_lzsa: .incbin \"controls_e.lzsa\"" > selena_graphics.inc echo "organ_w_lzsa: .incbin \"organ_w.lzsa\"" >> selena_graphics.inc echo "spaceship_inside_w_lzsa: .incbin \"spaceship_inside_w.lzsa\"" >> selena_graphics.inc @@ -68,12 +61,6 @@ selena_graphics.inc: \ echo "bunker_n_lzsa: .incbin \"bunker_n.lzsa\"" >> selena_graphics.inc echo "bunker_s_lzsa: .incbin \"bunker_s.lzsa\"" >> selena_graphics.inc echo "bunker_e_lzsa: .incbin \"bunker_e.lzsa\"" >> selena_graphics.inc - echo "subroom_s_lzsa: .incbin \"subroom_s.lzsa\"" >> selena_graphics.inc - echo "subroom_n_lzsa: .incbin \"subroom_n.lzsa\"" >> selena_graphics.inc - echo "book_table_s_lzsa: .incbin \"book_table_s.lzsa\"" >> selena_graphics.inc - echo "book_table_n_lzsa: .incbin \"book_table_n.lzsa\"" >> selena_graphics.inc - echo "book_mist_open_s_lzsa: .incbin \"book_mist_open_s.lzsa\"" >> selena_graphics.inc - echo "book_mist_closed_s_lzsa: .incbin \"book_mist_closed_s.lzsa\"" >> selena_graphics.inc echo "water_turn_n_lzsa: .incbin \"water_turn_n.lzsa\"" >> selena_graphics.inc echo "water_turn_s_lzsa: .incbin \"water_turn_s.lzsa\"" >> selena_graphics.inc echo "water_turn_w_lzsa: .incbin \"water_turn_w.lzsa\"" >> selena_graphics.inc @@ -137,16 +124,8 @@ selena_graphics.inc: \ echo "tunnel_note_n_lzsa: .incbin \"tunnel_note_n.lzsa\"" >> selena_graphics.inc echo "tunnel_main_n_lzsa: .incbin \"tunnel_main_n.lzsa\"" >> selena_graphics.inc echo "tunnel_main_s_lzsa: .incbin \"tunnel_main_s.lzsa\"" >> selena_graphics.inc - echo "book_hallway_n_lzsa: .incbin \"book_hallway_n.lzsa\"" >> selena_graphics.inc - echo "book_hallway_s_lzsa: .incbin \"book_hallway_s.lzsa\"" >> selena_graphics.inc - echo "inside_sub_e_lzsa: .incbin \"inside_sub_e.lzsa\"" >> selena_graphics.inc - echo "inside_sub_w_lzsa: .incbin \"inside_sub_w.lzsa\"" >> selena_graphics.inc echo "bunker_keypad_e_lzsa: .incbin \"bunker_keypad_e.lzsa\"" >> selena_graphics.inc echo "bunker_open_e_lzsa: .incbin \"bunker_open_e.lzsa\"" >> selena_graphics.inc - echo "bunker_entry_e_lzsa: .incbin \"bunker_entry_e.lzsa\"" >> selena_graphics.inc - echo "bunker_entry_w_lzsa: .incbin \"bunker_entry_w.lzsa\"" >> selena_graphics.inc - echo "sub_hallway_e_lzsa: .incbin \"sub_hallway_e.lzsa\"" >> selena_graphics.inc - echo "sub_hallway_w_lzsa: .incbin \"sub_hallway_w.lzsa\"" >> selena_graphics.inc %.gr: %.png diff --git a/mist/graphics_sub/Makefile b/mist/graphics_sub/Makefile new file mode 100644 index 00000000..1f353034 --- /dev/null +++ b/mist/graphics_sub/Makefile @@ -0,0 +1,45 @@ +#include ../Makefile.inc + +PNG2RLE = ../../gr-utils/png2rle +PNG2GR = ../../gr-utils/png2gr +LZSA = ~/research/lzsa/lzsa/lzsa + +all: sub_graphics.inc + + +#### + +sub_graphics.inc: \ + subroom_s.lzsa subroom_n.lzsa \ + book_table_n.lzsa book_table_s.lzsa \ + book_mist_open_s.lzsa book_mist_closed_s.lzsa \ + book_hallway_n.lzsa book_hallway_s.lzsa \ + inside_sub_e.lzsa inside_sub_w.lzsa \ + bunker_entry_e.lzsa bunker_entry_w.lzsa \ + sub_hallway_e.lzsa sub_hallway_w.lzsa + echo "subroom_s_lzsa: .incbin \"subroom_s.lzsa\"" > sub_graphics.inc + echo "subroom_n_lzsa: .incbin \"subroom_n.lzsa\"" >> sub_graphics.inc + echo "book_table_s_lzsa: .incbin \"book_table_s.lzsa\"" >> sub_graphics.inc + echo "book_table_n_lzsa: .incbin \"book_table_n.lzsa\"" >> sub_graphics.inc + echo "book_mist_open_s_lzsa: .incbin \"book_mist_open_s.lzsa\"" >> sub_graphics.inc + echo "book_mist_closed_s_lzsa: .incbin \"book_mist_closed_s.lzsa\"" >> sub_graphics.inc + echo "inside_sub_e_lzsa: .incbin \"inside_sub_e.lzsa\"" >> sub_graphics.inc + echo "inside_sub_w_lzsa: .incbin \"inside_sub_w.lzsa\"" >> sub_graphics.inc + echo "bunker_entry_e_lzsa: .incbin \"bunker_entry_e.lzsa\"" >> sub_graphics.inc + echo "bunker_entry_w_lzsa: .incbin \"bunker_entry_w.lzsa\"" >> sub_graphics.inc + echo "sub_hallway_e_lzsa: .incbin \"sub_hallway_e.lzsa\"" >> sub_graphics.inc + echo "sub_hallway_w_lzsa: .incbin \"sub_hallway_w.lzsa\"" >> sub_graphics.inc + echo "book_hallway_n_lzsa: .incbin \"book_hallway_n.lzsa\"" >> sub_graphics.inc + echo "book_hallway_s_lzsa: .incbin \"book_hallway_s.lzsa\"" >> sub_graphics.inc + + +%.gr: %.png + $(PNG2GR) $< $@ + +%.lzsa: %.gr + $(LZSA) -r -f2 $< $@ + +#### + +clean: + rm -f *~ *.o *.lst *.gr *.lzsa sub_graphics.inc diff --git a/mist/graphics_selena/book_hallway_n.png b/mist/graphics_sub/book_hallway_n.png similarity index 100% rename from mist/graphics_selena/book_hallway_n.png rename to mist/graphics_sub/book_hallway_n.png diff --git a/mist/graphics_selena/book_hallway_s.png b/mist/graphics_sub/book_hallway_s.png similarity index 100% rename from mist/graphics_selena/book_hallway_s.png rename to mist/graphics_sub/book_hallway_s.png diff --git a/mist/graphics_selena/book_mist_closed_s.png b/mist/graphics_sub/book_mist_closed_s.png similarity index 100% rename from mist/graphics_selena/book_mist_closed_s.png rename to mist/graphics_sub/book_mist_closed_s.png diff --git a/mist/graphics_selena/book_mist_open_s.png b/mist/graphics_sub/book_mist_open_s.png similarity index 100% rename from mist/graphics_selena/book_mist_open_s.png rename to mist/graphics_sub/book_mist_open_s.png diff --git a/mist/graphics_selena/book_table_n.png b/mist/graphics_sub/book_table_n.png similarity index 100% rename from mist/graphics_selena/book_table_n.png rename to mist/graphics_sub/book_table_n.png diff --git a/mist/graphics_selena/book_table_s.png b/mist/graphics_sub/book_table_s.png similarity index 100% rename from mist/graphics_selena/book_table_s.png rename to mist/graphics_sub/book_table_s.png diff --git a/mist/graphics_selena/bunker_entry_e.png b/mist/graphics_sub/bunker_entry_e.png similarity index 100% rename from mist/graphics_selena/bunker_entry_e.png rename to mist/graphics_sub/bunker_entry_e.png diff --git a/mist/graphics_selena/bunker_entry_w.png b/mist/graphics_sub/bunker_entry_w.png similarity index 100% rename from mist/graphics_selena/bunker_entry_w.png rename to mist/graphics_sub/bunker_entry_w.png diff --git a/mist/graphics_selena/inside_sub_e.png b/mist/graphics_sub/inside_sub_e.png similarity index 100% rename from mist/graphics_selena/inside_sub_e.png rename to mist/graphics_sub/inside_sub_e.png diff --git a/mist/graphics_selena/inside_sub_w.png b/mist/graphics_sub/inside_sub_w.png similarity index 100% rename from mist/graphics_selena/inside_sub_w.png rename to mist/graphics_sub/inside_sub_w.png diff --git a/mist/graphics_selena/sub_hallway_e.png b/mist/graphics_sub/sub_hallway_e.png similarity index 100% rename from mist/graphics_selena/sub_hallway_e.png rename to mist/graphics_sub/sub_hallway_e.png diff --git a/mist/graphics_selena/sub_hallway_w.png b/mist/graphics_sub/sub_hallway_w.png similarity index 100% rename from mist/graphics_selena/sub_hallway_w.png rename to mist/graphics_sub/sub_hallway_w.png diff --git a/mist/graphics_selena/subroom_n.png b/mist/graphics_sub/subroom_n.png similarity index 100% rename from mist/graphics_selena/subroom_n.png rename to mist/graphics_sub/subroom_n.png diff --git a/mist/graphics_selena/subroom_s.png b/mist/graphics_sub/subroom_s.png similarity index 100% rename from mist/graphics_selena/subroom_s.png rename to mist/graphics_sub/subroom_s.png diff --git a/mist/leveldata_selena.inc b/mist/leveldata_selena.inc index af306cf8..3a0c621b 100644 --- a/mist/leveldata_selena.inc +++ b/mist/leveldata_selena.inc @@ -14,9 +14,7 @@ locations: .word location28,location29,location30,location31 .word location32,location33,location34,location35 .word location36,location37,location38,location39 - .word location40,location41,location42,location43 - .word location44,location45,location46,location47 - .word location48,location49 + .word location40,location41 ; SELENA_INSIDE_SHIP -- Inside Ship location0: @@ -148,79 +146,8 @@ location6: .byte BG_NORTH|BG_SOUTH|BG_EAST .byte $ff -; SELENA_SUB_ROOM -- sub room -location7: - .byte SELENA_SUB_HALLWAY ; north exit - .byte SELENA_INSIDE_SUB ; south exit - .byte $ff ; east exit - .byte $ff ; west exit - .byte DIRECTION_W ; north exit_dir - .byte DIRECTION_E ; south exit_dir - .byte $ff ; east exit_dir - .byte $ff ; west exit_dir - .word subroom_n_lzsa ; north bg - .word subroom_s_lzsa ; south bg - .word $0000 ; east bg - .word $0000 ; west bg - .byte BG_SOUTH|BG_NORTH - .byte $ff - -; SELENA_BOOK_ROOM -- book room -location8: - .byte SELENA_BOOK_HALLWAY ; north exit - .byte SELENA_BOOK_CLOSED ; south exit - .byte $ff ; east exit - .byte $ff ; west exit - .byte DIRECTION_N ; north exit_dir - .byte DIRECTION_S ; south exit_dir - .byte $ff ; east exit_dir - .byte $ff ; west exit_dir - .word book_table_n_lzsa ; north bg - .word book_table_s_lzsa ; south bg - .word $0000 ; east bg - .word $0000 ; west bg - .byte BG_SOUTH|BG_NORTH - .byte $ff - -; SELENA_BOOK_CLOSED -- book -location9: - .byte $ff ; north exit - .byte SELENA_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 book_mist_closed_s_lzsa ; south bg - .word $0000 ; east bg - .word $0000 ; west bg - .byte BG_SOUTH - .byte $ff - -; SELENA_BOOK_OPEN -- mist book open -location10: - .byte $ff ; north exit - .byte SELENA_BOOK_ROOM ; 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 book_mist_open_s_lzsa ; south bg - .word $0000 ; east bg - .word $0000 ; west bg - .byte BG_SOUTH - .byte DIRECTION_S - .byte 24,32 ; special x - .byte 12,22 ; special y - .word mist_link_book-1 ; special function - ; SELENA_WATER_TURN -- turnoff for water -location11: +location7: .byte SELENA_TOWER_VIEW ; north exit .byte SELENA_BUNKER ; south exit .byte $ff ; east exit @@ -237,7 +164,7 @@ location11: .byte $ff ; SELENA_WATER_PATH -- path to water -location12: +location8: .byte $ff ; north exit .byte $ff ; south exit .byte SELENA_WATER_TURN ; east exit @@ -254,7 +181,7 @@ location12: .byte $ff ; SELENA_WATER -- water -location13: +location9: .byte $ff ; north exit .byte $ff ; south exit .byte SELENA_WATER_PATH ; east exit @@ -274,7 +201,7 @@ location13: .word selena_take_blue_page-1 ; special function ; SELENA_TOWER_VIEW -- tower view -location14: +location10: .byte $ff ; north exit .byte SELENA_WATER_TURN ; south exit .byte SELENA_CLOCK_PATH ; east exit @@ -291,7 +218,7 @@ location14: .byte $ff ; SELENA_CHASM_PATH -- path to chasm -location15: +location11: .byte $ff ; north exit .byte $ff ; south exit .byte SELENA_TOWER_VIEW ; east exit @@ -308,7 +235,7 @@ location15: .byte $ff ; SELENA_CHASM -- chasm -location16: +location12: .byte SELENA_CHASM_PATH ; north exit .byte $ff ; south exit .byte $ff ; east exit @@ -329,7 +256,7 @@ location16: ; SELENA_CLOCK_PATH -- path on way to clock -location17: +location13: .byte $ff ; north exit .byte $ff ; south exit .byte SELENA_CLOCK ; east exit @@ -346,7 +273,7 @@ location17: .byte $ff ; SELENA_CLOCK -- clocks -location18: +location14: .byte $ff ; north exit .byte SELENA_CLOCK_CLOSE ; south exit .byte SELENA_CLOCK_BEFORE ; east exit @@ -363,7 +290,7 @@ location18: .byte $ff ; SELENA_CLOCK_CLOSE -- clock device -location19: +location15: .byte $ff ; north exit .byte SELENA_CLOCK ; south exit .byte $ff ; east exit @@ -383,7 +310,7 @@ location19: .word clock_button_pressed-1 ; special function ; SELENA_CLOCK_BEFORE -- path before clocks, when coming from crystals -location20: +location16: .byte $ff ; north exit .byte $ff ; south exit .byte SELENA_CRYSTAL_TURN ; east exit @@ -400,7 +327,7 @@ location20: .byte $ff ; SELENA_CRYSTAL_TURN -- crystal turnoff -location21: +location17: .byte $ff ; north exit .byte SELENA_CRYSTAL_STEPS ; south exit .byte SELENA_BEFORE_CRYSTALS ; east exit @@ -417,7 +344,7 @@ location21: .byte $ff ; SELENA_CRYSTAL_STEPS -- top of steps -location22: +location18: .byte $ff ; north exit .byte SELENA_CRYSTALS ; south exit .byte $ff ; east exit @@ -434,7 +361,7 @@ location22: .byte $ff ; SELENA_CRYSTAL_PATH -- bottom of steps -location23: +location19: .byte SELENA_CRYSTAL_TURN ; north exit .byte $ff ; south exit .byte $ff ; east exit @@ -451,7 +378,7 @@ location23: .byte $ff ; SELENA_CRYSTALS -- down by the crystals -location24: +location20: .byte SELENA_CRYSTAL_PATH ; north exit .byte SELENA_CRYSTAL_CLOSE ; south exit .byte $ff ; east exit @@ -468,7 +395,7 @@ location24: .byte $ff ; SELENA_CRYSTAL_CLOSE -- at the crystal device -location25: +location21: .byte $ff ; north exit .byte $ff ; south exit .byte SELENA_CRYSTALS ; east exit @@ -489,7 +416,7 @@ location25: ; SELENA_SPACESHIP_PATH -- spaceship path/ walkway3? -location26: +location22: .byte SELENA_WALKWAY4 ; north exit .byte SELENA_WALKWAY1 ; south exit .byte $ff ; east exit @@ -506,7 +433,7 @@ location26: .byte $ff ; SELENA_BEFORE_CRYSTALS -- before crystals, if coming from tunnel -location27: +location23: .byte $ff ; north exit .byte $ff ; south exit .byte SELENA_TUNNEL_STEPS ; east exit @@ -523,7 +450,7 @@ location27: .byte $ff ; SELENA_TUNNEL_STEPS -- steps on way to tunnel -location28: +location24: .byte $ff ; north exit .byte $ff ; south exit .byte SELENA_TUNNEL_PATH ; east exit @@ -540,7 +467,7 @@ location28: .byte $ff ; SELENA_TUNNEL_PATH -- path near tunnel -location29: +location25: .byte SELENA_TUNNEL_MAINLAND ; north exit .byte SELENA_TUNNEL_STEPS ; south exit .byte $ff ; east exit @@ -557,7 +484,7 @@ location29: .byte $ff ; SELENA_TUNNEL_MAINLAND -- mainland tunnel entrance -location30: +location26: .byte SELENA_TUNNEL_MAIN_CLOSE; north exit .byte SELENA_TUNNEL_PATH ; south exit .byte $ff ; east exit @@ -577,7 +504,7 @@ location30: .word tunnel_main_down-1 ; special function ; SELENA_TUNNEL_MAIN_CLOSE -- note panel on the tunnel -location31: +location27: .byte SELENA_TUNNEL_MAINLAND ; north exit .byte $ff ; south exit .byte $ff ; east exit @@ -597,7 +524,7 @@ location31: .word tunnel_button_pressed-1 ; special function ; SELENA_TUNNEL_MAIN_TOP -- top of the ladder -location32: +location28: .byte $ff ; north exit .byte $ff ; south exit .byte SELENA_TUNNEL_MAINLAND ; east exit @@ -617,7 +544,7 @@ location32: .word tunnel_main_top_down-1 ; special function ; SELENA_TUNNEL_MAIN_MID -- middle of ladder -location33: +location29: .byte $ff ; north exit .byte $ff ; south exit .byte SELENA_TUNNEL_MAIN_TOP ; east exit @@ -637,7 +564,7 @@ location33: .word tunnel_main_mid_down-1 ; special function ; SELENA_TUNNEL_BASEMENT -- bottom of ladder -location34: +location30: .byte $ff ; north exit .byte $ff ; south exit .byte SELENA_TUNNEL_MAIN_MID ; east exit @@ -654,7 +581,7 @@ location34: .byte $ff ; SELENA_TUNNEL -- middle of tunnel (dark for now) -location35: +location31: .byte $ff ; north exit .byte $ff ; south exit .byte SELENA_TUNNEL_BASEMENT ; east exit @@ -671,7 +598,7 @@ location35: .byte $ff ; SELENA_ANTENNA_BASEMENT -- basement near antenna -location36: +location32: .byte $ff ; north exit .byte $ff ; south exit .byte SELENA_TUNNEL ; east exit @@ -688,7 +615,7 @@ location36: .byte $ff ; SELENA_ANTENNA_MID -- antenna ladder, mid -location37: +location33: .byte $ff ; north exit .byte $ff ; south exit .byte SELENA_ANTENNA_TOP ; east exit @@ -707,9 +634,8 @@ location37: .byte 24,46 ; special y .word antenna_mid_down-1 ; special function - ; SELENA_ANTENNA_TOP -- staring down ladder near antenna -location38: +location34: .byte $ff ; north exit .byte $ff ; south exit .byte SELENA_ANTENNA_TUNNEL ; east exit @@ -729,7 +655,7 @@ location38: .word antenna_mid_down-1 ; special function ; SELENA_ANTENNA_TUNNEL -- top of ladder near antenna -location39: +location35: .byte $ff ; north exit .byte $ff ; south exit .byte $ff ; east exit @@ -749,7 +675,7 @@ location39: .word antenna_down-1 ; special function ; SELENA_ANTENNA_STEPS -- steps near antenna -location40: +location36: .byte SELENA_ANTENNA ; north exit .byte SELENA_ANTENNA_TUNNEL ; south exit .byte $ff ; east exit @@ -766,7 +692,7 @@ location40: .byte $ff ; SELENA_ANTENNA -- base of antenna -location41: +location37: .byte $ff ; north exit .byte $ff ; south exit .byte SELENA_ANTENNA_STEPS ; east exit @@ -783,7 +709,7 @@ location41: .byte $ff ; SELENA_ANTENNA_OPEN -- antenna panel open -location42: +location38: .byte $ff ; north exit .byte $ff ; south exit .byte SELENA_ANTENNA_STEPS ; east exit @@ -800,7 +726,7 @@ location42: .byte $ff ; SELENA_ANTENNA_CLOSE -- antenna panel -location43: +location39: .byte $ff ; north exit .byte $ff ; south exit .byte $ff ; east exit @@ -819,79 +745,11 @@ location43: .byte 24,40 ; special y .word touch_antenna_panel-1 ; special function -; SELENA_BOOK_HALLWAY -- hallway to the book room -location44: - .byte SELENA_INSIDE_SUB ; north exit - .byte SELENA_BOOK_ROOM ; south exit - .byte $ff ; east exit - .byte $ff ; west exit - .byte DIRECTION_E ; north exit_dir - .byte DIRECTION_S ; south exit_dir - .byte $ff ; east exit_dir - .byte $ff ; west exit_dir - .word book_hallway_n_lzsa ; north bg - .word book_hallway_s_lzsa ; south bg - .word $0000 ; east bg - .word $0000 ; west bg - .byte BG_NORTH|BG_SOUTH - .byte $ff - -; SELENA_INSIDE_SUB -- inside the submarine -location45: - .byte $ff ; north exit - .byte $ff ; south exit - .byte $ff ; east exit - .byte SELENA_BOOK_HALLWAY ; west exit - .byte $ff ; north exit_dir - .byte $ff ; south exit_dir - .byte $ff ; east exit_dir - .byte DIRECTION_S ; west exit_dir - .word $0000 ; north bg - .word $0000 ; south bg - .word inside_sub_e_lzsa ; east bg - .word inside_sub_w_lzsa ; west bg - .byte BG_EAST|BG_WEST - .byte $ff - -; SELENA_SUB_HALLWAY -- hallway to the sub room -location46: - .byte $ff ; north exit - .byte $ff ; south exit - .byte SELENA_SUB_ROOM ; east exit - .byte SELENA_BUNKER_ENTRY ; west exit - .byte $ff ; north exit_dir - .byte $ff ; south exit_dir - .byte DIRECTION_S ; east exit_dir - .byte DIRECTION_W ; west exit_dir - .word $0000 ; north bg - .word $0000 ; south bg - .word sub_hallway_e_lzsa ; east bg - .word sub_hallway_w_lzsa ; west bg - .byte BG_EAST|BG_WEST - .byte $ff - -; SELENA_BUNKER_ENTRY -- entryway inside bunker -location47: - .byte $ff ; north exit - .byte $ff ; south exit - .byte SELENA_SUB_HALLWAY ; east exit - .byte SELENA_BUNKER ; west exit - .byte $ff ; north exit_dir - .byte $ff ; south exit_dir - .byte DIRECTION_E ; east exit_dir - .byte DIRECTION_N ; west exit_dir - .word $0000 ; north bg - .word $0000 ; south bg - .word bunker_entry_e_lzsa ; east bg - .word bunker_entry_w_lzsa ; west bg - .byte BG_EAST|BG_WEST - .byte $ff - ; SELENA_BUNKER_OPEN -- bunker with door open -location48: +location40: .byte SELENA_WATER_TURN ; north exit .byte SELENA_WALKWAY4 ; south exit - .byte SELENA_BUNKER_ENTRY ; east exit + .byte $ff ; east exit .byte $ff ; west exit .byte DIRECTION_N ; north exit_dir .byte DIRECTION_S ; south exit_dir @@ -906,7 +764,7 @@ location48: ; SELENA_BUNKER_KEYPAD -- bunker keypad -location49: +location41: .byte $ff ; north exit .byte $ff ; south exit .byte SELENA_BUNKER ; east exit diff --git a/mist/leveldata_sub.inc b/mist/leveldata_sub.inc new file mode 100644 index 00000000..c111a21a --- /dev/null +++ b/mist/leveldata_sub.inc @@ -0,0 +1,148 @@ + +;=============================================== +; level data for Bunker/Submarine level +;=============================================== + +locations: + .word location0, location1, location2, location3 + .word location4, location5, location6, location7 + +; SUB_BUNKER_ENTRY -- entryway inside bunker +location0: + .byte $ff ; north exit + .byte $ff ; south exit + .byte SUB_HALLWAY ; east exit + .byte SELENA_BUNKER ; west exit + .byte $ff ; north exit_dir + .byte $ff ; south exit_dir + .byte DIRECTION_E ; east exit_dir + .byte DIRECTION_N ; west exit_dir + .word $0000 ; north bg + .word $0000 ; south bg + .word bunker_entry_e_lzsa ; east bg + .word bunker_entry_w_lzsa ; west bg + .byte BG_EAST|BG_WEST + .byte $ff + +; SUB_HALLWAY -- hallway to the sub room +location1: + .byte $ff ; north exit + .byte $ff ; south exit + .byte SUB_ROOM ; east exit + .byte SUB_BUNKER_ENTRY ; west exit + .byte $ff ; north exit_dir + .byte $ff ; south exit_dir + .byte DIRECTION_S ; east exit_dir + .byte DIRECTION_W ; west exit_dir + .word $0000 ; north bg + .word $0000 ; south bg + .word sub_hallway_e_lzsa ; east bg + .word sub_hallway_w_lzsa ; west bg + .byte BG_EAST|BG_WEST + .byte $ff + +; SUB_ROOM -- sub room +location2: + .byte SUB_HALLWAY ; north exit + .byte SUB_INSIDE_SUB ; south exit + .byte $ff ; east exit + .byte $ff ; west exit + .byte DIRECTION_W ; north exit_dir + .byte DIRECTION_E ; south exit_dir + .byte $ff ; east exit_dir + .byte $ff ; west exit_dir + .word subroom_n_lzsa ; north bg + .word subroom_s_lzsa ; south bg + .word $0000 ; east bg + .word $0000 ; west bg + .byte BG_SOUTH|BG_NORTH + .byte $ff + +; SUB_INSIDE_SUB -- inside the submarine +location3: + .byte $ff ; north exit + .byte $ff ; south exit + .byte $ff ; east exit + .byte SUB_BOOK_HALLWAY ; west exit + .byte $ff ; north exit_dir + .byte $ff ; south exit_dir + .byte $ff ; east exit_dir + .byte DIRECTION_S ; west exit_dir + .word $0000 ; north bg + .word $0000 ; south bg + .word inside_sub_e_lzsa ; east bg + .word inside_sub_w_lzsa ; west bg + .byte BG_EAST|BG_WEST + .byte $ff + +; SUB_BOOK_HALLWAY -- hallway to the book room +location4: + .byte SUB_INSIDE_SUB ; north exit + .byte SUB_BOOK_ROOM ; south exit + .byte $ff ; east exit + .byte $ff ; west exit + .byte DIRECTION_E ; north exit_dir + .byte DIRECTION_S ; south exit_dir + .byte $ff ; east exit_dir + .byte $ff ; west exit_dir + .word book_hallway_n_lzsa ; north bg + .word book_hallway_s_lzsa ; south bg + .word $0000 ; east bg + .word $0000 ; west bg + .byte BG_NORTH|BG_SOUTH + .byte $ff + +; SELENA_BOOK_ROOM -- book room +location5: + .byte SUB_BOOK_HALLWAY ; north exit + .byte SUB_BOOK_CLOSED ; south exit + .byte $ff ; east exit + .byte $ff ; west exit + .byte DIRECTION_N ; north exit_dir + .byte DIRECTION_S ; south exit_dir + .byte $ff ; east exit_dir + .byte $ff ; west exit_dir + .word book_table_n_lzsa ; north bg + .word book_table_s_lzsa ; south bg + .word $0000 ; east bg + .word $0000 ; west bg + .byte BG_SOUTH|BG_NORTH + .byte $ff + +; SUB_BOOK_CLOSED -- book +location6: + .byte $ff ; north exit + .byte SUB_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 book_mist_closed_s_lzsa ; south bg + .word $0000 ; east bg + .word $0000 ; west bg + .byte BG_SOUTH + .byte $ff + +; SUB_BOOK_OPEN -- mist book open +location7: + .byte $ff ; north exit + .byte SUB_BOOK_ROOM ; 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 book_mist_open_s_lzsa ; south bg + .word $0000 ; east bg + .word $0000 ; west bg + .byte BG_SOUTH + .byte DIRECTION_S + .byte 24,32 ; special x + .byte 12,22 ; special y + .word mist_link_book-1 ; special function + diff --git a/mist/loader.s b/mist/loader.s index 887830aa..3df67223 100644 --- a/mist/loader.s +++ b/mist/loader.s @@ -153,7 +153,7 @@ filenames: .word mist_filename,meche_filename,selena_filename,octagon_filename .word viewer_filename,stoney_filename,channel_filename,cabin_filename .word dentist_filename,arbor_filename,nibel_filename,ship_filename - .word generator_filename,dni_filename + .word generator_filename,dni_filename,sub_filename which_disk: .byte '1' ; MIST_TITLE @@ -171,6 +171,7 @@ which_disk: .byte '1' ; SHIP .byte '3' ; GENERATOR .byte '1' ; D'NI + .byte '3' ; SUB intro_filename: .byte "MIST_TITLE",0 @@ -202,6 +203,8 @@ generator_filename: .byte "GENERATOR",0 dni_filename: .byte "D'NI",0 +sub_filename: + .byte "SUB",3 ;=================================================== diff --git a/mist/selena.s b/mist/selena.s index 87b6e544..2c817e6d 100644 --- a/mist/selena.s +++ b/mist/selena.s @@ -101,9 +101,6 @@ game_loop: cmp #SELENA_CONTROLS beq controls_animation - cmp #SELENA_BOOK_OPEN - beq mist_book_animation - cmp #SELENA_WATER beq fg_draw_blue_page ; and water note @@ -125,11 +122,6 @@ game_loop: jmp nothing_special -mist_book_animation: - - jsr draw_mist_animation - jmp nothing_special - controls_animation: ldy #LOCATION_SPECIAL_EXIT @@ -365,46 +357,6 @@ no_draw_page: rts - ;=============================== - ; draw mist book animation - ;=============================== - -draw_mist_animation: - ; handle animated linking book - - lda ANIMATE_FRAME - cmp #6 - bcc mist_book_good ; blt - - lda #0 - sta ANIMATE_FRAME - -mist_book_good: - - asl - tay - lda mist_movie,Y - sta INL - lda mist_movie+1,Y - sta INH - - lda #24 - sta XPOS - lda #12 - sta YPOS - - jsr put_sprite_crop - - lda FRAMEL - and #$f - bne done_animate_mist_book - - inc ANIMATE_FRAME - -done_animate_mist_book: - jmp nothing_special - - ;============================== ; tunnel actions @@ -453,7 +405,7 @@ keypad_press: .include "selena_sound_puzzle.s" ; linking books - .include "link_book_mist.s" +; .include "link_book_mist.s" .include "handle_pages.s" @@ -464,6 +416,3 @@ keypad_press: .include "speaker_beeps.s" .include "simple_sounds.s" - - - diff --git a/mist/sub.s b/mist/sub.s new file mode 100644 index 00000000..5c9feefd --- /dev/null +++ b/mist/sub.s @@ -0,0 +1,196 @@ +; Bunker/Sub part of Selena Age + +; Ein U-Boot holt uns dann hier raus +; Und du bist der Kapitaen + +; by deater (Vince Weaver) + +; Zero Page + .include "zp.inc" + .include "hardware.inc" + .include "common_defines.inc" + .include "common_routines.inc" + +sub_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_H + + + lda #0 + sta DRAW_PAGE + sta LEVEL_OVER + + ; init cursor + + lda #20 + sta CURSOR_X + sta CURSOR_Y + + ;================= + ; init vars + + ; 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 #SUB_BOOK_OPEN + beq mist_book_animation + + jmp nothing_special + +mist_book_animation: + + jsr draw_mist_animation + 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 + + + + ;=============================== + ; draw mist book animation + ;=============================== + +draw_mist_animation: + ; handle animated linking book + + lda ANIMATE_FRAME + cmp #6 + bcc mist_book_good ; blt + + lda #0 + sta ANIMATE_FRAME + +mist_book_good: + + asl + tay + lda mist_movie,Y + sta INL + lda mist_movie+1,Y + sta INH + + lda #24 + sta XPOS + lda #12 + sta YPOS + + jsr put_sprite_crop + + lda FRAMEL + and #$f + bne done_animate_mist_book + + inc ANIMATE_FRAME + +done_animate_mist_book: + jmp nothing_special + + ;========================== + ; includes + ;========================== + + ; level graphics + .include "graphics_sub/sub_graphics.inc" + + ; puzzles + + ; linking books + .include "link_book_mist.s" + +; .include "handle_pages.s" + + ; level data + .include "leveldata_sub.inc" + + ; sound + .include "simple_sounds.s" + + + +