diff --git a/mist/generator.s b/mist/generator.s index 3eeb1f0b..c46988ae 100644 --- a/mist/generator.s +++ b/mist/generator.s @@ -69,6 +69,7 @@ game_loop: ;==================================== ; handle generator puzzle + lda LOCATION location_generator: cmp #GEN_GENERATOR_ROOM bne nothing_special diff --git a/mist/generator_puzzle.s b/mist/generator_puzzle.s index b672fbe3..cc7943f5 100644 --- a/mist/generator_puzzle.s +++ b/mist/generator_puzzle.s @@ -1,3 +1,7 @@ +;==================================== +; Routines for the generator puzzles +;==================================== + leave_tower1: lda #GEN_TOWER1_TOP sta LOCATION @@ -9,7 +13,20 @@ leave_tower1: rts +back_to_mist: + lda #MIST_TREE_CORRIDOR_4 + sta LOCATION + lda #DIRECTION_E + sta DIRECTION + + lda #LOAD_MIST + sta WHICH_LOAD + + lda #$ff + sta LEVEL_OVER + + rts ;======================= diff --git a/mist/leveldata_generator.inc b/mist/leveldata_generator.inc index 17b24dea..9a81de56 100644 --- a/mist/leveldata_generator.inc +++ b/mist/leveldata_generator.inc @@ -23,7 +23,11 @@ location0: .word green_house_e_lzsa ; east bg .word green_house_w_lzsa ; west bg .byte BG_EAST | BG_WEST - .byte $ff + .byte DIRECTION_E ; special exit + .byte 9,29 ; special x + .byte 2,46 ; special y + .word back_to_mist-1 ; special function + ; GEN_GREEN_STEPS1 -- green shack steps 1 location1: @@ -61,11 +65,11 @@ location2: ; GEN_GENERATOR_DOOR -- generator room door location3: - .byte GEN_GENERATOR_DOOR ; north exit + .byte $ff ; north exit .byte GEN_GREEN_STEPS6 ; south exit .byte $ff ; east exit .byte $ff ; west exit - .byte DIRECTION_S ; north exit_dir + .byte $ff ; north exit_dir .byte DIRECTION_W ; south exit_dir .byte $ff ; east exit_dir .byte $ff ; west exit_dir @@ -115,7 +119,10 @@ location5: .word tower1_trail_e_lzsa ; east bg .word tower1_trail_w_lzsa ; west bg .byte BG_WEST|BG_EAST - .byte $ff + .byte DIRECTION_E ; special exit + .byte 9,29 ; special x + .byte 2,46 ; special y + .word back_to_mist-1 ; special function ; GEN_TOWER1_TRAIL2 -- tower1 trail2 location6: diff --git a/mist/leveldata_mist.inc b/mist/leveldata_mist.inc index 973799b5..786bed8f 100644 --- a/mist/leveldata_mist.inc +++ b/mist/leveldata_mist.inc @@ -384,9 +384,9 @@ location19: .word tree4_w_lzsa ; west bg .byte BG_NORTH|BG_SOUTH|BG_WEST|BG_EAST .byte DIRECTION_W ; special exit - .byte 6,28 ; special x + .byte 6,34 ; special x .byte 0,46 ; special y - .word green_house-1 ; special function + .word go_to_generator-1 ; special function ; MIST_TREE_CORRIDOR_1 location20: diff --git a/mist/mist.s b/mist/mist.s index 0964b33f..ed021436 100644 --- a/mist/mist.s +++ b/mist/mist.s @@ -177,17 +177,6 @@ leave_tower2: rts -green_house: - - ; FIXME: handle switch separately - -; lda #MIST_GREEN_SHACK -; sta LOCATION - - jmp change_location - - - goto_dentist_steps: lda #MIST_STEPS_DENTIST diff --git a/mist/mist_puzzles.s b/mist/mist_puzzles.s index 33be6d72..cf0b165e 100644 --- a/mist/mist_puzzles.s +++ b/mist/mist_puzzles.s @@ -72,10 +72,46 @@ done_ss_door: ;====================== ; go to selena +;====================== go_to_selena: - lda #3 ; Selena + lda #LOAD_SELENA ; Selena + sta WHICH_LOAD + + lda #$ff + sta LEVEL_OVER + + rts + +;====================== +; go to generator +;====================== + +go_to_generator: + + lda CURSOR_X + cmp #27 + bcs goto_tower + + cmp #13 + bcs goto_shack + +marker_switch: + ; FIXME + rts + +goto_shack: + lda #GEN_GREEN_SHACK + jmp into_generator + +goto_tower: + lda #GEN_TOWER1_TRAIL + +into_generator: + sta LOCATION + + lda #LOAD_GENERATOR ; Selena sta WHICH_LOAD lda #$ff @@ -87,3 +123,4 @@ go_to_selena: +