diff --git a/mist/common_defines.inc b/mist/common_defines.inc index 82ae7857..a0e57c0f 100644 --- a/mist/common_defines.inc +++ b/mist/common_defines.inc @@ -117,6 +117,12 @@ OCTAGON_RED_BOOKSHELF = 2 OCTAGON_FIREPLACE = 3 OCTAGON_IN_FIREPLACE = 4 OCTAGON_CEILING = 5 +OCTAGON_MAP = 6 +OCTAGON_FRAME_SHELF = 7 +OCTAGON_BOOKSHELF = 8 +OCTAGON_FRAME_DOOR = 9 +OCTAGON_BLUE_BOOKSHELF = 10 + ; Mechanical Engineering diff --git a/mist/draw_pointer.s b/mist/draw_pointer.s index 135590f9..cfdd2bdb 100644 --- a/mist/draw_pointer.s +++ b/mist/draw_pointer.s @@ -18,11 +18,18 @@ draw_pointer: cmp #$ff beq finger_not_special ; if $ff not special + lda (LOCATION_STRUCT_L),Y + cmp #$4 + beq was_any + lda DIRECTION and #$f + cmp (LOCATION_STRUCT_L),Y bne finger_not_special ; only special if facing right way +was_any: + ; see if X1 < X < X2 lda CURSOR_X ldy #LOCATION_SPECIAL_X1 diff --git a/mist/graphics_octagon/Makefile b/mist/graphics_octagon/Makefile index 05ff559b..ba0f7fa4 100644 --- a/mist/graphics_octagon/Makefile +++ b/mist/graphics_octagon/Makefile @@ -17,7 +17,12 @@ octagon_graphics.inc: \ red_book_open.lzsa red_book_closed.lzsa \ red_book_static.lzsa red_book_static2.lzsa \ fireplace_e.lzsa \ - in_fireplace_w.lzsa in_fireplace_door.lzsa + in_fireplace_w.lzsa in_fireplace_door.lzsa \ + frame_door_open.lzsa \ + frame_bookcase_open.lzsa \ + blue_book_shelf.lzsa \ + bookshelf_n.lzsa \ + map.lzsa echo "temple_door_n_lzsa: .incbin \"temple_door_n.lzsa\"" > octagon_graphics.inc echo "temple_door_s_lzsa: .incbin \"temple_door_s.lzsa\"" >> octagon_graphics.inc echo "temple_center_n_lzsa: .incbin \"temple_center_n.lzsa\"" >> octagon_graphics.inc @@ -33,8 +38,11 @@ octagon_graphics.inc: \ echo "fireplace_e_lzsa: .incbin \"fireplace_e.lzsa\"" >> octagon_graphics.inc echo "in_fireplace_w_lzsa: .incbin \"in_fireplace_w.lzsa\"" >> octagon_graphics.inc echo "in_fireplace_door_lzsa: .incbin \"in_fireplace_door.lzsa\"" >> octagon_graphics.inc - - + echo "frame_door_open_lzsa: .incbin \"frame_door_open.lzsa\"" >> octagon_graphics.inc + echo "frame_bookcase_open_lzsa: .incbin \"frame_bookcase_open.lzsa\"" >> octagon_graphics.inc + echo "blue_book_shelf_lzsa: .incbin \"blue_book_shelf.lzsa\"" >> octagon_graphics.inc + echo "bookshelf_n_lzsa: .incbin \"bookshelf_n.lzsa\"" >> octagon_graphics.inc + echo "map_lzsa: .incbin \"map.lzsa\"" >> octagon_graphics.inc %.gr: %.png $(PNG2GR) $< $@ diff --git a/mist/graphics_octagon/blue_book_shelf.png b/mist/graphics_octagon/blue_book_shelf.png new file mode 100644 index 00000000..5110189c Binary files /dev/null and b/mist/graphics_octagon/blue_book_shelf.png differ diff --git a/mist/graphics_octagon/bookshelf_n.png b/mist/graphics_octagon/bookshelf_n.png new file mode 100644 index 00000000..dac273f6 Binary files /dev/null and b/mist/graphics_octagon/bookshelf_n.png differ diff --git a/mist/graphics_octagon/frame_bookcase_open.png b/mist/graphics_octagon/frame_bookcase_open.png new file mode 100644 index 00000000..118f1d16 Binary files /dev/null and b/mist/graphics_octagon/frame_bookcase_open.png differ diff --git a/mist/graphics_octagon/frame_door_open.png b/mist/graphics_octagon/frame_door_open.png new file mode 100644 index 00000000..ee0a673e Binary files /dev/null and b/mist/graphics_octagon/frame_door_open.png differ diff --git a/mist/graphics_octagon/map.png b/mist/graphics_octagon/map.png new file mode 100644 index 00000000..66ec1d31 Binary files /dev/null and b/mist/graphics_octagon/map.png differ diff --git a/mist/graphics_octagon/temple_center_n.png b/mist/graphics_octagon/temple_center_n.png index dc39b902..49fec4c7 100644 Binary files a/mist/graphics_octagon/temple_center_n.png and b/mist/graphics_octagon/temple_center_n.png differ diff --git a/mist/leveldata_octagon.inc b/mist/leveldata_octagon.inc index 3d511803..5518d8f5 100644 --- a/mist/leveldata_octagon.inc +++ b/mist/leveldata_octagon.inc @@ -5,7 +5,8 @@ locations: .word location0, location1, location2, location3 - .word location4, location5 + .word location4, location5, location6, location7 + .word location8, location9, location10 ; OCTAGON_TEMPLE_DOORWAY -- temple doorway location0: @@ -14,7 +15,7 @@ location0: .byte $ff ; south exit .byte $ff ; east exit .byte $ff ; west exit - .byte DIRECTION_N ; north exit_dir + .byte DIRECTION_N|DIRECTION_ONLY_POINT ; north exit_dir .byte DIRECTION_S ; south exit_dir .byte $ff ; east exit_dir .byte $ff ; west exit_dir @@ -44,7 +45,10 @@ location1: .word temple_center_e_lzsa ; east bg .word temple_center_w_lzsa ; west bg .byte BG_NORTH|BG_WEST|BG_SOUTH|BG_EAST ; all directions - .byte $ff ; special exit + .byte DIRECTION_ANY ; special exit + .byte 4,35 ; special x + .byte 0,46 ; special y + .word handle_octagon-1 ; special function ; OCTAGON_RED_BOOK_SHELF -- red book shelf location2: @@ -55,7 +59,7 @@ location2: .byte $ff ; north exit_dir .byte $ff ; south exit_dir .byte $ff ; east exit_dir - .byte DIRECTION_W ; west exit_dir + .byte DIRECTION_W|DIRECTION_ONLY_POINT ; west exit_dir .word $0000 ; north bg .word $0000 ; south bg .word $0000 ; east bg @@ -92,7 +96,7 @@ location4: .byte $ff ; north exit_dir .byte $ff ; south exit_dir .byte $ff ; east exit_dir - .byte DIRECTION_W ; west exit_dir + .byte DIRECTION_W|DIRECTION_ONLY_POINT ; west exit_dir .word $0000 ; north bg .word $0000 ; south bg .word $0000 ; east bg @@ -106,7 +110,7 @@ location5: .byte $ff ; south exit .byte $ff ; east exit .byte $ff ; west exit - .byte DIRECTION_N ; north exit_dir + .byte DIRECTION_N|DIRECTION_ONLY_POINT ; north exit_dir .byte $ff ; south exit_dir .byte $ff ; east exit_dir .byte $ff ; west exit_dir @@ -116,3 +120,91 @@ location5: .word $0000 ; west bg .byte BG_NORTH .byte $ff + +; OCTAGON_MAP -- looking at map +location6: + .byte $ff ; north exit + .byte $ff ; south exit + .byte $ff ; east exit + .byte OCTAGON_TEMPLE_CENTER ; west exit + .byte $ff ; north exit_dir + .byte $ff ; south exit_dir + .byte $ff ; east exit_dir + .byte DIRECTION_W|DIRECTION_ONLY_POINT ; west exit_dir + .word $0000 ; north bg + .word $0000 ; south bg + .word $0000 ; east bg + .word map_lzsa ; west bg + .byte BG_WEST + .byte $ff + +; OCTAGON_FRAME_SHELF -- picture that moves the bookcase +location7: + .byte OCTAGON_TEMPLE_CENTER ; north exit + .byte $ff ; south exit + .byte $ff ; east exit + .byte $ff ; west exit + .byte DIRECTION_N|DIRECTION_ONLY_POINT ; north exit_dir + .byte $ff ; south exit_dir + .byte $ff ; east exit_dir + .byte $ff ; west exit_dir + .word frame_bookcase_open_lzsa ; north bg + .word $0000 ; south bg + .word $0000 ; east bg + .word $0000 ; west bg + .byte BG_NORTH + .byte $ff + + +; OCTAGON_BOOKSHELF -- the bookcase +location8: + .byte OCTAGON_TEMPLE_CENTER ; north exit + .byte $ff ; south exit + .byte $ff ; east exit + .byte $ff ; west exit + .byte DIRECTION_N|DIRECTION_ONLY_POINT ; north exit_dir + .byte $ff ; south exit_dir + .byte $ff ; east exit_dir + .byte $ff ; west exit_dir + .word bookshelf_n_lzsa ; north bg + .word $0000 ; south bg + .word $0000 ; east bg + .word $0000 ; west bg + .byte BG_NORTH + .byte $ff + +; OCTAGON_FRAME_DOOR -- picture that opens the door +location9: + .byte OCTAGON_TEMPLE_CENTER ; north exit + .byte $ff ; south exit + .byte $ff ; east exit + .byte $ff ; west exit + .byte DIRECTION_N|DIRECTION_ONLY_POINT ; north exit_dir + .byte $ff ; south exit_dir + .byte $ff ; east exit_dir + .byte $ff ; west exit_dir + .word frame_door_open_lzsa ; north bg + .word $0000 ; south bg + .word $0000 ; east bg + .word $0000 ; west bg + .byte BG_NORTH + .byte $ff + +; OCTAGON_BLUE_BOOKSHELF -- the blue bookshelf +location10: + .byte $ff ; north exit + .byte $ff ; south exit + .byte OCTAGON_TEMPLE_CENTER ; east exit + .byte $ff ; west exit + .byte $ff ; north exit_dir + .byte $ff ; south exit_dir + .byte DIRECTION_E|DIRECTION_ONLY_POINT ; east exit_dir + .byte $ff ; west exit_dir + .word $0000 ; north bg + .word $0000 ; south bg + .word blue_book_shelf_lzsa ; east bg + .word $0000 ; west bg + .byte BG_EAST + .byte $ff + + diff --git a/mist/octagon.s b/mist/octagon.s index 1659c2ba..fc3f1388 100644 --- a/mist/octagon.s +++ b/mist/octagon.s @@ -114,6 +114,97 @@ leave_octagon: rts +handle_octagon: + + ldx CURSOR_X + + lda DIRECTION + and #$f + + cmp #DIRECTION_W + beq octagon_w + + cmp #DIRECTION_E + beq octagon_e + + cmp #DIRECTION_S + beq octagon_s + +octagon_n: + cpx #10 + bcc goto_shelf_frame + cpx #29 + bcs goto_door_frame + bcc goto_bookshelf + +octagon_e: + cpx #10 + bcc goto_door_frame + cpx #29 + bcs goto_fireplace + bcc goto_blue_book + +octagon_w: + cpx #10 + bcc goto_map + cpx #29 + bcs goto_shelf_frame + bcc goto_red_book + +octagon_s: + cpx #10 + bcc goto_fireplace + cpx #29 + bcs goto_map + bcc goto_door + +goto_map: + ldy #OCTAGON_MAP + lda #DIRECTION_W + jmp done_goto + +goto_red_book: + ldy #OCTAGON_RED_BOOKSHELF + lda #DIRECTION_W + jmp done_goto + +goto_shelf_frame: + ldy #OCTAGON_FRAME_SHELF + lda #DIRECTION_N + jmp done_goto + +goto_bookshelf: + ldy #OCTAGON_BOOKSHELF + lda #DIRECTION_N + jmp done_goto + +goto_door_frame: + ldy #OCTAGON_FRAME_DOOR + lda #DIRECTION_N + jmp done_goto + +goto_blue_book: + ldy #OCTAGON_BLUE_BOOKSHELF + lda #DIRECTION_E + jmp done_goto + +goto_fireplace: + ldy #OCTAGON_FIREPLACE + lda #DIRECTION_E + jmp done_goto + +goto_door: + ldy #OCTAGON_TEMPLE_DOORWAY + lda #DIRECTION_S + jmp done_goto + +done_goto: + sty LOCATION + sta DIRECTION + jmp change_location + + + ;========================== ; includes diff --git a/mist/zp.inc b/mist/zp.inc index 759419bd..41175e05 100644 --- a/mist/zp.inc +++ b/mist/zp.inc @@ -40,6 +40,7 @@ DIRECTION = $66 DIRECTION_S = $1 DIRECTION_E = $2 DIRECTION_W = $3 + DIRECTION_ANY=$4 DIRECTION_ONLY_POINT = $40 ; do not change pointer to grab DIRECTION_SPLIT = $80 ; split text/graphics LOCATION = $67