From 282ebdd475b019bb1ec37a211074f07a01930884 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Thu, 26 Mar 2020 14:17:10 -0400 Subject: [PATCH] mist: add initial stoneship access --- mist/Makefile | 19 +++- mist/common_defines.inc | 11 +- mist/graphics_stoney/Makefile | 33 ++++++ mist/graphics_stoney/book_chair_s.png | Bin 0 -> 1060 bytes mist/graphics_stoney/ship_bow_go_n.png | Bin 0 -> 1139 bytes mist/graphics_stoney/ship_bow_s.png | Bin 0 -> 1071 bytes mist/graphics_stoney/ship_entry_n.png | Bin 0 -> 1150 bytes mist/graphics_stoney/ship_entry_s.png | Bin 0 -> 1059 bytes mist/leveldata_mist.inc | 6 +- mist/leveldata_stoney.inc | 49 ++++++++ mist/leveldata_viewer.inc | 1 + mist/loader.s | 6 +- mist/mist.s | 27 +++-- mist/stoney.s | 152 +++++++++++++++++++++++++ 14 files changed, 288 insertions(+), 16 deletions(-) create mode 100644 mist/graphics_stoney/Makefile create mode 100644 mist/graphics_stoney/book_chair_s.png create mode 100644 mist/graphics_stoney/ship_bow_go_n.png create mode 100644 mist/graphics_stoney/ship_bow_s.png create mode 100644 mist/graphics_stoney/ship_entry_n.png create mode 100644 mist/graphics_stoney/ship_entry_s.png create mode 100644 mist/leveldata_stoney.inc create mode 100644 mist/stoney.s diff --git a/mist/Makefile b/mist/Makefile index 08a1ea4f..49b9308c 100644 --- a/mist/Makefile +++ b/mist/Makefile @@ -8,7 +8,7 @@ B2D = ../bmp2dhr/b2d all: mist.dsk -mist.dsk: HELLO LOADER MIST_TITLE MIST OCTAGON MECHE SELENA VIEWER +mist.dsk: HELLO LOADER MIST_TITLE MIST OCTAGON MECHE SELENA VIEWER STONEY cp empty.dsk mist.dsk $(DOS33) -y mist.dsk SAVE A HELLO $(DOS33) -y mist.dsk BSAVE -a 0x1000 LOADER @@ -18,6 +18,7 @@ mist.dsk: HELLO LOADER MIST_TITLE MIST OCTAGON MECHE SELENA VIEWER $(DOS33) -y mist.dsk BSAVE -a 0x1400 MECHE $(DOS33) -y mist.dsk BSAVE -a 0x1400 SELENA $(DOS33) -y mist.dsk BSAVE -a 0x1400 VIEWER + $(DOS33) -y mist.dsk BSAVE -a 0x1400 STONEY $(DOS33) -y mist.dsk BSAVE -a 0x9000 ./audio/link_noise.btc LINK_NOISE.BTC ### @@ -137,6 +138,22 @@ viewer.o: viewer.s zp.inc hardware.inc common_defines.inc \ gr_copy.s audio.s text_print.s decompress_fast_v2.s ca65 -o viewer.o viewer.s -l viewer.lst +#### + +STONEY: stoney.o + ld65 -o STONEY stoney.o -C ../linker_scripts/apple2_1400.inc + +stoney.o: stoney.s zp.inc hardware.inc common_defines.inc \ + graphics_stoney/stoney_graphics.inc \ + common_sprites.inc \ + page_sprites.inc \ + leveldata_stoney.inc \ + keyboard.s \ + draw_pointer.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/common_defines.inc b/mist/common_defines.inc index b8d0eb13..3c1d4164 100644 --- a/mist/common_defines.inc +++ b/mist/common_defines.inc @@ -52,7 +52,7 @@ LOAD_MECHE = $2 LOAD_SELENA = $3 LOAD_OCTAGON = $4 LOAD_VIEWER = $5 -LOAD_STONEDSHIP = $6 +LOAD_STONEY = $6 LOAD_CHANNEL = $7 LOAD_ENDING = $8 @@ -186,3 +186,12 @@ SELENA_BOOK_OPEN = 10 VIEWER_STEPS = 0 VIEWER_POOL = 1 +; Stoney Ship +STONEY_SHIP_STERN = 0 +STONEY_SHIP_BOW = 1 +STONEY_SHIP_DOOR_OPEN = 2 +STONEY_SHIP_CHAIR = 3 +STONEY_SHIP_BOOK_CLOSED = 4 +STONEY_SHIP_BOOK_OPEN = 5 + + diff --git a/mist/graphics_stoney/Makefile b/mist/graphics_stoney/Makefile new file mode 100644 index 00000000..68d57f30 --- /dev/null +++ b/mist/graphics_stoney/Makefile @@ -0,0 +1,33 @@ +#include ../Makefile.inc + +PNG2RLE = ../../gr-utils/png2rle +PNG2GR = ../../gr-utils/png2gr +LZSA = ~/research/lzsa/lzsa/lzsa + +all: stoney_graphics.inc + +#### + +stoney_graphics.inc: \ + ship_entry_n.lzsa ship_entry_s.lzsa \ + ship_bow_s.lzsa ship_bow_go_n.lzsa \ + book_chair_s.lzsa + echo "ship_entry_n_lzsa: .incbin \"ship_entry_n.lzsa\"" > stoney_graphics.inc + echo "ship_entry_s_lzsa: .incbin \"ship_entry_s.lzsa\"" >> stoney_graphics.inc + echo "ship_bow_s_lzsa: .incbin \"ship_bow_s.lzsa\"" >> stoney_graphics.inc + echo "ship_bow_go_n_lzsa: .incbin \"ship_bow_go_n.lzsa\"" >> stoney_graphics.inc + echo "book_chair_s_lzsa: .incbin \"book_chair_s.lzsa\"" >> stoney_graphics.inc + + + + +%.gr: %.png + $(PNG2GR) $< $@ + +%.lzsa: %.gr + $(LZSA) -r -f2 $< $@ + +#### + +clean: + rm -f *~ *.o *.lst *.gr *.lzsa viewer_graphics.inc diff --git a/mist/graphics_stoney/book_chair_s.png b/mist/graphics_stoney/book_chair_s.png new file mode 100644 index 0000000000000000000000000000000000000000..9b893a750a89235a42f532bf929988bbab5f6991 GIT binary patch literal 1060 zcmV+<1l#+GP)EX>4Tx04R}tkv&MmKpe$iQ>7vmK|2(2$WS|35EXIMDionYs1;guFuC*#ni!H4 z7e~Rh;NZt%)xpJCR|i)?5c~jfa&%I3krMxx6k5c1aNLh~_a1le0HIN3n$)S(glehxvqHp#<}FOz%wIeHZw;YAr?y=taLCdn;P*XaZJ^8$`^7T ztDLtuYtq2d^-JVZ$W;L& z$2>NmL3aJ%fAG6ot2i<4C54kf_lx6vi~ylspjmgE?_mpef8$&gLim4Y;dVi9;hqi@OsgSSBMs@GdoSYQT z{m{ezU~&WhYCN5to&TWF6!kpN-Hmep(EtDc0001;kA{E%000SaNLh0L02Fip02N>X zmRIYN00007bV*G`2jl}86BHAlz#3Bk000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2H zM@dakSAh-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WzllY-^S=Oh<}j5 zq(= zlA&_~avS3MiV{4IK4=T{_Zu2{0i+xYplvxh$Ll@~cl;9s8BW2y3RELA#sG5`6tXji zdnW)QFKIb&xQ{0)aG!)yz=SI2FfR%+c;+;>lB*U)N}6FpTFk~WsAaa864gE&fr{Ph z=SmPABF8kt7OS(wsfyg_GA;PVGHcf`5d)aO6-tS~dUx002ovPDHLk FV1lT&^CAEM literal 0 HcmV?d00001 diff --git a/mist/graphics_stoney/ship_bow_s.png b/mist/graphics_stoney/ship_bow_s.png new file mode 100644 index 0000000000000000000000000000000000000000..443fc04ba062399954704010bcecc9254c0aaf02 GIT binary patch literal 1071 zcmV+~1kn45P)EX>4Tx04R}tkv&MmKpe$iQ>7vmK|2(2$WS|35EXIMDionYs1;guFuC*#ni!H4 z7e~Rh;NZt%)xpJCR|i)?5c~jfa&%I3krMxx6k5c1aNLh~_a1le0HIN3n$)S(glehxvqHp#<}FOz%wIeHZw;YAr?y=taLCdn;P*XaZJ^8$`^7T ztDLtuYtq2d^-JVZ$W;L& z$2>NmL3aJ%fAG6ot2i<4C54kf_lx6vi~ylspjmgE?_mpef8$&gLim4Y;dVi9;hqi@OsgSSBMs@GdoSYQT z{m{ezU~&WhYCN5to&TWF6!kpN-Hmep(EtDc0001;kA{E%000SaNLh0L02Fip02N>X zmRIYN00007bV*G`2jl}91sFF4Xu+ZY000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2H zM@dakSAh-}0005nNklG6b)OT%9JJU1vzd4K@v#Y#~8hv1eU_>Kj>@Gf`r9jDRdbyeom%< zn)XxHRhaVxP-jTs_J~~rJ*PpCH-gXSzROoZOxuH0fn0}2VSf+eDLFZ@N1Fl`AaNi+ z0@oj2%YE^ufUB(66i^obBakLWAPtmB;&k@l>EEcvA`s{cFs0uuxTROdS|hMEdTmEA z%|8=>V0sY48Ig#=b_N+GXjs94-OvreT(}&#I4Z;??7BZieb( zidsLk|76h@pdYSV&Gb294-DAna@NWZ3MgcI$q{hx8G~4>i1XFRJ%8#2d%v%cjWz%P002ovPDHLkV1i0w-4Xx* literal 0 HcmV?d00001 diff --git a/mist/graphics_stoney/ship_entry_n.png b/mist/graphics_stoney/ship_entry_n.png new file mode 100644 index 0000000000000000000000000000000000000000..997b5abcbe54540b59a2fd5d51c17f0bda58d6e5 GIT binary patch literal 1150 zcmV-^1cCdBP)EX>4Tx04R}tkv&MmKpe$iQ>7vmK|2(2$WS|35EXIMDionYs1;guFuC*#ni!H4 z7e~Rh;NZt%)xpJCR|i)?5c~jfa&%I3krMxx6k5c1aNLh~_a1le0HIN3n$)S(glehxvqHp#<}FOz%wIeHZw;YAr?y=taLCdn;P*XaZJ^8$`^7T ztDLtuYtq2d^-JVZ$W;L& z$2>NmL3aJ%fAG6ot2i<4C54kf_lx6vi~ylspjmgE?_mpef8$&gLim4Y;dVi9;hqi@OsgSSBMs@GdoSYQT z{m{ezU~&WhYCN5to&TWF6!kpN-Hmep(EtDc0001;kA{E%000SaNLh0L02Fip02N>X zmRIYN00007bV*G`2jl}85Ht#GX((s_000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2H zM@dakSAh-}0006hNklxlL6GOpWK{aKuq(Q- zg>xa;$hl<=9xdiMMvYp(tXJIw+PDEe*Jyz;mY`*K3m9VsG_DWgRf6SN7r_wT%P|1z zGP{_U3p`J^0y-y<-}S&{>4H4Az-bC$nh4hNTfxT~-+&+mE=v=9>@fl|Lu5Kl1K{H^ z0>=0OG)`j!jl@KAkgGWi=Ife+{AQlHmN7bqR{?rI0-~bI5F;EvfZl%#qVWZu?&UtH zo+F3~1H@5hf~-8{0)t+u3VFKYpPg09cc5oTiE) QQ2+n{07*qoM6N<$f*wo!(EtDd literal 0 HcmV?d00001 diff --git a/mist/graphics_stoney/ship_entry_s.png b/mist/graphics_stoney/ship_entry_s.png new file mode 100644 index 0000000000000000000000000000000000000000..dd7283ac70dbd8b12a7c445c6297bd5eb99c4a14 GIT binary patch literal 1059 zcmV+;1l;?HP)EX>4Tx04R}tkv&MmKpe$iQ>7vmK|2(2$WS|35EXIMDionYs1;guFuC*#ni!H4 z7e~Rh;NZt%)xpJCR|i)?5c~jfa&%I3krMxx6k5c1aNLh~_a1le0HIN3n$)S(glehxvqHp#<}FOz%wIeHZw;YAr?y=taLCdn;P*XaZJ^8$`^7T ztDLtuYtq2d^-JVZ$W;L& z$2>NmL3aJ%fAG6ot2i<4C54kf_lx6vi~ylspjmgE?_mpef8$&gLim4Y;dVi9;hqi@OsgSSBMs@GdoSYQT z{m{ezU~&WhYCN5to&TWF6!kpN-Hmep(EtDc0001;kA{E%000SaNLh0L02Fip02N>X zmRIYN00007bV*G`2jl}85;7xu1;gwB000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2H zM@dakSAh-}0005bNklC*2t|Ex6HLbK|Nre4kr4!~y1mIXTf3ft3sxsw z%L2Hr5OSuw7;z-t0tf;B&KW;p4~WPRUIikOfQWhthyVuS_&i{;dE3Y}E8M0+^E5%xHoIj#QAk z!mWWB^G_g!FRwEX`=m>LCqMw-MOBo_H?M<3pywZ5cRc(8Tf@k75k%vjhm#1oVfcZ> z`oM;9R!d6HK;7=XhhOBVp{Xbgd@hOsj!Lpx+_Q9;->&yFXc48;I-QAR-9UIOpE1ACyC+ORNs5%oac%cLkKyP7M|-`Qva zNAK?+{=A^iEq#phjnr+O8L<9P2s5DB3VMJ=N|*W6rB7oHa2BJ)NrZp4SOWTo6Aj-1 d4$eBhkAF^6iHDp3n=}9b002ovPDHLkV1kHu)PVp1 literal 0 HcmV?d00001 diff --git a/mist/leveldata_mist.inc b/mist/leveldata_mist.inc index eeb3d061..9e66b008 100644 --- a/mist/leveldata_mist.inc +++ b/mist/leveldata_mist.inc @@ -31,7 +31,11 @@ location0: .word dock_e_lzsa ; east bg .word dock_w_lzsa ; west bg .byte BG_EAST|BG_NORTH|BG_SOUTH|BG_WEST ; all bgs - .byte $ff ; special exit + .byte DIRECTION_E ; special exit + .byte 9,29 ; special x + .byte 2,46 ; special y + .word enter_stoneyship-1 ; special function + ; MIST_DOCK_SWITCH -- by dock switch location1: diff --git a/mist/leveldata_stoney.inc b/mist/leveldata_stoney.inc new file mode 100644 index 00000000..fccaab0a --- /dev/null +++ b/mist/leveldata_stoney.inc @@ -0,0 +1,49 @@ + +;=============================================== +; level data for Viewer Room +;=============================================== + +locations: + .word location0, location1 + + +; STONEY_SHIP_STERN -- back of the ship +location0: + .byte STONEY_SHIP_BOW ; north exit + .byte STONEY_SHIP_DOOR_OPEN ; south exit + .byte $ff ; east exit + .byte $ff ; west exit + .byte DIRECTION_N ; north exit_dir + .byte DIRECTION_S ; south exit_dir + .byte $ff ; east exit_dir + .byte $ff ; west exit_dir + .word ship_entry_n_lzsa ; north bg + .word ship_entry_s_lzsa ; south bg + .word $0000 ; east bg + .word $0000 ; west bg + .byte BG_NORTH|BG_SOUTH + .byte $ff +; .byte DIRECTION_E ; special exit +; .byte 12,25 ; special x +; .byte 26,46 ; special y +; .word controls_pressed-1 ; special function + +; Ship Bow -- bow of the ship +location1: + .byte $ff ; north exit + .byte STONEY_SHIP_STERN ; 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 ship_bow_go_n_lzsa ; north bg + .word ship_bow_s_lzsa ; south bg + .word $0000 ; east bg + .word $0000 ; west bg + .byte BG_NORTH | BG_SOUTH + .byte DIRECTION_N ; special exit + .byte 9,29 ; special x + .byte 2,46 ; special y + .word back_to_mist-1 ; special function diff --git a/mist/leveldata_viewer.inc b/mist/leveldata_viewer.inc index d29cddc6..ea03b47e 100644 --- a/mist/leveldata_viewer.inc +++ b/mist/leveldata_viewer.inc @@ -41,6 +41,7 @@ location1: .word viewer_e_lzsa ; east bg .word viewer_w_lzsa ; west bg .byte BG_EAST|BG_WEST + .byte $ff ; .byte DIRECTION_E ; special exit ; .byte 12,25 ; special x ; .byte 26,46 ; special y diff --git a/mist/loader.s b/mist/loader.s index 7ade4b58..a6aaadd9 100644 --- a/mist/loader.s +++ b/mist/loader.s @@ -157,7 +157,7 @@ copy_filename_done: filenames: .word intro_filename .word mist_filename,meche_filename,selena_filename,octagon_filename - .word viewer_filename,ending_filename + .word viewer_filename,stoney_filename,channel_filename,ending_filename intro_filename: .byte "MIST_TITLE",0 @@ -171,6 +171,10 @@ octagon_filename: .byte "OCTAGON",0 viewer_filename: .byte "VIEWER",0 +stoney_filename: + .byte "STONEY",0 +channel_filename: + .byte "CHANNEL",0 ending_filename: .byte "ENDING",0 diff --git a/mist/mist.s b/mist/mist.s index a9dfa6c8..d771ee0c 100644 --- a/mist/mist.s +++ b/mist/mist.s @@ -157,12 +157,7 @@ go_to_meche: lda #DIRECTION_E sta DIRECTION - - lda #$ff - sta LEVEL_OVER - - rts - + jmp set_level_over pad_special: lda #MIST_TOWER2_PATH @@ -214,10 +209,7 @@ enter_octagon: lda #LOAD_OCTAGON sta WHICH_LOAD - lda #$ff - sta LEVEL_OVER - - rts + jmp set_level_over enter_viewer: @@ -227,14 +219,25 @@ enter_viewer: lda #LOAD_VIEWER sta WHICH_LOAD + jmp set_level_over + +enter_stoneyship: + lda #STONEY_SHIP_STERN + sta LOCATION + + lda #DIRECTION_N + sta DIRECTION + + lda #LOAD_STONEY + sta WHICH_LOAD + +set_level_over: lda #$ff sta LEVEL_OVER rts - - ;========================== ; includes ;========================== diff --git a/mist/stoney.s b/mist/stoney.s new file mode 100644 index 00000000..baa319c1 --- /dev/null +++ b/mist/stoney.s @@ -0,0 +1,152 @@ +; The Stone Ship level + +; by deater (Vince Weaver) + +; Zero Page + .include "zp.inc" + .include "hardware.inc" + .include "common_defines.inc" + +viewer_start: + ;=================== + ; init screen + jsr TEXT + jsr HOME + bit KEYRESET + + bit SET_GR + bit PAGE0 + bit LORES + bit FULLGR + + lda #0 + sta DRAW_PAGE + sta LEVEL_OVER + + ; init cursor + + lda #20 + sta CURSOR_X + sta CURSOR_Y + + ; set up initial location + + jsr change_location + + lda #1 + sta CURSOR_VISIBLE ; visible at first + + lda #0 + sta ANIMATE_FRAME + + ; FIXME + ; handle gear visibility + +game_loop: + ;================= + ; reset things + ;================= + + lda #0 + sta IN_SPECIAL + sta IN_RIGHT + sta IN_LEFT + + ;==================================== + ; copy background to current page + ;==================================== + + jsr gr_copy_to_current + + ;==================================== + ; handle special-case forground logic + ;==================================== + + lda LOCATION +; cmp #MECHE_OPEN_BOOK + +nothing_special: + + ;==================================== + ; draw pointer + ;==================================== + + jsr draw_pointer + + ;==================================== + ; page flip + ;==================================== + + jsr page_flip + + ;==================================== + ; handle keypress/joystick + ;==================================== + + jsr handle_keypress + + + ;==================================== + ; inc frame count + ;==================================== + + inc FRAMEL + bne room_frame_no_oflo + inc FRAMEH +room_frame_no_oflo: + + ;==================================== + ; check level over + ;==================================== + + lda LEVEL_OVER + bne really_exit + jmp game_loop + +really_exit: + jmp end_level + + + +back_to_mist: + + lda #$ff + sta LEVEL_OVER + + lda #MIST_ARRIVAL_DOCK ; the dock + sta LOCATION + lda #DIRECTION_N + sta DIRECTION + + lda #LOAD_MIST + sta WHICH_LOAD + + rts + + + + ;========================== + ; includes + ;========================== + + .include "gr_copy.s" + .include "gr_offsets.s" + .include "gr_pageflip.s" + .include "gr_putsprite_crop.s" + .include "text_print.s" + .include "gr_fast_clear.s" + .include "decompress_fast_v2.s" + .include "keyboard.s" + .include "draw_pointer.s" + .include "end_level.s" + + .include "graphics_stoney/stoney_graphics.inc" + + + ; puzzles + + .include "common_sprites.inc" + + .include "page_sprites.inc" + + .include "leveldata_stoney.inc"