From 91b7f71f2c6fe8291c175b41f76fa76e746b8249 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Tue, 30 Jun 2020 14:13:33 -0400 Subject: [PATCH] mist: nibel: can get blue page now --- mist/Makefile | 2 +- mist/common_routines.inc | 10 +++--- mist/leveldata_nibel.inc | 7 ++++- mist/loader.s | 2 +- mist/nibel.s | 15 ++++++--- mist/nibel_switches.s | 68 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 92 insertions(+), 12 deletions(-) diff --git a/mist/Makefile b/mist/Makefile index c10b6ad7..a495ea9c 100644 --- a/mist/Makefile +++ b/mist/Makefile @@ -282,7 +282,7 @@ nibel.o: nibel.s zp.inc hardware.inc common_defines.inc \ common_routines.inc \ graphics_nibel/nibel_graphics.inc \ leveldata_nibel.inc \ - nibel_switches.s + handle_pages.s nibel_switches.s ca65 -o nibel.o nibel.s -l nibel.lst #### diff --git a/mist/common_routines.inc b/mist/common_routines.inc index b5fdf062..491d8350 100644 --- a/mist/common_routines.inc +++ b/mist/common_routines.inc @@ -41,11 +41,11 @@ change_location =$1acd move_and_print =$1b65 ; page_sprites.inc -blue_page_sprite =$1d33 -red_page_sprite =$1d7f -white_page_sprite =$1d95 -blue_page_small_sprite =$1dab -red_page_small_sprite =$1db3 +blue_page_sprite =$1c7a +red_page_sprite =$1c90 +white_page_sprite =$1ca6 +blue_page_small_sprite =$1cbc +red_page_small_sprite =$1cc4 ; audio files linking_noise = $9000 diff --git a/mist/leveldata_nibel.inc b/mist/leveldata_nibel.inc index 5662428e..be527876 100644 --- a/mist/leveldata_nibel.inc +++ b/mist/leveldata_nibel.inc @@ -147,7 +147,12 @@ location7: .word blue_house_e_lzsa ; east bg .word blue_house_w_lzsa ; west bg .byte BG_NORTH|BG_SOUTH|BG_EAST|BG_WEST - .byte $ff + .byte DIRECTION_E ; special exit + .byte 5,11 ; special x + .byte 40,46 ; special y + .word nibel_take_blue_page-1 ; special function + + ; NIBEL_BLUE_HOUSE_VIEWER -- blue house viewer machine location8: diff --git a/mist/loader.s b/mist/loader.s index c55ec4fd..d1a457cb 100644 --- a/mist/loader.s +++ b/mist/loader.s @@ -731,8 +731,8 @@ sectbl: .byte $00,$0d,$0b,$09,$07,$05,$03,$01,$0e,$0c,$0a,$08,$06,$04,$02,$0f .include "text_print.s" .include "loadstore.s" - .include "common_sprites.inc" .include "page_sprites.inc" + .include "common_sprites.inc" loader_end: diff --git a/mist/nibel.s b/mist/nibel.s index 061b93a3..d3f86a2c 100644 --- a/mist/nibel.s +++ b/mist/nibel.s @@ -72,11 +72,17 @@ game_loop: ; handle special-case forground logic ;==================================== -; lda LOCATION -; cmp #CHANNEL_BOOK_OPEN + lda LOCATION + cmp #NIBEL_BLUE_ROOM + beq fg_draw_blue_page ; beq animate_mist_book -; jmp nothing_special + jmp nothing_special + +fg_draw_blue_page: + jsr draw_blue_page + jmp nothing_special + nothing_special: @@ -132,4 +138,5 @@ really_exit: ; level data .include "leveldata_nibel.inc" - + ; book pages + .include "handle_pages.s" diff --git a/mist/nibel_switches.s b/mist/nibel_switches.s index 51420873..97ce035b 100644 --- a/mist/nibel_switches.s +++ b/mist/nibel_switches.s @@ -41,4 +41,72 @@ elevator2_close_door: jmp change_location +nibel_take_red_page: + lda #CHANNEL_PAGE + jmp take_red_page +nibel_take_blue_page: + lda #CHANNEL_PAGE + jmp take_blue_page + + +draw_blue_page: + lda DIRECTION + cmp #DIRECTION_E + bne no_draw_page + + lda BLUE_PAGES_TAKEN + and #CHANNEL_PAGE + bne no_draw_page + + lda #6 + sta XPOS + lda #42 + sta YPOS + + lda #blue_page_sprite + sta INH + + jmp put_sprite_crop ; tail call + +no_draw_page: + rts + + + + +; viewer + +; position 1 +; [talking in another language] + +viewer1_text: +.byte "[WORDS IN ANOTHER LANGUAGE]" + +; position 2 +; [scary talking in another language] +viewer2_text: +.byte "[OMINIOUS WORDS IN ANOTHER LANGUAGE]" + +; position 3 +; [ more talking in another language] + +viewer3_text: +.byte "[MORE OMINIOUS WORDS IN ANOTHER LANGUAGE]" + +; position 4 +; Sirrus: I hope I pushed the right button +; my dear brother.what an interesting device you have here +; I'm not erasing anything important am I? haha +; remember he is preparing. take only 1 page my dear +; brother + +viewer4_text: +; 1 2 3 +; 0123456789012345678901234567890123456789 +.byte "I HOPE I PUSHED THE RIGHT BUTTON." +.byte "WHAT AN INTERESTING DEVICE YOU HAVE HERE" +.byte "NOT ERASING ANYTHING IMPORTANT, AM I?" +.byte "TAKE ONLY ONE PAGE MY DEAR BROTHER."