diff --git a/mist/default_save.s b/mist/default_save.s index fe7644cd..2a233f83 100644 --- a/mist/default_save.s +++ b/mist/default_save.s @@ -61,3 +61,10 @@ .byte $00 ; CHANNEL_SWITCHES = $B5 .byte $00 ; CHANNEL_VALVES = $B6 +.byte $00 ; DENTIST_LIGHT = $B7 +.byte $00 ; DENTIST_MONTH = $B8 +.byte $00 ; DENTIST_DAY = $B9 +.byte $00 ; DENTIST_CENTURY = $BA +.byte $00 ; DENTIST_YEAR = $BB +.byte $00 ; DENTIST_HOURS = $BC +.byte $00 ; DENTIST_MINUTES = $BD diff --git a/mist/dentist.s b/mist/dentist.s index 866affd6..cdcd526f 100644 --- a/mist/dentist.s +++ b/mist/dentist.s @@ -40,6 +40,10 @@ dentist_start: sta CURSOR_X sta CURSOR_Y + ; handle light switch + + jsr setup_backgrounds + ; set up initial location jsr change_location @@ -166,6 +170,98 @@ pull_down_panel: +light_switch: + + lda DENTIST_LIGHT + eor #$1 + sta DENTIST_LIGHT + + jsr setup_backgrounds + + jmp change_location + + + ; setup backgrounds based on light switch being on or off +setup_backgrounds: + + lda DENTIST_LIGHT + bne lights_are_off + + ; lights are on +lights_are_on: + ldy #LOCATION_NORTH_BG + lda #dentist_door_open_n_lzsa + sta location1+1,Y ; DENTIST_OUTSIDE_OPEN + + lda #chair_view_n_lzsa + sta location2+1,Y ; DENTIST_INSIDE_DOOR + + lda #chair_close_n_lzsa + sta location3+1,Y ; DENTIST_CHAIR_CLOSE + + lda #panel_up_lzsa + sta location4+1,Y ; DENTIST_PANEL_UP + + + ldy #LOCATION_SOUTH_BG + lda #chair_view_s_lzsa + sta location2+1,Y ; DENTIST_INSIDE_DOOR + + lda #chair_close_s_lzsa + sta location3+1,Y ; DENTIST_CHAIR_CLOSE + + rts + + ; lights are off +lights_are_off: + ldy #LOCATION_NORTH_BG + lda #dentist_door_open_dark_n_lzsa + sta location1+1,Y ; DENTIST_OUTSIDE_OPEN + + lda #chair_view_dark_n_lzsa + sta location2+1,Y ; DENTIST_INSIDE_DOOR + + lda #chair_close_dark_n_lzsa + sta location3+1,Y ; DENTIST_CHAIR_CLOSE + + lda #panel_up_dark_lzsa + sta location4+1,Y ; DENTIST_PANEL_UP + + + ldy #LOCATION_SOUTH_BG + lda #chair_view_dark_s_lzsa + sta location2+1,Y ; DENTIST_INSIDE_DOOR + + lda #chair_close_dark_s_lzsa + sta location3+1,Y ; DENTIST_CHAIR_CLOSE + + + rts + ;========================== ; includes diff --git a/mist/graphics_dentist/Makefile b/mist/graphics_dentist/Makefile index b3dba239..d2e0dae5 100644 --- a/mist/graphics_dentist/Makefile +++ b/mist/graphics_dentist/Makefile @@ -10,22 +10,29 @@ all: dentist_graphics.inc dentist_graphics.inc: \ dentist_door_n.lzsa dentist_door_s.lzsa \ dentist_door_open_n.lzsa \ + dentist_door_open_dark_n.lzsa \ chair_view_s.lzsa chair_view_n.lzsa \ + chair_view_dark_s.lzsa chair_view_dark_n.lzsa \ chair_close_s.lzsa chair_close_n.lzsa \ - panel_up.lzsa \ + chair_close_dark_s.lzsa chair_close_dark_n.lzsa \ + panel_up.lzsa panel_up_dark.lzsa \ panel.lzsa echo "dentist_door_n_lzsa: .incbin \"dentist_door_n.lzsa\"" > dentist_graphics.inc echo "dentist_door_open_n_lzsa: .incbin \"dentist_door_open_n.lzsa\"" >> dentist_graphics.inc + echo "dentist_door_open_dark_n_lzsa: .incbin \"dentist_door_open_dark_n.lzsa\"" >> dentist_graphics.inc echo "dentist_door_s_lzsa: .incbin \"dentist_door_s.lzsa\"" >> dentist_graphics.inc echo "chair_view_s_lzsa: .incbin \"chair_view_s.lzsa\"" >> dentist_graphics.inc echo "chair_view_n_lzsa: .incbin \"chair_view_n.lzsa\"" >> dentist_graphics.inc + echo "chair_view_dark_s_lzsa: .incbin \"chair_view_dark_s.lzsa\"" >> dentist_graphics.inc + echo "chair_view_dark_n_lzsa: .incbin \"chair_view_dark_n.lzsa\"" >> dentist_graphics.inc echo "chair_close_s_lzsa: .incbin \"chair_close_s.lzsa\"" >> dentist_graphics.inc echo "chair_close_n_lzsa: .incbin \"chair_close_n.lzsa\"" >> dentist_graphics.inc + echo "chair_close_dark_s_lzsa: .incbin \"chair_close_dark_s.lzsa\"" >> dentist_graphics.inc + echo "chair_close_dark_n_lzsa: .incbin \"chair_close_dark_n.lzsa\"" >> dentist_graphics.inc echo "panel_up_lzsa: .incbin \"panel_up.lzsa\"" >> dentist_graphics.inc + echo "panel_up_dark_lzsa: .incbin \"panel_up_dark.lzsa\"" >> dentist_graphics.inc echo "panel_lzsa: .incbin \"panel.lzsa\"" >> dentist_graphics.inc - - %.gr: %.png $(PNG2GR) $< $@ diff --git a/mist/graphics_dentist/chair_close_dark_n.png b/mist/graphics_dentist/chair_close_dark_n.png new file mode 100644 index 00000000..734be689 Binary files /dev/null and b/mist/graphics_dentist/chair_close_dark_n.png differ diff --git a/mist/graphics_dentist/chair_close_dark_s.png b/mist/graphics_dentist/chair_close_dark_s.png new file mode 100644 index 00000000..253b6552 Binary files /dev/null and b/mist/graphics_dentist/chair_close_dark_s.png differ diff --git a/mist/graphics_dentist/chair_view_dark_n.png b/mist/graphics_dentist/chair_view_dark_n.png new file mode 100644 index 00000000..63fba94d Binary files /dev/null and b/mist/graphics_dentist/chair_view_dark_n.png differ diff --git a/mist/graphics_dentist/chair_view_dark_s.png b/mist/graphics_dentist/chair_view_dark_s.png new file mode 100644 index 00000000..8edceb3c Binary files /dev/null and b/mist/graphics_dentist/chair_view_dark_s.png differ diff --git a/mist/graphics_dentist/dentist_door_open_dark_n.png b/mist/graphics_dentist/dentist_door_open_dark_n.png new file mode 100644 index 00000000..ada85006 Binary files /dev/null and b/mist/graphics_dentist/dentist_door_open_dark_n.png differ diff --git a/mist/graphics_dentist/panel.png b/mist/graphics_dentist/panel.png new file mode 100644 index 00000000..cffb0756 Binary files /dev/null and b/mist/graphics_dentist/panel.png differ diff --git a/mist/graphics_dentist/panel_up_dark.png b/mist/graphics_dentist/panel_up_dark.png new file mode 100644 index 00000000..d3009352 Binary files /dev/null and b/mist/graphics_dentist/panel_up_dark.png differ diff --git a/mist/leveldata_dentist.inc b/mist/leveldata_dentist.inc index 80389547..7056f5c3 100644 --- a/mist/leveldata_dentist.inc +++ b/mist/leveldata_dentist.inc @@ -61,7 +61,10 @@ location2: .word $0000 ; east bg .word $0000 ; west bg .byte BG_NORTH | BG_SOUTH - .byte $ff ; TODO: lightswitch + .byte DIRECTION_S ; special exit + .byte 29,34 ; special x + .byte 18,30 ; special y + .word light_switch-1 ; DENTIST_CHAIR_CLOSE -- chair view location3: