mist: nibel: can close gate from one side

This commit is contained in:
Vince Weaver 2020-08-19 01:30:38 -04:00
parent 9eb3bac9d5
commit 034d7d5637
6 changed files with 72 additions and 2 deletions

View File

@ -16,6 +16,7 @@ nibel_graphics.inc: \
blue_path2_n.lzsa blue_path2_s.lzsa \
blue_path_2p25_n.lzsa blue_path_2p25_s.lzsa blue_path_2p25_e.lzsa \
blue_path_2p25_open_e.lzsa \
blue_path_2p25_gate_s.lzsa \
blue_path_2p5_n.lzsa blue_path_2p5_s.lzsa \
blue_path_2p75_n.lzsa blue_path_2p75_s.lzsa \
blue_path3_n.lzsa blue_path3_s.lzsa \
@ -49,6 +50,7 @@ nibel_graphics.inc: \
echo "blue_path_2p25_s_lzsa: .incbin \"blue_path_2p25_s.lzsa\"" >> nibel_graphics.inc
echo "blue_path_2p25_e_lzsa: .incbin \"blue_path_2p25_e.lzsa\"" >> nibel_graphics.inc
echo "blue_path_2p25_open_e_lzsa: .incbin \"blue_path_2p25_open_e.lzsa\"" >> nibel_graphics.inc
echo "blue_path_2p25_gate_s_lzsa: .incbin \"blue_path_2p25_gate_s.lzsa\"" >> nibel_graphics.inc
echo "blue_path_2p5_n_lzsa: .incbin \"blue_path_2p5_n.lzsa\"" >> nibel_graphics.inc
echo "blue_path_2p5_s_lzsa: .incbin \"blue_path_2p5_s.lzsa\"" >> nibel_graphics.inc
echo "blue_path_2p75_n_lzsa: .incbin \"blue_path_2p75_n.lzsa\"" >> nibel_graphics.inc

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 907 B

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

@ -586,4 +586,4 @@ location30:
.byte 11,27 ; special x
.byte 4,44 ; special y
.word scary_entrance-1 ; special function
; FIXME: we should also still handle south stuff if possible

View File

@ -83,6 +83,10 @@ game_loop:
beq animate_projector
cmp #NIBEL_SHACK_CENTER
beq animate_trap
cmp #NIBEL_BLUE_PATH_2P25
beq animate_gate_s
cmp #NIBEL_BLUE_PATH_2P5
beq animate_gate_n
jmp nothing_special
@ -102,6 +106,14 @@ animate_trap:
jsr draw_trap
jmp nothing_special
animate_gate_s:
jsr update_gate_s
jmp nothing_special
animate_gate_n:
jsr update_gate_n
jmp nothing_special
animate_viewer:
lda ANIMATE_FRAME
beq nothing_special

View File

@ -1,3 +1,59 @@
update_gate_n:
rts
update_gate_s:
lda ANIMATE_FRAME
beq open_gate_s
bne close_gate_s
open_gate_s:
ldy #LOCATION_SOUTH_BG
lda location19,Y ; NIBEL_BLUE_PATH_2P25
cmp #<blue_path_2p25_s_lzsa
beq done_open_gate_s ; see if already open
lda #<blue_path_2p25_s_lzsa
sta location19,Y ; NIBEL_BLUE_PATH_2P25
lda #>blue_path_2p25_s_lzsa
sta location19+1,Y ; NIBEL_BLUE_PATH_2P25
jsr change_direction
done_open_gate_s:
rts
close_gate_s:
ldy #LOCATION_SOUTH_BG
lda location19,Y ; NIBEL_BLUE_PATH_2P25
cmp #<blue_path_2p25_gate_s_lzsa
beq done_close_gate_s ; see if already closed
lda #<blue_path_2p25_gate_s_lzsa
sta location19,Y ; NIBEL_BLUE_PATH_2P25
lda #>blue_path_2p25_gate_s_lzsa
sta location19+1,Y ; NIBEL_BLUE_PATH_2P25
; lda ANIMATE_FRAME
; pha
jsr change_direction
; pla
; sta ANIMATE_FRAME
done_close_gate_s:
lda FRAMEL
and #$3f
bne really_done_close_gate_s
dec ANIMATE_FRAME
really_done_close_gate_s:
rts
draw_gate_animation_s:
lda DIRECTION
cmp #DIRECTION_S
@ -435,7 +491,7 @@ handle_shack_door:
; swing gate (26,27,28,29)
lda #1
lda #2
sta ANIMATE_FRAME
rts