riven: hookup telescope data

This commit is contained in:
Vince Weaver 2024-07-01 12:02:52 -04:00
parent 34e63cf92e
commit 4dfc18a674
6 changed files with 235 additions and 7 deletions

View File

@ -3,7 +3,7 @@ include ../../../Makefile.inc
LINKER_SCRIPTS = ../../../linker_scripts/
all: DISK01 LEVEL_ARRIVAL
all: DISK01 LEVEL_ARRIVAL LEVEL_TELESCOPE
####
@ -27,19 +27,36 @@ level_arrival.o: level_arrival.s \
####
LEVEL_TELESCOPE: level_telescope.o
ld65 -o LEVEL_TELESCOPE level_telescope.o -C $(LINKER_SCRIPTS)/apple2_4000.inc
level_telescope.o: level_telescope.s \
../zp.inc ../hardware.inc ../qload.inc \
../common_defines.inc disk01_defines.inc \
leveldata_telescope.inc \
graphics_telescope/telescope_graphics.inc
ca65 -o level_telescope.o level_telescope.s -l level_telescope.lst
####
graphics_arrival/arrival_graphics.inc:
cd graphics_arrival && make
graphics_telescope/telescope_graphics.inc:
cd graphics_telescope && make
####
clean:
rm -f *~ *.o *.lst \
LEVEL_ARRIVAL
LEVEL_ARRIVAL LEVEL_TELESCOPE
####
distclean:
rm -f *~ *.o *.lst \
LEVEL_ARRIVAL
LEVEL_ARRIVAL LEVEL_TELESCOPE
cd graphics_arrival && make clean
cd graphics_telescope && make clean

View File

@ -4,18 +4,18 @@ which_disk:
.byte $01 ; BCD
load_address_array:
.byte $40,$40,$40,$40 ; TITLE, ARRIVAL
.byte $40,$40,$40,$40 ; TITLE, ARRIVAL, ARRIVAL2, TELESCOPE
.byte $00,$00,$00,$00
track_array:
.byte 1, 2, 2,17 ; TITLE, ARRIVAL
.byte 1, 2, 2,17 ; TITLE, ARRIVAL, ARRIVAL2, TELESCOPE
.byte 0,0,0,0
sector_array:
.byte 9, 0, 0, 0 ; TITLE, ARRIVAL
.byte 9, 0, 0, 0 ; TITLE, ARRIVAL, ARRIVAL2, TELESCOPE
.byte 0,0,0,0
length_array:
.byte 8, 128,123, 64 ; TITLE, ARRIVAL
.byte 8, 128,123, 64 ; TITLE, ARRIVAL, ARRIVAL2, TELESCOPE
.byte 0,0,0,0

View File

@ -1,5 +1,7 @@
LOAD_TITLE = 0
LOAD_ARRIVAL = 1
LOAD_ARRIVAL2 = 2
LOAD_TELESCOPE = 3
;================================
; Level definitions
@ -9,3 +11,9 @@ LOAD_ARRIVAL = 1
RIVEN_ARRIVAL = 0
RIVEN_ARRIVAL_NEAR = 1
RIVEN_ARRIVAL_HANDLE = 2
; Telescope
RIVEN_TELESCOPE = 0
RIVEN_MANHOLE = 1

View File

@ -0,0 +1,29 @@
include ../../../../Makefile.inc
ZX02 = ~/research/6502_compression/zx02.git/build/zx02
PNG_TO_HGR = ../../../../utils/hgr-utils/png2hgr
all: telescope_graphics.inc
telescope_graphics.inc: \
telescope_n.hgr.zx02 telescope_s.hgr.zx02 telescope_e.hgr.zx02 telescope_w.hgr.zx02 \
manhole_w.hgr.zx02
echo "telescope_n_zx02: .incbin \"telescope_n.hgr.zx02\"" > telescope_graphics.inc
echo "telescope_s_zx02: .incbin \"telescope_s.hgr.zx02\"" >> telescope_graphics.inc
echo "telescope_e_zx02: .incbin \"telescope_e.hgr.zx02\"" >> telescope_graphics.inc
echo "telescope_w_zx02: .incbin \"telescope_w.hgr.zx02\"" >> telescope_graphics.inc
echo "manhole_w_zx02: .incbin \"manhole_w.hgr.zx02\"" >> telescope_graphics.inc
####
%.hgr: %.png
$(PNG_TO_HGR) $< > $@
%.hgr.zx02: %.hgr
$(ZX02) -f $< $@
####
clean:
rm -f *~ *.o *.lst *.zx02 *.hgr telescope_graphics.inc

View File

@ -0,0 +1,129 @@
; Riven -- Dome Island -- Telescope Area
; by deater (Vince Weaver) <vince@deater.net>
; Zero Page
.include "../zp.inc"
.include "../hardware.inc"
.include "../common_defines.inc"
.include "../qload.inc"
.include "disk01_defines.inc"
riven_telescope:
;===================
; init screen
;===================
; jsr TEXT
; jsr HOME
bit KEYRESET
bit SET_GR
bit PAGE1
bit HIRES
bit FULLGR
;========================
; set up location
;========================
lda #<locations
sta LOCATIONS_L
lda #>locations
sta LOCATIONS_H
lda #0
sta DRAW_PAGE
sta LEVEL_OVER
lda #0
sta JOYSTICK_ENABLED
sta UPDATE_POINTER
lda #1
sta CURSOR_VISIBLE
lda #20
sta CURSOR_X
sta CURSOR_Y
;===================================
; init
;===================================
; done in title
; lda #$20
; sta HGR_PAGE
; jsr hgr_make_tables
jsr change_location
jsr save_bg_14x14 ; save old bg
game_loop:
;===================================
; draw pointer
;===================================
jsr draw_pointer
;===================================
; handle keypress/joystick
;===================================
jsr handle_keypress
;===================================
; increment frame count
;===================================
inc FRAMEL
bne frame_no_oflo
inc FRAMEH
frame_no_oflo:
;====================================
; check level over
;====================================
lda LEVEL_OVER
bne really_exit
jmp game_loop
really_exit:
rts
;==================================
; big handle clicked
;==================================
handle_clicked:
; bit SPEAKER
lda #DIRECTION_N
sta DIRECTION
lda #RIVEN_ARRIVAL_HANDLE
sta LOCATION
jsr change_location
rts
;==========================
; includes
;==========================
.include "graphics_telescope/telescope_graphics.inc"
.include "leveldata_telescope.inc"

View File

@ -0,0 +1,45 @@
;===============================================
; level data for Arrival Telescope Area
;===============================================
locations:
.word location0,location1
; RIVEN_TELESCOPE -- near telescope
location0:
.byte $ff ; north exit
.byte $ff ; south exit
.byte $FF ; east exit
.byte RIVEN_MANHOLE ; west exit
.byte DIRECTION_N ; north exit_dir
.byte DIRECTION_S ; south exit_dir
.byte $ff ; east exit_dir
.byte DIRECTION_W ; west exit_dir
.word telescope_n_zx02 ; north bg
.word telescope_s_zx02 ; south bg
.word telescope_e_zx02 ; east bg
.word telescope_w_zx02 ; west bg
.byte BG_NORTH|BG_SOUTH|BG_EAST|BG_WEST
.byte $ff ; special exit
; RIVEN_MANHOLE -- looking at the manhole
location1:
.byte $ff ; north exit
.byte $ff ; south exit
.byte $ff ; east exit
.byte RIVEN_TELESCOPE ; 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 manhole_w_zx02 ; west bg
.byte BG_WEST ; backgrounds
.byte $ff ; unimplemented for now
; .byte DIRECTION_E ; special exit
; .byte 12,16 ; special x
; .byte 100,161 ; special y
; .word handle_clicked-1