diff --git a/mist/Makefile b/mist/Makefile index af767aba..1bc7e88a 100644 --- a/mist/Makefile +++ b/mist/Makefile @@ -50,7 +50,7 @@ mist.o: mist.s zp.inc hardware.inc \ common_sprites.inc \ leveldata_mist.inc \ clock_bridge_puzzle.s clock_sprites.inc \ - link_book_mist.s \ + link_book_mist_dock.s \ letter_cat.s \ marker_switch.s \ brother_books.s \ @@ -71,6 +71,7 @@ meche.o: meche.s zp.inc hardware.inc \ common_sprites.inc \ leveldata_meche.inc \ link_book_meche.s \ + link_book_mist.s \ keyboard.s \ draw_pointer.s \ gr_copy.s audio.s text_print.s decompress_fast_v2.s @@ -85,6 +86,8 @@ selena.o: selena.s zp.inc hardware.inc \ graphics_selena/selena_graphics.inc \ common_sprites.inc \ leveldata_selena.inc \ + link_book_mist.s \ + end_level.s \ keyboard.s \ draw_pointer.s \ speaker_beeps.s \ diff --git a/mist/graphics_island/Makefile b/mist/graphics_island/Makefile index da5bd7f9..46aa041c 100644 --- a/mist/graphics_island/Makefile +++ b/mist/graphics_island/Makefile @@ -22,7 +22,8 @@ mist_graphics.inc: \ step_land3_w.lzsa step_land3_e.lzsa \ step_top_e.lzsa step_top_w.lzsa step_top_n.lzsa step_top_s.lzsa \ temple_door_n.lzsa temple_door_s.lzsa \ - temple_center_n.lzsa temple_center_s.lzsa temple_center_e.lzsa temple_center_w.lzsa \ + temple_center_n.lzsa temple_center_s.lzsa temple_center_e.lzsa \ + temple_center_w.lzsa temple_center_up.lzsa \ red_book_shelf.lzsa \ red_book_closed.lzsa \ pool_s.lzsa \ @@ -83,6 +84,7 @@ mist_graphics.inc: \ echo "temple_center_s_lzsa: .incbin \"temple_center_s.lzsa\"" >> mist_graphics.inc echo "temple_center_e_lzsa: .incbin \"temple_center_e.lzsa\"" >> mist_graphics.inc echo "temple_center_w_lzsa: .incbin \"temple_center_w.lzsa\"" >> mist_graphics.inc + echo "temple_center_up_lzsa: .incbin \"temple_center_up.lzsa\"" >> mist_graphics.inc echo "red_book_closed_lzsa: .incbin \"red_book_closed.lzsa\"" >> mist_graphics.inc echo "red_book_shelf_lzsa: .incbin \"red_book_shelf.lzsa\"" >> mist_graphics.inc echo "pool_s_lzsa: .incbin \"pool_s.lzsa\"" >> mist_graphics.inc diff --git a/mist/graphics_island/mist_graphics.inc b/mist/graphics_island/mist_graphics.inc index d0d6b629..70c76732 100644 --- a/mist/graphics_island/mist_graphics.inc +++ b/mist/graphics_island/mist_graphics.inc @@ -30,6 +30,7 @@ temple_center_n_lzsa: .incbin "temple_center_n.lzsa" temple_center_s_lzsa: .incbin "temple_center_s.lzsa" temple_center_e_lzsa: .incbin "temple_center_e.lzsa" temple_center_w_lzsa: .incbin "temple_center_w.lzsa" +temple_center_up_lzsa: .incbin "temple_center_up.lzsa" red_book_closed_lzsa: .incbin "red_book_closed.lzsa" red_book_shelf_lzsa: .incbin "red_book_shelf.lzsa" pool_s_lzsa: .incbin "pool_s.lzsa" diff --git a/mist/graphics_island/temple_center_up.png b/mist/graphics_island/temple_center_up.png new file mode 100644 index 00000000..64d0dbf8 Binary files /dev/null and b/mist/graphics_island/temple_center_up.png differ diff --git a/mist/graphics_selena/Makefile b/mist/graphics_selena/Makefile index a82091d6..d382b2b1 100644 --- a/mist/graphics_selena/Makefile +++ b/mist/graphics_selena/Makefile @@ -17,7 +17,10 @@ selena_graphics.inc: \ walkway1_n.lzsa walkway1_s.lzsa \ spaceship_door_s.lzsa \ walkway4_n.lzsa walkway4_s.lzsa \ - bunker_n.lzsa bunker_s.lzsa bunker_e.lzsa + bunker_n.lzsa bunker_s.lzsa bunker_e.lzsa \ + subroom_s.lzsa \ + book_table_s.lzsa \ + book_mist_open_s.lzsa book_mist_closed_s.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 @@ -32,6 +35,10 @@ 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 "book_table_s_lzsa: .incbin \"book_table_s.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 %.gr: %.png diff --git a/mist/graphics_selena/book_mist_closed_s.png b/mist/graphics_selena/book_mist_closed_s.png new file mode 100644 index 00000000..4e8f33cc Binary files /dev/null and b/mist/graphics_selena/book_mist_closed_s.png differ diff --git a/mist/graphics_selena/book_mist_open_s.png b/mist/graphics_selena/book_mist_open_s.png new file mode 100644 index 00000000..8e7ff23e Binary files /dev/null and b/mist/graphics_selena/book_mist_open_s.png differ diff --git a/mist/graphics_selena/book_table_s.png b/mist/graphics_selena/book_table_s.png new file mode 100644 index 00000000..2d18ca5b Binary files /dev/null and b/mist/graphics_selena/book_table_s.png differ diff --git a/mist/graphics_selena/subroom_s.png b/mist/graphics_selena/subroom_s.png new file mode 100644 index 00000000..07889af2 Binary files /dev/null and b/mist/graphics_selena/subroom_s.png differ diff --git a/mist/leveldata_mist.inc b/mist/leveldata_mist.inc index 108b4778..979dc7d7 100644 --- a/mist/leveldata_mist.inc +++ b/mist/leveldata_mist.inc @@ -42,7 +42,7 @@ locations: .word location24,location25,location26,location27 .word location28,location29,location30,location31 .word location32,location33,location34,location35 - .word location36,location37,location38 + .word location36,location37,location38,location39 ; myst linking book location0: @@ -752,3 +752,20 @@ location38: .byte 8,46 ; special y .word open_ss_door-1 ; special function +; ceiling of temple +location39: + .byte 12 ; north exit + .byte $ff ; south exit + .byte $ff ; east exit + .byte $ff ; west exit + .byte DIRECTION_N ; north exit_dir + .byte $ff ; south exit_dir + .byte $ff ; east exit_dir + .byte $ff ; west exit_dir + .word temple_center_up_lzsa ; north bg + .word $0000 ; south bg + .word $0000 ; east bg + .word $0000 ; west bg + .byte BG_NORTH + .byte $ff + diff --git a/mist/leveldata_selena.inc b/mist/leveldata_selena.inc index be245cd4..5384a434 100644 --- a/mist/leveldata_selena.inc +++ b/mist/leveldata_selena.inc @@ -34,7 +34,8 @@ LOCATION_SPECIAL_FUNC=22 ; pointer-1 of function to call on click locations: .word location0, location1, location2, location3 - .word location4, location5, location6 + .word location4, location5, location6, location7 + .word location8, location9, location10 ; Inside Ship location0: @@ -151,11 +152,11 @@ location5: location6: .byte $ff ; north exit .byte 5 ; south exit - .byte $ff ; east exit + .byte 7 ; east exit .byte $ff ; west exit .byte $ff ; north exit_dir .byte DIRECTION_S ; south exit_dir - .byte $ff ; east exit_dir + .byte DIRECTION_S ; east exit_dir .byte $ff ; west exit_dir .word bunker_n_lzsa ; north bg .word bunker_s_lzsa ; south bg @@ -164,4 +165,74 @@ location6: .byte BG_NORTH|BG_SOUTH|BG_EAST .byte $ff +; sub room +location7: + .byte $ff ; north exit + .byte 8 ; 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 subroom_s_lzsa ; south bg + .word $0000 ; east bg + .word $0000 ; west bg + .byte BG_SOUTH + .byte $ff + +; book room +location8: + .byte $ff ; north exit + .byte 9 ; 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_table_s_lzsa ; south bg + .word $0000 ; east bg + .word $0000 ; west bg + .byte BG_SOUTH + .byte $ff + +; book +location9: + .byte $ff ; north exit + .byte 10 ; 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 + +; mist book open +location10: + .byte $ff ; north exit + .byte 8 ; 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/link_book_mist.s b/mist/link_book_mist.s index 77f81cb4..9421e24f 100644 --- a/mist/link_book_mist.s +++ b/mist/link_book_mist.s @@ -1,19 +1,93 @@ - ;============================= - ; mist_link_book - ;============================= + ;====================================== + ; mist link book to the octogon temple + ;====================================== mist_link_book: + ; clear screen + lda #0 + sta clear_all_color+1 + + jsr clear_all + jsr page_flip + ; play sound effect? -.if 0 + lda #audio_link_noise sta BTC_H ldx #43 ; 45 pages long??? jsr play_audio -.endif - lda #1 + + lda #39 sta LOCATION - jsr change_location + lda #DIRECTION_N + sta DIRECTION + + lda #LOAD_MIST ; return to MIST + sta WHICH_LOAD + + lda #$ff + sta LEVEL_OVER + rts + +mist_movie: + .word ceiling_sprite0,ceiling_sprite1,ceiling_sprite2 + .word ceiling_sprite3,ceiling_sprite4,ceiling_sprite5 + ; probably should have 6 more + +ceiling_sprite0: + .byte 9,6 + .byte $88,$88,$22,$75,$75,$75,$22,$88,$88 + .byte $88,$22,$27,$02,$f2,$02,$27,$22,$88 + .byte $28,$22,$0f,$02,$00,$0f,$02,$55,$22 + .byte $22,$ff,$22,$02,$20,$02,$22,$55,$22 + .byte $88,$22,$2f,$f2,$f2,$f2,$52,$22,$88 + .byte $88,$88,$22,$2f,$2f,$22,$25,$88,$88 + +ceiling_sprite1: + .byte 9,6 + .byte $88,$88,$52,$22,$75,$75,$25,$88,$88 + .byte $88,$25,$22,$f2,$00,$f2,$27,$72,$88 + .byte $28,$ff,$20,$02,$00,$0f,$f0,$27,$22 + .byte $22,$ff,$20,$22,$00,$ff,$20,$52,$22 + .byte $88,$22,$2f,$ff,$f0,$22,$52,$55,$88 + .byte $88,$88,$22,$52,$52,$52,$25,$88,$88 + +ceiling_sprite2: + .byte 9,6 + .byte $88,$88,$22,$25,$25,$22,$22,$88,$88 + .byte $88,$22,$ff,$02,$2f,$02,$27,$72,$88 + .byte $28,$22,$0f,$02,$00,$0f,$0f,$77,$22 + .byte $22,$22,$ff,$02,$20,$0f,$2f,$77,$22 + .byte $88,$52,$22,$2f,$22,$22,$27,$22,$88 + .byte $88,$88,$25,$22,$55,$55,$25,$88,$88 + +ceiling_sprite3: + .byte 9,6 + .byte $88,$88,$22,$ff,$22,$22,$25,$88,$88 + .byte $88,$22,$ff,$2f,$00,$ff,$22,$22,$88 + .byte $28,$22,$f0,$02,$00,$02,$f0,$77,$22 + .byte $55,$22,$f0,$0f,$00,$ff,$20,$77,$22 + .byte $88,$55,$22,$22,$20,$22,$75,$57,$88 + .byte $88,$88,$25,$52,$52,$52,$22,$88,$88 + +ceiling_sprite4: + .byte 9,6 + .byte $88,$88,$22,$f2,$2f,$22,$22,$88,$88 + .byte $88,$22,$ff,$02,$22,$02,$22,$22,$88 + .byte $58,$f5,$0f,$02,$00,$02,$0f,$72,$22 + .byte $55,$22,$22,$02,$f0,$02,$2f,$77,$22 + .byte $88,$52,$22,$22,$2f,$22,$77,$22,$88 + .byte $88,$88,$55,$52,$52,$27,$22,$88,$88 + +ceiling_sprite5: + .byte 9,6 + .byte $88,$88,$72,$27,$f2,$d2,$22,$88,$88 + .byte $88,$55,$f2,$2f,$00,$22,$2f,$22,$88 + .byte $28,$f2,$20,$02,$00,$02,$f0,$55,$22 + .byte $55,$22,$20,$f2,$00,$f2,$20,$25,$22 + .byte $88,$55,$22,$2f,$20,$72,$27,$22,$88 + .byte $88,$88,$55,$27,$27,$52,$52,$88,$88 diff --git a/mist/link_book_mist_dock.s b/mist/link_book_mist_dock.s new file mode 100644 index 00000000..77f81cb4 --- /dev/null +++ b/mist/link_book_mist_dock.s @@ -0,0 +1,19 @@ + ;============================= + ; mist_link_book + ;============================= +mist_link_book: + + ; play sound effect? +.if 0 + lda #audio_link_noise + sta BTC_H + ldx #43 ; 45 pages long??? + jsr play_audio +.endif + lda #1 + sta LOCATION + jsr change_location + rts + diff --git a/mist/mist.s b/mist/mist.s index 8aa0a85a..1e43aa4a 100644 --- a/mist/mist.s +++ b/mist/mist.s @@ -32,27 +32,19 @@ mist_start: sta CURSOR_X sta CURSOR_Y - ;================= - ; init vars - ; FIXME: we could be re-called from other books - ; so don't set location here - - lda #0 - sta LOCATION - lda #0 - sta DIRECTION - - lda LOCATION bne not_first_time ; first time init lda #0 + sta CLOCK_MINUTE sta CLOCK_HOUR jsr clock_inside_reset lda #0 + sta DIRECTION + sta GEAR_OPEN sta BREAKER_TRIPPED @@ -182,7 +174,7 @@ really_exit: go_to_meche: - lda #2 + lda #LOAD_MECHE sta WHICH_LOAD lda #$ff @@ -220,7 +212,7 @@ go_to_meche: ; linking books - .include "link_book_mist.s" + .include "link_book_mist_dock.s" ; letters diff --git a/mist/mist_title.s b/mist/mist_title.s index 24e9f4e4..64223e43 100644 --- a/mist/mist_title.s +++ b/mist/mist_title.s @@ -44,8 +44,10 @@ keyloop: bit KEYRESET - lda #1 ; load mist - sta 5 + lda #0 + sta LOCATION ; start at first room + lda #LOAD_MIST ; load mist + sta WHICH_LOAD rts diff --git a/mist/selena.s b/mist/selena.s index 3fd425ab..a7f7e9d3 100644 --- a/mist/selena.s +++ b/mist/selena.s @@ -35,6 +35,8 @@ selena_start: lda #0 sta LOCATION + sta LEVEL_OVER + lda #DIRECTION_E sta DIRECTION @@ -78,7 +80,49 @@ game_loop: lda LOCATION cmp #1 - bne nothing_special + beq controls_animation + cmp #10 + beq mist_book_animation + jmp nothing_special + +mist_book_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 + + +controls_animation: ldy #LOCATION_SPECIAL_EXIT lda location1,Y @@ -161,8 +205,17 @@ nothing_special: inc FRAMEH room_frame_no_oflo: + ;==================================== + ; check level over + ;==================================== + + lda LEVEL_OVER + bne really_exit jmp game_loop +really_exit: + jmp end_level + ;========================== ; includes @@ -177,6 +230,7 @@ room_frame_no_oflo: .include "decompress_fast_v2.s" .include "keyboard.s" .include "draw_pointer.s" + .include "end_level.s" .include "audio.s" @@ -189,6 +243,8 @@ room_frame_no_oflo: ; linking books + .include "link_book_mist.s" + .include "common_sprites.inc" .include "leveldata_selena.inc" diff --git a/mist/zp.inc b/mist/zp.inc index ca467845..2c867c05 100644 --- a/mist/zp.inc +++ b/mist/zp.inc @@ -4,6 +4,11 @@ NIBCOUNT = $00 WHICH_LOAD = $05 + LOAD_TITLE = $0 + LOAD_MIST = $1 + LOAD_MECHE = $2 + LOAD_SELENA = $3 + ;; Zero page monitor routines addresses WNDLFT = $20