diff --git a/mist/default_save.s b/mist/default_save.s index 2a233f83..0ed05a3c 100644 --- a/mist/default_save.s +++ b/mist/default_save.s @@ -68,3 +68,4 @@ .byte $00 ; DENTIST_YEAR = $BB .byte $00 ; DENTIST_HOURS = $BC .byte $00 ; DENTIST_MINUTES = $BD +.byte $00 ; PILLAR_ON = $BE diff --git a/mist/graphics_mist/pillar_cross.png b/mist/graphics_mist/pillar_cross.png index e7ac3ecf..41d76f13 100644 Binary files a/mist/graphics_mist/pillar_cross.png and b/mist/graphics_mist/pillar_cross.png differ diff --git a/mist/graphics_mist/pillar_snake.png b/mist/graphics_mist/pillar_snake.png index d68a93c5..5026df61 100644 Binary files a/mist/graphics_mist/pillar_snake.png and b/mist/graphics_mist/pillar_snake.png differ diff --git a/mist/leveldata_mist.inc b/mist/leveldata_mist.inc index 4c04b127..1c39890a 100644 --- a/mist/leveldata_mist.inc +++ b/mist/leveldata_mist.inc @@ -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 diff --git a/mist/mist.s b/mist/mist.s index ed021436..028802f6 100644 --- a/mist/mist.s +++ b/mist/mist.s @@ -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 diff --git a/mist/mist_puzzles.s b/mist/mist_puzzles.s index 5c5aa304..ef11e06f 100644 --- a/mist/mist_puzzles.s +++ b/mist/mist_puzzles.s @@ -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 diff --git a/mist/zp.inc b/mist/zp.inc index e2737db0..439fa32c 100644 --- a/mist/zp.inc +++ b/mist/zp.inc @@ -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