diff --git a/mist/Makefile b/mist/Makefile index 01c1fbea..08530dbd 100644 --- a/mist/Makefile +++ b/mist/Makefile @@ -312,7 +312,8 @@ dentist.o: dentist.s zp.inc hardware.inc common_defines.inc \ common_routines.inc \ graphics_dentist/dentist_graphics.inc \ leveldata_dentist.inc \ - dentist_panel.s + dentist_panel.s \ + marker_switch.s ca65 -o dentist.o dentist.s -l dentist.lst diff --git a/mist/dentist.s b/mist/dentist.s index efbc7132..3d08ed04 100644 --- a/mist/dentist.s +++ b/mist/dentist.s @@ -74,13 +74,11 @@ game_loop: ; handle special-case forground logic ;==================================== + jsr draw_marker_switch + lda LOCATION cmp #DENTIST_PANEL beq fg_draw_panel -; cmp #NIBEL_RED_TABLE_OPEN -; beq fg_draw_red_page -; cmp #NIBEL_BLUE_HOUSE_VIEWER -; beq animate_viewer jmp nothing_special @@ -137,10 +135,52 @@ really_exit: ;=========================== back_to_mist: + lda DIRECTION + cmp #DIRECTION_S + beq go_back_to_mist +oh_its_the_marker_switch: + + lda CURSOR_X + cmp #10 + bcs use_door + lda CURSOR_Y + cmp #28 + bcc use_door + cmp #40 + bcs use_door + + lda #MARKER_DENTIST + jmp click_marker_switch +use_door: + lda LOCATION + cmp #DENTIST_OUTSIDE + bne go_inside + +open_door: + lda #DENTIST_OUTSIDE_OPEN + sta LOCATION + jmp change_location + +go_inside: + lda #DENTIST_INSIDE_DOOR + sta LOCATION + jmp change_location + +go_back_to_mist: lda #MIST_STEPS_4TH_LANDING sta LOCATION + lda CURSOR_X + cmp #20 + bcs go_west_young_man + + lda #DIRECTION_E + jmp steps_direction + +go_west_young_man: lda #DIRECTION_W + +steps_direction: sta DIRECTION lda #LOAD_MIST @@ -150,6 +190,7 @@ set_level_over: lda #$ff sta LEVEL_OVER +done_door: rts ;=========================== @@ -280,6 +321,7 @@ lights_are_off: ; puzzles .include "dentist_panel.s" + .include "marker_switch.s" ; level data .include "leveldata_dentist.inc" diff --git a/mist/graphics_dentist/dentist_door_n.png b/mist/graphics_dentist/dentist_door_n.png index 17bd4d6e..613c21b8 100644 Binary files a/mist/graphics_dentist/dentist_door_n.png and b/mist/graphics_dentist/dentist_door_n.png differ diff --git a/mist/graphics_dentist/dentist_door_open_dark_n.png b/mist/graphics_dentist/dentist_door_open_dark_n.png index ada85006..dfcc3ca0 100644 Binary files a/mist/graphics_dentist/dentist_door_open_dark_n.png and b/mist/graphics_dentist/dentist_door_open_dark_n.png differ diff --git a/mist/graphics_dentist/dentist_door_open_n.png b/mist/graphics_dentist/dentist_door_open_n.png index 1ff890dc..bdd6b5c6 100644 Binary files a/mist/graphics_dentist/dentist_door_open_n.png and b/mist/graphics_dentist/dentist_door_open_n.png differ diff --git a/mist/graphics_dentist/panel.png b/mist/graphics_dentist/panel.png index cffb0756..24914690 100644 Binary files a/mist/graphics_dentist/panel.png and b/mist/graphics_dentist/panel.png differ diff --git a/mist/leveldata_dentist.inc b/mist/leveldata_dentist.inc index 3e578924..fcddaf22 100644 --- a/mist/leveldata_dentist.inc +++ b/mist/leveldata_dentist.inc @@ -21,8 +21,8 @@ location0: .word $0000 ; east bg .word $0000 ; west bg .byte BG_NORTH | BG_SOUTH - .byte DIRECTION_S ; special exit - .byte 10,30 ; special x + .byte DIRECTION_S|DIRECTION_N ; special exit + .byte 4,30 ; special x .byte 0,46 ; special y .word back_to_mist-1 @@ -41,8 +41,8 @@ location1: .word $0000 ; east bg .word $0000 ; west bg .byte BG_NORTH | BG_SOUTH - .byte DIRECTION_S ; special exit - .byte 10,30 ; special x + .byte DIRECTION_S|DIRECTION_N ; special exit + .byte 4,30 ; special x .byte 0,46 ; special y .word back_to_mist-1 diff --git a/mist/marker_switch.s b/mist/marker_switch.s index 6f19fa54..86e5291e 100644 --- a/mist/marker_switch.s +++ b/mist/marker_switch.s @@ -7,6 +7,7 @@ ; cab/0 MARKER_TREE = $20 CABIN_OUTSIDE E 5 ; 13 MARKER_POOL = $40 MIST_TREE_CORRIDOR_2 N 6 ; den/0 MARKER_DENTIST = $80 DENTIST_OUTSIDE N 7 +; den/1 MARKER_DENTIST = $80 DENTIST_OUTSIDE_OPEN N 7 ; up is on @@ -33,6 +34,17 @@ marker_sprite_on: .byte $6A,$6A .byte $AA,$AA +marker_wide_sprite_off: + .byte 3,2 + .byte $AA,$AA,$AA + .byte $6A,$6A,$6A + +marker_wide_sprite_on: + .byte 3,2 + .byte $96,$A6,$96 + .byte $AA,$55,$AA + + marker_sprites_on: .word marker_sprite_on ; dock .word marker_sprite_on ; gears @@ -41,7 +53,7 @@ marker_sprites_on: .word marker_sprite_on ; clock .word marker_sprite_on ; tree .word marker_sprite_on ; pool - .word marker_sprite_on ; dentist + .word marker_wide_sprite_on ; dentist marker_sprites_off: .word marker_sprite_off ; dock @@ -51,7 +63,7 @@ marker_sprites_off: .word marker_sprite_off ; clock .word marker_sprite_off ; tree .word marker_sprite_off ; pool - .word marker_sprite_off ; dentist + .word marker_wide_sprite_off ; dentist marker_sprites_direction: .byte DIRECTION_N ; dock @@ -71,7 +83,7 @@ marker_sprites_xy: .byte 5,28 ; clock .byte 10,10 ; tree .byte 28,18 ; pool - .byte 10,10 ; dentist + .byte 5,32 ; dentist ; FIXME: use generic log2 table somewhere marker_which: @@ -122,10 +134,14 @@ check_ms_pool: bne done_draw_marker ldy #6 bne draw_marker + marker_check_dentist: lda LOCATION cmp #DENTIST_OUTSIDE + beq dentist_marker + cmp #DENTIST_OUTSIDE_OPEN bne done_draw_marker +dentist_marker: ldy #7 bne draw_marker ; bra marker_check_cabin: