mist: start adding clock puzzle

This commit is contained in:
Vince Weaver 2020-03-07 11:06:29 -05:00
parent 5d42a49e97
commit 7d1fb17aa8
5 changed files with 142 additions and 3 deletions

View File

@ -49,6 +49,7 @@ mist.o: mist.s zp.inc hardware.inc \
graphics_island/mist_graphics.inc \
common_sprites.inc \
leveldata_island.inc \
clock_bridge_puzzle.s clock_sprites.inc \
gr_copy.s audio.s text_print.s decompress_fast_v2.s
ca65 -o mist.o mist.s -l mist.lst

View File

@ -0,0 +1,44 @@
;======================
; draw the clock face
draw_clock_face:
lda CLOCK_HOUR
asl
tay
lda clock_hour_sprites,Y
sta INL
lda clock_hour_sprites+1,Y
sta INH
lda #20
sta XPOS
lda #6
sta YPOS
jsr put_sprite_crop
lda CLOCK_MINUTE
asl
tay
lda clock_minute_sprites,Y
sta INL
lda clock_minute_sprites+1,Y
sta INH
lda #20
sta XPOS
lda #6
sta YPOS
jsr put_sprite_crop
rts
.include "clock_sprites.inc"

75
mist/clock_sprites.inc Normal file
View File

@ -0,0 +1,75 @@
clock_hour_sprites:
.word hour12_sprite,hour1_sprite,hour2_sprite,hour3_sprite
.word hour12_sprite,hour1_sprite,hour2_sprite,hour3_sprite
.word hour12_sprite,hour1_sprite,hour2_sprite,hour3_sprite
clock_minute_sprites:
.word minute12_sprite,minute1_sprite,minute2_sprite,minute3_sprite
.word minute12_sprite,minute1_sprite,minute2_sprite,minute3_sprite
.word minute12_sprite,minute1_sprite,minute2_sprite,minute3_sprite
hour12_sprite:
.byte 3,5
.byte $fd,$0d,$fd
.byte $ff,$00,$ff
.byte $ff,$00,$ff
.byte $ff,$ff,$ff
.byte $ff,$ff,$ff
hour1_sprite:
.byte 3,5
.byte $fd,$fd,$0d
.byte $ff,$0f,$f0
.byte $ff,$00,$ff
.byte $ff,$ff,$ff
.byte $ff,$ff,$ff
hour2_sprite:
.byte 3,5
.byte $fd,$fd,$fd
.byte $ff,$ff,$0f
.byte $ff,$00,$ff
.byte $ff,$ff,$ff
.byte $ff,$ff,$ff
hour3_sprite:
.byte 3,5
.byte $fd,$fd,$fd
.byte $ff,$ff,$ff
.byte $ff,$0f,$0f
.byte $ff,$ff,$ff
.byte $ff,$ff,$ff
minute12_sprite:
.byte 3,5
.byte $aa,$aa,$aa
.byte $aa,$00,$aa
.byte $aa,$00,$aa
.byte $aa,$aa,$aa
.byte $aa,$aa,$aa
minute1_sprite:
.byte 3,5
.byte $aa,$aa,$aa
.byte $aa,$0a,$a0
.byte $aa,$00,$aa
.byte $aa,$aa,$aa
.byte $aa,$aa,$aa
minute2_sprite:
.byte 3,5
.byte $aa,$aa,$aa
.byte $aa,$aa,$5a
.byte $aa,$00,$aa
.byte $aa,$aa,$aa
.byte $aa,$aa,$aa
minute3_sprite:
.byte 3,5
.byte $aa,$aa,$aa
.byte $aa,$aa,$aa
.byte $aa,$0a,$5a
.byte $aa,$aa,$aa
.byte $aa,$aa,$aa

View File

@ -31,13 +31,28 @@ mist_start:
sta CURSOR_X
sta CURSOR_Y
; init location
;=================
; init vars
; FIXME: we could be re-called from other books
; so don't set location here
lda #0
sta LOCATION
lda #0
sta DIRECTION
lda LOCATION
bne not_first_time
; first time init
lda #0
sta CLOCK_MINUTE
sta CLOCK_HOUR
not_first_time:
; set up initial location
jsr change_location
@ -747,6 +762,10 @@ red_book_done:
.include "graphics_island/mist_graphics.inc"
; puzzles
.include "clock_bridge_puzzle.s"
.include "common_sprites.inc"
.include "leveldata_island.inc"

View File

@ -53,8 +53,8 @@ HOLDING_PAGE = $70
CLOCK_BRIDGE = $71
GEAR_OPEN = $72
MARKER_SWITCHES = $73
CLOCK_H = $74
CLOCK_M = $75
CLOCK_HOUR = $74
CLOCK_MINUTE = $75
GENERATOR_ON = $76
TREE_FURNACE_ON = $77
FIREPLACE_GRID0 = $78