From 3c1a521c0a419bb4b87882f806e0666a402e2406 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Fri, 13 Mar 2020 13:04:31 -0400 Subject: [PATCH] mist: initial selenitic age --- mist/Makefile | 20 +- mist/graphics_island/Makefile | 3 +- mist/graphics_island/mist_graphics.inc | 1 + mist/graphics_island/tree4_e.png | Bin 0 -> 1048 bytes mist/graphics_selena/Makefile | 34 ++++ ...na_n.png => spaceship_inside_selena_n.png} | Bin mist/graphics_selena/spaceship_inside_w.png | Bin 0 -> 999 bytes mist/leveldata_island.inc | 6 +- mist/leveldata_selena.inc | 96 +++++++++ mist/link_book_selena.s | 139 +++++++++++++ mist/selena.s | 183 ++++++++++++++++++ 11 files changed, 476 insertions(+), 6 deletions(-) create mode 100644 mist/graphics_island/tree4_e.png create mode 100644 mist/graphics_selena/Makefile rename mist/graphics_selena/{ship_selena_n.png => spaceship_inside_selena_n.png} (100%) create mode 100644 mist/graphics_selena/spaceship_inside_w.png create mode 100644 mist/leveldata_selena.inc create mode 100644 mist/link_book_selena.s create mode 100644 mist/selena.s diff --git a/mist/Makefile b/mist/Makefile index e8abe502..a1fff951 100644 --- a/mist/Makefile +++ b/mist/Makefile @@ -8,13 +8,14 @@ B2D = ../bmp2dhr/b2d all: mist.dsk -mist.dsk: HELLO LOADER MIST_TITLE MIST MECHE +mist.dsk: HELLO LOADER MIST_TITLE MIST MECHE SELENA cp empty.dsk mist.dsk $(DOS33) -y mist.dsk SAVE A HELLO $(DOS33) -y mist.dsk BSAVE -a 0x1000 LOADER $(DOS33) -y mist.dsk BSAVE -a 0x4000 MIST_TITLE $(DOS33) -y mist.dsk BSAVE -a 0x1400 MIST $(DOS33) -y mist.dsk BSAVE -a 0x1400 MECHE + $(DOS33) -y mist.dsk BSAVE -a 0x1400 SELENA ### @@ -75,6 +76,21 @@ meche.o: meche.s zp.inc hardware.inc \ gr_copy.s audio.s text_print.s decompress_fast_v2.s ca65 -o meche.o meche.s -l meche.lst +#### + +SELENA: selena.o + ld65 -o SELENA selena.o -C ../linker_scripts/apple2_1400.inc + +selena.o: selena.s zp.inc hardware.inc \ + graphics_selena/selena_graphics.inc \ + common_sprites.inc \ + leveldata_selena.inc \ + link_book_selena.s \ + keyboard.s \ + draw_pointer.s \ + gr_copy.s audio.s text_print.s decompress_fast_v2.s + ca65 -o selena.o selena.s -l selena.lst + #### @@ -85,4 +101,4 @@ graphics_island/mist_graphics.inc: #### clean: - rm -f *~ *.o *.lst HELLO LOADER MIST_TITLE MIST MECHE + rm -f *~ *.o *.lst HELLO LOADER MIST_TITLE MIST MECHE SELENA diff --git a/mist/graphics_island/Makefile b/mist/graphics_island/Makefile index f73c871e..5d28b6c6 100644 --- a/mist/graphics_island/Makefile +++ b/mist/graphics_island/Makefile @@ -35,7 +35,7 @@ mist_graphics.inc: \ gear_base_n.lzsa \ dentist_door_n.lzsa dentist_door_s.lzsa \ spaceship_switch_n.lzsa \ - tree4_n.lzsa tree4_s.lzsa tree4_w.lzsa \ + tree4_n.lzsa tree4_s.lzsa tree4_w.lzsa tree4_e.lzsa \ tree_cabin_e.lzsa \ clock_island_s.lzsa clock_island_n.lzsa \ clock_puzzle_s.lzsa clock_puzzle_bridge.lzsa \ @@ -105,6 +105,7 @@ mist_graphics.inc: \ echo "tree4_n_lzsa: .incbin \"tree4_n.lzsa\"" >> mist_graphics.inc echo "tree4_s_lzsa: .incbin \"tree4_s.lzsa\"" >> mist_graphics.inc echo "tree4_w_lzsa: .incbin \"tree4_w.lzsa\"" >> mist_graphics.inc + echo "tree4_e_lzsa: .incbin \"tree4_e.lzsa\"" >> mist_graphics.inc echo "tree_cabin_e_lzsa: .incbin \"tree_cabin_e.lzsa\"" >> mist_graphics.inc echo "clock_island_s_lzsa: .incbin \"clock_island_s.lzsa\"" >> mist_graphics.inc echo "clock_island_n_lzsa: .incbin \"clock_island_n.lzsa\"" >> mist_graphics.inc diff --git a/mist/graphics_island/mist_graphics.inc b/mist/graphics_island/mist_graphics.inc index 7b00aa7d..444181fc 100644 --- a/mist/graphics_island/mist_graphics.inc +++ b/mist/graphics_island/mist_graphics.inc @@ -54,6 +54,7 @@ spaceship_switch_n_lzsa: .incbin "spaceship_switch_n.lzsa" tree4_n_lzsa: .incbin "tree4_n.lzsa" tree4_s_lzsa: .incbin "tree4_s.lzsa" tree4_w_lzsa: .incbin "tree4_w.lzsa" +tree4_e_lzsa: .incbin "tree4_e.lzsa" tree_cabin_e_lzsa: .incbin "tree_cabin_e.lzsa" clock_island_s_lzsa: .incbin "clock_island_s.lzsa" clock_island_n_lzsa: .incbin "clock_island_n.lzsa" diff --git a/mist/graphics_island/tree4_e.png b/mist/graphics_island/tree4_e.png new file mode 100644 index 0000000000000000000000000000000000000000..31a7814eab31cb1d2fb590e2950f54cc642393df GIT binary patch literal 1048 zcmV+z1n2vSP)EX>4Tx04R}tkv&MmP!xrasZx;^2Rn#3WT;LS#ELj-D-@wZs1;guFnQ@8G-*gu zTpR`0f`dPcRR)J(gBGdxvqHp#<}FOz%wIeHj^Zd5R0WQR=Sv#O^tY(II3zoH~2kUs~Dg1l0pff@5OOG#(>~1&}ul&_p#%&PJqBOaHV(rwI(q8NqVEB zMUQ~NZQ$a%qbYm9swCDE&6T5PO*JwuI0000pP)t-s0002v9$;Wjz5hi00Ha`>oSYQT z{m{ezU~&WhYCN5to&TWF6!kpN-Hmep(EtDc0001;kA{E%000SaNLh0L02Fip02N>X zmRIYN00007bV*G`2jl|{0st>up12MG000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2H zM@dakSAh-}0005QNkllteevEh@h4)fLZHXU>4B;WbvSVR6y4D2~2=Z?(8lDAY3!&2> zy79ny+t#&KsnMfWw%7UxGVEz8#e*P7odenW3!*5>)bPC=E5uJh{Jt(iRM=2c;kK>FE87PZ7g0c=1Pzpi5B99PPNnb!2A_r=OG6XX7 z0@`TNSJ#DP6vj{=i69?RTwZTM#OhOSK2{NAVyqRCb+|X6j$r=v(=>Gg?L5+k1d>vsY4X~#w0fVwx2KtGak4FoW5vJvRVPrx5#cVvnG Sjtjv60000 selena_graphics.inc + echo "organ_w_lzsa: .incbin \"organ_w.lzsa\"" >> selena_graphics.inc + echo "spaceship_inside_w_lzsa: .incbin \"spaceship_inside_w.lzsa\"" >> selena_graphics.inc + echo "spaceship_inside_selena_n_lzsa: .incbin \"spaceship_inside_selena_n.lzsa\"" >> selena_graphics.inc + echo "walkway1_n_lzsa: .incbin \"walkway1_n.lzsa\"" >> selena_graphics.inc + + +%.gr: %.png + $(PNG2GR) $< $@ + +%.lzsa: %.gr + $(LZSA) -r -f2 $< $@ + +#### + +clean: + rm -f *~ *.o *.lst *.gr selena_graphics.inc diff --git a/mist/graphics_selena/ship_selena_n.png b/mist/graphics_selena/spaceship_inside_selena_n.png similarity index 100% rename from mist/graphics_selena/ship_selena_n.png rename to mist/graphics_selena/spaceship_inside_selena_n.png diff --git a/mist/graphics_selena/spaceship_inside_w.png b/mist/graphics_selena/spaceship_inside_w.png new file mode 100644 index 0000000000000000000000000000000000000000..73a9ef03dcd1e55e25824dfc54dd57433dbe9405 GIT binary patch literal 999 zcmVEX>4Tx04R}tkv&MmP!xrasZx;^2Rn#3WT;LS#ELj-D-@wZs1;guFnQ@8G-*gu zTpR`0f`dPcRR)J(gBGdxvqHp#<}FOz%wIeHj^Zd5R0WQR=Sv#O^tY(II3zoH~2kUs~Dg1l0pff@5OOG#(>~1&}ul&_p#%&PJqBOaHV(rwI(q8NqVEB zMUQ~NZQ$a%qbYm9swCDE&6T5PO*JwuI0000pP)t-s0002v9$;Wjz5hi00Ha`>oSYQT z{m{ezU~&WhYCN5to&TWF6!kpN-Hmep(EtDc0001;kA{E%000SaNLh0L02Fip02N>X zmRIYN00007bV*G`2jl|{1U4?F2xVUY000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2H zM@dakSAh-}0004!NklFqa0)7S~)7EamkHd_Dq#!zWSim}wBJ^FVCJRLbPMghfVjqJ~#Rn*^`B;072q zkCG|q^$nj)g6u#mvnN4Oqm6W z>m1&<1T|HK%R~-g@zG(1)bOsO4<^8oWs%%o^2FTerVx1hpkxYPn zoPOg^#0HI55esaGz*EHn`O6N>a2DCY!~5YGY|REq?$;QC5!cta2aQ+a8E{XI;2S&4 VEWL`KZAt(D002ovPDHLkV1n{Q#0&rc literal 0 HcmV?d00001 diff --git a/mist/leveldata_island.inc b/mist/leveldata_island.inc index 885f5f17..32bfa10e 100644 --- a/mist/leveldata_island.inc +++ b/mist/leveldata_island.inc @@ -473,9 +473,9 @@ location23: .byte DIRECTION_W ; west exit_dir .word tree4_n_lzsa ; north bg .word tree4_s_lzsa ; south bg - .word $0000 ; east bg + .word tree4_e_lzsa ; east bg .word tree4_w_lzsa ; west bg - .byte BG_NORTH|BG_SOUTH|BG_WEST + .byte BG_NORTH|BG_SOUTH|BG_WEST|BG_EAST .byte $ff ; special exit ; tree cabin @@ -631,7 +631,7 @@ location32: .byte 33 ; west exit .byte $ff ; north exit_dir .byte $ff ; south exit_dir - .byte DIRECTION_N ; east exit_dir + .byte DIRECTION_E ; east exit_dir .byte DIRECTION_N ; west exit_dir .word $0000 ; north bg .word $0000 ; south bg diff --git a/mist/leveldata_selena.inc b/mist/leveldata_selena.inc new file mode 100644 index 00000000..de07750a --- /dev/null +++ b/mist/leveldata_selena.inc @@ -0,0 +1,96 @@ + +;=============================================== +; level data for Selena level +;=============================================== +; 24 bytes each location +; we put special at end as it's ignored if not set + +LOCATION_NORTH_EXIT=0 ; new room when heading north +LOCATION_SOUTH_EXIT=1 ; new room when heading south +LOCATION_EAST_EXIT=2 ; new room when heading east +LOCATION_WEST_EXIT=3 ; new room when heading west +LOCATION_NORTH_EXIT_DIR=4 ; direction faced in new room when N +LOCATION_SOUTH_EXIT_DIR=5 ; direction faced in new room when S +LOCATION_EAST_EXIT_DIR=6 ; direction faced in new room when E +LOCATION_WEST_EXIT_DIR=7 ; direction faced in new room when W +LOCATION_NORTH_BG=8 ; pointer to north background image +LOCATION_SOUTH_BG=10 ; pointer to south background image +LOCATION_EAST_BG=12 ; pointer to east background image +LOCATION_WEST_BG=14 ; pointer to west background image +LOCATION_BGS = 16 ; bitmap saying which backgrounds valid + BG_NORTH = 1 + BG_SOUTH = 2 + BG_EAST = 4 + BG_WEST = 8 +LOCATION_SPECIAL_EXIT=17 ; if we have something clickable + ; $FF if not, direction if so +LOCATION_SPECIAL_X1=18 ; collision box for the thing to click +LOCATION_SPECIAL_X2=19 +LOCATION_SPECIAL_Y1=20 +LOCATION_SPECIAL_Y2=21 +LOCATION_SPECIAL_FUNC=22 ; pointer-1 of function to call on click + + + +locations: + .word location0, location1, location2 + + +; Inside Ship +location0: + .byte $ff ; north exit + .byte $ff ; south exit + .byte 1 ; east exit + .byte 2 ; west exit + .byte $ff ; north exit_dir + .byte $ff ; south exit_dir + .byte DIRECTION_E ; east exit_dir + .byte DIRECTION_W ; west exit_dir + .word $0000 ; north bg + .word $0000 ; south bg + .word $0000 ; east bg + .word spaceship_inside_w_lzsa ; west bg + .byte BG_WEST + .byte $ff ; special exit + + +; controls +location1: + .byte $ff ; north exit + .byte $ff ; south exit + .byte 0 ; 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 controls_e_lzsa ; east bg + .word $0000 ; west bg + .byte BG_EAST + .byte $ff ; special exit + +; electric organ +location2: + .byte $ff ; north exit + .byte $ff ; south exit + .byte $ff ; east exit + .byte 0 ; west exit + .byte $ff ; north exit_dir + .byte $ff ; south exit_dir + .byte $ff ; east exit_dir + .byte DIRECTION_W ; west exit_dir + .word $0000 ; north bg + .word $0000 ; south bg + .word $0000 ; east bg + .word organ_w_lzsa ; west bg + .byte BG_WEST + .byte $ff +;DIRECTION_E ; special exit +; .byte 21,31 ; special x +; .byte 10,24 ; special y +; .word meche_link_book-1 ; special function + + + diff --git a/mist/link_book_selena.s b/mist/link_book_selena.s new file mode 100644 index 00000000..821a1835 --- /dev/null +++ b/mist/link_book_selena.s @@ -0,0 +1,139 @@ + ;============================= + ; meche_link_book + ;============================= +meche_link_book: + + ; clear screen + lda #0 + sta clear_all_color+1 + + jsr clear_all + jsr page_flip + + ; play sound effect? + + lda #audio_link_noise + sta BTC_H + ldx #43 ; 45 pages long??? + jsr play_audio + + lda #3 + sta LOCATION + lda #DIRECTION_W + sta DIRECTION + + jsr change_location + rts + + +meche_movie: + .word meche_sprite0,meche_sprite1,meche_sprite2 + .word meche_sprite3,meche_sprite4,meche_sprite5 + .word meche_sprite6,meche_sprite7,meche_sprite8 + .word meche_sprite9,meche_sprite10 + +meche_sprite0: + .byte 9,6 + .byte $77,$77,$77,$77,$77,$77,$55,$77,$77 + .byte $77,$77,$77,$77,$77,$47,$49,$49,$47 + .byte $57,$77,$77,$77,$77,$ff,$55,$88,$88 + .byte $05,$67,$00,$60,$60,$00,$67,$86,$60 + .byte $00,$00,$06,$06,$68,$66,$66,$68,$66 + .byte $00,$00,$00,$00,$00,$06,$66,$66,$66 + +meche_sprite1: + .byte 9,6 + .byte $77,$77,$77,$47,$45,$45,$45,$74,$77 + .byte $77,$77,$74,$ff,$8f,$ff,$ff,$77,$77 + .byte $07,$07,$07,$ff,$08,$0f,$0f,$07,$07 + .byte $77,$77,$00,$67,$67,$60,$66,$66,$66 + .byte $66,$66,$86,$66,$66,$88,$66,$66,$66 + .byte $88,$66,$68,$66,$66,$66,$66,$66,$66 + +meche_sprite2: + .byte 9,6 + .byte $77,$47,$45,$45,$47,$47,$77,$77,$77 + .byte $74,$ff,$8f,$5f,$55,$77,$77,$77,$77 + .byte $70,$0f,$08,$f5,$08,$77,$77,$67,$67 + .byte $77,$77,$00,$67,$67,$66,$66,$66,$66 + .byte $77,$66,$66,$66,$66,$88,$66,$66,$66 + .byte $66,$66,$66,$66,$66,$88,$66,$66,$66 + +meche_sprite3: + .byte 9,6 + .byte $55,$55,$55,$57,$77,$77,$77,$77,$77 + .byte $f5,$ff,$5f,$5f,$77,$77,$77,$77,$77 + .byte $88,$0f,$05,$f5,$77,$77,$77,$57,$57 + .byte $08,$70,$00,$57,$57,$55,$55,$65,$65 + .byte $57,$55,$55,$65,$65,$88,$66,$66,$66 + .byte $65,$66,$66,$66,$88,$88,$00,$66,$66 + +meche_sprite4: + .byte 9,6 + .byte $00,$70,$77,$77,$77,$77,$77,$77,$77 + .byte $00,$77,$77,$77,$77,$77,$77,$77,$dd + .byte $00,$77,$77,$77,$77,$77,$77,$55,$dd + .byte $57,$57,$57,$57,$57,$76,$57,$66,$6d + .byte $66,$60,$66,$60,$66,$66,$88,$55,$55 + .byte $66,$66,$66,$66,$66,$66,$88,$66,$66 + +meche_sprite5: + .byte 9,6 + .byte $77,$77,$77,$77,$77,$77,$77,$77,$77 + .byte $77,$77,$77,$77,$77,$d7,$dd,$dd,$77 + .byte $77,$77,$77,$55,$57,$dd,$dd,$dd,$d7 + .byte $77,$67,$67,$55,$67,$dd,$dd,$dd,$dd + .byte $66,$66,$66,$65,$66,$6d,$6d,$6d,$66 + .byte $56,$56,$56,$56,$56,$56,$66,$66,$66 + +meche_sprite6: + .byte 9,6 + .byte $77,$77,$77,$77,$77,$77,$77,$77,$77 + .byte $77,$77,$77,$77,$d7,$77,$77,$77,$77 + .byte $77,$77,$77,$77,$dd,$dd,$77,$77,$77 + .byte $77,$77,$88,$dd,$dd,$dd,$67,$66,$66 + .byte $77,$67,$88,$dd,$dd,$dd,$66,$66,$66 + .byte $56,$65,$88,$dd,$dd,$dd,$66,$66,$66 + +meche_sprite7: + .byte 9,6 + .byte $77,$77,$77,$77,$77,$87,$87,$88,$78 + .byte $77,$77,$77,$77,$88,$d8,$77,$77,$77 + .byte $77,$77,$77,$77,$88,$dd,$77,$88,$87 + .byte $77,$77,$77,$67,$88,$dd,$dd,$88,$88 + .byte $67,$67,$66,$66,$88,$dd,$dd,$dd,$dd + .byte $66,$62,$22,$22,$88,$dd,$dd,$dd,$dd + +meche_sprite8: + .byte 9,6 + .byte $77,$77,$77,$77,$77,$77,$77,$77,$87 + .byte $77,$77,$77,$77,$77,$88,$77,$88,$77 + .byte $77,$77,$77,$77,$87,$88,$87,$88,$87 + .byte $77,$77,$77,$77,$88,$88,$88,$88,$88 + .byte $67,$67,$26,$26,$88,$88,$88,$88,$88 + .byte $62,$62,$62,$62,$68,$88,$88,$88,$88 + +meche_sprite9: + .byte 9,6 + .byte $77,$77,$77,$77,$77,$77,$88,$88,$88 + .byte $77,$77,$77,$77,$77,$88,$88,$88,$88 + .byte $77,$77,$77,$77,$87,$88,$88,$88,$88 + .byte $77,$77,$77,$87,$88,$88,$88,$88,$88 + .byte $26,$26,$26,$88,$88,$88,$88,$88,$88 + .byte $62,$62,$62,$88,$88,$88,$88,$88,$88 + +meche_sprite10: + .byte 9,6 + .byte $77,$77,$77,$77,$77,$77,$77,$47,$77 + .byte $77,$77,$77,$77,$77,$74,$f4,$f4,$88 + .byte $77,$77,$77,$77,$57,$57,$ff,$ff,$88 + .byte $77,$77,$55,$55,$77,$77,$77,$87,$88 + .byte $62,$62,$62,$62,$62,$62,$62,$88,$88 + .byte $66,$66,$66,$66,$66,$66,$66,$88,$88 + + + + + diff --git a/mist/selena.s b/mist/selena.s new file mode 100644 index 00000000..199cad9e --- /dev/null +++ b/mist/selena.s @@ -0,0 +1,183 @@ +; Selenitic (selena) island + +; by deater (Vince Weaver) + +; Zero Page + .include "zp.inc" + .include "hardware.inc" + + +selena_start: + ;=================== + ; init screen + jsr TEXT + jsr HOME + bit KEYRESET + + bit SET_GR + bit PAGE0 + bit LORES + bit FULLGR + + lda #0 + sta DRAW_PAGE + + ; init cursor + + lda #20 + sta CURSOR_X + sta CURSOR_Y + + ;================= + ; init vars + ; FIXME: we could be re-called from other books + ; so don't set location here + + lda #0 + sta LOCATION + lda #DIRECTION_E + sta DIRECTION + + + lda LOCATION + bne not_first_time + +not_first_time: + + + ; set up initial location + + jsr change_location + + lda #1 + sta CURSOR_VISIBLE ; visible at first + + lda #0 + sta ANIMATE_FRAME + + +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 #2 +; bne nothing_special + + ; handle animated linking book + +; lda ANIMATE_FRAME +; asl +; tay +; lda meche_movie,Y +; sta INL +; lda meche_movie+1,Y +; sta INH + +; lda #22 +; sta XPOS +; lda #12 +; sta YPOS + +; jsr put_sprite_crop + +; lda FRAMEL +; and #$f +; bne done_animate_book + +; inc ANIMATE_FRAME +; lda ANIMATE_FRAME +; cmp #11 +; bne done_animate_book +; lda #0 +; sta ANIMATE_FRAME + +;done_animate_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: + + jmp game_loop + + + ;========================== + ; 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 "audio.s" + + .include "graphics_selena/selena_graphics.inc" + + + ; puzzles + + ; linking books + + .include "link_book_selena.s" + + .include "common_sprites.inc" + + .include "leveldata_selena.inc" + + + + + +;.align $100 +audio_link_noise: +.incbin "audio/link_noise.btc" + +