riven: more work hooking up disk0

almost disastrous issues with alternate graphics
This commit is contained in:
Vince Weaver 2024-07-13 16:08:25 -04:00
parent cd2ad3bea0
commit 56bf637d3d
15 changed files with 185 additions and 12 deletions

View File

@ -46,7 +46,8 @@ riven_disk00.dsk: QBOOT QLOAD TITLE_00 \
disk00_files/ATRUS \
disk00_files/CYAN \
disk00_files/CAPTURED \
disk00_files/CHO
disk00_files/CHO \
disk00_files/LEVEL_START
cp $(EMPTY_DISK)/empty.dsk riven_disk00.dsk
$(DOS33_RAW) riven_disk00.dsk 0 0 QBOOT 0 1
$(DOS33_RAW) riven_disk00.dsk 0 2 QBOOT 1 1
@ -58,7 +59,7 @@ riven_disk00.dsk: QBOOT QLOAD TITLE_00 \
$(DOS33_RAW) riven_disk00.dsk 10 0 disk00_files/ATRUS 0 0
$(DOS33_RAW) riven_disk00.dsk 18 0 disk00_files/CAPTURED 0 0
$(DOS33_RAW) riven_disk00.dsk 26 0 disk00_files/CHO 0 0
$(DOS33_RAW) riven_disk00.dsk 31 0 disk00_files/LEVEL_START 0 0
###

View File

@ -3,7 +3,7 @@ include ../../../Makefile.inc
LINKER_SCRIPTS = ../../../linker_scripts/
all: DISK00 ATRUS CYAN CAPTURED CHO
all: DISK00 ATRUS CYAN CAPTURED CHO LEVEL_START
####
@ -48,7 +48,17 @@ cho.o: cho.s \
ca65 -o cho.o cho.s -l cho.lst
####
LEVEL_START: level_start.o
ld65 -o LEVEL_START level_start.o -C $(LINKER_SCRIPTS)/apple2_4000.inc
level_start.o: level_start.s \
../zp.inc ../hardware.inc ../qload.inc \
../common_defines.inc disk00_defines.inc \
leveldata_start.inc \
graphics_start/start_graphics.inc
ca65 -o level_start.o level_start.s -l level_start.lst
####

View File

@ -130,7 +130,7 @@ done_cho:
bit KEYRESET
lda #LOAD_CHO
lda #LOAD_START
sta WHICH_LOAD
lda #$1

View File

@ -5,18 +5,18 @@ which_disk:
load_address_array:
.byte $40,$40,$40,$60 ; TITLE, CYAN, ATRUS, CAPTURED
.byte $40,$00,$00,$00 ; CHO
.byte $40,$40,$00,$00 ; CHO, START
track_array:
.byte 0, 2, 10,18 ; TITLE, CYAN, ATRUS, CAPTURED
.byte 26,0,0,0 ; CHO
.byte 26,31,0,0 ; CHO, START
sector_array:
.byte 8, 0, 0, 0 ; TITLE, CYAN, ATRUS, CAPTURED
.byte 0,0,0,0 ; CHO
.byte 0,0,0,0 ; CHO, START
length_array:
.byte 8, 127,127,80 ; TITLE, CYAN, ATRUS, CAPTURED
.byte 127,0,0,0 ; CHO
.byte 80,64,0,0 ; CHO. START
disk_exit_disk: ; note: BCD (yes I'm lazy)
@ -29,13 +29,13 @@ disk_exit_dni_l:
.byte $01
.byte 0,0,0
; want to go to disk01, LOAD_ARRIVAL, RIVEN_ARRIVAL, N
; want to go to disk01, LOAD_ARRIVAL, RIVEN_ARRIVAL_NEAR, N
disk_exit_load:
.byte 1 ; LOAD_ARRIVAL
.byte 0,0,0
disk_exit_level:
.byte 0 ; RIVEN_ARRIVAL
.byte 1 ; RIVEN_ARRIVAL_NEAR
.byte 0,0,0
disk_exit_direction:
.byte DIRECTION_N

View File

@ -3,4 +3,4 @@ LOAD_CYAN = 1
LOAD_ATRUS = 2
LOAD_CAPTURED = 3
LOAD_CHO = 4
LOAD_START = 5

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -0,0 +1,114 @@
; Riven -- Dome Island -- Start of Game
; by deater (Vince Weaver) <vince@deater.net>
; Zero Page
.include "../zp.inc"
.include "../hardware.inc"
.include "../common_defines.inc"
.include "../qload.inc"
.include "disk00_defines.inc"
riven_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
;==========================
; includes
;==========================
.include "graphics_start/start_graphics.inc"
.include "leveldata_start.inc"

View File

@ -0,0 +1,24 @@
;===============================================
; level data for Dome Island level
;===============================================
locations:
.word location0
; RIVEN_START - first arrival
location0:
.byte $E0|0 ; north exit
.byte $ff ; south exit
.byte $FF ; east exit
.byte $ff ; west exit
.byte DIRECTION_N ; north exit_dir
.byte $ff ; south exit_dir
.byte $ff ; east exit_dir
.byte $ff ; west exit_dir
.word arrival_n_zx02 ; north bg
.word $0000 ; south bg
.word $0000 ; east bg
.word $0000 ; west bg
.byte BG_NORTH
.byte $ff ; special exit

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

@ -145,7 +145,7 @@ right_pressed:
cmp #38 ; if Xpos > 38 don't increment
bcc do_inc_cursor_x ; blt
; cmp #$FE
; bcc done_right_pressed
bcs done_right_pressed
do_inc_cursor_x:
inc CURSOR_X ; move right one 3.5 pixel column
done_right_pressed: