From ac3c8c0378ce4810aff9ea2f4d29c1a57d7b76f0 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Mon, 24 Aug 2020 16:28:06 -0400 Subject: [PATCH] mist: arbor: elevator1 is properly down if you come up via steps --- mist/README | 44 ++++++++---- mist/arbor.s | 11 +-- mist/arbor_switches.s | 84 +++++++++++++++++++++++ mist/common_defines.inc | 1 + mist/graphics_arbor/Makefile | 3 + mist/graphics_arbor/arrival_down_e.png | Bin 0 -> 1120 bytes mist/graphics_arbor/arrival_noelev_e.png | Bin 0 -> 1251 bytes mist/leveldata_arbor.inc | 19 ++++- 8 files changed, 143 insertions(+), 19 deletions(-) create mode 100644 mist/graphics_arbor/arrival_down_e.png create mode 100644 mist/graphics_arbor/arrival_noelev_e.png diff --git a/mist/README b/mist/README index 11aba575..97c75570 100644 --- a/mist/README +++ b/mist/README @@ -28,30 +28,46 @@ Sizes: ====== 496 +New disk1: + TRACK SECTOR + 0 0 BOOT + 0 2,4 STAGE2/QBOOT_CORE + 0 1,3,5,7,9 = SAVE0,1,2,3,4 + 1 0..14 LOADER + 2..7 * MIST_TITLE + 8..17 * MIST + 18..26 * OCTAGON + 27,28 * VIEWER + 29,30 * DENTIST + 31,32 * D'NI + 33,34 * SHIP + + disk1: SECTORS TRACKS + BOOT/SAVE 1 1T0S HELLO 566 -> 768 -> 3 - LOADER 4013 -> 4096 -> 16 1 - MIST_TITLE 21008 -> 21248 -> 83 6 - MIST 40653 -> 40704 -> 159 10 - OCTAGON 32610 -> 32768 -> 128 8 - VIEWER 4834 -> 4864 -> 19 2 - DENTIST 7879 -> 7936 -> 31 2 - D'NI 6863 -> 6912 -> 27 2 + LOADER 4013 -> 4096 -> 16 1 1T0S + MIST_TITLE 21008 -> 21248 -> 83 6 5T3S + MIST 40653 -> 40704 -> 159 10 9T13S + OCTAGON 32610 -> 32768 -> 128 8 8T0S + VIEWER 4834 -> 4864 -> 19 2 1T3S + DENTIST 7879 -> 7936 -> 31 2 2T0S + D'NI 6863 -> 6912 -> 27 2 1T11S SAVE0 88 -> 256 -> 1 1 - SHIP 5047 -> 5120 -> 20 2 - ======== ==== - 484+10 = 494 = 126k 34 + SHIP 5047 -> 5120 -> 20 2 1T4S + ======== ==== ===== + 484+10 = 494 = 126k 34 30T8S disk2: CHANNEL 34418 -> 34560 -> 135 9 ARBOR 31591 -> 31744 -> 124 8 - NIBEL 15467 -> 15616 -> 61 4 + NIBEL 27688 -> 28904 -> 109 6 CABIN 15398 -> 15616 -> 61 4 - GENERATOR 8434 -> 8448 -> 33 3 + GENERATOR 8434 -> 8448 -> 33 3 2T1S ======== === - 414+5= 419 = 104k 28 + 414+5= 419 = 104k 30 disk3: - MECHE 30465 -> 30720 -> 120 8 + MECHE 32004 -> 32256 -> 126 8 SELENA 36912 -> 37120 -> 145 10 STONEY 40195 -> 40448 -> 158 10 SUB 13786 -> 13824 -> 54 4 diff --git a/mist/arbor.s b/mist/arbor.s index 9a78dbdb..3acf10d7 100644 --- a/mist/arbor.s +++ b/mist/arbor.s @@ -76,11 +76,14 @@ game_loop: ; handle special-case forground logic ;==================================== -; lda LOCATION -; cmp #CHANNEL_BOOK_OPEN -; beq animate_mist_book + lda LOCATION + cmp #ARBOR_BRIDGE1 + bne not_bridge1 -; jmp nothing_special + jsr draw_bridge1_bg + +not_bridge1: + jmp nothing_special nothing_special: diff --git a/mist/arbor_switches.s b/mist/arbor_switches.s index 4cea0131..8d6a97df 100644 --- a/mist/arbor_switches.s +++ b/mist/arbor_switches.s @@ -211,6 +211,54 @@ update_stair_gate: jmp change_location +;=============================================== +; draw bridge1 bg +;=============================================== +; if the elevator is down, erase it +; doing it this way is abour 40 bytes +; doing it with dedicated bg image would be about 400 bytes +draw_bridge1_bg: + + ; only if bridge down + lda CHANNEL_SWITCHES + and #CHANNEL_ELEVATOR1_UP + bne done_bridge1_bg + + ; only if facing east + + lda DIRECTION + and #$f + cmp #DIRECTION_E + bne done_bridge1_bg + + lda #18 + sta XPOS + lda #10 + sta YPOS + + lda #elev_down_patch_sprite + sta INH + + jsr put_sprite_crop +done_bridge1_bg: + rts + +elev_down_patch_sprite: + .byte 4,6 + .byte $55,$00,$00,$55 + .byte $55,$00,$00,$55 + .byte $55,$00,$00,$55 + .byte $55,$00,$00,$55 + .byte $55,$00,$00,$55 + .byte $58,$08,$08,$58 + + + + + + ;=============================================== ;=============================================== ; update all backgrounds based on switch states @@ -218,6 +266,42 @@ update_stair_gate: ;=============================================== update_arbor_state: + ; update on elevator1 + lda CHANNEL_SWITCHES + and #CHANNEL_ELEVATOR1_UP + beq make_elevator1_down +make_elevator1_up: + + ; change elevator view + ldy #LOCATION_EAST_BG + lda #arrival_e_lzsa + sta location2+1,Y ; ARBOR_ARRIVAL_CLOSED + + ; connect elevator exit + ldy #LOCATION_EAST_EXIT + lda #ARBOR_ARRIVAL_OPEN + sta location2,Y ; ARBOR_ARRIVAL_CLOSED + + jmp make_elevator1_done +make_elevator1_down: + + ; change elevator view + ldy #LOCATION_EAST_BG + lda #arrival_noelev_e_lzsa + sta location2+1,Y ; ARBOR_ARRIVAL_CLOSED + + ; disconnect elevator exit + ldy #LOCATION_EAST_EXIT + lda #ARBOR_ARRIVAL_NOELEV + sta location2,Y ; ARBOR_ARRIVAL_CLOSED + +make_elevator1_done: + + ; update based on switches lda CHANNEL_SWITCHES and #CHANNEL_SW_GATE_TOP diff --git a/mist/common_defines.inc b/mist/common_defines.inc index 79756db6..86b3062f 100644 --- a/mist/common_defines.inc +++ b/mist/common_defines.inc @@ -448,6 +448,7 @@ ARBOR_STEPS_TOP = 27 ARBOR_STEPS2 = 28 ARBOR_STEPS1 = 29 ARBOR_STEPS_BOTTOM = 30 +ARBOR_ARRIVAL_NOELEV = 31 ; NIBEL, up in the clouds NIBEL_IN_ELEV2_TOP_CLOSED= 0 diff --git a/mist/graphics_arbor/Makefile b/mist/graphics_arbor/Makefile index 9aac0ce0..feea1388 100644 --- a/mist/graphics_arbor/Makefile +++ b/mist/graphics_arbor/Makefile @@ -10,6 +10,7 @@ all: arbor_graphics.inc arbor_graphics.inc: \ arrival_e.lzsa arrival_w.lzsa arrival_open_e.lzsa \ + arrival_down_e.lzsa arrival_noelev_e.lzsa \ inside_elevator1_closed_w.lzsa inside_elevator1_open_w.lzsa \ bridge1_e.lzsa bridge1_w.lzsa \ hut1_e.lzsa hut1_w.lzsa \ @@ -40,6 +41,8 @@ arbor_graphics.inc: \ echo "arrival_e_lzsa: .incbin \"arrival_e.lzsa\"" > arbor_graphics.inc echo "arrival_open_e_lzsa: .incbin \"arrival_open_e.lzsa\"" >> arbor_graphics.inc echo "arrival_w_lzsa: .incbin \"arrival_w.lzsa\"" >> arbor_graphics.inc + echo "arrival_down_e_lzsa: .incbin \"arrival_down_e.lzsa\"" >> arbor_graphics.inc + echo "arrival_noelev_e_lzsa: .incbin \"arrival_noelev_e.lzsa\"" >> arbor_graphics.inc echo "inside_elevator1_open_w_lzsa: .incbin \"inside_elevator1_open_w.lzsa\"" >> arbor_graphics.inc echo "inside_elevator1_closed_w_lzsa: .incbin \"inside_elevator1_closed_w.lzsa\"" >> arbor_graphics.inc echo "bridge1_e_lzsa: .incbin \"bridge1_e.lzsa\"" >> arbor_graphics.inc diff --git a/mist/graphics_arbor/arrival_down_e.png b/mist/graphics_arbor/arrival_down_e.png new file mode 100644 index 0000000000000000000000000000000000000000..c5a5315e8d7376187db0ac82cd3763903e694719 GIT binary patch literal 1120 zcmV-m1fTnfP)EX>4Tx04R}tkv&MmKpe$iQ>8^J9qb_DkfAzRkotk6R-p(LLaorMgUO{|(4-+r zad8w}3l4rPRvlcNb#-tR1i=pwCr2km7b)?7X`w}o2gm(*ckglc4iFj@rdd7XfTr7K zI++l&xm7XniXa9N#uVZ*vy3@OO2Kn{-NVP%yBN>%KKJM7SMwGFd?N8IGfbO!gLrz= zHaPDSM_5T#iO-40Ou8WPBiEG{zi}?QEbz>TnMuzRM~KB@7b{)NN~T6UNgP!*o$`fj zi&f5BoV7}gweQJa7|QD_%Uq{9j3gGZ1PLM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}3Xz-=qe<}S0N&GG;Ur0ybcUE9R2 z)l%jH#PWU%WJs7w7hoy1qGIq6(q;&e6cAl44F zhb(T&L;G(aB{5A5xUSd-4agZLkeNu}_se?efyXe4j_oD{`edNXg7eD+$msNd+XjH< z5G@QytplKbKnP5y0cb%nARq$zpn#B+#so6&r31Um7^r`a3y`}%nqwhpBS5z+kjeyP z%sW6JJxo=GKo)opOo@xtd*guSitQ=vq=kPq{#hH6UYxi)=FKtv*vY4~tDiGE`6B%;gA_ z^8@5_px3D4mU{ZI9Pfc`&);<&wP`#7)6lfFd5!0AE%b>(wrLYC=N~w>Qk#t1pS=J8 N002ovPDHLkV1ljTFuVW& literal 0 HcmV?d00001 diff --git a/mist/leveldata_arbor.inc b/mist/leveldata_arbor.inc index 260c1411..32e76e8f 100644 --- a/mist/leveldata_arbor.inc +++ b/mist/leveldata_arbor.inc @@ -10,7 +10,8 @@ locations: .word location16,location17,location18,location19 .word location20,location21,location22,location23 .word location24,location25,location26,location27 - .word location28,location29,location30 + .word location28,location29,location30,location31 + ; ARBOR_INSIDE_ELEV1 -- arrival in elevator1 location0: @@ -567,3 +568,19 @@ location30: .word stair_gate-1 ; special function +; ARBOR_ARRIVAL_NOELEV -- looking down where elevator was +location31: + .byte $ff ; north exit + .byte $ff ; south exit + .byte ARBOR_ARRIVAL_CLOSED ; east exit + .byte $ff ; west exit + .byte $ff ; north exit_dir + .byte $ff ; south exit_dir + .byte DIRECTION_E ; east exit_dir + .byte $FF ; west exit_dir + .word $0000 ; north bg + .word $0000 ; south bg + .word arrival_down_e_lzsa ; east bg + .word $ff ; west bg + .byte BG_EAST + .byte $ff