From eb32aa5e17d6fefbc8abea386d1dd0b013c5a84c Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Wed, 15 Apr 2020 15:05:58 -0400 Subject: [PATCH] mist: can actually poke around the tree cabin fully now --- mist/channel.s | 86 ++++++++++++++++++++++++-------------- mist/leveldata_channel.inc | 41 +++++++----------- mist/leveldata_mist.inc | 2 +- 3 files changed, 72 insertions(+), 57 deletions(-) diff --git a/mist/channel.s b/mist/channel.s index 38f0d38e..c26376ce 100644 --- a/mist/channel.s +++ b/mist/channel.s @@ -110,53 +110,77 @@ really_exit: back_to_mist: - lda #$ff - sta LEVEL_OVER + lda #DIRECTION_N + sta DIRECTION lda #MIST_ARRIVAL_DOCK ; the dock - sta LOCATION - lda #DIRECTION_N - sta DIRECTION - lda #LOAD_MIST - sta WHICH_LOAD + jmp exit_to_mist - rts - -enter_path: - - lda #$ff - sta LEVEL_OVER - - lda #MIST_TREE_CORRIDOR_5 - sta LOCATION - lda #DIRECTION_N - sta DIRECTION - - lda #LOAD_MIST - sta WHICH_LOAD - - rts enter_clock: - lda #$ff - sta LEVEL_OVER - - lda #MIST_CLOCK - sta LOCATION 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 ;========================== diff --git a/mist/leveldata_channel.inc b/mist/leveldata_channel.inc index d9fc41d8..bc462534 100644 --- a/mist/leveldata_channel.inc +++ b/mist/leveldata_channel.inc @@ -25,11 +25,10 @@ location0: .word clearing_e_lzsa ; east bg .word clearing_w_lzsa ; west bg .byte BG_SOUTH|BG_EAST|BG_WEST - .byte $ff -; .byte DIRECTION_E ; special exit -; .byte 12,25 ; special x -; .byte 26,46 ; special y -; .word controls_pressed-1 ; special function + .byte DIRECTION_E|DIRECTION_W ; special exit + .byte 7,33 ; special x + .byte 2,46 ; special y + .word handle_clearing-1 ; special function ; CHANNEL_CABIN_OPEN -- outside, door open location1: @@ -46,7 +45,10 @@ location1: .word clearing_e_open_lzsa ; east bg .word clearing_w_lzsa ; west bg .byte BG_SOUTH|BG_EAST|BG_WEST - .byte $ff + .byte DIRECTION_E|DIRECTION_W ; special exit + .byte 7,33 ; special x + .byte 2,46 ; special y + .word handle_clearing-1 ; special function ; CHANNEL_CABIN_ENTRANCE -- entering the cabin location2: @@ -129,7 +131,7 @@ location6: .byte CHANNEL_OUTSIDE_CABIN ; west exit .byte $ff ; north exit_dir .byte $ff ; south exit_dir - .byte DIRECTION_E ; east exit_dir + .byte DIRECTION_N ; east exit_dir .byte DIRECTION_W ; west exit_dir .word $0000 ; north bg .word $0000 ; south bg @@ -145,7 +147,7 @@ location7: .byte $ff ; east exit .byte $ff ; west exit .byte DIRECTION_S ; north exit_dir - .byte DIRECTION_E ; south 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 @@ -174,19 +176,19 @@ location8: ; CHANNEL_TREE_BASEMENT -- in the tree basement location9: - .byte $ff ; north exit + .byte CHANNEL_BIG_TREE ; north exit .byte CHANNEL_TREE_BOOK ; south exit .byte $ff ; east exit .byte $ff ; west exit - .byte $ff ; north exit_dir + .byte DIRECTION_S ; 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 tree_basement_n_lzsa ; north bg + .word tree_basement_s_lzsa ; south bg .word $0000 ; east bg .word $0000 ; west bg - .byte BG_SOUTH + .byte BG_SOUTH|BG_NORTH .byte $ff ; CHANNEL_TREE_BOOK -- tree basement book @@ -226,7 +228,7 @@ location11: ; CHANNEL_TREE_BOOK_OPEN -- tree basement book open location12: .byte $ff ; north exit - .byte CHANNEL_TREE_BOOK_OPEN ; south exit + .byte CHANNEL_TREE_BASEMENT ; south exit .byte $ff ; east exit .byte $ff ; west exit .byte $ff ; north exit_dir @@ -256,14 +258,3 @@ location13: .word $0000 ; west bg .byte BG_SOUTH|BG_NORTH .byte $ff - - - - - - - - - - - diff --git a/mist/leveldata_mist.inc b/mist/leveldata_mist.inc index 7bb13084..a099dfa6 100644 --- a/mist/leveldata_mist.inc +++ b/mist/leveldata_mist.inc @@ -236,7 +236,7 @@ location11: .word $0000 ; west bg .byte BG_SOUTH|BG_EAST .byte DIRECTION_E ; special exit - .byte 9,29 ; special x + .byte 5,30 ; special x .byte 2,46 ; special y .word enter_channel_clock-1 ; special function