diff --git a/games/riven_hgr/Makefile b/games/riven_hgr/Makefile index c3bb3f01..a853155d 100644 --- a/games/riven_hgr/Makefile +++ b/games/riven_hgr/Makefile @@ -11,7 +11,7 @@ PRODOS = ../../utils/prodos-utils/prodos PRODOS_RAW = ../../utils/prodos-utils/prodos_raw all: riven_disk00.dsk \ - riven_disk01.dsk riven_disk02.dsk \ + riven_disk01.dsk riven_disk02.dsk riven_disk03.dsk \ riven_disk38.dsk riven_disk39.dsk \ riven_disk40.dsk riven_disk41.dsk riven_disk43.dsk riven_disk44.dsk \ riven_disk50.dsk \ @@ -78,9 +78,19 @@ riven_disk02.dsk: QBOOT QLOAD TITLE_02 \ $(DOS33_RAW) riven_disk02.dsk 2 0 disk02_files/LEVEL_STEPS1 0 0 $(DOS33_RAW) riven_disk02.dsk 22 0 disk02_files/LEVEL_TOP 0 0 +### - - +riven_disk03.dsk: QBOOT QLOAD TITLE_03 \ + disk03_files/DISK03 \ + disk03_files/LEVEL_OUTSIDE + cp $(EMPTY_DISK)/empty.dsk riven_disk03.dsk + $(DOS33_RAW) riven_disk03.dsk 0 0 QBOOT 0 1 + $(DOS33_RAW) riven_disk03.dsk 0 2 QBOOT 1 1 + $(DOS33_RAW) riven_disk03.dsk 0 4 QBOOT 2 1 + $(DOS33_RAW) riven_disk03.dsk 0 1 disk03_files/DISK03 0 0 + $(DOS33_RAW) riven_disk03.dsk 0 8 TITLE_03 0 0 + $(DOS33_RAW) riven_disk03.dsk 1 0 QLOAD 0 0 + $(DOS33_RAW) riven_disk03.dsk 16 0 disk03_files/LEVEL_OUTSIDE 0 0 ### @@ -279,6 +289,18 @@ title_02.o: title.s zp.inc hardware.inc \ graphics_title/riven_title.hgr.zx02 ca65 -o title_02.o title.s -DDISK=02 -l title_02.lst +#### + +TITLE_03: title_03.o + ld65 -o TITLE_03 title_03.o -C $(LINKER_SCRIPTS)/apple2_4000.inc + +title_03.o: title.s zp.inc hardware.inc \ + qload.inc \ + hgr_tables.s \ + graphics_title/riven_title.hgr.zx02 + ca65 -o title_03.o title.s -DDISK=03 -l title_03.lst + + #### @@ -374,6 +396,9 @@ disk01_files/DISK01: disk02_files/DISK02: cd disk02_files && make +disk03_files/DISK03: + cd disk03_files && make + disk38_files/DISK38: cd disk38_files && make @@ -420,6 +445,11 @@ disk02_files/LEVEL_TOP: #### +disk03_files/LEVEL_OUTSIDE: + cd disk03_files && make + +#### + disk38_files/LEVEL_PROJECTOR: cd disk38_files && make @@ -481,10 +511,13 @@ graphics_title/riven_title.hgr.zx02: clean: rm -f *~ *.o *.lst dts_block generate_common \ QBOOT QLOAD QLOAD_HD \ - TITLE_00 TITLE_01 TITLE_38 TITLE_39 \ + TITLE_00 TITLE_01 TITLE_02 TITLE_03 TITLE_04 TITLE_05 \ + TITLE_38 TITLE_39 \ TITLE_40 TITLE_41 TITLE_43 TITLE_44 TITLE_50 cd disk00_files && make clean cd disk01_files && make clean + cd disk02_files && make clean + cd disk03_files && make clean cd disk38_files && make clean cd disk39_files && make clean cd disk40_files && make clean @@ -498,12 +531,15 @@ clean: distclean: rm -f *~ *.o *.lst generate_common \ QBOOT QLOAD QLOAD_HD \ - TITLE_00 TITLE_01 TITLE_38 TITLE_39 \ + TITLE_00 TITLE_01 TITLE_02 TITLE_03 TITLE_04 TITLE_05 \ + TITLE_38 TITLE_39 \ TITLE_40 TITLE_41 TITLE_43 TITLE_44 TITLE_50 cd graphics_title && make clean cd graphics_sprites && make clean cd disk00_files && make distclean cd disk01_files && make distclean + cd disk02_files && make distclean + cd disk03_files && make distclean cd disk38_files && make distclean cd disk39_files && make distclean cd disk40_files && make distclean @@ -539,12 +575,13 @@ qload.inc: generate_common QLOAD ./generate_common -a 0x1600 -s gr_offsets qload.lst >> qload.inc ./generate_common -a 0x1600 -s clear_gr_all qload.lst >> qload.inc -submit: riven_disk00.dsk riven_disk01.dsk \ +submit: riven_disk00.dsk riven_disk01.dsk riven_disk02.dsk riven_disk03.dsk \ riven_disk38.dsk riven_disk39.dsk \ riven_disk40.dsk riven_disk41.dsk riven_disk43.dsk riven_disk44.dsk \ riven_disk50.dsk riven_hgr.2mg zip riven_hgr.zip riven_disk00.dsk riven_disk01.dsk \ + riven_disk02.dsk riven_disk03.dsk \ riven_disk38.dsk riven_disk39.dsk \ riven_disk40.dsk riven_disk41.dsk riven_disk43.dsk \ riven_disk44.dsk \ @@ -578,6 +615,8 @@ riven_hgr.2mg: dts_block PROBOOTHD QLOAD_HD \ disk02_files/DISK02 \ disk02_files/LEVEL_STEPS1 \ disk02_files/LEVEL_TOP \ + disk03_files/DISK03 \ + disk03_files/LEVEL_OUTSIDE \ disk38_files/DISK38 \ disk38_files/LEVEL_PROJECTOR \ disk39_files/DISK39 \ @@ -629,6 +668,8 @@ riven_hgr.2mg: dts_block PROBOOTHD QLOAD_HD \ $(PRODOS_RAW) riven_hgr.2mg `./dts_block 2 0 2` disk02_files/DISK02 0 0 $(PRODOS_RAW) riven_hgr.2mg `./dts_block 2 2 0` disk02_files/LEVEL_STEPS1 0 0 $(PRODOS_RAW) riven_hgr.2mg `./dts_block 2 22 0` disk02_files/LEVEL_TOP 0 0 + $(PRODOS_RAW) riven_hgr.2mg `./dts_block 3 0 2` disk03_files/DISK03 0 0 + $(PRODOS_RAW) riven_hgr.2mg `./dts_block 3 16 0` disk03_files/LEVEL_OUTSIDE 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 39 0 2` disk39_files/DISK39 0 0 diff --git a/games/riven_hgr/disk02_files/disk02.s b/games/riven_hgr/disk02_files/disk02.s index 8d482dd8..564b4521 100644 --- a/games/riven_hgr/disk02_files/disk02.s +++ b/games/riven_hgr/disk02_files/disk02.s @@ -1,6 +1,6 @@ .include "../zp.inc" .include "../disk01_files/disk01_defines.inc" -;.include "../disk03_files/disk03_defines.inc" +.include "../disk03_files/disk03_defines.inc" ;.include "../disk04_files/disk04_defines.inc" .include "../disk00_files/disk00_defines.inc" @@ -55,16 +55,16 @@ disk_exit_dni_l: ; disk_exit_load: .byte LOAD_PATH - .byte 0 + .byte LOAD_OUTSIDE .byte 0 .byte LOAD_CYAN disk_exit_level: .byte RIVEN_STEPS_BASE - .byte 0 + .byte RIVEN_OUTSIDE .byte 0 .byte 0 disk_exit_direction: .byte DIRECTION_W - .byte 0 + .byte DIRECTION_N .byte 0 .byte 0 diff --git a/games/riven_hgr/disk03_files/Makefile b/games/riven_hgr/disk03_files/Makefile new file mode 100644 index 00000000..8aedd81a --- /dev/null +++ b/games/riven_hgr/disk03_files/Makefile @@ -0,0 +1,47 @@ +include ../../../Makefile.inc + +LINKER_SCRIPTS = ../../../linker_scripts/ + + +all: DISK03 LEVEL_OUTSIDE + +#### + +DISK03: disk03.o + ld65 -o DISK03 disk03.o -C $(LINKER_SCRIPTS)/apple2_4000.inc + +disk03.o: disk03.s ../zp.inc + ca65 -o disk03.o disk03.s -l disk03.lst + +#### + +LEVEL_OUTSIDE: level_outside.o + ld65 -o LEVEL_OUTSIDE level_outside.o -C $(LINKER_SCRIPTS)/apple2_4000.inc + +level_outside.o: level_outside.s \ + ../zp.inc ../hardware.inc ../qload.inc \ + ../common_defines.inc disk03_defines.inc \ + leveldata_outside.inc \ + graphics_outside/outside_graphics.inc + ca65 -o level_outside.o level_outside.s -l level_outside.lst + +#### + +graphics_outside/outside_graphics.inc: + cd graphics_outside && make + +#### + +clean: + rm -f *~ *.o *.lst \ + LEVEL_OUTSIDE + +#### + +distclean: + rm -f *~ *.o *.lst \ + LEVEL_OUTSIDE + cd graphics_outside && make clean + + + diff --git a/games/riven_hgr/disk03_files/disk03.s b/games/riven_hgr/disk03_files/disk03.s new file mode 100644 index 00000000..b434be25 --- /dev/null +++ b/games/riven_hgr/disk03_files/disk03.s @@ -0,0 +1,68 @@ +.include "../zp.inc" +.include "../disk02_files/disk02_defines.inc" +;.include "../disk04_files/disk04_defines.inc" +.include "../disk00_files/disk00_defines.inc" + +which_disk_bcd: + .byte $03 ; BCD + +which_disk_bin: + .byte 3 + +load_address_array: + .byte $40,$40,$40,$40 ; TITLE, STEPS1,STEPS3,OUTSIDE + .byte $40,$00,$00,$00 ; + +track_array: + .byte 0, 2, 9,16 ; TITLE, STEPS1,STEPS3,OUTSIDE + .byte 22,0,0,0 ; + +sector_array: + .byte 8, 0, 0, 0 ; TITLE, STEPS1,STEPS3,OUTSIDE + .byte 0,0,0,0 ; + +length_array: + .byte 8, 96,84, 96 ; TITLE, STEPS1,STEPS3,OUTSIDE + .byte 80,0,0,0 + + +disk_exit_disk: ; note: not BCD anymore + .byte $02 + .byte 0 + .byte 0 + .byte 0 + +disk_exit_disk_bcd: + .byte $02 + .byte 0 + .byte 0 + .byte 0 + + +disk_exit_dni_h: + .byte 0 + .byte 0 + .byte 0 + .byte 0 +disk_exit_dni_l: + .byte $02 + .byte 0 + .byte 0 + .byte 0 + + ; +disk_exit_load: + .byte LOAD_TOP + .byte 0 + .byte 0 + .byte LOAD_CYAN +disk_exit_level: + .byte RIVEN_TOP + .byte 0 + .byte 0 + .byte 0 +disk_exit_direction: + .byte DIRECTION_S + .byte 0 + .byte 0 + .byte 0 diff --git a/games/riven_hgr/disk03_files/graphics_outside/Makefile b/games/riven_hgr/disk03_files/graphics_outside/Makefile new file mode 100644 index 00000000..87428ed5 --- /dev/null +++ b/games/riven_hgr/disk03_files/graphics_outside/Makefile @@ -0,0 +1,25 @@ +include ../../../../Makefile.inc + +ZX02 = ~/research/6502_compression/zx02.git/build/zx02 -f +PNG_TO_HGR = ../../../../utils/hgr-utils/png2hgr + +all: outside_graphics.inc + +outside_graphics.inc: \ + outside_n.hgr.zx02 outside_s.hgr.zx02 + echo "outside_n_zx02: .incbin \"outside_n.hgr.zx02\"" > outside_graphics.inc + echo "outside_s_zx02: .incbin \"outside_s.hgr.zx02\"" >> outside_graphics.inc + +#### + +%.hgr: %.png + $(PNG_TO_HGR) $< > $@ + +%.hgr.zx02: %.hgr + $(ZX02) -f $< $@ + +#### + +clean: + rm -f *~ *.o *.lst *.zx02 *.hgr outside_graphics.inc + diff --git a/games/riven_hgr/disk03_files/graphics_outside/outside_n.png b/games/riven_hgr/disk03_files/graphics_outside/outside_n.png new file mode 100644 index 00000000..b6792f12 Binary files /dev/null and b/games/riven_hgr/disk03_files/graphics_outside/outside_n.png differ diff --git a/games/riven_hgr/disk03_files/graphics_outside/outside_s.png b/games/riven_hgr/disk03_files/graphics_outside/outside_s.png new file mode 100644 index 00000000..736a6a99 Binary files /dev/null and b/games/riven_hgr/disk03_files/graphics_outside/outside_s.png differ diff --git a/games/riven_hgr/disk03_files/level_outside.s b/games/riven_hgr/disk03_files/level_outside.s new file mode 100644 index 00000000..ee799331 --- /dev/null +++ b/games/riven_hgr/disk03_files/level_outside.s @@ -0,0 +1,113 @@ +; Riven -- Outside the door + +; by deater (Vince Weaver) + +; Zero Page + .include "../zp.inc" + .include "../hardware.inc" + .include "../common_defines.inc" + .include "../qload.inc" + .include "disk03_defines.inc" + +outside_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_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_outside/outside_graphics.inc" + +.include "leveldata_outside.inc" diff --git a/games/riven_hgr/disk03_files/leveldata_outside.inc b/games/riven_hgr/disk03_files/leveldata_outside.inc new file mode 100644 index 00000000..965a8229 --- /dev/null +++ b/games/riven_hgr/disk03_files/leveldata_outside.inc @@ -0,0 +1,23 @@ +;=============================================== +; level data for outside +;=============================================== + +locations: + .word location0 + +; RIVEN_OUTSIDE -- outside the door +location0: + .byte $FF ; north exit + .byte $E0 ; 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 outside_n_zx02 ; north bg + .word outside_s_zx02 ; south bg + .word $0000 ; east bg + .word $0000 ; west bg + .byte BG_NORTH|BG_SOUTH ; all bgs + .byte $ff ; special exit diff --git a/games/riven_hgr/title.s b/games/riven_hgr/title.s index 87f30337..7205979e 100644 --- a/games/riven_hgr/title.s +++ b/games/riven_hgr/title.s @@ -20,6 +20,9 @@ .include "disk02_files/disk02_defines.inc" .endif +.if DISK=03 + .include "disk03_files/disk03_defines.inc" +.endif .if DISK=38 .include "disk38_files/disk38_defines.inc" @@ -469,6 +472,17 @@ game_continue: sta DIRECTION .endif +.if DISK=03 + lda #LOAD_OUTSIDE + sta WHICH_LOAD + + lda #RIVEN_OUTSIDE + sta LOCATION + + lda #DIRECTION_N + sta DIRECTION +.endif + .if DISK=38 lda #LOAD_PROJECTOR