mist: dentist: hook up marker switch
@ -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
|
||||
|
||||
|
||||
|
@ -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"
|
||||
|
Before Width: | Height: | Size: 446 B After Width: | Height: | Size: 8.6 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 8.9 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 12 KiB |
@ -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
|
||||
|
||||
|
@ -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:
|
||||
|