riven_hgr: hook up some more graphics

This commit is contained in:
Vince Weaver 2024-05-17 00:10:29 -04:00
parent ce5511230f
commit aa3a7c1a82
7 changed files with 223 additions and 3 deletions

View File

@ -12,13 +12,14 @@ EMPTY_DISK = ../../empty_disk/empty.dsk
all: riven_hgr.dsk
riven_hgr.dsk: HELLO LOADER TITLE \
LEVEL_PROJECTOR LEVEL_MAGSTEPS DOME
LEVEL_PROJECTOR LEVEL_MAGSTEPS LEVEL_MAGLEV DOME
cp $(EMPTY_DISK) riven_hgr.dsk
$(DOS33) -y riven_hgr.dsk SAVE A HELLO
$(DOS33) -y riven_hgr.dsk BSAVE -a 0x1000 LOADER
$(DOS33) -y riven_hgr.dsk BSAVE -a 0x4000 TITLE
$(DOS33) -y riven_hgr.dsk BSAVE -a 0x4000 LEVEL_PROJECTOR
$(DOS33) -y riven_hgr.dsk BSAVE -a 0x4000 LEVEL_MAGSTEPS
$(DOS33) -y riven_hgr.dsk BSAVE -a 0x4000 LEVEL_MAGLEV
$(DOS33) -y riven_hgr.dsk BSAVE -a 0x4000 DOME
###
@ -90,13 +91,29 @@ level_magsteps.o: level_magsteps.s zp.inc hardware.inc \
graphics_magsteps/magsteps_graphics.inc
ca65 -o level_magsteps.o level_magsteps.s -l level_magsteps.lst
####
LEVEL_MAGLEV: level_maglev.o
ld65 -o LEVEL_MAGLEV level_maglev.o -C ../../linker_scripts/apple2_4000.inc
level_maglev.o: level_maglev.s zp.inc hardware.inc \
zx02_optim.s \
hgr_sprite.s hgr_tables.s \
keyboard.s \
hgr_14x14_sprite.s \
leveldata_maglev.inc \
graphics_sprites/pointer_sprites.inc \
graphics_maglev/maglev_graphics.inc
ca65 -o level_maglev.o level_maglev.s -l level_maglev.lst
####
clean:
rm -f *~ *.o *.lst HELLO LOADER TITLE \
LEVEL_PROJECTOR LEVEL_MAGSTEPS DOME
LEVEL_PROJECTOR LEVEL_MAGSTEPS LEVEL_MAGLEV DOME
# cd graphics && make clean
# cd maps && make clean
# cd title && make clean

View File

@ -2,7 +2,7 @@ LOAD_TITLE = 0
LOAD_DOME = 1
LOAD_PROJECTOR = 2
LOAD_MAGSTEPS = 3
LOAD_MAGLEV = 4
div7_table = $BC00
mod7_table = $BD00
@ -62,3 +62,7 @@ RIVEN_PROJ_DOOR = 1
RIVEN_MAGSTEPS2 = 0
RIVEN_MAGSTEPS3 = 1
; Maglev
RIVEN_LOOKIN = 0
RIVEN_INSEAT = 1

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: maglev_graphics.inc
maglev_graphics.inc: \
inseat_s.hgr.zx02 inseat_w.hgr.zx02 \
lookin_w.hgr.zx02
echo "inseat_s_zx02: .incbin \"inseat_s.hgr.zx02\"" > maglev_graphics.inc
echo "inseat_w_zx02: .incbin \"inseat_w.hgr.zx02\"" >> maglev_graphics.inc
echo "lookin_w_zx02: .incbin \"lookin_w.hgr.zx02\"" >> maglev_graphics.inc
####
%.hgr: %.png
$(PNG_TO_HGR) $< > $@
%.hgr.zx02: %.hgr
$(ZX02) -f $< $@
####
clean:
rm -f *~ *.o *.lst *.zx02 *.hgr maglev_graphics.inc

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -0,0 +1,123 @@
; Riven -- Dome Island, Inside Maglev
; by deater (Vince Weaver) <vince@deater.net>
; Zero Page
.include "zp.inc"
.include "hardware.inc"
.include "common_defines.inc"
riven_maglev:
;===================
; 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 "zx02_optim.s"
.include "keyboard.s"
.include "hgr_14x14_sprite.s"
.include "draw_pointer.s"
.include "log_table.s"
.include "graphics_maglev/maglev_graphics.inc"
;.include "common_sprites.inc"
.include "graphics_sprites/pointer_sprites.inc"
.include "leveldata_maglev.inc"

View File

@ -0,0 +1,46 @@
;===============================================
; level data for inside the maglev
;===============================================
locations:
.word location0,location1
; RIVEN_LOOKIN -- looking into the maglev
location0:
.byte $FF ; north exit
.byte LOAD_MAGSTEPS<<4|RIVEN_MAGSTEPS3 ; south exit
.byte $ff ; east exit
.byte RIVEN_INSEAT ; west exit
.byte $FF ; north exit_dir
.byte DIRECTION_S ; south exit_dir
.byte $ff ; east exit_dir
.byte DIRECTION_W ; west exit_dir
.word $0000 ; north bg
.word inseat_s_zx02 ; south bg
.word $0000 ; east bg
.word lookin_w_zx02 ; west bg
.byte BG_WEST|BG_SOUTH
.byte DIRECTION_E ; special exit
.byte 9,29 ; special x
.byte 2,46 ; special y
.word location0-1 ; FIXME
; RIVEN_INSEAT -- when sitting in seat
location1:
.byte $FF ; north exit
.byte LOAD_MAGSTEPS<<4|RIVEN_MAGSTEPS3 ; 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 inseat_s_zx02 ; south bg
.word $0000 ; east bg
.word inseat_w_zx02 ; west bg
.byte BG_WEST|BG_SOUTH
.byte DIRECTION_E ; special exit
.byte 9,29 ; special x
.byte 2,46 ; special y
.word location1-1 ; special function FIXME