mist: cabin: can rotate the valve

This commit is contained in:
Vince Weaver 2020-07-15 22:55:11 -04:00
parent 9ad4011783
commit 8b8154526c
8 changed files with 138 additions and 11 deletions

View File

@ -22,19 +22,18 @@ mist.dsk: HELLO LOADER MIST_TITLE MIST OCTAGON VIEWER \
$(DOS33) -y mist.dsk BSAVE -a 0x2000 OCTAGON
$(DOS33) -y mist.dsk BSAVE -a 0x2000 CABIN
$(DOS33) -y mist.dsk BSAVE -a 0x2000 DENTIST
$(DOS33) -y mist.dsk BSAVE -a 0x2000 GENERATOR
$(DOS33) -y mist.dsk BSAVE -a 0x2000 D\'NI
$(DOS33) -y mist.dsk BSAVE -a 0xe00 SAVE0
$(DOS33) -y mist.dsk BSAVE -a 0x9000 ./audio/link_noise.btc LINK_NOISE.BTC
mist_side2.dsk: HELLO_DISK2 CHANNEL VIEWER ARBOR NIBEL
mist_side2.dsk: HELLO_DISK2 CHANNEL VIEWER ARBOR NIBEL GENERATOR
cp empty.dsk mist_side2.dsk
$(DOS33) -y mist_side2.dsk SAVE A HELLO_DISK2 HELLO
$(DOS33) -y mist_side2.dsk BSAVE -a 0x2000 CHANNEL
$(DOS33) -y mist_side2.dsk BSAVE -a 0x2000 ARBOR
$(DOS33) -y mist_side2.dsk BSAVE -a 0x2000 NIBEL
$(DOS33) -y mist_side2.dsk BSAVE -a 0x2000 VIEWER
# $(DOS33) -y mist_side2.dsk BSAVE -a 0x9000 ./audio/link_noise.btc LINK_NOISE.BTC
$(DOS33) -y mist.dsk BSAVE -a 0x2000 GENERATOR
mist_side3.dsk: HELLO_DISK2 MECHE SELENA STONEY SHIP

View File

@ -79,11 +79,23 @@ game_loop:
beq animate_channel_book
cmp #CABIN_SAFE
bne check_next
bne check_boiler
jsr draw_safe_combination
jmp nothing_special
check_next:
check_boiler:
cmp #CABIN_INSIDE
bne check_basement
jsr draw_valve_cabin
jmp nothing_special
check_basement:
cmp #CABIN_TREE_BASEMENT
bne nothing_special
jsr draw_valve_basement
jmp nothing_special

View File

@ -174,6 +174,34 @@ cabin_update_state:
rts
goto_safe_or_valve:
lda DIRECTION
and #$f
cmp #DIRECTION_W
beq goto_safe
valve_clicked_cabin:
lda CURSOR_X
cmp #33
bcc valve_dec
bcs valve_inc
valve_dec:
lda BOILER_VALVE
beq done_valve
dec BOILER_VALVE
jmp done_valve
valve_inc:
lda BOILER_VALVE
cmp #24
bcs done_valve
inc BOILER_VALVE
done_valve:
rts
;====================
; safe was clicked
;====================
@ -384,3 +412,91 @@ draw_safe_combination:
rts
; valve sprites
valve_sprites:
.word valve0_sprite
.word valve1_sprite
.word valve2_sprite
.word valve3_sprite
valve0_sprite:
.byte 6,6
.byte $AA,$1A,$11,$11,$1A,$AA
.byte $1A,$A1,$11,$AA,$A1,$11
.byte $11,$AA,$d1,$1A,$1A,$11
.byte $11,$A1,$A1,$1A,$AA,$11
.byte $A1,$11,$AA,$11,$1A,$A1
.byte $AA,$A1,$A1,$A1,$A1,$AA
valve1_sprite:
.byte 6,6
.byte $AA,$1A,$A1,$11,$1A,$AA
.byte $11,$A1,$AA,$11,$AA,$11
.byte $11,$A1,$dA,$a1,$AA,$11
.byte $11,$AA,$11,$A1,$A1,$11
.byte $A1,$11,$11,$AA,$1A,$A1
.byte $AA,$AA,$A1,$A1,$A1,$AA
valve2_sprite:
.byte 6,6
.byte $AA,$1A,$A1,$A1,$1A,$AA
.byte $11,$11,$AA,$AA,$11,$11
.byte $11,$AA,$d1,$A1,$AA,$11
.byte $11,$AA,$11,$A1,$1A,$11
.byte $A1,$11,$AA,$AA,$11,$A1
.byte $AA,$AA,$A1,$A1,$A1,$AA
valve3_sprite:
.byte 6,6
.byte $AA,$1A,$A1,$A1,$1A,$AA
.byte $11,$A1,$1A,$AA,$AA,$11
.byte $11,$AA,$d1,$1A,$A1,$11
.byte $11,$1A,$A1,$11,$AA,$11
.byte $AA,$11,$AA,$A1,$11,$A1
.byte $AA,$AA,$A1,$A1,$A1,$AA
draw_valve_cabin:
lda DIRECTION
and #$f
cmp #DIRECTION_E
bne done_draw_valve
bit TEXTGR ; bit of a hack
lda #31
sta XPOS
lda #14
bne really_draw_valve ; bra
draw_valve_basement:
lda DIRECTION
and #$f
cmp #DIRECTION_N
bne done_draw_valve
lda #5
sta XPOS
lda #24
really_draw_valve:
sta YPOS
lda BOILER_VALVE
and #$3
asl
tay
lda valve_sprites,Y
sta INL
lda valve_sprites+1,Y
sta INH
jmp put_sprite_crop
done_draw_valve:
rts

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 867 B

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View File

@ -56,7 +56,7 @@ location2:
.byte CABIN_OUTSIDE ; west exit
.byte $ff ; north exit_dir
.byte $ff ; south exit_dir
.byte DIRECTION_E ; east exit_dir
.byte DIRECTION_E|DIRECTION_SPLIT ; east exit_dir
.byte DIRECTION_W ; west exit_dir
.word $0000 ; north bg
.word $0000 ; south bg
@ -84,10 +84,10 @@ location3:
.word boiler_e_lzsa ; east bg
.word boiler_w_lzsa ; west bg
.byte BG_EAST|BG_WEST
.byte DIRECTION_W ; special exit
.byte 28,36 ; special x
.byte 16,32 ; special y
.word goto_safe-1
.byte DIRECTION_W|DIRECTION_E ; special exit
.byte 28,38 ; special x
.byte 12,32 ; special y
.word goto_safe_or_valve-1
; CABIN_SAFE -- looking at safe
@ -184,7 +184,7 @@ location8:
; CABIN_TREE_BASEMENT -- in the tree basement
location9:
.byte CABIN_BIG_TREE ; north exit
.byte CABIN_TREE_ELEVATOR ; north exit
.byte CABIN_TREE_BOOK ; south exit
.byte $ff ; east exit
.byte $ff ; west exit