Compare commits

...

4 Commits

Author SHA1 Message Date
Vince Weaver
652fbce9b9 riven_hgr: some more graphics 2024-05-15 01:51:36 -04:00
Vince Weaver
103e8dcfcd riven_hgr: auto-generate pointers from png 2024-05-15 00:17:57 -04:00
Vince Weaver
fc8e3c657e riven_hgr: can actuall walk around
sort of
2024-05-14 16:31:41 -04:00
Vince Weaver
c9d8d8fbd1 riven_hgr: move some files around 2024-05-14 12:54:56 -04:00
31 changed files with 1297 additions and 1634 deletions

View File

@ -11,12 +11,12 @@ EMPTY_DISK = ../../empty_disk/empty.dsk
all: riven_hgr.dsk
riven_hgr.dsk: HELLO LOADER MAIN
riven_hgr.dsk: HELLO LOADER TITLE 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 MAIN
# $(DOS33) -y riven_hgr.dsk BSAVE -a 0x4000 MARS
$(DOS33) -y riven_hgr.dsk BSAVE -a 0x4000 TITLE
$(DOS33) -y riven_hgr.dsk BSAVE -a 0x4000 DOME
###
@ -33,34 +33,33 @@ loader.o: loader.s hardware_detect.s
####
MAIN: main.o
ld65 -o MAIN main.o -C ../../linker_scripts/apple2_4000.inc
TITLE: title.o
ld65 -o TITLE title.o -C ../../linker_scripts/apple2_4000.inc
main.o: main.s zp.inc hardware.inc \
title.o: title.s zp.inc hardware.inc \
zx02_optim.s wait_a_bit.s \
hgr_sprite.s hgr_tables.s \
graphics_title/riven_title.hgr.zx02
ca65 -o title.o title.s -l title.lst
####
DOME: dome.o
ld65 -o DOME dome.o -C ../../linker_scripts/apple2_4000.inc
dome.o: dome.s zp.inc hardware.inc \
zx02_optim.s \
hgr_sprite.s hgr_tables.s \
keyboard.s \
hgr_14x14_sprite.s \
graphics/maglev1.hgr.zx02
ca65 -o main.o main.s -l main.lst
####
#MARS: mars.o
# ld65 -o MARS mars.o -C ../../linker_scripts/apple2_4000.inc
#mars.o: mars.s zp.inc hardware.inc game_over.s \
# gr_fade.s \
# mars_keyboard.s draw_tilemap.s \
# mars_sfx.s longer_sound.s \
# text_help.s tilemap_lookup.s \
# maps/mars_map.zx02 graphics/parts.gr.zx02
# ca65 -o mars.o mars.s -l mars.lst
graphics_sprites/pointer_sprites.inc \
graphics_dome/dome_graphics.inc
ca65 -o dome.o dome.s -l dome.lst
####
clean:
rm -f *~ *.o *.lst HELLO LOADER MAIN
rm -f *~ *.o *.lst HELLO LOADER TITLE DOME
# cd graphics && make clean
# cd maps && make clean
# cd title && make clean

View File

@ -1,4 +1,53 @@
LOAD_TITLE = 0
LOAD_MAIN = 1
LOAD_DOME = 1
div7_table = $BC00
mod7_table = $BD00
hposn_high = $BE00
hposn_low = $BF00
;=============================
; common stuff
;===============================================
; level data structure definitions
;===============================================
; 24 bytes each location
; we put special at end as it's ignored if not set
LOCATION_NORTH_EXIT=0 ; new room when heading north
LOCATION_SOUTH_EXIT=1 ; new room when heading south
LOCATION_EAST_EXIT=2 ; new room when heading east
LOCATION_WEST_EXIT=3 ; new room when heading west
LOCATION_NORTH_EXIT_DIR=4 ; direction faced in new room when N
LOCATION_SOUTH_EXIT_DIR=5 ; direction faced in new room when S
LOCATION_EAST_EXIT_DIR=6 ; direction faced in new room when E
LOCATION_WEST_EXIT_DIR=7 ; direction faced in new room when W
LOCATION_NORTH_BG=8 ; pointer to north background image
LOCATION_SOUTH_BG=10 ; pointer to south background image
LOCATION_EAST_BG=12 ; pointer to east background image
LOCATION_WEST_BG=14 ; pointer to west background image
LOCATION_BGS = 16 ; bitmap saying which backgrounds valid
BG_NORTH = 1
BG_SOUTH = 2
BG_WEST = 4
BG_EAST = 8
LOCATION_SPECIAL_EXIT=17 ; if we have something clickable
; $FF if not, direction if so
LOCATION_SPECIAL_X1=18 ; collision box for the thing to click
LOCATION_SPECIAL_X2=19
LOCATION_SPECIAL_Y1=20
LOCATION_SPECIAL_Y2=21
LOCATION_SPECIAL_FUNC=22 ; pointer-1 of function to call on click
;================================
; Level definitions
; Dome
RIVEN_MAGLEV1 = 0
RIVEN_MAGLEV2 = 1
RIVEN_MAGLEV3 = 2

View File

@ -1,862 +0,0 @@
finger_point_sprite:
;===============
; point sprite
;===============
point_sprite_l: ; X 654 3 210
.byte $00 ; 0 000 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $63 ; 0 110 0 011
.byte $66 ; 0 110 0 110
.byte $2c ; 0 010 1 100
.byte $6c ; 0 110 1 100
.byte $78 ; 0 111 1 000
.byte $70 ; 0 111 0 000
.byte $70 ; 0 111 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
point_sprite_r: ; X 654 3 210
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $0A ; 0 000 1 010
.byte $2A ; 0 010 1 010
.byte $2D ; 0 010 1 101
.byte $37 ; 0 011 0 111
.byte $3F ; 0 011 1 111
.byte $3F ; 0 011 1 111
.byte $1F ; 0 001 1 111
.byte $1F ; 0 001 1 111
.byte $1F ; 0 001 1 111
point_mask_l: ; X 654 3 210
.byte $9f ; 1 001 1 111
.byte $8f ; 1 000 1 111
.byte $8f ; 1 000 1 111
.byte $8f ; 1 000 1 111
.byte $88 ; 1 000 1 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $81 ; 1 000 0 001
.byte $81 ; 1 000 0 001
.byte $83 ; 1 000 0 011
.byte $87 ; 1 000 0 111
.byte $8f ; 1 000 1 111
.byte $8f ; 1 000 1 111
point_mask_r: ; X 654 3 210
.byte $ff ; 1 111 1 111
.byte $fe ; 1 111 1 110
.byte $fe ; 1 111 1 110
.byte $fe ; 1 111 1 110
.byte $e0 ; 1 110 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $c0 ; 1 100 0 000
.byte $c0 ; 1 100 0 000
finger_grab_sprite:
;===============
; grab sprite
;===============
grab_sprite_l: ; X 654 3 210
.byte $00 ; 0 000 0 000
.byte $4c ; 0 100 1 100
.byte $4c ; 0 100 1 100
.byte $58 ; 0 101 1 000
.byte $58 ; 0 101 1 000
.byte $70 ; 0 111 0 000
.byte $73 ; 0 111 0 011
.byte $77 ; 0 111 0 111
.byte $7e ; 0 111 1 110
.byte $7c ; 0 111 1 100
.byte $7c ; 0 111 1 100
.byte $78 ; 0 111 1 000
.byte $70 ; 0 111 0 000
.byte $60 ; 0 110 0 000
grab_sprite_r: ; X 654 3 210
.byte $00 ; 0 000 0 000
.byte $0d ; 0 000 1 101
.byte $0d ; 0 000 1 101
.byte $0d ; 0 000 1 101
.byte $6d ; 0 110 1 101
.byte $6f ; 0 110 1 111
.byte $7f ; 0 111 1 111
.byte $3f ; 0 011 1 111
.byte $3f ; 0 011 1 111
.byte $3f ; 0 011 1 111
.byte $1f ; 0 001 1 111
.byte $1f ; 0 001 1 111
.byte $0f ; 0 000 1 111
.byte $0f ; 0 000 1 111
grab_mask_l: ; X 654 3 210
.byte $b3 ; 1 011 0 011
.byte $81 ; 1 000 0 001
.byte $81 ; 1 000 0 001
.byte $83 ; 1 000 0 011
.byte $83 ; 1 000 0 011
.byte $84 ; 1 000 0 100
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $81 ; 1 000 0 001
.byte $81 ; 1 000 0 001
.byte $83 ; 1 000 0 011
.byte $c7 ; 1 100 0 111
.byte $c7 ; 1 100 1 111
grab_mask_r: ; X 654 3 210
.byte $f2 ; 1 111 0 010
.byte $e0 ; 1 110 0 000
.byte $e0 ; 1 110 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 100 0 000
.byte $c0 ; 1 100 0 000
.byte $e0 ; 1 110 0 000
.byte $e0 ; 1 110 0 000
;======================
; finger left
;======================
; TODO
finger_left_sprite:
finger_left_sprite_l: ; X 654 3 210
.byte $00 ; 0 000 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $63 ; 0 110 0 011
.byte $66 ; 0 110 0 110
.byte $2c ; 0 010 1 100
.byte $6c ; 0 110 1 100
.byte $78 ; 0 111 1 000
.byte $70 ; 0 111 0 000
.byte $70 ; 0 111 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
finger_left_sprite_r: ; X 654 3 210
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $0A ; 0 000 1 010
.byte $2A ; 0 010 1 010
.byte $2D ; 0 010 1 101
.byte $37 ; 0 011 0 111
.byte $3F ; 0 011 1 111
.byte $3F ; 0 011 1 111
.byte $1F ; 0 001 1 111
.byte $1F ; 0 001 1 111
.byte $1F ; 0 001 1 111
finger_left_mask_l: ; X 654 3 210
.byte $ff ; 1 001 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 001
.byte $ff ; 1 000 0 001
.byte $ff ; 1 000 0 011
.byte $ff ; 1 000 0 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
finger_left_mask_r: ; X 654 3 210
.byte $ff ; 1 111 1 111
.byte $fe ; 1 111 1 110
.byte $fe ; 1 111 1 110
.byte $fe ; 1 111 1 110
.byte $e0 ; 1 110 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $c0 ; 1 100 0 000
.byte $c0 ; 1 100 0 000
;====================
; finger right
;====================
; TODO
finger_right_sprite:
finger_right_sprite_l: ; X 654 3 210
.byte $00 ; 0 000 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $63 ; 0 110 0 011
.byte $66 ; 0 110 0 110
.byte $2c ; 0 010 1 100
.byte $6c ; 0 110 1 100
.byte $78 ; 0 111 1 000
.byte $70 ; 0 111 0 000
.byte $70 ; 0 111 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
finger_right_sprite_r: ; X 654 3 210
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $0A ; 0 000 1 010
.byte $2A ; 0 010 1 010
.byte $2D ; 0 010 1 101
.byte $37 ; 0 011 0 111
.byte $3F ; 0 011 1 111
.byte $3F ; 0 011 1 111
.byte $1F ; 0 001 1 111
.byte $1F ; 0 001 1 111
.byte $1F ; 0 001 1 111
finger_right_mask_l: ; X 654 3 210
.byte $ff ; 1 001 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 001
.byte $ff ; 1 000 0 001
.byte $ff ; 1 000 0 011
.byte $ff ; 1 000 0 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
finger_right_mask_r: ; X 654 3 210
.byte $ff ; 1 111 1 111
.byte $fe ; 1 111 1 110
.byte $fe ; 1 111 1 110
.byte $fe ; 1 111 1 110
.byte $e0 ; 1 110 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $c0 ; 1 100 0 000
.byte $c0 ; 1 100 0 000
;====================
; Finger turn left
;====================
finger_turn_left_sprite:
finger_turn_left_sprite_l: ; X 654 3 210
.byte $00 ; 0 000 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $63 ; 0 110 0 011
.byte $66 ; 0 110 0 110
.byte $2c ; 0 010 1 100
.byte $6c ; 0 110 1 100
.byte $78 ; 0 111 1 000
.byte $70 ; 0 111 0 000
.byte $70 ; 0 111 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
finger_turn_left_sprite_r: ; X 654 3 210
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $0A ; 0 000 1 010
.byte $2A ; 0 010 1 010
.byte $2D ; 0 010 1 101
.byte $37 ; 0 011 0 111
.byte $3F ; 0 011 1 111
.byte $3F ; 0 011 1 111
.byte $1F ; 0 001 1 111
.byte $1F ; 0 001 1 111
.byte $1F ; 0 001 1 111
finger_turn_left_mask_l: ; X 654 3 210
.byte $ff ; 1 001 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 001
.byte $ff ; 1 000 0 001
.byte $ff ; 1 000 0 011
.byte $ff ; 1 000 0 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
finger_turn_left_mask_r: ; X 654 3 210
.byte $ff ; 1 111 1 111
.byte $fe ; 1 111 1 110
.byte $fe ; 1 111 1 110
.byte $fe ; 1 111 1 110
.byte $e0 ; 1 110 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $c0 ; 1 100 0 000
.byte $c0 ; 1 100 0 000
;=====================
; Finger turn right
;=====================
; TODO
finger_turn_right_sprite:
finger_turn_right_sprite_l: ; X 654 3 210
.byte $00 ; 0 000 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $63 ; 0 110 0 011
.byte $66 ; 0 110 0 110
.byte $2c ; 0 010 1 100
.byte $6c ; 0 110 1 100
.byte $78 ; 0 111 1 000
.byte $70 ; 0 111 0 000
.byte $70 ; 0 111 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
finger_turn_right_sprite_r: ; X 654 3 210
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $0A ; 0 000 1 010
.byte $2A ; 0 010 1 010
.byte $2D ; 0 010 1 101
.byte $37 ; 0 011 0 111
.byte $3F ; 0 011 1 111
.byte $3F ; 0 011 1 111
.byte $1F ; 0 001 1 111
.byte $1F ; 0 001 1 111
.byte $1F ; 0 001 1 111
finger_turn_right_mask_l: ; X 654 3 210
.byte $ff ; 1 001 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 001
.byte $ff ; 1 000 0 001
.byte $ff ; 1 000 0 011
.byte $ff ; 1 000 0 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
finger_turn_right_mask_r: ; X 654 3 210
.byte $ff ; 1 111 1 111
.byte $fe ; 1 111 1 110
.byte $fe ; 1 111 1 110
.byte $fe ; 1 111 1 110
.byte $e0 ; 1 110 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $c0 ; 1 100 0 000
.byte $c0 ; 1 100 0 000
;=====================
; finger match
;=====================
; TODO
finger_match_sprite:
.if 0
finger_match_sprite_l: ; X 654 3 210
.byte $00 ; 0 000 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $63 ; 0 110 0 011
.byte $66 ; 0 110 0 110
.byte $2c ; 0 010 1 100
.byte $6c ; 0 110 1 100
.byte $78 ; 0 111 1 000
.byte $70 ; 0 111 0 000
.byte $70 ; 0 111 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
finger_match_sprite_r: ; X 654 3 210
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $0A ; 0 000 1 010
.byte $2A ; 0 010 1 010
.byte $2D ; 0 010 1 101
.byte $37 ; 0 011 0 111
.byte $3F ; 0 011 1 111
.byte $3F ; 0 011 1 111
.byte $1F ; 0 001 1 111
.byte $1F ; 0 001 1 111
.byte $1F ; 0 001 1 111
finger_match_mask_l: ; X 654 3 210
.byte $ff ; 1 001 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 001
.byte $ff ; 1 000 0 001
.byte $ff ; 1 000 0 011
.byte $ff ; 1 000 0 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
finger_match_mask_r: ; X 654 3 210
.byte $ff ; 1 111 1 111
.byte $fe ; 1 111 1 110
.byte $fe ; 1 111 1 110
.byte $fe ; 1 111 1 110
.byte $e0 ; 1 110 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $c0 ; 1 100 0 000
.byte $c0 ; 1 100 0 000
.endif
;======================
; finger match lit
;======================
; TODO
finger_match_lit_sprite:
.if 0
finger_match_lit_sprite_l: ; X 654 3 210
.byte $00 ; 0 000 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $63 ; 0 110 0 011
.byte $66 ; 0 110 0 110
.byte $2c ; 0 010 1 100
.byte $6c ; 0 110 1 100
.byte $78 ; 0 111 1 000
.byte $70 ; 0 111 0 000
.byte $70 ; 0 111 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
finger_match_lit_sprite_r: ; X 654 3 210
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $0A ; 0 000 1 010
.byte $2A ; 0 010 1 010
.byte $2D ; 0 010 1 101
.byte $37 ; 0 011 0 111
.byte $3F ; 0 011 1 111
.byte $3F ; 0 011 1 111
.byte $1F ; 0 001 1 111
.byte $1F ; 0 001 1 111
.byte $1F ; 0 001 1 111
finger_match_lit_mask_l: ; X 654 3 210
.byte $ff ; 1 001 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 001
.byte $ff ; 1 000 0 001
.byte $ff ; 1 000 0 011
.byte $ff ; 1 000 0 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
finger_match_lit_mask_r: ; X 654 3 210
.byte $ff ; 1 111 1 111
.byte $fe ; 1 111 1 110
.byte $fe ; 1 111 1 110
.byte $fe ; 1 111 1 110
.byte $e0 ; 1 110 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $c0 ; 1 100 0 000
.byte $c0 ; 1 100 0 000
.endif
;=========================
; finger key sprite
;=========================
; TODO
finger_key_sprite:
.if 0
finger_key_sprite_l: ; X 654 3 210
.byte $00 ; 0 000 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $63 ; 0 110 0 011
.byte $66 ; 0 110 0 110
.byte $2c ; 0 010 1 100
.byte $6c ; 0 110 1 100
.byte $78 ; 0 111 1 000
.byte $70 ; 0 111 0 000
.byte $70 ; 0 111 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
finger_key_sprite_r: ; X 654 3 210
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $0A ; 0 000 1 010
.byte $2A ; 0 010 1 010
.byte $2D ; 0 010 1 101
.byte $37 ; 0 011 0 111
.byte $3F ; 0 011 1 111
.byte $3F ; 0 011 1 111
.byte $1F ; 0 001 1 111
.byte $1F ; 0 001 1 111
.byte $1F ; 0 001 1 111
finger_key_mask_l: ; X 654 3 210
.byte $ff ; 1 001 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 001
.byte $ff ; 1 000 0 001
.byte $ff ; 1 000 0 011
.byte $ff ; 1 000 0 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
finger_key_mask_r: ; X 654 3 210
.byte $ff ; 1 111 1 111
.byte $fe ; 1 111 1 110
.byte $fe ; 1 111 1 110
.byte $fe ; 1 111 1 110
.byte $e0 ; 1 110 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $c0 ; 1 100 0 000
.byte $c0 ; 1 100 0 000
.endif
;===========================
; finger red sprite
;===========================
; TODO
finger_red_page_sprite:
finger_red_sprite_l: ; X 654 3 210
.byte $00 ; 0 000 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $63 ; 0 110 0 011
.byte $66 ; 0 110 0 110
.byte $2c ; 0 010 1 100
.byte $6c ; 0 110 1 100
.byte $78 ; 0 111 1 000
.byte $70 ; 0 111 0 000
.byte $70 ; 0 111 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
finger_red_sprite_r: ; X 654 3 210
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $0A ; 0 000 1 010
.byte $2A ; 0 010 1 010
.byte $2D ; 0 010 1 101
.byte $37 ; 0 011 0 111
.byte $3F ; 0 011 1 111
.byte $3F ; 0 011 1 111
.byte $1F ; 0 001 1 111
.byte $1F ; 0 001 1 111
.byte $1F ; 0 001 1 111
finger_red_mask_l: ; X 654 3 210
.byte $ff ; 1 001 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 001
.byte $ff ; 1 000 0 001
.byte $ff ; 1 000 0 011
.byte $ff ; 1 000 0 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
finger_red_mask_r: ; X 654 3 210
.byte $ff ; 1 111 1 111
.byte $fe ; 1 111 1 110
.byte $fe ; 1 111 1 110
.byte $fe ; 1 111 1 110
.byte $e0 ; 1 110 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $c0 ; 1 100 0 000
.byte $c0 ; 1 100 0 000
;=====================
; finger blue sprite
;=====================
; TODO
finger_blue_page_sprite:
finger_blue_sprite_l: ; X 654 3 210
.byte $00 ; 0 000 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $63 ; 0 110 0 011
.byte $66 ; 0 110 0 110
.byte $2c ; 0 010 1 100
.byte $6c ; 0 110 1 100
.byte $78 ; 0 111 1 000
.byte $70 ; 0 111 0 000
.byte $70 ; 0 111 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
finger_blue_sprite_r: ; X 654 3 210
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $0A ; 0 000 1 010
.byte $2A ; 0 010 1 010
.byte $2D ; 0 010 1 101
.byte $37 ; 0 011 0 111
.byte $3F ; 0 011 1 111
.byte $3F ; 0 011 1 111
.byte $1F ; 0 001 1 111
.byte $1F ; 0 001 1 111
.byte $1F ; 0 001 1 111
finger_blue_mask_l: ; X 654 3 210
.byte $ff ; 1 001 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 001
.byte $ff ; 1 000 0 001
.byte $ff ; 1 000 0 011
.byte $ff ; 1 000 0 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
finger_blue_mask_r: ; X 654 3 210
.byte $ff ; 1 111 1 111
.byte $fe ; 1 111 1 110
.byte $fe ; 1 111 1 110
.byte $fe ; 1 111 1 110
.byte $e0 ; 1 110 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $c0 ; 1 100 0 000
.byte $c0 ; 1 100 0 000
;========================
; finger white page
;========================
; TODO
finger_white_page_sprite:
finger_white_sprite_l: ; X 654 3 210
.byte $00 ; 0 000 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
.byte $63 ; 0 110 0 011
.byte $66 ; 0 110 0 110
.byte $2c ; 0 010 1 100
.byte $6c ; 0 110 1 100
.byte $78 ; 0 111 1 000
.byte $70 ; 0 111 0 000
.byte $70 ; 0 111 0 000
.byte $60 ; 0 110 0 000
.byte $60 ; 0 110 0 000
finger_white_sprite_r: ; X 654 3 210
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $00 ; 0 000 0 000
.byte $0A ; 0 000 1 010
.byte $2A ; 0 010 1 010
.byte $2D ; 0 010 1 101
.byte $37 ; 0 011 0 111
.byte $3F ; 0 011 1 111
.byte $3F ; 0 011 1 111
.byte $1F ; 0 001 1 111
.byte $1F ; 0 001 1 111
.byte $1F ; 0 001 1 111
finger_white_mask_l: ; X 654 3 210
.byte $ff ; 1 001 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 000
.byte $ff ; 1 000 0 001
.byte $ff ; 1 000 0 001
.byte $ff ; 1 000 0 011
.byte $ff ; 1 000 0 111
.byte $ff ; 1 000 1 111
.byte $ff ; 1 000 1 111
finger_white_mask_r: ; X 654 3 210
.byte $ff ; 1 111 1 111
.byte $fe ; 1 111 1 110
.byte $fe ; 1 111 1 110
.byte $fe ; 1 111 1 110
.byte $e0 ; 1 110 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $80 ; 1 000 0 000
.byte $c0 ; 1 100 0 000
.byte $c0 ; 1 100 0 000

123
games/riven_hgr/dome.s Normal file
View File

@ -0,0 +1,123 @@
; Riven -- Dome Island
; by deater (Vince Weaver) <vince@deater.net>
; Zero Page
.include "zp.inc"
.include "hardware.inc"
.include "common_defines.inc"
riven_dome:
;===================
; 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:
jmp really_exit
;==========================
; includes
;==========================
.include "zx02_optim.s"
.include "keyboard.s"
.include "hgr_14x14_sprite.s"
.include "draw_pointer.s"
.include "log_table.s"
.include "graphics_dome/dome_graphics.inc"
;.include "common_sprites.inc"
.include "graphics_sprites/pointer_sprites.inc"
.include "leveldata_dome.inc"

View File

@ -0,0 +1,285 @@
;====================================
; draw pointer
;====================================
draw_pointer:
lda UPDATE_POINTER
bne really_draw_pointer
rts
really_draw_pointer:
lda #0
sta IN_SPECIAL
sta IN_LEFT
sta IN_RIGHT
jsr save_bg_14x14 ; save old bg
; for now assume the only 14x14 sprites are the pointers
lda CURSOR_X
sta XPOS
lda CURSOR_Y
sta YPOS
; see if inside special region
ldy #LOCATION_SPECIAL_EXIT
lda (LOCATION_STRUCT_L),Y
cmp #$ff
beq finger_not_special ; if $ff not special
; lda (LOCATION_STRUCT_L),Y
; cmp #DIRECTION_ANY
; beq was_any
lda DIRECTION
and #$f
and (LOCATION_STRUCT_L),Y
beq finger_not_special ; only special if facing right way
;was_any:
; see if X1 < X < X2
lda CURSOR_X
ldy #LOCATION_SPECIAL_X1
cmp (LOCATION_STRUCT_L),Y
bcc finger_not_special ; blt
ldy #LOCATION_SPECIAL_X2
cmp (LOCATION_STRUCT_L),Y
bcs finger_not_special ; bge
; see if Y1 < Y < Y2
lda CURSOR_Y
ldy #LOCATION_SPECIAL_Y1
cmp (LOCATION_STRUCT_L),Y
bcc finger_not_special ; blt
ldy #LOCATION_SPECIAL_Y2
cmp (LOCATION_STRUCT_L),Y
bcs finger_not_special ; bge
; we made it this far, we are special
finger_grab:
lda #1
sta IN_SPECIAL
lda CURSOR_VISIBLE ; if not visible skip
bne really_draw_grab
rts
really_draw_grab:
lda DIRECTION
and #DIRECTION_ONLY_POINT
bne special_but_point
lda #<grab_sprite
sta INL
lda #>grab_sprite
jmp finger_draw
special_but_point:
jmp finger_point
finger_not_special:
lda CURSOR_VISIBLE ; if not visible skip
bne really_not_special
rts
really_not_special:
; check for left/right
lda CURSOR_X
cmp #7
bcc check_cursor_left ; blt
cmp #$f0 ; check if off left side of screen
bcs check_cursor_left ; bge
cmp #33
bcs check_cursor_right ; bge
; otherwise, finger_point
finger_point:
.if 0
; holding item takes precednce
lda HOLDING_ITEM
cmp #HOLDING_MATCH
beq match_finger
cmp #HOLDING_LIT_MATCH
beq match_lit_finger
cmp #HOLDING_KEY
beq key_finger
lda HOLDING_PAGE
and #$c0
beq real_finger_point
cmp #HOLDING_BLUE_PAGE
beq blue_finger
cmp #HOLDING_WHITE_PAGE
beq white_finger
cmp #HOLDING_RED_PAGE
; beq red_finger
red_finger:
lda #<finger_red_page_sprite
sta INL
lda #>finger_red_page_sprite
jmp finger_draw
; all that's left is key
key_finger:
lda #<finger_key_sprite
sta INL
lda #>finger_key_sprite
jmp finger_draw
match_finger:
lda #<finger_match_sprite
sta INL
lda #>finger_match_sprite
jmp finger_draw
match_lit_finger:
lda #<finger_match_lit_sprite
sta INL
lda #>finger_match_lit_sprite
jmp finger_draw
blue_finger:
lda #<finger_blue_page_sprite
sta INL
lda #>finger_blue_page_sprite
jmp finger_draw
white_finger:
lda #<finger_white_page_sprite
sta INL
lda #>finger_white_page_sprite
jmp finger_draw
.endif
real_finger_point:
lda #<point_sprite
sta INL
lda #>point_sprite
jmp finger_draw
check_cursor_left:
jsr lookup_direction
and #$f
beq finger_point
cmp #$1
beq finger_left
bne finger_uturn_left
check_cursor_right:
jsr lookup_direction
and #$f0
beq finger_point
cmp #$10
beq finger_right
bne finger_uturn_right
lookup_direction:
lda DIRECTION
and #$f
tay
lda log2_table,Y
asl
asl
asl
asl
clc
ldy #LOCATION_BGS
adc (LOCATION_STRUCT_L),Y
tay
lda direction_lookup,Y
rts
finger_left:
lda #1
sta IN_LEFT
lda #<left_sprite
sta INL
lda #>left_sprite
jmp finger_draw
finger_right:
lda #1
sta IN_RIGHT
lda #<right_sprite
sta INL
lda #>right_sprite
jmp finger_draw
finger_uturn_left:
lda #2
sta IN_LEFT
lda #<uturn_left_sprite
sta INL
lda #>uturn_left_sprite
jmp finger_draw
finger_uturn_right:
lda #2
sta IN_RIGHT
lda #<uturn_right_sprite
sta INL
lda #>uturn_right_sprite
jmp finger_draw
finger_draw:
sta INH
jsr hgr_draw_sprite_14x14
no_draw_pointer:
lda #0
sta UPDATE_POINTER
rts
; 0 = point
; 1 = left
; 2 = left u-turn
; R/L EWSN 0010
; 1010
direction_lookup:
direction_lookup_n:
.byte $00,$00,$22,$22,$01,$01,$21,$21,$10,$10,$12,$12,$11,$11,$11,$11
direction_lookup_s:
; N S SN W WN WS WSN
.byte $00, $22,$00,$22,$10,$12,$10,$12
; E EN ES ESN EW EWN EWS EWSN
.byte $01,$02,$01,$21,$11,$11,$11,$11
direction_lookup_e:
.byte $00,$01,$10,$11,$22,$21,$12,$11,$00,$01,$10,$11,$22,$21,$12,$11
direction_lookup_w:
.byte $00,$10,$01,$11,$00,$10,$01,$11,$22,$12,$21,$11,$22,$12,$21,$11

View File

@ -1,36 +0,0 @@
include ../../../Makefile.inc
ZX02 = ~/research/6502_compression/zx02.git/build/zx02 -f
PNG_TO_HGR = ../../../utils/hgr-utils/png2hgr
LINKER_SCRIPTS = ../../../linker_scripts
DOS33 = ../../../utils/dos33fs-utils/dos33
EMPTY_DISK = ../../../empty_disk/empty.dsk
TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft
PNG2GR = ../../../utils/gr-utils/png2gr
PNG2SPRITES = ../../../utils/gr-utils/png2sprites
HGR_SPRITE = ../../../utils/hgr-utils/hgr_make_sprite
all: maglev1.hgr.zx02
####
#title_sprites.inc: title_sprites.png
# $(HGR_SPRITE) -s -l title_sprite title_sprites.png 0 0 167 95 > title_sprites.inc
# $(HGR_SPRITE) -s -l ball_bg title_sprites.png 0 96 6 104 >> title_sprites.inc
# $(HGR_SPRITE) -s -l ball0 title_sprites.png 0 105 6 113 >> title_sprites.inc
# $(HGR_SPRITE) -s -l ball1 title_sprites.png 0 114 6 122 >> title_sprites.inc
# $(HGR_SPRITE) -s -l ball2 title_sprites.png 0 123 6 131 >> title_sprites.inc
####
maglev1.hgr.zx02: maglev1.hgr
$(ZX02) maglev1.hgr maglev1.hgr.zx02
maglev1.hgr: maglev1.png
$(PNG_TO_HGR) maglev1.png > maglev1.hgr
####
clean:
rm -f *~ *.o *.lst *.zx02 *.hgr

View File

@ -0,0 +1,39 @@
include ../../../Makefile.inc
ZX02 = ~/research/6502_compression/zx02.git/build/zx02 -f
PNG_TO_HGR = ../../../utils/hgr-utils/png2hgr
LINKER_SCRIPTS = ../../../linker_scripts
DOS33 = ../../../utils/dos33fs-utils/dos33
EMPTY_DISK = ../../../empty_disk/empty.dsk
TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft
PNG2GR = ../../../utils/gr-utils/png2gr
PNG2SPRITES = ../../../utils/gr-utils/png2sprites
HGR_SPRITE = ../../../utils/hgr-utils/hgr_make_sprite
all: dome_graphics.inc
dome_graphics.inc: \
maglev1_n.hgr.zx02 maglev1_s.hgr.zx02 maglev1_e.hgr.zx02 maglev1_w.hgr.zx02 \
maglev2_n.hgr.zx02 \
maglev3_n.hgr.zx02
echo "maglev1_n_zx02: .incbin \"maglev1_n.hgr.zx02\"" > dome_graphics.inc
echo "maglev1_s_zx02: .incbin \"maglev1_s.hgr.zx02\"" >> dome_graphics.inc
echo "maglev1_e_zx02: .incbin \"maglev1_e.hgr.zx02\"" >> dome_graphics.inc
echo "maglev1_w_zx02: .incbin \"maglev1_w.hgr.zx02\"" >> dome_graphics.inc
echo "maglev2_n_zx02: .incbin \"maglev2_n.hgr.zx02\"" >> dome_graphics.inc
echo "maglev3_n_zx02: .incbin \"maglev3_n.hgr.zx02\"" >> dome_graphics.inc
####
%.hgr: %.png
$(PNG_TO_HGR) $< > $@
%.hgr.zx02: %.hgr
$(ZX02) -f $< $@
####
clean:
rm -f *~ *.o *.lst *.zx02 *.hgr dome_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.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

View File

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View File

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 29 KiB

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: projector_graphics.inc
projector_graphics.inc: \
doorway_n.hgr.zx02 doorway_s.hgr.zx02 \
projector_n.hgr.zx02 projector_s.hgr.zx02
echo "projector_n_zx02: .incbin \"projector_n.hgr.zx02\"" > projector_graphics.inc
echo "projector_s_zx02: .incbin \"projector_s.hgr.zx02\"" >> projector_graphics.inc
echo "doorway_n_zx02: .incbin \"doorway_n.hgr.zx02\"" >> projector_graphics.inc
echo "doorway_s_zx02: .incbin \"doorway_s.hgr.zx02\"" >> projector_graphics.inc
####
%.hgr: %.png
$(PNG_TO_HGR) $< > $@
%.hgr.zx02: %.hgr
$(ZX02) -f $< $@
####
clean:
rm -f *~ *.o *.lst *.zx02 *.hgr projector_graphics.inc

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -0,0 +1,42 @@
include ../../../Makefile.inc
ZX02 = ~/research/6502_compression/zx02.git/build/zx02 -f
PNG_TO_HGR = ../../../utils/hgr-utils/png2hgr
LINKER_SCRIPTS = ../../../linker_scripts
DOS33 = ../../../utils/dos33fs-utils/dos33
EMPTY_DISK = ../../../empty_disk/empty.dsk
TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft
PNG2GR = ../../../utils/gr-utils/png2gr
PNG2SPRITES = ../../../utils/gr-utils/png2sprites
HGR_SPRITE = ../../../utils/hgr-utils/hgr_make_sprite
all: pointer_sprites.inc
####
pointer_sprites.inc: pointer_sprites.png
$(HGR_SPRITE) -l point_sprite pointer_sprites.png 0 0 13 14 > pointer_sprites.inc
$(HGR_SPRITE) -l point_mask pointer_sprites.png 0 15 13 29 >> pointer_sprites.inc
$(HGR_SPRITE) -l grab_sprite pointer_sprites.png 28 0 41 14 >> pointer_sprites.inc
$(HGR_SPRITE) -l grab_mask pointer_sprites.png 28 15 41 29 >> pointer_sprites.inc
$(HGR_SPRITE) -l right_sprite pointer_sprites.png 0 30 13 44 >> pointer_sprites.inc
$(HGR_SPRITE) -l right_mask pointer_sprites.png 0 45 13 59 >> pointer_sprites.inc
$(HGR_SPRITE) -l left_sprite pointer_sprites.png 28 30 41 44 >> pointer_sprites.inc
$(HGR_SPRITE) -l left_mask pointer_sprites.png 28 45 41 59 >> pointer_sprites.inc
$(HGR_SPRITE) -l uturn_right_sprite pointer_sprites.png 0 60 13 74 >> pointer_sprites.inc
$(HGR_SPRITE) -l uturn_right_mask pointer_sprites.png 0 75 13 89 >> pointer_sprites.inc
$(HGR_SPRITE) -l uturn_left_sprite pointer_sprites.png 28 60 41 74 >> pointer_sprites.inc
$(HGR_SPRITE) -l uturn_left_mask pointer_sprites.png 28 75 41 89 >> pointer_sprites.inc
####
clean:
rm -f *~ *.o *.lst *.zx02 *.hgr pointer_sprites.inc

Binary file not shown.

After

Width:  |  Height:  |  Size: 1015 B

View File

@ -0,0 +1,87 @@
include ../../../Makefile.inc
ZX02 = ~/research/6502_compression/zx02.git/build/zx02 -f
PNG_TO_HGR = ../../../utils/hgr-utils/png2hgr
LINKER_SCRIPTS = ../../../linker_scripts
DOS33 = ../../../utils/dos33fs-utils/dos33
EMPTY_DISK = ../../../empty_disk/empty.dsk
TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft
PNG2GR = ../../../utils/gr-utils/png2gr
PNG2SPRITES = ../../../utils/gr-utils/png2sprites
HGR_SPRITE = ../../../utils/hgr-utils/hgr_make_sprite
all: riven_title.hgr.zx02
####
#title_sprites.inc: title_sprites.png
# $(HGR_SPRITE) -s -l title_sprite title_sprites.png 0 0 167 95 > title_sprites.inc
# $(HGR_SPRITE) -s -l ball_bg title_sprites.png 0 96 6 104 >> title_sprites.inc
# $(HGR_SPRITE) -s -l ball0 title_sprites.png 0 105 6 113 >> title_sprites.inc
# $(HGR_SPRITE) -s -l ball1 title_sprites.png 0 114 6 122 >> title_sprites.inc
# $(HGR_SPRITE) -s -l ball2 title_sprites.png 0 123 6 131 >> title_sprites.inc
####
maglev1_n.hgr.zx02: maglev1_n.hgr
$(ZX02) maglev1_n.hgr maglev1_n.hgr.zx02
maglev1_n.hgr: maglev1_n.png
$(PNG_TO_HGR) maglev1_n.png > maglev1_n.hgr
####
maglev1_s.hgr.zx02: maglev1_s.hgr
$(ZX02) maglev1_s.hgr maglev1_s.hgr.zx02
maglev1_s.hgr: maglev1_s.png
$(PNG_TO_HGR) maglev1_s.png > maglev1_s.hgr
####
maglev1_e.hgr.zx02: maglev1_e.hgr
$(ZX02) maglev1_e.hgr maglev1_e.hgr.zx02
maglev1_e.hgr: maglev1_e.png
$(PNG_TO_HGR) maglev1_e.png > maglev1_e.hgr
####
maglev1_w.hgr.zx02: maglev1_w.hgr
$(ZX02) maglev1_w.hgr maglev1_w.hgr.zx02
maglev1_w.hgr: maglev1_w.png
$(PNG_TO_HGR) maglev1_w.png > maglev1_w.hgr
####
maglev2_n.hgr.zx02: maglev2_n.hgr
$(ZX02) maglev2_n.hgr maglev2_n.hgr.zx02
maglev2_n.hgr: maglev2_n.png
$(PNG_TO_HGR) maglev2_n.png > maglev2_n.hgr
####
maglev3_n.hgr.zx02: maglev3_n.hgr
$(ZX02) maglev3_n.hgr maglev3_n.hgr.zx02
maglev3_n.hgr: maglev3_n.png
$(PNG_TO_HGR) maglev3_n.png > maglev3_n.hgr
####
riven_title.hgr.zx02: riven_title.hgr
$(ZX02) riven_title.hgr riven_title.hgr.zx02
riven_title.hgr: riven_title.png
$(PNG_TO_HGR) riven_title.png > riven_title.hgr
####
clean:
rm -f *~ *.o *.lst *.zx02 *.hgr

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -5,87 +5,71 @@
; SPRITE in INL/INH
; Location at CURSOR_X CURSOR_Y
; left sprite AT INL/INH
; right sprite at INL/INH + 14
; left mask at INL/INH + 28
; right mask at INL/INH + 42
; sprite at INL/INH
; mask at INL/INH + 28
hgr_draw_sprite_14x14:
; set up pointers
; set up pointers for sprite
lda INL
sta hds_smc1+1
lda INH
sta hds_smc1+2
clc
lda INL
adc #14
sta hds_smc2+1
lda INH
adc #0
sta hds_smc1+2
sta hds_smc2+2
; setup pointers for mask
clc
lda INL
adc #28
sta hds_smc3+1
lda INH
adc #0
sta hds_smc3+2
clc
lda INL
adc #42
sta hds_smc4+1
lda INH
adc #0
sta hds_smc3+2
sta hds_smc4+2
ldx #0
hgr_14x14_sprite_yloop:
txa
pha
lsr ; get Ypos from X
clc
adc CURSOR_Y
tax
lda hposn_high,X
tay ; point GBASL/GBASH to Ypos row
lda hposn_high,Y
sta GBASH
lda hposn_low,X
lda hposn_low,Y
sta GBASL
; ldx #0
; ldy #0
; pla
; tax
; calc GBASL/GBASH
; jsr HPOSN ; (Y,X),(A) (values stored in HGRX,XH,Y)
ldy CURSOR_X ; point to Xpos
pla
tax
ldy CURSOR_X
lda (GBASL),Y
lda (GBASL),Y ; load background color
hds_smc3:
and point_mask_l,X
and point_mask,X
hds_smc1:
ora point_sprite_l,X
ora point_sprite,X
sta (GBASL),Y
iny
inx
lda (GBASL),Y
hds_smc4:
and point_mask_r,X
and point_mask,X
hds_smc2:
ora point_sprite_r,X
ora point_sprite,X
sta (GBASL),Y
inx
cpx #14
cpx #28
bne hgr_14x14_sprite_yloop
rts

View File

@ -34,10 +34,10 @@ js_check:
js_check_left:
; lda value0
; cmp #$20
; bcs js_check_right ; if less than 32, left
; lda #'A'
; bne handle_input
cmp #$20
bcs js_check_right ; if less than 32, left
lda #'A'
bne handle_input
js_check_right:
cmp #$40
@ -47,9 +47,9 @@ js_check_right:
js_check_up:
; lda value1
; cmp #$20
; bcs js_check_down
; lda #'W'
cmp #$20
bcs js_check_down
lda #'W'
bne handle_input
@ -84,39 +84,39 @@ handle_input:
inc UPDATE_POINTER
pla
;check_sound:
; cmp #$14 ; control-T
; bne check_joystick
;
; lda SOUND_STATUS
; eor #SOUND_DISABLED
; sta SOUND_STATUS
; jmp done_keypress
check_sound:
cmp #$14 ; control-T
bne check_joystick
lda SOUND_STATUS
eor #SOUND_DISABLED
sta SOUND_STATUS
jmp done_keypress
; can't be ^J as that's the same as down
;check_joystick:
check_joystick:
; cmp #$10 ; control-P
; cmp #'J'
; bne check_load
cmp #'J'
bne check_load
; lda JOYSTICK_ENABLED
; eor #1
; sta JOYSTICK_ENABLED
; jmp done_keypress
lda JOYSTICK_ENABLED
eor #1
sta JOYSTICK_ENABLED
jmp done_keypress
;check_load:
; cmp #$C ; control-L
; bne check_save
check_load:
cmp #$C ; control-L
bne check_save
; jsr load_game
; jmp done_keypress
jmp done_keypress
;check_save:
; cmp #$13 ; control-S
; bne check_left
check_save:
cmp #$13 ; control-S
bne check_left
; jsr save_game
; jmp done_keypress
jmp done_keypress
check_left:
cmp #'A'
@ -205,29 +205,49 @@ check_return:
return_pressed:
; lda IN_SPECIAL
; beq not_special_return
lda IN_SPECIAL
beq not_special_return
;special_return:
; jsr handle_special
special_return:
jsr handle_special
; special case, don't make cursor visible
; jmp no_keypress
jmp no_keypress
;not_special_return:
not_special_return:
; lda IN_RIGHT
; beq not_right_return
lda IN_RIGHT
beq not_right_return
; cmp #1
; beq right_return
cmp #1
beq right_return
;right_uturn:
; jsr uturn
; jmp no_keypress
right_uturn:
jsr uturn
jmp no_keypress
;right_return:
; jsr turn_right
right_return:
jsr turn_right
jmp no_keypress
not_right_return:
lda IN_LEFT
beq not_left_return
cmp #1
beq left_return
left_uturn:
jsr uturn
jmp no_keypress
left_return:
jsr turn_left
jmp no_keypress
not_left_return:
jsr go_forward
jmp no_keypress
done_keypress:
@ -238,4 +258,205 @@ no_keypress:
bit KEYRESET
rts
;============================
; handle_special
;===========================
; set up jump table fakery
handle_special:
ldy #LOCATION_SPECIAL_FUNC+1
lda (LOCATION_STRUCT_L),Y
pha
dey
lda (LOCATION_STRUCT_L),Y
pha
rts
;=============================
; change direction
;=============================
change_direction:
; load background
lda DIRECTION
bpl no_split
; split text/graphics
bit TEXTGR
; also change sprite cutoff
; not needed for HGR
; ldx #40
; stx psc_smc1+1
;; stx psc_smc2+1
jmp done_split
no_split:
bit FULLGR
; also change sprite cutoff
; ldx #48
; stx psc_smc1+1
;; stx psc_smc2+1
done_split:
and #$f ; mask off special flags
tay
lda log2_table,Y
asl
clc
adc #LOCATION_NORTH_BG
tay
lda (LOCATION_STRUCT_L),Y
sta ZX0_src
iny
lda (LOCATION_STRUCT_L),Y
sta ZX0_src+1
lda #$20 ; decompress to hgr page1
jsr full_decomp
rts
;=============================
; change location
;=============================
change_location:
; reset graphics
bit SET_GR
; clear IN_SPECIAL
lda #0
sta IN_SPECIAL
sta IN_RIGHT
sta IN_LEFT
; reset pointer to not visible, centered
sta ANIMATE_FRAME
sta CURSOR_VISIBLE
lda #20
sta CURSOR_X
lda #89
sta CURSOR_Y
lda LOCATION
asl
tay
lda (LOCATIONS_L),Y
sta LOCATION_STRUCT_L
iny
lda (LOCATIONS_L),Y
sta LOCATION_STRUCT_H
jsr change_direction
rts
;==========================
; go forward
;===========================
go_forward:
; update new location
lda DIRECTION
and #$f
tay
lda log2_table,Y
clc
adc #LOCATION_NORTH_EXIT
tay
lda (LOCATION_STRUCT_L),Y
cmp #$ff
beq cant_go_forward
sta LOCATION
; update new direction
lda DIRECTION
and #$f
tay
lda log2_table,Y
clc
adc #LOCATION_NORTH_EXIT_DIR
tay
lda (LOCATION_STRUCT_L),Y
sta DIRECTION
jsr change_location
cant_go_forward:
rts
;==========================
; turn left
;===========================
turn_left:
lda DIRECTION
and #$f
cmp #DIRECTION_N
beq go_west
cmp #DIRECTION_W
beq go_south
cmp #DIRECTION_S
beq go_east
bne go_north
;==========================
; turn right
;===========================
turn_right:
lda DIRECTION
and #$f
cmp #DIRECTION_N
beq go_east
cmp #DIRECTION_E
beq go_south
cmp #DIRECTION_S
beq go_west
bne go_north
;==========================
; uturn
;===========================
uturn:
lda DIRECTION
and #$f
cmp #DIRECTION_N
beq go_south
cmp #DIRECTION_W
beq go_east
cmp #DIRECTION_S
beq go_north
bne go_west
go_north:
lda #DIRECTION_N
jmp done_turning
go_east:
lda #DIRECTION_E
jmp done_turning
go_south:
lda #DIRECTION_S
jmp done_turning
go_west:
lda #DIRECTION_W
jmp done_turning
done_turning:
sta DIRECTION
jsr change_direction
rts

View File

@ -0,0 +1,67 @@
;===============================================
; level data for Dome Island level
;===============================================
locations:
.word location0,location1,location2
; RIVEN_MAGLEV1 -- maglev steps
location0:
.byte RIVEN_MAGLEV2 ; 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 maglev1_n_zx02 ; north bg
.word maglev1_s_zx02 ; south bg
.word maglev1_e_zx02 ; east bg
.word maglev1_w_zx02 ; west bg
.byte BG_EAST|BG_NORTH|BG_SOUTH|BG_WEST ; all bgs
.byte DIRECTION_E ; special exit
.byte 9,29 ; special x
.byte 2,46 ; special y
.word location0-1 ; FIXME
; RIVEN_MAGLEV2 -- maglev steps
location1:
.byte RIVEN_MAGLEV3 ; 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 maglev2_n_zx02 ; north bg
.word $0000 ; south bg
.word $0000 ; east bg
.word $0000 ; west bg
.byte BG_NORTH
.byte DIRECTION_E ; special exit
.byte 9,29 ; special x
.byte 2,46 ; special y
.word location1-1 ; special function FIXME
; RIVEN_MAGLEV3 -- maglev inside
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 maglev3_n_zx02 ; north bg
.word $0000 ; south bg
.word $0000 ; east bg
.word $0000 ; west bg
.byte BG_NORTH
.byte DIRECTION_E ; special exit
.byte 9,29 ; special x
.byte 2,46 ; special y
.word location2-1 ; FIXME

View File

@ -193,11 +193,13 @@ copy_filename_done:
rts
filenames:
.word main_filename
main_filename:
.byte "MAIN",0
.word title_filename
.word dome_filename
title_filename:
.byte "TITLE",0
dome_filename:
.byte "DOME",0
;===================================================
;===================================================

View File

@ -0,0 +1,5 @@
log2_table:
; 0 1 2 3 4 5 6 7 8
.byte 0,0,1,1,2,2,2,2,3

View File

@ -1,552 +0,0 @@
; Riven graphics
; by deater (Vince Weaver) <vince@deater.net>
; Zero Page
.include "zp.inc"
.include "hardware.inc"
.include "common_defines.inc"
div7_table = $9C00
mod7_table = $9D00
hposn_high = $9E00
hposn_low = $9F00
riven_hgr:
;===================
; init screen
;===================
jsr TEXT
jsr HOME
bit KEYRESET
bit SET_GR
bit PAGE1
bit HIRES
bit FULLGR
;===================
; machine workarounds
;===================
; mostly IIgs
;===================
; thanks to 4am who provided this code from Total Replay
lda ROM_MACHINEID
cmp #$06
bne not_a_iigs
sec
jsr $FE1F ; check for IIgs
bcs not_a_iigs
; gr/text page2 handling broken on early IIgs models
; this enables the workaround
jsr ROM_TEXT2COPY ; set alternate display mode on IIgs
cli ; enable VBL interrupts
; also set background color to black instead of blue
lda NEWVIDEO
and #%00011111 ; bit 7 = 0 -> IIgs Apple II-compat video modes
; bit 6 = 0 -> IIgs 128K memory map same as IIe
; bit 5 = 0 -> IIgs DHGR is color, not mono
; bits 0-4 unchanged
sta NEWVIDEO
lda #$F0
sta TBCOLOR ; white text on black background
lda #$00
sta CLOCKCTL ; black border
sta CLOCKCTL ; set twice for VidHD
not_a_iigs:
;===================
; Load hires graphics
;===================
reload_everything:
lda #<new_title
sta ZX0_src
lda #>new_title
sta ZX0_src+1
lda #$20 ; decompress to hgr page1
jsr full_decomp
;===================================
; detect if we have a language card
; and load sound into it if possible
;===================================
; lda #0
; sta SOUND_STATUS ; clear out, sound enabled
; jsr detect_language_card
; bcs no_language_card
; update sound status
; lda SOUND_STATUS
; ora #SOUND_IN_LC
; sta SOUND_STATUS
; load sounds into LC
; read ram, write ram, use $d000 bank1
; bit $C08B
; bit $C08B
; lda #<linking_noise_compressed
; sta getsrc_smc+1
; lda #>linking_noise_compressed
; sta getsrc_smc+2
; lda #$D0 ; decompress to $D000
; jsr decompress_lzsa2_fast
;blah:
; read rom, nowrite, use $d000 bank1
; bit $C08A
no_language_card:
;===================================
; Setup Mockingboard
;===================================
; lda #0
; sta DONE_PLAYING
; sta LOOP
; detect mockingboard
; jsr mockingboard_detect
; bcc mockingboard_notfound
mockingboard_found:
;; jsr mockingboard_patch ; patch to work in slots other than 4?
; lda SOUND_STATUS
; ora #SOUND_MOCKINGBOARD
; sta SOUND_STATUS
;=======================
; Set up 50Hz interrupt
;========================
; jsr mockingboard_init
; jsr mockingboard_setup_interrupt
;============================
; Init the Mockingboard
;============================
; jsr reset_ay_both
; jsr clear_ay_both
;==================
; init song
;==================
; jsr pt3_init_song
; jmp done_setup_sound
mockingboard_notfound:
done_setup_sound:
;===================================
; init
;===================================
lda #$20
sta HGR_PAGE
jsr hgr_make_tables
lda #0
sta JOYSTICK_ENABLED
sta UPDATE_POINTER
lda #20
sta CURSOR_X
sta CURSOR_Y
jsr save_bg_14x14 ; save old bg
blah:
jsr handle_keypress
lda UPDATE_POINTER
beq no_draw_pointer
lda #0
sta UPDATE_POINTER
jsr save_bg_14x14 ; save old bg
lda #<finger_point_sprite
sta INL
lda #>finger_point_sprite
sta INH
jsr hgr_draw_sprite_14x14
no_draw_pointer:
jmp blah
.if 0
;===================================
; Do Intro Sequence
;===================================
; wait a bit at LOAD screen
lda #100
jsr wait_a_bit
;===================================
; Draw title message
;===================================
lda #<title_sprite
sta INL
lda #>title_sprite
sta INH
lda #8
sta SPRITE_X
lda #48
sta SPRITE_Y
lda #$20
sta DRAW_PAGE
jsr hgr_draw_sprite
;===========================
; title loop
;==========================
lda #0
sta WHICH_CURSOR
sta FRAMEL
sta FRAMEH
sta MENU_OPTION
title_loop:
lda KEYPRESS
bpl done_title_keyboard
bit KEYRESET
and #$7f ; clear high bit
and #$df ; convert to uppercase
cmp #13 ; exit if enter pressed
beq done_intro
cmp #'H'
bne not_help
jsr print_help
not_help:
check_up:
cmp #'W'
beq up_pressed
cmp #$0B ; up key
bne check_down
up_pressed:
lda MENU_OPTION
beq done_title_keyboard
jsr erase_marker
dec MENU_OPTION
jsr draw_marker
jmp done_title_keyboard
check_down:
cmp #'S'
beq down_pressed
cmp #$0A ; down key
bne done_title_keyboard
down_pressed:
lda MENU_OPTION
cmp #7
beq done_title_keyboard
jsr erase_marker
inc MENU_OPTION
jsr draw_marker
jmp done_title_keyboard
done_title_keyboard:
inc FRAMEL
bne noframeoflo
inc FRAMEH
noframeoflo:
lda FRAMEL
bne no_adjust_cursor
lda FRAMEH
and #$0f
bne no_adjust_cursor
clc
lda WHICH_CURSOR
adc #1
cmp #3
bne no_cursor_oflo
lda #0
no_cursor_oflo:
sta WHICH_CURSOR
jsr draw_marker
no_adjust_cursor:
jmp title_loop
done_intro:
; restore to full screen (no text)
lda MENU_OPTION
cmp #0
beq new_game ; new game
cmp #1
beq nothing ; continue game
cmp #2
beq do_story
nothing:
jmp title_loop
;=====================
;=====================
; do story
;=====================
;=====================
do_story:
bit FULLGR
bit LORES
lda #LOAD_STORY
sta WHICH_LOAD ; assume new game (mars map)
rts
;=====================
;=====================
; new game
;=====================
;=====================
new_game:
init_vars:
bit FULLGR
bit LORES
lda #0
sta ANIMATE_FRAME
sta FRAMEL
sta FRAMEH
sta JOYSTICK_ENABLED
sta LEVEL_OVER
sta SCORE0 ; set score to 0
sta SCORE1
sta SCORE2
sta RAYGUNS ; number of laser blasts
sta KEYCARDS
sta SHIP_PARTS
sta POGO
lda #4 ; number of lives
sta KEENS
;============================
; set up initial location
lda #10
sta MARS_TILEX
lda #34
sta MARS_TILEY
lda #0
sta MARS_X
sta MARS_Y
lda #LOAD_MARS
sta WHICH_LOAD ; assume new game (mars map)
rts
.endif
;==========================
; includes
;==========================
; .include "gr_pageflip.s"
; .include "gr_copy.s"
; .include "wait_a_bit.s"
; .include "gr_offsets.s"
.include "zx02_optim.s"
; .include "text_help.s"
; .include "gr_fast_clear.s"
; .include "text_print.s"
; .include "hgr_sprite.s"
.include "hgr_tables.s"
; .include "lc_detect.s"
.include "keyboard.s"
.include "hgr_14x14_sprite.s"
new_title:
.incbin "graphics/maglev1.hgr.zx02"
.include "common_sprites.inc"
.if 0
.include "graphics/title_sprites.inc"
;====================================
; wait for keypress or a few seconds
;====================================
wait_a_bit:
bit KEYRESET
tax
keyloop:
lda #200 ; delay a bit
jsr WAIT
lda KEYPRESS
bmi done_keyloop
; bmi keypress_exit
dex
bne keyloop
done_keyloop:
bit KEYRESET
cmp #'H'|$80
bne really_done_keyloop
lda #$04
sta DRAW_PAGE
jsr print_help
bit SET_GR
lda #$20
sta DRAW_PAGE
bit PAGE1
ldx #100
jmp keyloop
really_done_keyloop:
rts
;=============================
; erase
;=============================
erase_marker:
lda #<ball_bg
sta INL
lda #>ball_bg
sta INH
lda #12
sta SPRITE_X
lda MENU_OPTION
asl
asl
asl
clc
adc #55
sta SPRITE_Y
; lda #$20
; sta DRAW_PAGE
jsr hgr_draw_sprite
rts
;=============================
; draw
;=============================
draw_marker:
ldx WHICH_CURSOR
lda cursor_lookup_l,X
sta INL
lda cursor_lookup_h,X
sta INH
lda #12
sta SPRITE_X
lda MENU_OPTION
asl
asl
asl
clc
adc #55
sta SPRITE_Y
; lda #$20
; sta DRAW_PAGE
jsr hgr_draw_sprite
rts
cursor_lookup_h:
.byte >ball0,>ball1,>ball2
cursor_lookup_l:
.byte <ball0,<ball1,<ball2
.endif

211
games/riven_hgr/title.s Normal file
View File

@ -0,0 +1,211 @@
; Riven HGR Title Screen
; by deater (Vince Weaver) <vince@deater.net>
; Zero Page
.include "zp.inc"
.include "hardware.inc"
.include "common_defines.inc"
riven_title:
;===================
; init screen
;===================
jsr TEXT
jsr HOME
bit KEYRESET
bit SET_GR
bit PAGE1
bit HIRES
bit FULLGR
;===================
; machine workarounds
;===================
; mostly IIgs
;===================
; thanks to 4am who provided this code from Total Replay
lda ROM_MACHINEID
cmp #$06
bne not_a_iigs
sec
jsr $FE1F ; check for IIgs
bcs not_a_iigs
; gr/text page2 handling broken on early IIgs models
; this enables the workaround
jsr ROM_TEXT2COPY ; set alternate display mode on IIgs
cli ; enable VBL interrupts
; also set background color to black instead of blue
lda NEWVIDEO
and #%00011111 ; bit 7 = 0 -> IIgs Apple II-compat video modes
; bit 6 = 0 -> IIgs 128K memory map same as IIe
; bit 5 = 0 -> IIgs DHGR is color, not mono
; bits 0-4 unchanged
sta NEWVIDEO
lda #$F0
sta TBCOLOR ; white text on black background
lda #$00
sta CLOCKCTL ; black border
sta CLOCKCTL ; set twice for VidHD
not_a_iigs:
;===================
; Load hires graphics
;===================
reload_everything:
lda #<riven_title_image
sta ZX0_src
lda #>riven_title_image
sta ZX0_src+1
lda #$20 ; decompress to hgr page1
jsr full_decomp
;===================================
; detect if we have a language card
; and load sound into it if possible
;===================================
; lda #0
; sta SOUND_STATUS ; clear out, sound enabled
; jsr detect_language_card
; bcs no_language_card
; update sound status
; lda SOUND_STATUS
; ora #SOUND_IN_LC
; sta SOUND_STATUS
; load sounds into LC
; read ram, write ram, use $d000 bank1
; bit $C08B
; bit $C08B
; lda #<linking_noise_compressed
; sta getsrc_smc+1
; lda #>linking_noise_compressed
; sta getsrc_smc+2
; lda #$D0 ; decompress to $D000
; jsr decompress_lzsa2_fast
;blah:
; read rom, nowrite, use $d000 bank1
; bit $C08A
no_language_card:
;===================================
; Setup Mockingboard
;===================================
; lda #0
; sta DONE_PLAYING
; sta LOOP
; detect mockingboard
; jsr mockingboard_detect
; bcc mockingboard_notfound
mockingboard_found:
;; jsr mockingboard_patch ; patch to work in slots other than 4?
; lda SOUND_STATUS
; ora #SOUND_MOCKINGBOARD
; sta SOUND_STATUS
;=======================
; Set up 50Hz interrupt
;========================
; jsr mockingboard_init
; jsr mockingboard_setup_interrupt
;============================
; Init the Mockingboard
;============================
; jsr reset_ay_both
; jsr clear_ay_both
;==================
; init song
;==================
; jsr pt3_init_song
; jmp done_setup_sound
mockingboard_notfound:
done_setup_sound:
;===================================
; init
;===================================
lda #$20
sta HGR_PAGE
jsr hgr_make_tables
lda #0
sta JOYSTICK_ENABLED
sta UPDATE_POINTER
sta HOLDING_ITEM
sta HOLDING_PAGE
lda #20
sta CURSOR_X
sta CURSOR_Y
;===================================
; Do Intro Sequence
;===================================
; wait a bit at LOAD screen
lda #100
jsr wait_a_bit
lda #RIVEN_MAGLEV1
sta LOCATION
lda #DIRECTION_N
sta DIRECTION
lda #LOAD_DOME
sta WHICH_LOAD ; assume new game (dome island)
rts
;==========================
; includes
;==========================
.include "zx02_optim.s"
.include "hgr_tables.s"
.include "wait_a_bit.s"
; .include "lc_detect.s"
riven_title_image:
.incbin "graphics_title/riven_title.hgr.zx02"

View File

@ -0,0 +1,23 @@
;====================================
; wait for keypress or a few seconds
;====================================
wait_a_bit:
bit KEYRESET
tax
keyloop:
lda #200 ; delay a bit
jsr WAIT
lda KEYPRESS
bmi done_keyloop
dex
bne keyloop
done_keyloop:
bit KEYRESET
rts

View File

@ -88,87 +88,34 @@ PATTERN_H = $7F
WHICH_LOAD = $80 ; which file to load
TILEMAP_X = $81 ; upper left corner of tilemap
TILEMAP_Y = $82
DIRECTION = $81
DIRECTION_N = $1
DIRECTION_S = $2
DIRECTION_E = $4
DIRECTION_W = $8
DIRECTION_ANY=$f
DIRECTION_ONLY_POINT = $40 ; do not change pointer to grab
DIRECTION_SPLIT = $80 ; split text/graphics
LOCATION = $82
HOLDING_PAGE = $90
HOLDING_RED_PAGE = $80
HOLDING_BLUE_PAGE = $40
HOLDING_WHITE_PAGE = $C0
HOLDING_ITEM = $91
HOLDING_KEY = $04
HOLDING_LIT_MATCH = $02
HOLDING_MATCH = $01
KEEN_TILEX = $83
KEEN_TILEY = $84
KEEN_X = $85 ; location of protagonist
KEEN_XL = $86 ; 8.8 fixed point?
KEEN_Y = $87
KEEN_DIRECTION = $88
KEEN_WALKING = $89
KEEN_JUMPING = $8A
LASER_OUT = $8B
LASER_TILEX = $8C
LASER_TILEY = $8D
LASER_DIRECTION = $8E
RAYGUNS = $8F
KEYCARDS = $90
INV_RED_KEY = $01
INV_BLUE_KEY = $02
INV_YELLOW_KEY = $04
INV_GREEN_KEY = $08
KEENS = $91
SCORE0 = $92
SCORE1 = $93
SCORE2 = $94
SHIP_PARTS = $95
PARTS_BOTTLE = $01
PARTS_VACUUM = $02
PARTS_BATTERY = $04
PARTS_JOYSTICK = $08
KEEN_FALLING = $96
KEEN_SHOOTING = $97
SOUND_OFFSET = $98
SUPPRESS_WALK = $99
POGO = $9A
LASER_TILE = $9B
TILE_TEMP = $9C
TILEY = $9D
TILE_ODD = $9E
TILEMAP_OFFSET = $9F
MARS_X = $A0
MARS_Y = $A1
MARS_TILEX = $A2
MARS_TILEY = $A3
INITIAL_SOUND = $A4
PLAY_END_SOUND = $A5
APPLEII_MODEL = $A6
CURRENT_LEVEL = $A7
ORACLE_SPOKEN = $A8
MAX_TILE_X = $A9
MAX_TILE_Y = $AA
;START_KEEN_TILEX = $AB
;START_KEEN_TILEY = $AC
;START_TILEMAP_X = $AD
;START_TILEMAP_Y = $AE
NUM_ENEMIES = $AF
HARDTOP_TILES = $B0
ALLHARD_TILES = $B1
SOUNDL = $B2
SOUNDH = $B3
START_LINE_L = $B4 ; story
START_LINE_H = $B5 ; story
SPRITE_Y = $B6 ; title
CURRENT_ROW = $B7 ; title
SPRITE_X = $B8 ; title
HGR_PAGE = $B9 ; title
MENU_OPTION = $BA ; title
WHICH_CURSOR = $BB ; title
CURSOR_X = $BC
CURSOR_Y = $BD
UPDATE_POINTER = $BE
APPLEII_MODEL = $D8
HGR_PAGE = $D9
WHICH_SLOT = $DA
JS_BUTTON_STATE = $DB
CURRENT_DISK = $DC