mist: initial selenitic age

This commit is contained in:
Vince Weaver 2020-03-13 13:04:31 -04:00
parent 83c3b3a28d
commit 3c1a521c0a
11 changed files with 476 additions and 6 deletions

View File

@ -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

View File

@ -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

View File

@ -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"

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,34 @@
#include ../Makefile.inc
PNG2RLE = ../../gr-utils/png2rle
PNG2GR = ../../gr-utils/png2gr
LZSA = ~/research/lzsa/lzsa/lzsa
all: selena_graphics.inc
####
selena_graphics.inc: \
controls_e.lzsa \
organ_w.lzsa \
spaceship_inside_w.lzsa \
spaceship_inside_selena_n.lzsa \
walkway1_n.lzsa
echo "controls_e_lzsa: .incbin \"controls_e.lzsa\"" > 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

View File

Before

Width:  |  Height:  |  Size: 762 B

After

Width:  |  Height:  |  Size: 762 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 999 B

View File

@ -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

96
mist/leveldata_selena.inc Normal file
View File

@ -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

139
mist/link_book_selena.s Normal file
View File

@ -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_L
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

183
mist/selena.s Normal file
View File

@ -0,0 +1,183 @@
; Selenitic (selena) island
; by deater (Vince Weaver) <vince@deater.net>
; 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"