mist: can now toggle the pillar buttons

This commit is contained in:
Vince Weaver 2020-07-08 16:39:24 -04:00
parent 2860397c80
commit d307d21f57
7 changed files with 157 additions and 18 deletions

View File

@ -68,3 +68,4 @@
.byte $00 ; DENTIST_YEAR = $BB
.byte $00 ; DENTIST_HOURS = $BC
.byte $00 ; DENTIST_MINUTES = $BD
.byte $00 ; PILLAR_ON = $BE

Binary file not shown.

Before

Width:  |  Height:  |  Size: 880 B

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 898 B

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -623,7 +623,7 @@ location31:
.byte DIRECTION_W ; special exit
.byte 14,27 ; special x
.byte 12,30 ; special y
.word touch_pillar_eye-1 ; special function
.word touch_pillar-1 ; special function
; MIST_PILLAR_SNAKE -- pillar with snake
location32:
@ -643,7 +643,7 @@ location32:
.byte DIRECTION_W ; special exit
.byte 14,27 ; special x
.byte 12,30 ; special y
.word touch_pillar_snake-1 ; special function
.word touch_pillar-1 ; special function
; MIST_PILLAR_BUG -- pillar with bug
location33:
@ -663,7 +663,7 @@ location33:
.byte DIRECTION_W ; special exit
.byte 14,27 ; special x
.byte 12,30 ; special y
.word touch_pillar_bug-1 ; special function
.word touch_pillar-1 ; special function
; MIST_PILLAR_ANCHOR -- pillar with anchor
location34:
@ -683,7 +683,7 @@ location34:
.byte DIRECTION_W ; special exit
.byte 14,27 ; special x
.byte 12,30 ; special y
.word touch_pillar_anchor-1 ; special function
.word touch_pillar-1 ; special function
; MIST_PILLAR_ARROW -- pillar with arrow
location35:
@ -703,7 +703,7 @@ location35:
.byte DIRECTION_E ; special exit
.byte 14,27 ; special x
.byte 12,30 ; special y
.word touch_pillar_arrow-1 ; special function
.word touch_pillar-1 ; special function
; MIST_PILLAR_LEAF -- pillar with leaf
location36:
@ -723,7 +723,7 @@ location36:
.byte DIRECTION_E ; special exit
.byte 14,27 ; special x
.byte 12,30 ; special y
.word touch_pillar_leaf-1 ; special function
.word touch_pillar-1 ; special function
; MIST_PILLAR_CROSS -- pillar with cross
location37:
@ -743,7 +743,7 @@ location37:
.byte DIRECTION_E ; special exit
.byte 14,27 ; special x
.byte 12,30 ; special y
.word touch_pillar_cross-1 ; special function
.word touch_pillar-1 ; special function
; MIST_PILLAR_EMU -- pillar with emu
location38:
@ -763,7 +763,7 @@ location38:
.byte DIRECTION_E ; special exit
.byte 14,27 ; special x
.byte 12,30 ; special y
.word touch_pillar_emu-1 ; special function
.word touch_pillar-1 ; special function

View File

@ -85,9 +85,15 @@ game_loop:
jsr check_gear_delete
not_gear_related:
; handl pillars
lda LOCATION
cmp #MIST_PILLAR_EYE
bcc check_if_clock
jsr draw_pillar
; handle clock puzzles
check_if_clock:
lda LOCATION
cmp #MIST_CLOCK_PUZZLE ; clock puzzle
beq location_clock

View File

@ -1,14 +1,136 @@
draw_pillar:
lda LOCATION
sec
sbc #MIST_PILLAR_EYE ; find which one we are on
tay
tax
touch_pillar_eye:
touch_pillar_snake:
touch_pillar_bug:
touch_pillar_anchor:
touch_pillar_arrow:
touch_pillar_leaf:
touch_pillar_cross:
touch_pillar_emu:
lda PILLAR_ON
and powersoftwo,Y
beq done_draw_pillar
; is on, so draw it green
txa
asl
tay
lda pillar_sprites,Y
sta INL
lda pillar_sprites+1,Y
sta INH
lda #17
sta XPOS
lda #16
sta YPOS
jsr put_sprite_crop
done_draw_pillar:
rts
touch_pillar:
lda PILLAR_ON
tax ; save to see if toggle ship state
lda LOCATION
sec
sbc #MIST_PILLAR_EYE ; find which on we touched
tay
lda PILLAR_ON
eor powersoftwo,Y
sta PILLAR_ON
; check to see if we need to raise/lower ship
rts
powersoftwo:
.byte $01,$02,$04,$08,$10,$20,$40,$80
pillar_sprites:
.word eye_sprite,snake_sprite,bug_sprite,anchor_sprite
.word arrow_sprite,leaf_sprite,cross_sprite,emu_sprite
eye_sprite: ; @17,16
.byte 7,6
.byte $AA,$AA,$AA,$AA,$AA,$AA,$AA
.byte $AA,$AA,$4A,$4A,$4A,$AA,$AA
.byte $4A,$A4,$44,$A4,$44,$A4,$4A
.byte $A4,$4A,$44,$4A,$44,$4A,$A4
.byte $AA,$AA,$A4,$A4,$A4,$AA,$AA
.byte $AA,$AA,$AA,$AA,$AA,$AA,$AA
snake_sprite: ; @17,16
.byte 6,6
.byte $AA,$4A,$4A,$AA,$AA,$AA
.byte $AA,$44,$AA,$4A,$A4,$4A
.byte $AA,$44,$AA,$44,$AA,$44
.byte $AA,$44,$AA,$44,$AA,$44
.byte $AA,$44,$AA,$44,$AA,$44
.byte $AA,$AA,$A4,$AA,$AA,$A4
bug_sprite: ; @17,16
.byte 6,5
.byte $AA,$AA,$AA,$AA,$AA,$AA
.byte $AA,$44,$AA,$44,$AA,$44
.byte $AA,$4A,$44,$44,$44,$4A
.byte $AA,$AA,$44,$44,$44,$AA
.byte $AA,$44,$AA,$A4,$AA,$44
anchor_sprite: ; @17,16
.byte 6,6
.byte $AA,$AA,$AA,$4A,$AA,$AA
.byte $AA,$AA,$AA,$44,$AA,$AA
.byte $AA,$AA,$A4,$44,$A4,$AA
.byte $AA,$AA,$AA,$44,$AA,$AA
.byte $AA,$A4,$4A,$44,$4A,$A4
.byte $AA,$AA,$AA,$A4,$AA,$AA
arrow_sprite: ; @17,16
.byte 7,6
.byte $AA,$AA,$AA,$AA,$4A,$4A,$4A
.byte $AA,$AA,$AA,$AA,$AA,$44,$44
.byte $AA,$AA,$AA,$4A,$A4,$AA,$A4
.byte $AA,$AA,$44,$AA,$AA,$AA,$AA
.byte $A4,$44,$AA,$AA,$AA,$AA,$AA
.byte $AA,$A4,$AA,$AA,$AA,$AA,$AA
leaf_sprite: ; @17,16
.byte 6,6
.byte $AA,$4A,$AA,$AA,$AA,$4A
.byte $AA,$44,$44,$4A,$44,$44
.byte $AA,$44,$44,$44,$44,$AA
.byte $AA,$A4,$44,$44,$44,$4A
.byte $AA,$4A,$AA,$44,$44,$44
.byte $AA,$A4,$AA,$AA,$AA,$AA
cross_sprite: ; @17,16
.byte 6,6
.byte $AA,$AA,$AA,$AA,$AA,$AA
.byte $AA,$AA,$A4,$44,$A4,$AA
.byte $AA,$4A,$AA,$44,$AA,$4A
.byte $AA,$44,$A4,$44,$A4,$44
.byte $AA,$AA,$AA,$44,$AA,$AA
.byte $AA,$AA,$A4,$A4,$A4,$AA
emu_sprite: ; @17,16
.byte 7,6
.byte $AA,$AA,$AA,$AA,$AA,$4A,$AA
.byte $AA,$AA,$AA,$AA,$AA,$44,$A4
.byte $AA,$4A,$44,$44,$44,$44,$AA
.byte $AA,$44,$44,$44,$44,$A4,$AA
.byte $AA,$44,$AA,$44,$AA,$AA,$AA
.byte $AA,$AA,$AA,$A4,$A4,$AA,$AA
tree2_pillars:
lda DIRECTION
cmp #DIRECTION_E

View File

@ -158,8 +158,18 @@ DENTIST_CENTURY = $BA
DENTIST_YEAR = $BB
DENTIST_HOURS = $BC
DENTIST_MINUTES = $BD
PILLAR_ON = $BE
PILLAR_EYE = $01
PILLAR_SNAKE = $02
PILLAR_BUG = $04
PILLAR_ANCHOR = $08
PILLAR_ARROW = $10
PILLAR_LEAF = $20
PILLAR_CROSS = $40
PILLAR_EMU = $80
END_OF_SAVE = $BE
END_OF_SAVE = $BF
; done game puzzle state