riven: attempt to hook up rotating room

probably missing some files
This commit is contained in:
Vince Weaver
2024-08-18 22:59:35 -04:00
parent 6e5dc7544a
commit 028066b34c
38 changed files with 1030 additions and 184 deletions

View File

@@ -156,8 +156,9 @@ riven_disk05.dsk: QBOOT QLOAD TITLE_05 \
###
riven_disk10.dsk: QBOOT QLOAD TITLE_10 \
disk10_files/LEVEL_INSIDE \
disk10_files/LEVEL_STAINED
disk10_files/LEVEL_CENTER \
disk10_files/LEVEL_PILLARS \
disk10_files/LEVEL_15
cp $(EMPTY_DISK)/empty.dsk riven_disk10.dsk
$(DOS33_RAW) riven_disk10.dsk 0 0 QBOOT 0 1
$(DOS33_RAW) riven_disk10.dsk 0 2 QBOOT 1 1
@@ -165,9 +166,9 @@ riven_disk10.dsk: QBOOT QLOAD TITLE_10 \
$(DOS33_RAW) riven_disk10.dsk 0 1 disk10_files/DISK10 0 0
$(DOS33_RAW) riven_disk10.dsk 0 8 TITLE_10 0 0
$(DOS33_RAW) riven_disk10.dsk 1 0 QLOAD 0 0
$(DOS33_RAW) riven_disk10.dsk 2 0 disk10_files/LEVEL_INSIDE 0 0
$(DOS33_RAW) riven_disk10.dsk 8 0 disk10_files/LEVEL_STAINED 0 0
$(DOS33_RAW) riven_disk10.dsk 2 0 disk10_files/LEVEL_CENTER 0 0
$(DOS33_RAW) riven_disk10.dsk 8 0 disk10_files/LEVEL_15 0 0
$(DOS33_RAW) riven_disk10.dsk 23 0 disk10_files/LEVEL_PILLARS 0 0
###
@@ -635,10 +636,13 @@ disk05_files/MOVIE_CHAIR:
####
disk10_files/LEVEL_INSIDE:
disk10_files/LEVEL_CENTER:
cd disk10_files && make
disk10_files/LEVEL_STAINED:
disk10_files/LEVEL_PILLARS:
cd disk10_files && make
disk10_files/LEVEL_15:
cd disk10_files && make
####
@@ -865,8 +869,9 @@ riven_hgr.2mg: dts_block PROBOOTHD QLOAD_HD \
disk05_files/LEVEL_CHAIR2 \
disk05_files/MOVIE_CHAIR \
disk10_files/DISK10 \
disk10_files/LEVEL_INSIDE \
disk10_files/LEVEL_STAINED \
disk10_files/LEVEL_CENTER \
disk10_files/LEVEL_PILLARS \
disk10_files/LEVEL_15 \
disk38_files/DISK38 \
disk38_files/LEVEL_PROJECTOR \
disk38_files/LEVEL_ENTRY \
@@ -945,8 +950,9 @@ riven_hgr.2mg: dts_block PROBOOTHD QLOAD_HD \
$(PRODOS_RAW) riven_hgr.2mg `./dts_block 5 8 0` disk05_files/LEVEL_CHAIR2 0 0
$(PRODOS_RAW) riven_hgr.2mg `./dts_block 5 15 0` disk05_files/MOVIE_CHAIR 0 0
$(PRODOS_RAW) riven_hgr.2mg `./dts_block 10 0 2` disk10_files/DISK10 0 0
$(PRODOS_RAW) riven_hgr.2mg `./dts_block 10 2 0` disk10_files/LEVEL_INSIDE 0 0
$(PRODOS_RAW) riven_hgr.2mg `./dts_block 10 8 0` disk10_files/LEVEL_STAINED 0 0
$(PRODOS_RAW) riven_hgr.2mg `./dts_block 10 2 0` disk10_files/LEVEL_CENTER 0 0
$(PRODOS_RAW) riven_hgr.2mg `./dts_block 10 8 0` disk10_files/LEVEL_15 0 0
$(PRODOS_RAW) riven_hgr.2mg `./dts_block 10 23 0` disk10_files/LEVEL_PILLARS 0 0
$(PRODOS_RAW) riven_hgr.2mg `./dts_block 38 0 2` disk38_files/DISK38 0 0
$(PRODOS_RAW) riven_hgr.2mg `./dts_block 38 2 0` disk38_files/LEVEL_PROJECTOR 0 0
$(PRODOS_RAW) riven_hgr.2mg `./dts_block 38 8 0` disk38_files/LEVEL_ENTRY 0 0

View File

@@ -120,8 +120,13 @@ Disk10 Map (disk has 35 tracks, each 4k in size)
T 0 = Qboot
T 0.5 = TITLE 1805 bytes 8S = 0T8S (2048) 400B free
T 1 = QLOAD 2314 bytes 16S= 1T0S (4096) 2k free
T 2 = INSIDE 17137 bytes = 6T0S (24576) 7k free
T 8 = STAINED 15420 bytes = 6T0S (24576) 9k free
T 2 = CENTER 23133 bytes = 6T0S (28672) ?k free
T 8 = LEVEL_15 8289 bytes = 3T0S (12288) ?k free
T 11 = LEVEL_21 18289 bytes = 3T0S (12288) ?k free
T 14 = LEVEL_32 18289 bytes = 3T0S (12288) ?k free
T 17 = LEVEL_43 18289 bytes = 3T0S (12288) ?k free
T 20 = LEVEL_54 18289 bytes = 3T0S (12288) ?k free
T 23 = PILLARS 32000 bytes = 7T15S (32512) ?k free

View File

@@ -66,20 +66,20 @@ disk_exit_load:
.byte LOAD_PATH
.byte LOAD_DSTEPS1
.byte LOAD_BRIDGE1
.byte LOAD_INSIDE
.byte LOAD_15
.byte 0
.byte LOAD_CYAN
disk_exit_level:
.byte RIVEN_STEPS_BASE
.byte RIVEN_DOWN1
.byte RIVEN_BRIDGE1
.byte RIVEN_INSIDE
.byte RIVEN_15
.byte 0
.byte 0
disk_exit_direction:
.byte DIRECTION_W
.byte DIRECTION_N
.byte DIRECTION_E
.byte DIRECTION_W
.byte DIRECTION_N
.byte 0
.byte 0

View File

@@ -3,7 +3,7 @@ include ../../../Makefile.inc
LINKER_SCRIPTS = ../../../linker_scripts/
all: DISK10 LEVEL_INSIDE LEVEL_STAINED
all: DISK10 LEVEL_CENTER LEVEL_PILLARS LEVEL_15
####
@@ -13,51 +13,86 @@ DISK10: disk10.o
disk10.o: disk10.s ../zp.inc
ca65 -o disk10.o disk10.s -l disk10.lst
####
LEVEL_INSIDE: level_inside.o
ld65 -o LEVEL_INSIDE level_inside.o -C $(LINKER_SCRIPTS)/apple2_4000.inc
LEVEL_CENTER: level_center.o
ld65 -o LEVEL_CENTER level_center.o -C $(LINKER_SCRIPTS)/apple2_4000.inc
level_inside.o: level_inside.s \
level_center.o: level_center.s \
../zp.inc ../hardware.inc ../qload.inc \
../common_defines.inc disk10_defines.inc \
leveldata_inside.inc \
graphics_inside/inside_graphics.inc
ca65 -o level_inside.o level_inside.s -l level_inside.lst
leveldata_center.inc \
graphics_center/center_graphics.inc
ca65 -o level_center.o level_center.s -l level_center.lst
####
LEVEL_STAINED: level_stained.o
ld65 -o LEVEL_STAINED level_stained.o -C $(LINKER_SCRIPTS)/apple2_4000.inc
LEVEL_15: level_15.o
ld65 -o LEVEL_15 level_15.o -C $(LINKER_SCRIPTS)/apple2_4000.inc
level_stained.o: level_stained.s \
level_15.o: level_15.s \
../zp.inc ../hardware.inc ../qload.inc \
../common_defines.inc disk10_defines.inc \
leveldata_stained.inc \
graphics_stained/stained_graphics.inc
ca65 -o level_stained.o level_stained.s -l level_stained.lst
leveldata_15.inc \
graphics_15/15_graphics.inc
ca65 -o level_15.o level_15.s -l level_15.lst
####
LEVEL_PILLARS: level_pillars.o
ld65 -o LEVEL_PILLARS level_pillars.o -C $(LINKER_SCRIPTS)/apple2_4000.inc
level_pillars.o: level_pillars.s \
../zp.inc ../hardware.inc ../qload.inc \
../common_defines.inc disk10_defines.inc \
leveldata_pillars.inc \
graphics_pillars/pillars_graphics.inc
ca65 -o level_pillars.o level_pillars.s -l level_pillars.lst
####
graphics_inside/inside_graphics.inc:
cd graphics_inside && make
LEVEL_23: level_23.o
ld65 -o LEVEL_23 level_23.o -C $(LINKER_SCRIPTS)/apple2_4000.inc
graphics_stained/stained_graphics.inc:
cd graphics_stained && make
level_23.o: level_23.s \
../zp.inc ../hardware.inc ../qload.inc \
../common_defines.inc disk10_defines.inc \
leveldata_23.inc \
graphics_23/23_graphics.inc
ca65 -o level_23.o level_23.s -l level_23.lst
####
graphics_center/center_graphics.inc:
cd graphics_center && make
graphics_pillars/pillars_graphics.inc:
cd graphics_pillars && make
graphics_15/15_graphics.inc:
cd graphics_15 && make
graphics_23/23_graphics.inc:
cd graphics_23 && make
####
clean:
rm -f *~ *.o *.lst DISK10 \
LEVEL_INSIDE LEVEL_STAINED
LEVEL_CENTER LEVEL_PILLARS \
LEVEL_15 LEVEL_23
####
distclean:
rm -f *~ *.o *.lst DISK10 \
LEVEL_INSIDE LEVEL_STAINED
cd graphics_inside && make clean
cd graphics_stained && make clean
LEVEL_CENTER LEVEL_PILLARS LEVEL_15 LEVEL_23
cd graphics_center && make clean
cd graphics_pillars && make clean
cd graphics_15 && make clean
cd graphics_23 && make clean

View File

@@ -9,20 +9,20 @@ which_disk_bin:
.byte 10
load_address_array:
.byte $40,$40,$40,$40 ; TITLE, INSIDE, STAINED
.byte $40,$40,$40,$40 ;
.byte $40,$40,$40,$40 ; TITLE, CENTER, LEVEL_15, LEVEL_21
.byte $40,$40,$40,$40 ; LEVEL_32,LEVEL_43,LEVEL_54,PILLARS
track_array:
.byte 0, 2, 8,12 ; TITLE, INSIDE, STAINED
.byte 17,22,27,0 ;
.byte 0, 2, 8,11 ; TITLE, CENTER, LEVEL_15, LEVEL_21
.byte 14,17,20,23 ; LEVEL_32,LEVEL_43,LEVEL_54,PILLARS
sector_array:
.byte 8, 0, 0, 0 ; TITLE, INSIDE, STAINED
.byte 0,0,0,0 ;
.byte 8, 0, 0, 0 ; TITLE, CENTER, LEVEL_15, LEVEL_21
.byte 0,0,0,0 ; LEVEL_32,LEVEL_43,LEVEL_54,PILLARS
length_array:
.byte 8, 96,96,80 ; TITLE, INSIDE, STAINED
.byte 80,80,80,0 ;
.byte 8, 112,48,48 ; TITLE, CENTER, LEVEL_15, LEVEL_21
.byte 48,48,48,112 ; LEVEL_32,LEVEL_43,LEVEL_54,PILLARS
disk_exit_disk: ; note: not BCD anymore

View File

@@ -1,20 +1,40 @@
LOAD_TITLE_10 = 0
LOAD_INSIDE = 1
LOAD_STAINED = 2
LOAD_CENTER = 1
LOAD_15 = 2
LOAD_21 = 3
LOAD_32 = 4
LOAD_43 = 5
LOAD_54 = 6
LOAD_PILLARS = 7
;================================
; Level definitions
; INSIDE
RIVEN_INSIDE = 0
RIVEN_PILLAR_23 = 1
RIVEN_PILLAR_51 = 2
RIVEN_PILLAR_12 = 3
RIVEN_PILLAR_34 = 4
RIVEN_PILLAR_45 = 5
; LOAD_CENTER
RIVEN_CENTER_51 = 0
RIVEN_CENTER_12 = 1
RIVEN_CENTER_23 = 2
RIVEN_CENTER_34 = 3
RIVEN_CENTER_45 = 4
; LOAD_15
RIVEN_15 = 0
; LOAD_21
RIVEN_21 = 0
; LOAD_32
RIVEN_32 = 0
; LOAD 43
RIVEN_43 = 0
; LOAD 54
RIVEN_54 = 0
; LOAD_PILLARS
RIVEN_BEETLE_R = 0
RIVEN_BEETLE_R_OPEN = 1
RIVEN_STAINED = 2
; STAINED
RIVEN_BEETLE_FAR_R = 0
RIVEN_BEETLE_CLOSE = 1
RIVEN_STAINED2 = 2
RIVEN_STAINED3 = 3

View File

@@ -0,0 +1,25 @@
include ../../../../Makefile.inc
ZX02 = ~/research/6502_compression/zx02.git/build/zx02 -f
PNG_TO_HGR = ../../../../utils/hgr-utils/png2hgr
all: 15_graphics.inc
15_graphics.inc: \
pillars_15_in.hgr.zx02 pillars_15_out.hgr.zx02
echo "pillars_15_in_zx02: .incbin \"pillars_15_in.hgr.zx02\"" > 15_graphics.inc
echo "pillars_15_out_zx02: .incbin \"pillars_15_out.hgr.zx02\"" >> 15_graphics.inc
####
%.hgr: %.png
$(PNG_TO_HGR) $< > $@
%.hgr.zx02: %.hgr
$(ZX02) -f $< $@
####
clean:
rm -f *~ *.o *.lst *.zx02 *.hgr 15_graphics.inc

View File

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View File

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

@@ -0,0 +1,31 @@
include ../../../../Makefile.inc
ZX02 = ~/research/6502_compression/zx02.git/build/zx02 -f
PNG_TO_HGR = ../../../../utils/hgr-utils/png2hgr
all: center_graphics.inc
center_graphics.inc: \
center_12.hgr.zx02 center_23.hgr.zx02 \
center_34.hgr.zx02 center_45.hgr.zx02 \
center_51.hgr.zx02
echo "center_12_zx02: .incbin \"center_12.hgr.zx02\"" > center_graphics.inc
echo "center_23_zx02: .incbin \"center_23.hgr.zx02\"" >> center_graphics.inc
echo "center_34_zx02: .incbin \"center_34.hgr.zx02\"" >> center_graphics.inc
echo "center_45_zx02: .incbin \"center_45.hgr.zx02\"" >> center_graphics.inc
echo "center_51_zx02: .incbin \"center_51.hgr.zx02\"" >> center_graphics.inc
####
%.hgr: %.png
$(PNG_TO_HGR) $< > $@
%.hgr.zx02: %.hgr
$(ZX02) -f $< $@
####
clean:
rm -f *~ *.o *.lst *.zx02 *.hgr center_graphics.inc

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@@ -1,29 +0,0 @@
include ../../../../Makefile.inc
ZX02 = ~/research/6502_compression/zx02.git/build/zx02 -f
PNG_TO_HGR = ../../../../utils/hgr-utils/png2hgr
all: inside_graphics.inc
inside_graphics.inc: \
entrance_w.hgr.zx02 entrance_e.hgr.zx02 \
pillars_23.hgr.zx02 pillars_51.hgr.zx02
echo "entrance_w_zx02: .incbin \"entrance_w.hgr.zx02\"" > inside_graphics.inc
echo "entrance_e_zx02: .incbin \"entrance_e.hgr.zx02\"" >> inside_graphics.inc
echo "pillars_23_zx02: .incbin \"pillars_23.hgr.zx02\"" >> inside_graphics.inc
echo "pillars_51_zx02: .incbin \"pillars_51.hgr.zx02\"" >> inside_graphics.inc
####
%.hgr: %.png
$(PNG_TO_HGR) $< > $@
%.hgr.zx02: %.hgr
$(ZX02) -f $< $@
####
clean:
rm -f *~ *.o *.lst *.zx02 *.hgr inside_graphics.inc

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

View File

@@ -1,4 +1,4 @@
; Riven -- Inside Rotate room
; Riven -- Inside Rotate room, area 15
; by deater (Vince Weaver) <vince@deater.net>
@@ -9,7 +9,7 @@
.include "../qload.inc"
.include "disk10_defines.inc"
bridge1_start:
room_15_start:
;===================
; init screen
@@ -103,54 +103,54 @@ really_exit:
rts
;==========================
; handle pillars 2/3
; move to center
;==========================
handle_pillars_23:
move_to_center:
; if 13 or to pillar 2
; if 26 or more, go to pillar 3
; otherwise, go to center path (nothing for now)
; if 17 or less, go to center_23
; if 23 or more, go to center_34
; otherwise, go directly to pillar 3 (TODO?)
lda CURSOR_X
cmp #26
bcs go_pillar3
cmp #18
bcc go_center_23 ; blt
cmp #13
bcc go_pillar2
cmp #23
bcs go_center_34 ; bge
; do nothing
rts
go_pillar3:
lda #LOAD_STAINED
go_center_23:
lda #LOAD_CENTER
sta WHICH_LOAD
lda #RIVEN_BEETLE_FAR_R
lda #RIVEN_CENTER_23
sta LOCATION
lda #DIRECTION_W
bne done_dir ; bra
jmp done_dir
go_pillar2:
lda #LOAD_STAINED
go_center_34:
lda #LOAD_CENTER
sta WHICH_LOAD
lda #RIVEN_BEETLE_FAR_R
lda #RIVEN_CENTER_34
sta LOCATION
lda #DIRECTION_W
done_dir:
lda #DIRECTION_N
sta DIRECTION
lda #1
sta LEVEL_OVER
rts
;==========================
; includes
;==========================
.include "graphics_inside/inside_graphics.inc"
.include "graphics_15/15_graphics.inc"
.include "leveldata_inside.inc"
.include "leveldata_15.inc"

View File

@@ -0,0 +1,337 @@
; Riven -- Inside Rotate room, center
; by deater (Vince Weaver) <vince@deater.net>
; Zero Page
.include "../zp.inc"
.include "../hardware.inc"
.include "../common_defines.inc"
.include "../qload.inc"
.include "disk10_defines.inc"
center_start:
;===================
; 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
;===========================
; go to a particular pillar
;===========================
; weird order to keep branch < 128 bytes
go_pillar_3:
lda #3
bne pillar_common ; bra
go_pillar_4:
lda #4
bne pillar_common ; bra
go_pillar_5:
lda #5
bne pillar_common ; bra
go_pillar_1:
lda #1
bne pillar_common ; bra
go_pillar_2:
lda #2
; bne pillar_common ; bra
pillar_common:
sta WHICH_PILLAR
lda #LOAD_PILLARS
sta WHICH_LOAD
lda #RIVEN_BEETLE_R
sta LOCATION
lda #DIRECTION_S
sta DIRECTION
lda #1
sta LEVEL_OVER
rts
;==========================
; move 51
;==========================
move_51:
; if 5 or less, go to center 45
; if 12 or less, go to pillar 5
; if 28 or more, go to pillar 1
; if 34 or more, go to center 12
; otherwise, go directly to level 15
lda CURSOR_X
cmp #6
bcc go_center_45 ; blt
cmp #13
bcc go_pillar_5 ; blt
cmp #34
bcs go_center_12 ; bge
cmp #28
bcs go_pillar_1 ; bge
; go to level_15
lda #LOAD_15
sta WHICH_LOAD
lda #RIVEN_15
jmp go_edge
;==========================
; move 45
;==========================
move_45:
; if 5 or less, go to center 34
; if 12 or less, go to pillar 4
; if 28 or more, go to pillar 5
; if 34 or more, go to center 51
; otherwise, go directly to level 54
lda CURSOR_X
cmp #6
bcc go_center_34 ; blt
cmp #13
bcc go_pillar_4 ; blt
cmp #34
bcs go_center_51 ; bge
cmp #28
bcs go_pillar_5 ; bge
rts
;==========================
; move 34
;==========================
move_34:
; if 5 or less, go to center 23
; if 12 or less, go to pillar 3
; if 28 or more, go to pillar 4
; if 34 or more, go to center 45
; otherwise, go directly to level 34
lda CURSOR_X
cmp #6
bcc go_center_23 ; blt
cmp #13
bcc go_pillar_3 ; blt
cmp #34
bcs go_center_45 ; bge
cmp #28
bcs go_pillar_4 ; bge
; go to level_34
rts
;==========================
; move 23
;==========================
move_23:
; if 5 or less, go to center 12
; if 12 or less, go to pillar 2
; if 28 or more, go to pillar 3
; if 34 or more, go to center 34
; otherwise, go directly to level 34
lda CURSOR_X
cmp #6
bcc go_center_12 ; blt
cmp #13
bcc go_pillar_2 ; blt
cmp #34
bcs go_center_34 ; bge
cmp #28
bcs go_pillar_3 ; bge
; go to level_23
rts
;==========================
; move 12
;==========================
move_12:
; if 5 or less, go to center 51
; if 12 or less, go to pillar 1
; if 28 or more, go to pillar 2
; if 34 or more, go to center 23
; otherwise, go directly to level 12
lda CURSOR_X
cmp #6
bcc go_center_51 ; blt
cmp #13
bcc go_pillar_1 ; blt
cmp #34
bcs go_center_23 ; bge
cmp #28
bcs go_pillar_2 ; bge
; go to level_23
rts
;======================
; go to edge room
;======================
go_edge:
sta LOCATION
lda #DIRECTION_S
sta DIRECTION
lda #1
sta LEVEL_OVER
rts
;============================
; go to next center location
; move around ring
;============================
go_center_12:
lda #RIVEN_CENTER_12
jmp done_center
go_center_23:
lda #RIVEN_CENTER_23
jmp done_center
go_center_34:
lda #RIVEN_CENTER_34
jmp done_center
go_center_45:
lda #RIVEN_CENTER_45
jmp done_center
go_center_51:
lda #RIVEN_CENTER_51
done_center:
sta LOCATION
lda #LOAD_CENTER
sta WHICH_LOAD
lda #DIRECTION_N
sta DIRECTION
lda #1
sta LEVEL_OVER
rts
;==========================
; includes
;==========================
.include "graphics_center/center_graphics.inc"
.include "leveldata_center.inc"

View File

@@ -0,0 +1,229 @@
; Riven -- Inside Rotate room, Pillars
; by deater (Vince Weaver) <vince@deater.net>
; Zero Page
.include "../zp.inc"
.include "../hardware.inc"
.include "../common_defines.inc"
.include "../qload.inc"
.include "disk10_defines.inc"
pillars_start:
;===================
; 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
;===================================
; set up proper stained glass
ldx WHICH_PILLAR
dex ; 1 indexed -> 0 indexed
lda stained_bg_l,X
sta location2+LOCATION_SOUTH_BG
lda stained_bg_h,X
sta location2+LOCATION_SOUTH_BG+1
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
;==========================
; move to center
;==========================
move_to_center:
; if 9 or less, left
; if 31 or more, right
; otherwise look at beetle
lda CURSOR_X
cmp #10
bcc go_left ; blt
cmp #31
bcs go_right ; bge
; look at beetle
lda #LOAD_PILLARS
sta WHICH_LOAD
lda #RIVEN_BEETLE_R_OPEN
sta LOCATION
lda #DIRECTION_S
sta DIRECTION
lda #1
sta LEVEL_OVER
rts
rts
go_left:
ldx WHICH_PILLAR ; 1-indexed
dex
lda left_lookup,X
jmp go_common
go_right:
ldx WHICH_PILLAR ; 1-indexed
dex
lda right_lookup,X
go_common:
sta LOCATION
lda #LOAD_CENTER
sta WHICH_LOAD
lda #DIRECTION_N
sta DIRECTION
lda #1
sta LEVEL_OVER
rts
;==========================
; view_stained
;==========================
; if clicked, view stained glass
view_stained:
lda #LOAD_PILLARS
sta WHICH_LOAD
lda #RIVEN_STAINED
sta LOCATION
lda #DIRECTION_S
sta DIRECTION
lda #1
sta LEVEL_OVER
rts
;==========================
; stained glass tables
stained_bg_l:
.byte <stained01_zx02
.byte <stained02_zx02
.byte <stained03_zx02
.byte <stained04_zx02
.byte <stained05_zx02
stained_bg_h:
.byte >stained01_zx02
.byte >stained02_zx02
.byte >stained03_zx02
.byte >stained04_zx02
.byte >stained05_zx02
left_lookup:
.byte RIVEN_CENTER_51 ; 1
.byte RIVEN_CENTER_12 ; 2
.byte RIVEN_CENTER_23 ; 3
.byte RIVEN_CENTER_34 ; 4
.byte RIVEN_CENTER_45 ; 5
right_lookup:
.byte RIVEN_CENTER_12 ; 1
.byte RIVEN_CENTER_23 ; 2
.byte RIVEN_CENTER_34 ; 3
.byte RIVEN_CENTER_45 ; 4
.byte RIVEN_CENTER_51 ; 5
;==========================
; includes
;==========================
.include "graphics_pillars/pillars_graphics.inc"
.include "leveldata_pillars.inc"

View File

@@ -0,0 +1,77 @@
;===============================================
; level data -- rotate room, between pillars 1+5
;===============================================
locations:
.word location0
; RIVEN_15 -- inside from bridge
location0:
.byte $ff ; north exit
.byte $E0 ; south exit
.byte $FF ; east exit
.byte $FF ; west exit
.byte $FF ; north exit_dir
.byte DIRECTION_E ; south exit_dir
.byte $FF ; east exit_dir
.byte $FF ; west exit_dir
.word pillars_15_in_zx02 ; north bg
.word pillars_15_out_zx02 ; south bg
.word $0000 ; east bg
.word $0000 ; west bg
.byte BG_NORTH|BG_SOUTH
.byte DIRECTION_N|DIRECTION_ONLY_POINT ; special exit
.byte 7,33
.byte 0,180
.word move_to_center-1
.if 0
; RIVEN_BEETLE_1
location1:
.byte $ff ; north exit
.byte $ff ; south exit
.byte $ff ; east exit
.byte $FF ; west exit
.byte $FF ; north exit_dir
.byte RIVEN_BEETLE_1_OPEN ; south exit_dir
.byte $FF ; east exit_dir
.byte $ff ; west exit_dir
.word $0000 ; north bg
.word beetle_1_r_zx02 ; south bg
.word $0000 ; east bg
.word $0000 ; west bg
.byte $FF
; .byte BG_SOUTH
; .byte DIRECTION_W|DIRECTION_ONLY_POINT ; special exit
; .byte 7,33
; .byte 0,180
; .word handle_pillars_23-1
; RIVEN_BEETLE_1_OPEN
location2:
.byte $ff ; north exit
.byte $ff ; south exit
.byte $ff ; east exit
.byte $FF ; west exit
.byte $FF ; north exit_dir
.byte RIVEN_STAINED1 ; south exit_dir
.byte $FF ; east exit_dir
.byte $ff ; west exit_dir
.word $0000 ; north bg
.word stained01_zx02 ; south bg
.word $0000 ; east bg
.word $0000 ; west bg
.byte $FF
; .byte BG_SOUTH
; .byte DIRECTION_W|DIRECTION_ONLY_POINT ; special exit
; .byte 7,33
; .byte 0,180
; .word handle_pillars_23-1
.endif

View File

@@ -29,7 +29,7 @@ location1:
.byte $ff ; north exit
.byte $ff ; south exit
.byte $FF ; east exit
.byte RIVEN_STAINED2 ; west exit
.byte RIVEN_STAINED3 ; west exit
.byte $FF ; north exit_dir
.byte $FF ; south exit_dir
.byte $FF ; east exit_dir

View File

@@ -0,0 +1,111 @@
;===============================================
; level data -- rotate room, center
;===============================================
locations:
.word location0,location1,location2,location3,location4
; RIVEN_CENTER_51 -- inside from bridge
location0:
.byte $ff ; north exit
.byte $FF ; south exit
.byte $FF ; east exit
.byte $FF ; west exit
.byte $FF ; north exit_dir
.byte $FF ; south exit_dir
.byte $FF ; east exit_dir
.byte $FF ; west exit_dir
.word center_51_zx02 ; north bg
.word $0000 ; south bg
.word $0000 ; east bg
.word $0000 ; west bg
.byte BG_NORTH
.byte DIRECTION_N|DIRECTION_ONLY_POINT ; special exit
.byte 1,39
.byte 0,180
.word move_51-1
; RIVEN_CENTER_12 --
location1:
.byte $ff ; north exit
.byte $FF ; south exit
.byte $FF ; east exit
.byte $FF ; west exit
.byte $FF ; north exit_dir
.byte $FF ; south exit_dir
.byte $FF ; east exit_dir
.byte $FF ; west exit_dir
.word center_12_zx02 ; north bg
.word $0000 ; south bg
.word $0000 ; east bg
.word $0000 ; west bg
.byte BG_NORTH
.byte DIRECTION_N|DIRECTION_ONLY_POINT ; special exit
.byte 1,39
.byte 0,180
.word move_12-1
; RIVEN_CENTER_23 --
location2:
.byte $ff ; north exit
.byte $FF ; south exit
.byte $FF ; east exit
.byte $FF ; west exit
.byte $FF ; north exit_dir
.byte $FF ; south exit_dir
.byte $FF ; east exit_dir
.byte $FF ; west exit_dir
.word center_23_zx02 ; north bg
.word $0000 ; south bg
.word $0000 ; east bg
.word $0000 ; west bg
.byte BG_NORTH
.byte DIRECTION_N|DIRECTION_ONLY_POINT ; special exit
.byte 1,39
.byte 0,180
.word move_23-1
; RIVEN_CENTER_34 -- inside from bridge
location3:
.byte $ff ; north exit
.byte $FF ; south exit
.byte $FF ; east exit
.byte $FF ; west exit
.byte $FF ; north exit_dir
.byte $FF ; south exit_dir
.byte $FF ; east exit_dir
.byte $FF ; west exit_dir
.word center_34_zx02 ; north bg
.word $0000 ; south bg
.word $0000 ; east bg
.word $0000 ; west bg
.byte BG_NORTH
.byte DIRECTION_N|DIRECTION_ONLY_POINT ; special exit
.byte 1,39
.byte 0,180
.word move_34-1
; RIVEN_CENTER_45 --
location4:
.byte $ff ; north exit
.byte $FF ; south exit
.byte $FF ; east exit
.byte $FF ; west exit
.byte $FF ; north exit_dir
.byte $FF ; south exit_dir
.byte $FF ; east exit_dir
.byte $FF ; west exit_dir
.word center_45_zx02 ; north bg
.word $0000 ; south bg
.word $0000 ; east bg
.word $0000 ; west bg
.byte BG_NORTH
.byte DIRECTION_N|DIRECTION_ONLY_POINT ; special exit
.byte 1,39
.byte 0,180
.word move_45-1

View File

@@ -1,68 +0,0 @@
;===============================================
; level data for inside the room
;===============================================
locations:
.word location0,location1,location2
; RIVEN_INSIDE -- part way across the bridge
location0:
.byte $ff ; north exit
.byte $ff ; south exit
.byte $E0 ; east exit
.byte RIVEN_PILLAR_23 ; 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 entrance_e_zx02 ; east bg
.word entrance_w_zx02 ; west bg
.byte BG_EAST|BG_WEST
.byte $ff ; special exit
; RIVEN_PILLAR23
location1:
.byte $ff ; north exit
.byte $ff ; south exit
.byte RIVEN_INSIDE ; east exit
.byte $FF ; 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 pillars_51_zx02 ; east bg
.word pillars_23_zx02 ; west bg
.byte BG_WEST|BG_EAST
.byte DIRECTION_W|DIRECTION_ONLY_POINT ; special exit
.byte 7,33
.byte 0,180
.word handle_pillars_23-1
; RIVEN_PILLAR51
location2:
.byte $ff ; north exit
.byte $ff ; south exit
.byte $ff ; east exit
.byte RIVEN_INSIDE ; 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 pillars_51_zx02 ; west bg
.byte BG_WEST
.byte $ff ; special exit

View File

@@ -0,0 +1,67 @@
;===============================================
; level data -- pillars
;===============================================
locations:
.word location0,location1,location2
; RIVEN_BEETLE_R
location0:
.byte $ff ; north exit
.byte $ff ; south exit
.byte $ff ; east exit
.byte $FF ; west exit
.byte $FF ; north exit_dir
.byte $ff ; south exit_dir
.byte $FF ; east exit_dir
.byte $ff ; west exit_dir
.word $0000 ; north bg
.word beetle_r_zx02 ; south bg
.word $0000 ; east bg
.word $0000 ; west bg
.byte BG_SOUTH
.byte DIRECTION_S|DIRECTION_ONLY_POINT ; special exit
.byte 0,39
.byte 0,180
.word move_to_center-1
; RIVEN_BEETLE_R_OPEN
location1:
.byte $ff ; north exit
.byte RIVEN_BEETLE_R ; 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 $0000 ; north bg
.word beetle_open_r_zx02 ; south bg
.word $0000 ; east bg
.word $0000 ; west bg
.byte BG_SOUTH
.byte DIRECTION_S
.byte 9,32
.byte 50,110
.word view_stained-1
; RIVEN_STAINED
location2:
.byte $ff ; north exit
.byte RIVEN_BEETLE_R_OPEN ; 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 $0000 ; north bg
.word stained01_zx02 ; south bg
.word $0000 ; east bg
.word $0000 ; west bg
.byte BG_SOUTH
.byte $FF

View File

@@ -476,13 +476,13 @@ game_continue:
.endif
.if DISK=10
lda #LOAD_INSIDE
lda #LOAD_15
sta WHICH_LOAD
lda #RIVEN_INSIDE
lda #RIVEN_15
sta LOCATION
lda #DIRECTION_W
lda #DIRECTION_N
sta DIRECTION
.endif

View File

@@ -154,7 +154,7 @@ STATE_EVENTS = $B3
ROOM_ROTATION = $B4
WHICH_PILLAR = $B5
COUNT = $F7
TEMPY = $F8