diff --git a/games/riven_hgr/Makefile b/games/riven_hgr/Makefile index 00a259e6..42166dd9 100644 --- a/games/riven_hgr/Makefile +++ b/games/riven_hgr/Makefile @@ -83,6 +83,7 @@ riven_disk02.dsk: QBOOT QLOAD TITLE_02 \ riven_disk03.dsk: QBOOT QLOAD TITLE_03 \ disk03_files/DISK03 \ + disk03_files/LEVEL_DOWNSTEPS \ disk03_files/LEVEL_OUTSIDE cp $(EMPTY_DISK)/empty.dsk riven_disk03.dsk $(DOS33_RAW) riven_disk03.dsk 0 0 QBOOT 0 1 @@ -91,6 +92,7 @@ riven_disk03.dsk: QBOOT QLOAD TITLE_03 \ $(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 2 0 disk03_files/LEVEL_DOWNSTEPS 0 0 $(DOS33_RAW) riven_disk03.dsk 16 0 disk03_files/LEVEL_OUTSIDE 0 0 ### @@ -505,6 +507,9 @@ disk02_files/LEVEL_TOP: #### +disk03_files/LEVEL_DOWNSTEPS: + cd disk03_files && make + disk03_files/LEVEL_OUTSIDE: cd disk03_files && make @@ -692,6 +697,7 @@ riven_hgr.2mg: dts_block PROBOOTHD QLOAD_HD \ disk02_files/LEVEL_STEPS1 \ disk02_files/LEVEL_TOP \ disk03_files/DISK03 \ + disk03_files/LEVEL_DOWNSTEPS \ disk03_files/LEVEL_OUTSIDE \ disk04_files/DISK04 \ disk04_files/LEVEL_TUNNEL3 \ @@ -749,6 +755,7 @@ riven_hgr.2mg: dts_block PROBOOTHD QLOAD_HD \ $(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 2 0` disk03_files/LEVEL_DOWNSTEPS 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 4 0 2` disk04_files/DISK04 0 0 $(PRODOS_RAW) riven_hgr.2mg `./dts_block 4 27 0` disk04_files/LEVEL_TUNNEL3 0 0 diff --git a/games/riven_hgr/disk03_files/Makefile b/games/riven_hgr/disk03_files/Makefile index 81a0b09d..a6c323d4 100644 --- a/games/riven_hgr/disk03_files/Makefile +++ b/games/riven_hgr/disk03_files/Makefile @@ -3,7 +3,7 @@ include ../../../Makefile.inc LINKER_SCRIPTS = ../../../linker_scripts/ -all: DISK03 LEVEL_OUTSIDE +all: DISK03 LEVEL_DOWNSTEPS LEVEL_OUTSIDE #### @@ -27,21 +27,37 @@ level_outside.o: level_outside.s \ #### +LEVEL_DOWNSTEPS: level_downsteps.o + ld65 -o LEVEL_DOWNSTEPS level_downsteps.o -C $(LINKER_SCRIPTS)/apple2_4000.inc + +level_downsteps.o: level_downsteps.s \ + ../zp.inc ../hardware.inc ../qload.inc \ + ../common_defines.inc disk03_defines.inc \ + leveldata_downsteps.inc \ + graphics_downsteps/downsteps_graphics.inc + ca65 -o level_downsteps.o level_downsteps.s -l level_downsteps.lst + +#### + graphics_outside/outside_graphics.inc: cd graphics_outside && make +graphics_downsteps/downsteps_graphics.inc: + cd graphics_downsteps && make + #### clean: rm -f *~ *.o *.lst DISK03 \ - LEVEL_OUTSIDE + LEVEL_OUTSIDE LEVEL_DOWNSTEPS #### distclean: rm -f *~ *.o *.lst DISK03 \ - LEVEL_OUTSIDE + LEVEL_OUTSIDE LEVEL_DOWNSTEPS cd graphics_outside && make clean + cd graphics_downsteps && make clean diff --git a/games/riven_hgr/disk03_files/disk03.s b/games/riven_hgr/disk03_files/disk03.s index b434be25..87bf8cef 100644 --- a/games/riven_hgr/disk03_files/disk03.s +++ b/games/riven_hgr/disk03_files/disk03.s @@ -1,6 +1,5 @@ .include "../zp.inc" .include "../disk02_files/disk02_defines.inc" -;.include "../disk04_files/disk04_defines.inc" .include "../disk00_files/disk00_defines.inc" which_disk_bcd: @@ -10,19 +9,19 @@ which_disk_bin: .byte 3 load_address_array: - .byte $40,$40,$40,$40 ; TITLE, STEPS1,STEPS3,OUTSIDE + .byte $40,$40,$40,$40 ; TITLE, DSTEPS1,DSTEPS3,OUTSIDE .byte $40,$00,$00,$00 ; track_array: - .byte 0, 2, 9,16 ; TITLE, STEPS1,STEPS3,OUTSIDE + .byte 0, 2, 9,16 ; TITLE, DSTEPS1,DSTEPS3,OUTSIDE .byte 22,0,0,0 ; sector_array: - .byte 8, 0, 0, 0 ; TITLE, STEPS1,STEPS3,OUTSIDE + .byte 8, 0, 0, 0 ; TITLE, DSTEPS1,DSTEPS3,OUTSIDE .byte 0,0,0,0 ; length_array: - .byte 8, 96,84, 96 ; TITLE, STEPS1,STEPS3,OUTSIDE + .byte 8, 96,84, 96 ; TITLE, DSTEPS1,DSTEPS3,OUTSIDE .byte 80,0,0,0 diff --git a/games/riven_hgr/disk03_files/disk03_defines.inc b/games/riven_hgr/disk03_files/disk03_defines.inc index 4ac74ad1..b709670f 100644 --- a/games/riven_hgr/disk03_files/disk03_defines.inc +++ b/games/riven_hgr/disk03_files/disk03_defines.inc @@ -1,11 +1,16 @@ LOAD_TITLE_03 = 0 -LOAD_STEPS1 = 1 -LOAD_STPES3 = 2 +LOAD_DSTEPS1 = 1 +LOAD_DSTPES3 = 2 LOAD_OUTSIDE = 3 ;================================ ; Level definitions +; DSTEPS1 + +RIVEN_DOWN1 = 0 +RIVEN_DOWN2 = 1 + ; OUTSIDE RIVEN_OUTSIDE = 0 diff --git a/games/riven_hgr/disk03_files/graphics_downsteps/Makefile b/games/riven_hgr/disk03_files/graphics_downsteps/Makefile new file mode 100644 index 00000000..e3d72f63 --- /dev/null +++ b/games/riven_hgr/disk03_files/graphics_downsteps/Makefile @@ -0,0 +1,27 @@ +include ../../../../Makefile.inc + +ZX02 = ~/research/6502_compression/zx02.git/build/zx02 -f +PNG_TO_HGR = ../../../../utils/hgr-utils/png2hgr + +all: downsteps_graphics.inc + +downsteps_graphics.inc: \ + down1_n.hgr.zx02 down1_s.hgr.zx02 + echo "down1_n_zx02: .incbin \"down1_n.hgr.zx02\"" > downsteps_graphics.inc + echo "down1_s_zx02: .incbin \"down1_s.hgr.zx02\"" >> downsteps_graphics.inc + + + +#### + +%.hgr: %.png + $(PNG_TO_HGR) $< > $@ + +%.hgr.zx02: %.hgr + $(ZX02) -f $< $@ + +#### + +clean: + rm -f *~ *.o *.lst *.zx02 *.hgr downsteps_graphics.inc + diff --git a/games/riven_hgr/disk03_files/graphics_downsteps/down1_n.png b/games/riven_hgr/disk03_files/graphics_downsteps/down1_n.png new file mode 100644 index 00000000..5d9d23aa Binary files /dev/null and b/games/riven_hgr/disk03_files/graphics_downsteps/down1_n.png differ diff --git a/games/riven_hgr/disk03_files/graphics_downsteps/down1_s.png b/games/riven_hgr/disk03_files/graphics_downsteps/down1_s.png new file mode 100644 index 00000000..edd54f7d Binary files /dev/null and b/games/riven_hgr/disk03_files/graphics_downsteps/down1_s.png differ diff --git a/games/riven_hgr/disk03_files/graphics_outside/Makefile b/games/riven_hgr/disk03_files/graphics_outside/Makefile index 87428ed5..0eb8fce0 100644 --- a/games/riven_hgr/disk03_files/graphics_outside/Makefile +++ b/games/riven_hgr/disk03_files/graphics_outside/Makefile @@ -6,9 +6,12 @@ PNG_TO_HGR = ../../../../utils/hgr-utils/png2hgr all: outside_graphics.inc outside_graphics.inc: \ - outside_n.hgr.zx02 outside_s.hgr.zx02 + outside_n.hgr.zx02 outside_s.hgr.zx02 outside_e.hgr.zx02 outside_w.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 + echo "outside_e_zx02: .incbin \"outside_e.hgr.zx02\"" >> outside_graphics.inc + echo "outside_w_zx02: .incbin \"outside_w.hgr.zx02\"" >> outside_graphics.inc + #### diff --git a/games/riven_hgr/disk03_files/graphics_outside/outside_e.png b/games/riven_hgr/disk03_files/graphics_outside/outside_e.png new file mode 100644 index 00000000..b6792f12 Binary files /dev/null and b/games/riven_hgr/disk03_files/graphics_outside/outside_e.png differ diff --git a/games/riven_hgr/disk03_files/graphics_outside/outside_n.png b/games/riven_hgr/disk03_files/graphics_outside/outside_n.png index b6792f12..95d73653 100644 Binary files a/games/riven_hgr/disk03_files/graphics_outside/outside_n.png and b/games/riven_hgr/disk03_files/graphics_outside/outside_n.png differ diff --git a/games/riven_hgr/disk03_files/graphics_outside/outside_w.png b/games/riven_hgr/disk03_files/graphics_outside/outside_w.png new file mode 100644 index 00000000..c2c63094 Binary files /dev/null and b/games/riven_hgr/disk03_files/graphics_outside/outside_w.png differ diff --git a/games/riven_hgr/disk03_files/level_downsteps.s b/games/riven_hgr/disk03_files/level_downsteps.s new file mode 100644 index 00000000..9b6eaf14 --- /dev/null +++ b/games/riven_hgr/disk03_files/level_downsteps.s @@ -0,0 +1,113 @@ +; Riven -- heading down the steps + +; by deater (Vince Weaver) + +; Zero Page + .include "../zp.inc" + .include "../hardware.inc" + .include "../common_defines.inc" + .include "../qload.inc" + .include "disk03_defines.inc" + +downsteps_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_downsteps/downsteps_graphics.inc" + +.include "leveldata_downsteps.inc" diff --git a/games/riven_hgr/disk03_files/leveldata_downsteps.inc b/games/riven_hgr/disk03_files/leveldata_downsteps.inc new file mode 100644 index 00000000..49267574 --- /dev/null +++ b/games/riven_hgr/disk03_files/leveldata_downsteps.inc @@ -0,0 +1,23 @@ +;=============================================== +; level data for outside +;=============================================== + +locations: + .word location0 + +; RIVEN_DOWN1 -- outside the door +location0: + .byte LOAD_OUTSIDE<<4|RIVEN_OUTSIDE ; north exit + .byte $E0 ; south exit + .byte $ff ; east exit + .byte $ff ; west exit + .byte DIRECTION_E ; north exit_dir + .byte DIRECTION_S ; south exit_dir + .byte $ff ; east exit_dir + .byte $ff ; west exit_dir + .word down1_n_zx02 ; north bg + .word down1_s_zx02 ; south bg + .word $0000 ; east bg + .word $0000 ; west bg + .byte BG_NORTH|BG_SOUTH + .byte $ff ; special exit diff --git a/games/riven_hgr/disk03_files/leveldata_outside.inc b/games/riven_hgr/disk03_files/leveldata_outside.inc index 965a8229..b5bb7a20 100644 --- a/games/riven_hgr/disk03_files/leveldata_outside.inc +++ b/games/riven_hgr/disk03_files/leveldata_outside.inc @@ -8,7 +8,7 @@ locations: ; RIVEN_OUTSIDE -- outside the door location0: .byte $FF ; north exit - .byte $E0 ; south exit + .byte LOAD_DSTEPS1<<4|RIVEN_DOWN1 ; south exit .byte $ff ; east exit .byte $ff ; west exit .byte $FF ; north exit_dir @@ -17,7 +17,7 @@ location0: .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 + .word outside_e_zx02 ; east bg + .word outside_w_zx02 ; west bg + .byte BG_NORTH|BG_SOUTH|BG_EAST|BG_WEST ; all bgs .byte $ff ; special exit diff --git a/games/riven_hgr/title.s b/games/riven_hgr/title.s index c0d73f8a..f60c5922 100644 --- a/games/riven_hgr/title.s +++ b/games/riven_hgr/title.s @@ -435,10 +435,10 @@ game_continue: .endif .if DISK=03 - lda #LOAD_OUTSIDE + lda #LOAD_DSTEPS1 sta WHICH_LOAD - lda #RIVEN_OUTSIDE + lda #RIVEN_DOWN1 sta LOCATION lda #DIRECTION_N