mist: stoney: hook up lighthouse beacon

This commit is contained in:
Vince Weaver 2020-08-07 11:00:25 -04:00
parent 58678e434b
commit bc32e0157b
3 changed files with 116 additions and 8 deletions

View File

@ -17,7 +17,12 @@ For release 1.0
-- load 1s clip of sounds (4k each) into language card?
+ STONEY
-- have lights off mean darken the levels
-- Lights out
+ somehow have tops of steps have light coming in
+ have yellow gem on doors even in dark
+ currently if you turn around with doors open
they aren't blacked out
-- have lights come on in telescope view
-- allow coming at steps from an angle
-- hook up compass rose

View File

@ -50,8 +50,9 @@ stoney_start:
jsr change_location
; make sure book access set up right
; make sure book access and lights set up right
jsr update_compass_state
jsr update_tunnel_lights
lda #1
sta CURSOR_VISIBLE ; visible at first
@ -73,8 +74,11 @@ game_loop:
;====================================
; turn lights off (if applicable)
;====================================
; first check ship_lights
check_ship_lights:
lda COMPASS_STATE
bne dont_touch_lights
bne check_tunnel_lights
lda LOCATION
cmp #STONEY_BOOK_STAIRS1
@ -83,6 +87,39 @@ game_loop:
beq turn_off_the_lights
cmp #STONEY_BOOK_ROOM
beq turn_off_the_lights
check_tunnel_lights:
lda BATTERY_CHARGE
bne dont_touch_lights
lda LOCATION
cmp #STONEY_LEFT_TUNNEL1
beq turn_off_the_lights
cmp #STONEY_LEFT_TUNNEL2
beq turn_off_the_lights
cmp #STONEY_LEFT_AIRLOCK
beq turn_off_the_lights
cmp #STONEY_CRAWLWAY_LEFT
beq turn_off_the_lights
cmp #STONEY_COMPASS_ROOM_LEFT
beq turn_off_the_lights
cmp #STONEY_COMPASS_ROSE_LEFT
beq turn_off_the_lights
cmp #STONEY_RIGHT_TUNNEL1
beq turn_off_the_lights
cmp #STONEY_RIGHT_TUNNEL2
beq turn_off_the_lights
cmp #STONEY_RIGHT_AIRLOCK
beq turn_off_the_lights
cmp #STONEY_CRAWLWAY_RIGHT
beq turn_off_the_lights
cmp #STONEY_COMPASS_ROOM_RIGHT
beq turn_off_the_lights
cmp #STONEY_COMPASS_ROSE_RIGHT
beq turn_off_the_lights
cmp #STONEY_CRAWLWAY_ENTRANCE_LEFT
beq turn_off_the_lights
cmp #STONEY_CRAWLWAY_ENTRANCE_RIGHT
bne dont_touch_lights
turn_off_the_lights:

View File

@ -55,6 +55,36 @@
; draw hatch as sprite
;==================================
; update tunnel lights
;==================================
; only on when BATTERY_CHARGE is non-zero
;
; darkening the rooms happens elsewhere
; here is where we change up backgrounds
; and turn the lighthouse on and off
;
; FIXME:
; + make the top stairwells dark
; + make inside top stairwells display outside still
; + do something about looking backwards from airlocks
update_tunnel_lights:
lda BATTERY_CHARGE
beq tunnel_lights_off
tunnel_lights_on:
jmp done_update_tunnel_lights
tunnel_lights_off:
jsr lighthouse_beacon_off
done_update_tunnel_lights:
rts
;==================================
@ -125,6 +155,8 @@ wrong_knob:
jsr long_beep
jsr update_tunnel_lights
jmp update_compass_state
compass_oob:
@ -327,6 +359,9 @@ handle_crank:
beq skip_charge
inc BATTERY_CHARGE
jsr update_tunnel_lights
skip_charge:
rts
@ -566,8 +601,30 @@ goto_telescope:
jmp change_location
;===================================
; display telescope
;===================================
display_telescope:
; blink beacon (where applicable)
lda BATTERY_CHARGE
beq done_blink_beacon
lda FRAMEL
and #$40
beq beacon_off
jsr lighthouse_beacon_on
jmp done_blink_beacon
beacon_off:
jsr lighthouse_beacon_off
done_blink_beacon:
lda #16
sta XPOS
lda #18
@ -956,9 +1013,9 @@ telescope_bg11_sprite:
telescope_bg12_sprite:
.byte 4,7
.byte $ff,$ff,$ff,$df
.byte $ff,$ff,$ff,$ff
.byte $ff,$ff,$ff,$ee
.byte $ff,$ff,$ff,$ff
.byte $ff,$ff,$ff,$dd
.byte $67,$67,$ee,$ee
.byte $66,$ee,$ee,$ee
.byte $66,$ee,$ee,$ee
@ -966,9 +1023,9 @@ telescope_bg12_sprite:
telescope_bg13_sprite:
.byte 4,7
.byte $df,$ff,$ff,$ff
.byte $ff,$ff,$ff,$ff
.byte $ee,$ff,$ff,$ff
.byte $ff,$ff,$ff,$ff
.byte $dd,$ff,$ff,$ff
.byte $ee,$ee,$67,$67
.byte $ee,$ee,$ee,$66
.byte $ee,$ee,$ee,$66
@ -1004,5 +1061,14 @@ telescope_bg16_sprite:
.byte $55,$55,$55,$55
lighthouse_beacon_off:
lda #$dd
sta telescope_bg12_sprite+13
sta telescope_bg13_sprite+10
rts
lighthouse_beacon_on:
lda #$d1
sta telescope_bg12_sprite+13
sta telescope_bg13_sprite+10
rts