From 6bc8eec4d45aa494830e08f95e5276054f8ddb53 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Tue, 21 Apr 2020 17:12:08 -0400 Subject: [PATCH] mist: stoneship: can take red page --- mist/Makefile | 3 +++ mist/handle_pages.s | 47 +++++++++++++++++++++++++++++++++++++++ mist/leveldata_stoney.inc | 5 ++++- mist/meche_rotation.s | 19 +++++++++------- mist/stoney.s | 12 ++++++++++ 5 files changed, 77 insertions(+), 9 deletions(-) create mode 100644 mist/handle_pages.s diff --git a/mist/Makefile b/mist/Makefile index 6930aff5..0fe671cc 100644 --- a/mist/Makefile +++ b/mist/Makefile @@ -115,6 +115,7 @@ meche.o: meche.s zp.inc hardware.inc common_defines.inc \ link_book_meche.s \ link_book_mist.s \ meche_rotation.s \ + handle_pages.s \ keyboard.s \ draw_pointer.s \ gr_copy.s audio.s text_print.s decompress_fast_v2.s @@ -168,6 +169,8 @@ stoney.o: stoney.s zp.inc hardware.inc common_defines.inc \ keyboard.s \ draw_pointer.s \ link_book_stoney.s \ + link_book_mist.s \ + handle_pages.s \ gr_copy.s audio.s text_print.s decompress_fast_v2.s ca65 -o stoney.o stoney.s -l stoney.lst diff --git a/mist/handle_pages.s b/mist/handle_pages.s new file mode 100644 index 00000000..eb7db8fa --- /dev/null +++ b/mist/handle_pages.s @@ -0,0 +1,47 @@ +; FIXME +; handle dropping pages +; handle white page + + + ;============================== + ; Take Blue Page + ;============================== + ; A should be page to take (i.e. MECHE_PAGE or similar) + +take_blue_page: + jsr drop_current_page + + eor BLUE_PAGES_TAKEN ; toggle the taken flag + sta BLUE_PAGES_TAKEN + + lda #HOLDING_BLUE_PAGE ; put it in hand + sta HOLDING_PAGE + rts + +take_red_page: + + jsr drop_current_page + + eor RED_PAGES_TAKEN + sta RED_PAGES_TAKEN + + lda #HOLDING_RED_PAGE + sta HOLDING_PAGE + rts + +take_white_page: + + jsr drop_current_page + +; lda #1 +; sta WHITE_PAGE_TAKEN + + lda #HOLDING_WHITE_PAGE + sta HOLDING_PAGE + rts + +drop_current_page: + ; FIXME + + rts + diff --git a/mist/leveldata_stoney.inc b/mist/leveldata_stoney.inc index fff8e47f..ef039351 100644 --- a/mist/leveldata_stoney.inc +++ b/mist/leveldata_stoney.inc @@ -709,7 +709,10 @@ location39: .word $0000 ; east bg .word dresser_open_e_lzsa ; west bg .byte BG_WEST - .byte $ff + .byte DIRECTION_W + .byte 14,21 ; special x + .byte 36,46 ; special y + .word stoney_take_red_page-1 ; special function ; STONEY_CRAWLWAY_LEFT -- left crawlway location40: diff --git a/mist/meche_rotation.s b/mist/meche_rotation.s index 4371f273..1f20a9b0 100644 --- a/mist/meche_rotation.s +++ b/mist/meche_rotation.s @@ -28,14 +28,6 @@ dropped_blue_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 @@ -61,6 +53,17 @@ dropped_red_page: rts + + + +enter_blue_secret: + + lda #MECHE_BLUE_SECRET_DOOR + sta LOCATION + jsr change_location + + rts + enter_red_secret: lda #MECHE_RED_SECRET_DOOR diff --git a/mist/stoney.s b/mist/stoney.s index 79a7d5e9..f5c6d29d 100644 --- a/mist/stoney.s +++ b/mist/stoney.s @@ -204,6 +204,16 @@ back_to_mist: rts + +stoney_take_red_page: + lda #STONEY_PAGE + jmp take_red_page + +stoney_take_blue_page: + lda #STONEY_PAGE + jmp take_blue_page + + ;============================= draw_red_page: @@ -274,6 +284,8 @@ no_draw_page: ; puzzles + .include "handle_pages.s" + .include "common_sprites.inc" .include "page_sprites.inc"