mist: meche: can now pick up red/blue pages

This commit is contained in:
Vince Weaver 2020-03-23 16:11:14 -04:00
parent 5ea2d2139d
commit faa97f61b4
20 changed files with 327 additions and 29 deletions

View File

@ -92,6 +92,7 @@ MECHE: meche.o
meche.o: meche.s zp.inc hardware.inc common_defines.inc \
graphics_meche/meche_graphics.inc \
common_sprites.inc \
page_sprites.inc \
leveldata_meche.inc \
link_book_meche.s \
link_book_mist.s \

View File

@ -157,6 +157,11 @@ MECHE_BOOK_STAIRS = 34
MECHE_MIST_BOOK = 35
MECHE_MIST_CLOSED = 36
MECHE_MIST_OPEN = 37
MECHE_BLUE_SECRET_DOOR = 38
MECHE_BLUE_SECRET_ROOM = 39
MECHE_RED_SECRET_DOOR = 40
MECHE_RED_SECRET_ROOM = 41

View File

@ -1,5 +1,3 @@
finger_point_sprite:
.byte 5,5
.byte $AA,$BB,$AA,$AA,$AA
@ -30,4 +28,26 @@ finger_right_sprite:
.byte $BB,$BB,$BB,$BB,$AA,$AA
.byte $AB,$BB,$BB,$AB,$AA,$AA
finger_red_page_sprite:
.byte 5,5
.byte $3a,$33,$33,$aa,$aa
.byte $33,$33,$33,$ba,$aa
.byte $33,$b3,$33,$bb,$ba
.byte $33,$3b,$bb,$bb,$bb
.byte $a3,$a3,$bb,$bb,$bb
finger_blue_page_sprite:
.byte 5,5
.byte $6a,$66,$66,$aa,$aa
.byte $66,$66,$66,$ba,$aa
.byte $66,$b6,$66,$bb,$ba
.byte $66,$6b,$bb,$bb,$bb
.byte $a6,$a6,$bb,$bb,$bb
finger_white_page_sprite:
.byte 5,5
.byte $fa,$ff,$ff,$aa,$aa
.byte $ff,$ff,$ff,$ba,$aa
.byte $ff,$bf,$ff,$bb,$ba
.byte $ff,$fb,$bb,$bb,$bb
.byte $af,$af,$bb,$bb,$bb

View File

@ -81,6 +81,32 @@ finger_not_special:
; otherwise, finger_point
finger_point:
lda HOLDING_PAGE
beq real_finger_point
cmp #HOLDING_BLUE_PAGE
beq blue_finger
cmp #HOLDING_WHITE_PAGE
beq white_finger
red_finger:
lda #<finger_red_page_sprite
sta INL
lda #>finger_red_page_sprite
jmp finger_draw
blue_finger:
lda #<finger_blue_page_sprite
sta INL
lda #>finger_blue_page_sprite
jmp finger_draw
white_finger:
lda #<finger_white_page_sprite
sta INL
lda #>finger_white_page_sprite
jmp finger_draw
real_finger_point:
lda #<finger_point_sprite
sta INL
lda #>finger_point_sprite
@ -168,8 +194,9 @@ handle_right_east:
; check if south exists
lda (LOCATION_STRUCT_L),Y
and #BG_SOUTH
beq finger_point
bne finger_right
; beq finger_point
jmp finger_point
check_right_west:
; we should be only option left
@ -177,9 +204,9 @@ handle_right_west:
; check if north exists
lda (LOCATION_STRUCT_L),Y
and #BG_NORTH
beq finger_point
bne finger_right
; beq finger_point
jmp finger_point
finger_left:

View File

@ -26,7 +26,7 @@ meche_graphics.inc: \
northturn_s.lzsa northturn_n.lzsa northturn_w.lzsa northturn_e.lzsa \
left_hall2_n.lzsa left_hall2_s.lzsa \
left_hall_corner_s.lzsa left_hall_corner_e.lzsa \
red_room_center_e.lzsa red_room_center_w.lzsa \
red_room_center_n.lzsa red_room_center_s.lzsa red_room_center_e.lzsa red_room_center_w.lzsa \
center_hall_e.lzsa center_hall_w.lzsa center_hall_s.lzsa \
red_button_n.lzsa red_button_s.lzsa red_button_e.lzsa \
red_button_of_oe_w.lzsa red_button_of_ce_w.lzsa \
@ -36,6 +36,7 @@ meche_graphics.inc: \
right_hall2_s.lzsa \
right_hall_corner_n.lzsa right_hall_corner_w.lzsa \
blue_room_center_n.lzsa blue_room_center_s.lzsa \
blue_room_center_e.lzsa blue_room_center_w.lzsa \
center_hall2_n.lzsa center_hall2_s.lzsa center_hall2_w.lzsa \
elevator_path_e.lzsa elevator_path_w.lzsa \
elevator_ground_e.lzsa \
@ -52,7 +53,9 @@ meche_graphics.inc: \
exit_puzzle_n.lzsa \
book_stairs_n.lzsa book_stairs_s.lzsa \
book_room_n.lzsa \
book_open_n.lzsa book_closed_n.lzsa
book_open_n.lzsa book_closed_n.lzsa \
blue_secret_door_w.lzsa blue_secret_room_w.lzsa \
red_secret_door_s.lzsa red_secret_room_s.lzsa
echo "departure_e_lzsa: .incbin \"departure_e.lzsa\"" > meche_graphics.inc
echo "arrival_w_lzsa: .incbin \"arrival_w.lzsa\"" >> meche_graphics.inc
echo "entrance_e_lzsa: .incbin \"entrance_e.lzsa\"" >> meche_graphics.inc
@ -91,6 +94,8 @@ meche_graphics.inc: \
echo "left_hall_corner_e_lzsa: .incbin \"left_hall_corner_e.lzsa\"" >> meche_graphics.inc
echo "red_room_center_e_lzsa: .incbin \"red_room_center_e.lzsa\"" >> meche_graphics.inc
echo "red_room_center_w_lzsa: .incbin \"red_room_center_w.lzsa\"" >> meche_graphics.inc
echo "red_room_center_n_lzsa: .incbin \"red_room_center_n.lzsa\"" >> meche_graphics.inc
echo "red_room_center_s_lzsa: .incbin \"red_room_center_s.lzsa\"" >> meche_graphics.inc
echo "center_hall_e_lzsa: .incbin \"center_hall_e.lzsa\"" >> meche_graphics.inc
echo "center_hall_w_lzsa: .incbin \"center_hall_w.lzsa\"" >> meche_graphics.inc
echo "center_hall_s_lzsa: .incbin \"center_hall_s.lzsa\"" >> meche_graphics.inc
@ -109,6 +114,8 @@ meche_graphics.inc: \
echo "right_hall_corner_w_lzsa: .incbin \"right_hall_corner_w.lzsa\"" >> meche_graphics.inc
echo "blue_room_center_n_lzsa: .incbin \"blue_room_center_n.lzsa\"" >> meche_graphics.inc
echo "blue_room_center_s_lzsa: .incbin \"blue_room_center_s.lzsa\"" >> meche_graphics.inc
echo "blue_room_center_e_lzsa: .incbin \"blue_room_center_e.lzsa\"" >> meche_graphics.inc
echo "blue_room_center_w_lzsa: .incbin \"blue_room_center_w.lzsa\"" >> meche_graphics.inc
echo "center_hall2_n_lzsa: .incbin \"center_hall2_n.lzsa\"" >> meche_graphics.inc
echo "center_hall2_s_lzsa: .incbin \"center_hall2_s.lzsa\"" >> meche_graphics.inc
echo "center_hall2_w_lzsa: .incbin \"center_hall2_w.lzsa\"" >> meche_graphics.inc
@ -137,6 +144,13 @@ meche_graphics.inc: \
echo "book_room_n_lzsa: .incbin \"book_room_n.lzsa\"" >> meche_graphics.inc
echo "book_open_n_lzsa: .incbin \"book_open_n.lzsa\"" >> meche_graphics.inc
echo "book_closed_n_lzsa: .incbin \"book_closed_n.lzsa\"" >> meche_graphics.inc
echo "blue_secret_door_w_lzsa: .incbin \"blue_secret_door_w.lzsa\"" >> meche_graphics.inc
echo "blue_secret_room_w_lzsa: .incbin \"blue_secret_room_w.lzsa\"" >> meche_graphics.inc
echo "red_secret_door_s_lzsa: .incbin \"red_secret_door_s.lzsa\"" >> meche_graphics.inc
echo "red_secret_room_s_lzsa: .incbin \"red_secret_room_s.lzsa\"" >> meche_graphics.inc
%.gr: %.png
$(PNG2GR) $< $@

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -36,6 +36,8 @@ left_hall_corner_s_lzsa: .incbin "left_hall_corner_s.lzsa"
left_hall_corner_e_lzsa: .incbin "left_hall_corner_e.lzsa"
red_room_center_e_lzsa: .incbin "red_room_center_e.lzsa"
red_room_center_w_lzsa: .incbin "red_room_center_w.lzsa"
red_room_center_n_lzsa: .incbin "red_room_center_n.lzsa"
red_room_center_s_lzsa: .incbin "red_room_center_s.lzsa"
center_hall_e_lzsa: .incbin "center_hall_e.lzsa"
center_hall_w_lzsa: .incbin "center_hall_w.lzsa"
center_hall_s_lzsa: .incbin "center_hall_s.lzsa"
@ -54,6 +56,8 @@ right_hall_corner_n_lzsa: .incbin "right_hall_corner_n.lzsa"
right_hall_corner_w_lzsa: .incbin "right_hall_corner_w.lzsa"
blue_room_center_n_lzsa: .incbin "blue_room_center_n.lzsa"
blue_room_center_s_lzsa: .incbin "blue_room_center_s.lzsa"
blue_room_center_e_lzsa: .incbin "blue_room_center_e.lzsa"
blue_room_center_w_lzsa: .incbin "blue_room_center_w.lzsa"
center_hall2_n_lzsa: .incbin "center_hall2_n.lzsa"
center_hall2_s_lzsa: .incbin "center_hall2_s.lzsa"
center_hall2_w_lzsa: .incbin "center_hall2_w.lzsa"
@ -82,3 +86,7 @@ book_stairs_s_lzsa: .incbin "book_stairs_s.lzsa"
book_room_n_lzsa: .incbin "book_room_n.lzsa"
book_open_n_lzsa: .incbin "book_open_n.lzsa"
book_closed_n_lzsa: .incbin "book_closed_n.lzsa"
blue_secret_door_w_lzsa: .incbin "blue_secret_door_w.lzsa"
blue_secret_room_w_lzsa: .incbin "blue_secret_room_w.lzsa"
red_secret_door_s_lzsa: .incbin "red_secret_door_s.lzsa"
red_secret_room_s_lzsa: .incbin "red_secret_room_s.lzsa"

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -5,6 +5,11 @@
init_state:
lda #0
; book pages
sta RED_PAGES_TAKEN
sta BLUE_PAGES_TAKEN
sta HOLDING_PAGE
; init clock puzzles
sta CLOCK_MINUTE
sta CLOCK_HOUR

View File

@ -13,7 +13,8 @@ locations:
.word location24,location25,location26,location27
.word location28,location29,location30,location31
.word location32,location33,location34,location35
.word location36,location37
.word location36,location37,location38,location39
.word location40,location41
; MECHE_INSIDE_GEAR -- Inside gear on Mist
location0:
@ -308,12 +309,15 @@ location16:
.byte $ff ; south exit_dir
.byte DIRECTION_E ; east exit_dir
.byte DIRECTION_S ; west exit_dir
.word $0000 ; north bg
.word $0000 ; south bg
.word red_room_center_n_lzsa ; north bg
.word red_room_center_s_lzsa ; south bg
.word red_room_center_e_lzsa ; east bg
.word red_room_center_w_lzsa ; west bg
.byte BG_WEST|BG_EAST
.byte $ff ; special exit
.byte BG_NORTH|BG_SOUTH|BG_WEST|BG_EAST
.byte DIRECTION_S
.byte 25,33 ; special x
.byte 18,38 ; special y
.word enter_red_secret-1 ; special function
; MECHE_CENTER_HALL -- center hall 1
location17:
@ -431,17 +435,20 @@ location23:
.byte MECHE_CENTER_HALL2 ; north exit
.byte MECHE_RIGHT_HALL_CORNER ; south exit
.byte $ff ; east exit
.byte $ff ; west exit
.byte $ff ; west exit
.byte DIRECTION_N ; north exit_dir
.byte DIRECTION_W ; south exit_dir
.byte $ff ; east exit_dir
.byte $ff ; west exit_dir
.word blue_room_center_n_lzsa ; north bg
.word blue_room_center_s_lzsa ; south bg
.word $0000 ; east bg
.word $0000 ; west bg
.byte BG_NORTH|BG_SOUTH
.byte $ff ; special exit
.word blue_room_center_e_lzsa ; east bg
.word blue_room_center_w_lzsa ; west bg
.byte BG_NORTH|BG_SOUTH|BG_EAST|BG_WEST
.byte DIRECTION_W
.byte 9,14 ; special x
.byte 24,44 ; special y
.word enter_blue_secret-1 ; special function
; MECHE_CENTER_HALL2 -- center hall 2
@ -694,4 +701,77 @@ location37:
.byte 12,22 ; special y
.word mist_link_book-1 ; special function
; MECHE_BLUE_SECRET_DOOR -- blue room secret door
location38:
.byte $ff ; north exit
.byte $ff ; south exit
.byte $ff ; east exit
.byte MECHE_BLUE_SECRET_ROOM ; west exit
.byte $ff ; north exit_dir
.byte $ff ; south exit_dir
.byte $ff ; east exit_dir
.byte DIRECTION_W ; west exit_dir
.word $0000 ; north bg
.word $0000 ; south bg
.word $0000 ; east bg
.word blue_secret_door_w_lzsa ; west bg
.byte BG_WEST
.byte $ff
; MECHE_BLUE_SECRET_ROOM -- blue room secret room
location39:
.byte $ff ; north exit
.byte $ff ; south exit
.byte $ff ; east exit
.byte MECHE_BLUE_ROOM_CENTER ; west exit
.byte $ff ; north exit_dir
.byte $ff ; south exit_dir
.byte $ff ; east exit_dir
.byte DIRECTION_W ; west exit_dir
.word $0000 ; north bg
.word $0000 ; south bg
.word $0000 ; east bg
.word blue_secret_room_w_lzsa ; west bg
.byte BG_WEST
.byte DIRECTION_W
.byte 14,18 ; special x
.byte 32,40 ; special y
.word take_blue_page-1 ; special function
; MECHE_RED_SECRET_DOOR -- red room secret door
location40:
.byte $ff ; north exit
.byte MECHE_RED_SECRET_ROOM ; south exit
.byte $ff ; east exit
.byte $ff ; west exit
.byte $ff ; north exit_dir
.byte DIRECTION_S ; south exit_dir
.byte $ff ; east exit_dir
.byte $ff ; west exit_dir
.word $0000 ; north bg
.word red_secret_door_s_lzsa ; south bg
.word $0000 ; east bg
.word $0000 ; west bg
.byte BG_SOUTH
.byte $ff
; MECHE_RED_SECRET_ROOM -- red room secret room
location41:
.byte $ff ; north exit
.byte MECHE_RED_ROOM_CENTER ; south exit
.byte $ff ; east exit
.byte $ff ; west exit
.byte $ff ; north exit_dir
.byte DIRECTION_S ; south exit_dir
.byte $ff ; east exit_dir
.byte $ff ; west exit_dir
.word $0000 ; north bg
.word red_secret_room_s_lzsa ; south bg
.word $0000 ; east bg
.word $0000 ; west bg
.byte BG_SOUTH
.byte DIRECTION_S
.byte 22,29 ; special x
.byte 14,24 ; special y
.word take_red_page-1 ; special function

View File

@ -74,6 +74,10 @@ game_loop:
beq animate_meche_puzzle
cmp #MECHE_MIST_OPEN
beq animate_mist_book
cmp #MECHE_BLUE_SECRET_ROOM
beq fg_draw_blue_page
cmp #MECHE_RED_SECRET_ROOM
beq fg_draw_red_page
jmp nothing_special
animate_meche_book:
@ -152,6 +156,16 @@ mist_book_good:
inc ANIMATE_FRAME
done_animate_mist_book:
jmp nothing_special
fg_draw_red_page:
jsr draw_red_page
jmp nothing_special
fg_draw_blue_page:
jsr draw_blue_page
jmp nothing_special
nothing_special:
@ -195,6 +209,49 @@ really_exit:
jmp end_level
;=============================
draw_red_page:
lda RED_PAGES_TAKEN
and #MECHE_PAGE
bne no_draw_page
lda #22
sta XPOS
lda #14
sta YPOS
lda #<red_page_sprite
sta INL
lda #>red_page_sprite
sta INH
jmp put_sprite_crop ; tail call
draw_blue_page:
lda BLUE_PAGES_TAKEN
and #MECHE_PAGE
bne no_draw_page
lda #15
sta XPOS
lda #34
sta YPOS
lda #<blue_page_sprite
sta INL
lda #>blue_page_sprite
sta INH
jmp put_sprite_crop ; tail call
no_draw_page:
rts
;==========================
; includes
;==========================
@ -225,6 +282,7 @@ really_exit:
.include "link_book_mist.s"
.include "common_sprites.inc"
.include "page_sprites.inc"
.include "leveldata_meche.inc"
@ -232,8 +290,3 @@ really_exit:
;.align $100
;audio_link_noise:
;.incbin "audio/link_noise.btc"

View File

@ -1,3 +1,59 @@
;==============================
; book page stuff
;==============================
take_blue_page:
; FIXME: if we came back we could return page
; should check to see if carrying first
; also what if holding red, click blu
lda BLUE_PAGES_TAKEN
eor #MECHE_PAGE
sta BLUE_PAGES_TAKEN
; FIXME: if holding another page, put it down?
lda #HOLDING_BLUE_PAGE
sta HOLDING_PAGE
rts
enter_blue_secret:
lda #MECHE_BLUE_SECRET_DOOR
sta LOCATION
jsr change_location
rts
take_red_page:
; FIXME: if we came back we could return page
; should check to see if carrying first
; also what if holding red, click blu
lda RED_PAGES_TAKEN
eor #MECHE_PAGE
sta RED_PAGES_TAKEN
; FIXME: if holding another page, put it down?
lda #HOLDING_RED_PAGE
sta HOLDING_PAGE
rts
enter_red_secret:
lda #MECHE_RED_SECRET_DOOR
sta LOCATION
jsr change_location
rts
;===============================
;===============================
; exit puzzle stuff

22
mist/page_sprites.inc Normal file
View File

@ -0,0 +1,22 @@
blue_page_sprite:
.byte 5,4
.byte $66,$66,$66,$66,$aa
.byte $66,$66,$66,$66,$aa
.byte $aa,$66,$66,$66,$66
.byte $aa,$66,$66,$66,$66
red_page_sprite:
.byte 5,4
.byte $33,$33,$33,$33,$aa
.byte $33,$33,$33,$33,$aa
.byte $aa,$33,$33,$33,$33
.byte $aa,$33,$33,$33,$33
white_page_sprite:
.byte 5,4
.byte $ff,$ff,$ff,$ff,$aa
.byte $ff,$ff,$ff,$ff,$aa
.byte $aa,$ff,$ff,$ff,$ff
.byte $aa,$ff,$ff,$ff,$ff

View File

@ -55,13 +55,16 @@ BTC_H = $6F
; If we ever support save to disk, we'd have to save/restore
; the following values
HOLDING_PAGE = $80
CLOCK_BRIDGE = $81
GEAR_OPEN = $82
MARKER_SWITCHES = $83
CLOCK_HOUR = $84
CLOCK_MINUTE = $85
;GENERATOR_ON = $86
RED_PAGES_TAKEN = $80
OCTOGON_PAGE = 1
MECHE_PAGE = 2
SELENA_PAGE = 4
BLUE_PAGES_TAKEN= $81
CLOCK_BRIDGE = $82
GEAR_OPEN = $83
MARKER_SWITCHES = $84
CLOCK_HOUR = $85
CLOCK_MINUTE = $86
TREE_FURNACE_ON = $87
FIREPLACE_GRID0 = $88
FIREPLACE_GRID1 = $89
@ -96,6 +99,10 @@ MECHE_LOCK1 = $A2
MECHE_LOCK2 = $A3
MECHE_LOCK3 = $A4
MECHE_LOCK4 = $A5
HOLDING_PAGE = $A6
HOLDING_RED_PAGE = 1
HOLDING_BLUE_PAGE = 2
HOLDING_WHITE_PAGE = 3
; done game puzzle state