riven: add disk16 (bridge to dome)

This commit is contained in:
Vince Weaver
2024-08-24 16:24:52 -04:00
parent f19fff59d2
commit 0970277a61
14 changed files with 467 additions and 4 deletions

View File

@@ -14,6 +14,7 @@ all: riven_disk00.dsk \
riven_disk01.dsk riven_disk02.dsk riven_disk03.dsk \
riven_disk04.dsk riven_disk05.dsk \
riven_disk10.dsk \
riven_disk16.dsk \
riven_disk38.dsk riven_disk39.dsk \
riven_disk40.dsk riven_disk41.dsk riven_disk43.dsk riven_disk44.dsk \
riven_disk50.dsk \
@@ -176,6 +177,20 @@ riven_disk10.dsk: QBOOT QLOAD TITLE_10 \
###
riven_disk16.dsk: QBOOT QLOAD TITLE_16 \
disk16_files/DISK16 \
disk16_files/LEVEL_BRIDGE
cp $(EMPTY_DISK)/empty.dsk riven_disk16.dsk
$(DOS33_RAW) riven_disk16.dsk 0 0 QBOOT 0 1
$(DOS33_RAW) riven_disk16.dsk 0 2 QBOOT 1 1
$(DOS33_RAW) riven_disk16.dsk 0 4 QBOOT 2 1
$(DOS33_RAW) riven_disk16.dsk 0 1 disk16_files/DISK16 0 0
$(DOS33_RAW) riven_disk16.dsk 0 8 TITLE_16 0 0
$(DOS33_RAW) riven_disk16.dsk 1 0 QLOAD 0 0
$(DOS33_RAW) riven_disk16.dsk 2 0 disk16_files/LEVEL_BRIDGE 0 0
###
riven_disk38.dsk: QBOOT QLOAD TITLE_38 \
disk38_files/DISK38 \
disk38_files/LEVEL_PROJECTOR \
@@ -428,7 +443,16 @@ title_10.o: title.s zp.inc hardware.inc \
ca65 -o title_10.o title.s -DDISK=10 -l title_10.lst
####
TITLE_16: title_16.o
ld65 -o TITLE_16 title_16.o -C $(LINKER_SCRIPTS)/apple2_4000.inc
title_16.o: title.s zp.inc hardware.inc \
qload.inc \
hgr_tables.s \
graphics_title/riven_title.hgr.zx02
ca65 -o title_16.o title.s -DDISK=16 -l title_16.lst
####
@@ -537,6 +561,9 @@ disk05_files/DISK05:
disk10_files/DISK10:
cd disk10_files && make
disk16_files/DISK16:
cd disk16_files && make
disk38_files/DISK38:
cd disk38_files && make
@@ -657,6 +684,11 @@ disk10_files/LEVEL_32:
####
disk16_files/LEVEL_BRIDGE:
cd disk16_files && make
####
disk38_files/LEVEL_PROJECTOR:
cd disk38_files && make
@@ -744,6 +776,7 @@ clean:
QBOOT QLOAD QLOAD_HD \
TITLE_00 TITLE_01 TITLE_02 TITLE_03 TITLE_04 TITLE_05 \
TITLE_10 \
TITLE_16 \
TITLE_38 TITLE_39 \
TITLE_40 TITLE_41 TITLE_43 TITLE_44 TITLE_50
cd disk00_files && make clean
@@ -753,6 +786,7 @@ clean:
cd disk04_files && make clean
cd disk05_files && make clean
cd disk10_files && make clean
cd disk16_files && make clean
cd disk38_files && make clean
cd disk39_files && make clean
cd disk40_files && make clean
@@ -768,6 +802,7 @@ distclean:
QBOOT QLOAD QLOAD_HD \
TITLE_00 TITLE_01 TITLE_02 TITLE_03 TITLE_04 TITLE_05 \
TITLE_10 \
TITLE_16 \
TITLE_38 TITLE_39 \
TITLE_40 TITLE_41 TITLE_43 TITLE_44 TITLE_50
cd graphics_title && make clean
@@ -779,6 +814,7 @@ distclean:
cd disk04_files && make distclean
cd disk05_files && make distclean
cd disk10_files && make distclean
cd disk16_files && make distclean
cd disk38_files && make distclean
cd disk39_files && make distclean
cd disk40_files && make distclean
@@ -817,6 +853,7 @@ qload.inc: generate_common QLOAD
submit: riven_disk00.dsk riven_disk01.dsk riven_disk02.dsk riven_disk03.dsk \
riven_disk04.dsk riven_disk05.dsk \
riven_disk10.dsk \
riven_disk16.dsk \
riven_disk38.dsk riven_disk39.dsk \
riven_disk40.dsk riven_disk41.dsk riven_disk43.dsk riven_disk44.dsk \
riven_disk50.dsk \
@@ -825,6 +862,7 @@ submit: riven_disk00.dsk riven_disk01.dsk riven_disk02.dsk riven_disk03.dsk \
riven_disk02.dsk riven_disk03.dsk riven_disk04.dsk \
riven_disk05.dsk \
riven_disk10.dsk \
riven_disk16.dsk \
riven_disk38.dsk riven_disk39.dsk \
riven_disk40.dsk riven_disk41.dsk riven_disk43.dsk \
riven_disk44.dsk \
@@ -884,6 +922,8 @@ riven_hgr.2mg: dts_block PROBOOTHD QLOAD_HD \
disk10_files/LEVEL_15 \
disk10_files/LEVEL_21 \
disk10_files/LEVEL_32 \
disk16_files/DISK16 \
disk16_files/LEVEL_BRIDGE \
disk38_files/DISK38 \
disk38_files/LEVEL_PROJECTOR \
disk38_files/LEVEL_ENTRY \
@@ -967,6 +1007,8 @@ riven_hgr.2mg: dts_block PROBOOTHD QLOAD_HD \
$(PRODOS_RAW) riven_hgr.2mg `./dts_block 10 11 0` disk10_files/LEVEL_21 0 0
$(PRODOS_RAW) riven_hgr.2mg `./dts_block 10 14 0` disk10_files/LEVEL_32 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 16 0 2` disk16_files/DISK16 0 0
$(PRODOS_RAW) riven_hgr.2mg `./dts_block 16 2 0` disk16_files/LEVEL_BRIDGE 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

@@ -128,7 +128,12 @@ 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
Disk16 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 = BRIDGE 21162 bytes = 6T0S (28672) 6k free
Disk38 Map (disk has 35 tracks, each 4k in size)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@@ -138,13 +138,13 @@ update_exit:
ldx ROOM_ROTATION
lda room_bg_l,X
sta location0+14
sta location0+LOCATION_WEST_BG
lda room_bg_h,X
sta location0+15
sta location0+LOCATION_WEST_BG+1
lda room_exits,X
sta location0+3
sta location0+LOCATION_WEST_EXIT
rts

View File

@@ -0,0 +1,82 @@
.include "../zp.inc"
.include "../disk10_files/disk10_defines.inc"
.include "../disk00_files/disk00_defines.inc"
which_disk_bcd:
.byte $16 ; BCD
which_disk_bin:
.byte 16
load_address_array:
.byte $40,$40,$40,$40 ; TITLE, BRIDGE, BRIDGE2, DOME
.byte $40,$00,$00,$00 ;
track_array:
.byte 0, 2, 8,15 ; TITLE, BRIDGE, BRIDGE2, DOME
.byte 22,0,0,0 ;
sector_array:
.byte 8, 0, 0, 0 ; TITLE, BRIDGE, BRIDGE2, DOME
.byte 0,0,0,0 ;
length_array:
.byte 8, 96,112,80 ; TITLE, BRIDGE, BRIDGE2, DOME
.byte 80,0,0,0
disk_exit_disk: ; note: not BCD anymore
.byte 10
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
disk_exit_disk_bcd:
.byte $10
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
disk_exit_dni_h:
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
disk_exit_dni_l:
.byte $20
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
;
disk_exit_load:
.byte LOAD_32
.byte 0
.byte 0
.byte 0
.byte 0
.byte LOAD_CYAN
disk_exit_level:
.byte RIVEN_32
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0
disk_exit_direction:
.byte DIRECTION_N
.byte 0
.byte 0
.byte 0
.byte 0
.byte 0

View File

@@ -0,0 +1,12 @@
LOAD_TITLE_16 = 0
LOAD_BRIDGE = 1
LOAD_BRIDGE2 = 2
LOAD_DOME = 3
;================================
; Level definitions
; BRIDGE
RIVEN_BRIDGE = 0

View File

@@ -0,0 +1,30 @@
include ../../../../Makefile.inc
ZX02 = ~/research/6502_compression/zx02.git/build/zx02 -f
PNG_TO_HGR = ../../../../utils/hgr-utils/png2hgr
all: bridge_graphics.inc
bridge_graphics.inc: \
dome_bridge_n.hgr.zx02 dome_bridge_s.hgr.zx02 \
dome_bridge_e.hgr.zx02 dome_bridge_w.hgr.zx02 \
dome_bridge_s_blocked.hgr.zx02
echo "dome_bridge_n_zx02: .incbin \"dome_bridge_n.hgr.zx02\"" > bridge_graphics.inc
echo "dome_bridge_s_zx02: .incbin \"dome_bridge_s.hgr.zx02\"" >> bridge_graphics.inc
echo "dome_bridge_e_zx02: .incbin \"dome_bridge_e.hgr.zx02\"" >> bridge_graphics.inc
echo "dome_bridge_w_zx02: .incbin \"dome_bridge_w.hgr.zx02\"" >> bridge_graphics.inc
echo "dome_bridge_s_blocked_zx02: .incbin \"dome_bridge_s_blocked.hgr.zx02\"" >> bridge_graphics.inc
####
%.hgr: %.png
$(PNG_TO_HGR) $< > $@
%.hgr.zx02: %.hgr
$(ZX02) -f $< $@
####
clean:
rm -f *~ *.o *.lst *.zx02 *.hgr bridge_graphics.inc

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@@ -0,0 +1,250 @@
; Riven -- Bridge to Dome
; by deater (Vince Weaver) <vince@deater.net>
; Zero Page
.include "../zp.inc"
.include "../hardware.inc"
.include "../common_defines.inc"
.include "../qload.inc"
.include "disk16_defines.inc"
bridge_start:
;===================
; init screen
;===================
; jsr TEXT
; jsr HOME
bit KEYRESET
bit SET_GR
bit PAGE1
bit HIRES
bit FULLGR
;===============================
; load sound into language card
;===============================
lda SOUND_STATUS
and #SOUND_IN_LC
beq do_not_load_audio
; load sounds into LC
; read ram, write ram, use $d000 bank1
bit $C08B
bit $C08B
lda #<rotate_audio
sta ZX0_src
lda #>rotate_audio
sta ZX0_src+1
lda #$D0 ; decompress to $D000
jsr full_decomp
; read rom, nowrite, use $d000 bank1
bit $C08A
do_not_load_audio:
;========================
; 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
;===================================
jsr update_exit ; update rotation
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
;==========================
; update exit
;==========================
update_exit:
ldx ROOM_ROTATION
lda room_bg_l,X
sta location0+LOCATION_SOUTH_BG
lda room_bg_h,X
sta location0+LOCATION_SOUTH_BG+1
lda room_exits,X
sta location0+LOCATION_SOUTH_EXIT
rts
; rotates clockwise
room_bg_l:
.byte <dome_bridge_s_zx02 ; opening
.byte <dome_bridge_s_blocked_zx02 ; blocked
.byte <dome_bridge_s_blocked_zx02 ; blocked
.byte <dome_bridge_s_zx02 ; opening
.byte <dome_bridge_s_blocked_zx02 ; blocked
room_bg_h:
.byte >dome_bridge_s_zx02 ; opening
.byte >dome_bridge_s_blocked_zx02 ; blocked
.byte >dome_bridge_s_blocked_zx02 ; blocked
.byte >dome_bridge_s_zx02 ; opening
.byte >dome_bridge_s_blocked_zx02 ; blocked
room_exits:
.byte $E0 ; 0
.byte $FF ; 1
.byte $FF ; 2
.byte $E0 ; 3
.byte $FF ; 4
;==========================
; bridge button
;==========================
bridge_button:
; rotate, mod5
inc ROOM_ROTATION
lda ROOM_ROTATION
cmp #5
bne room_no_wrap
lda #0
sta ROOM_ROTATION
room_no_wrap:
; update the pointers
jsr update_exit
; only play sound if language card
lda SOUND_STATUS
and #SOUND_IN_LC
bne do_play_audio
; wait a bit instead
ldx #20
jsr wait_50xms
jmp done_play_audio
do_play_audio:
; switch in language card
; read/write RAM $d000 bank 1
bit $C08B
bit $C08B
; call the btc player
lda #$00
sta BTC_L
lda #$D0
sta BTC_H
ldx #45 ; length
jsr play_audio
; read ROM/no-write
bit $c08A ; restore language card
done_play_audio:
; TODO: tail call
rts
;==========================
; includes
;==========================
.include "graphics_bridge/bridge_graphics.inc"
.include "leveldata_bridge.inc"
.include "../audio.s"
rotate_audio:
.incbin "../disk02_files/audio/rotate.btc.zx02"

View File

@@ -0,0 +1,26 @@
;===============================================
; level data for bridge to dome
;===============================================
locations:
.word location0
; RIVEN_BRIDGE -- bridge to dome
location0:
.byte $ff ; north exit
.byte $E0 ; 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 dome_bridge_n_zx02 ; north bg
.word dome_bridge_s_zx02 ; south bg
.word dome_bridge_e_zx02 ; east bg
.word dome_bridge_w_zx02 ; west bg
.byte BG_NORTH|BG_SOUTH|BG_EAST|BG_WEST ; all bgs
.byte DIRECTION_E ; special exit
.byte 16,26 ; x
.byte 82,140 ; y
.word bridge_button-1

View File

@@ -36,6 +36,10 @@
.include "disk10_files/disk10_defines.inc"
.endif
.if DISK=16
.include "disk16_files/disk16_defines.inc"
.endif
.if DISK=38
.include "disk38_files/disk38_defines.inc"
.endif
@@ -486,6 +490,18 @@ game_continue:
sta DIRECTION
.endif
.if DISK=16
lda #LOAD_BRIDGE
sta WHICH_LOAD
lda #RIVEN_BRIDGE
sta LOCATION
lda #DIRECTION_N
sta DIRECTION
.endif
.if DISK=38