From d6a42b37326560556b78a8721454ce49fc5cb06b Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Wed, 15 May 2024 14:14:13 -0400 Subject: [PATCH] riven_hgr: add projector level --- games/riven_hgr/Makefile | 22 ++++- games/riven_hgr/common_defines.inc | 7 ++ games/riven_hgr/level_projector.s | 123 ++++++++++++++++++++++++ games/riven_hgr/leveldata_projector.inc | 43 +++++++++ games/riven_hgr/loader.s | 3 + 5 files changed, 196 insertions(+), 2 deletions(-) create mode 100644 games/riven_hgr/level_projector.s create mode 100644 games/riven_hgr/leveldata_projector.inc diff --git a/games/riven_hgr/Makefile b/games/riven_hgr/Makefile index c9039c49..8f5b4bd4 100644 --- a/games/riven_hgr/Makefile +++ b/games/riven_hgr/Makefile @@ -11,11 +11,13 @@ EMPTY_DISK = ../../empty_disk/empty.dsk all: riven_hgr.dsk -riven_hgr.dsk: HELLO LOADER TITLE DOME +riven_hgr.dsk: HELLO LOADER TITLE \ + LEVEL_PROJECTOR 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 DOME ### @@ -58,8 +60,24 @@ dome.o: dome.s zp.inc hardware.inc \ #### +LEVEL_PROJECTOR: level_projector.o + ld65 -o LEVEL_PROJECTOR level_projector.o -C ../../linker_scripts/apple2_4000.inc + +level_projector.o: level_projector.s zp.inc hardware.inc \ + zx02_optim.s \ + hgr_sprite.s hgr_tables.s \ + keyboard.s \ + hgr_14x14_sprite.s \ + graphics_sprites/pointer_sprites.inc \ + graphics_projector/projector_graphics.inc + ca65 -o level_projector.o level_projector.s -l level_projector.lst + + +#### + clean: - rm -f *~ *.o *.lst HELLO LOADER TITLE DOME + rm -f *~ *.o *.lst HELLO LOADER TITLE \ + LEVEL_PROJECTOR DOME # cd graphics && make clean # cd maps && make clean # cd title && make clean diff --git a/games/riven_hgr/common_defines.inc b/games/riven_hgr/common_defines.inc index f7124a77..1c2e14ce 100644 --- a/games/riven_hgr/common_defines.inc +++ b/games/riven_hgr/common_defines.inc @@ -1,5 +1,6 @@ LOAD_TITLE = 0 LOAD_DOME = 1 +LOAD_PROJECTOR = 2 div7_table = $BC00 @@ -51,3 +52,9 @@ LOCATION_SPECIAL_FUNC=22 ; pointer-1 of function to call on click RIVEN_MAGLEV1 = 0 RIVEN_MAGLEV2 = 1 RIVEN_MAGLEV3 = 2 + +; Projector + +RIVEN_PROJECTOR = 0 +RIVEN_PROJ_DOOR = 1 + diff --git a/games/riven_hgr/level_projector.s b/games/riven_hgr/level_projector.s new file mode 100644 index 00000000..d122cb27 --- /dev/null +++ b/games/riven_hgr/level_projector.s @@ -0,0 +1,123 @@ +; Riven -- Dome Island, Projector Room area + +; by deater (Vince Weaver) + +; Zero Page + .include "zp.inc" + .include "hardware.inc" + .include "common_defines.inc" + +riven_projector: + + ;=================== + ; 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: + + 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_projector/projector_graphics.inc" + +;.include "common_sprites.inc" + +.include "graphics_sprites/pointer_sprites.inc" + +.include "leveldata_projector.inc" diff --git a/games/riven_hgr/leveldata_projector.inc b/games/riven_hgr/leveldata_projector.inc new file mode 100644 index 00000000..d707ff7a --- /dev/null +++ b/games/riven_hgr/leveldata_projector.inc @@ -0,0 +1,43 @@ +;=============================================== +; level data for Large Projector Area level +;=============================================== + +locations: + .word location0,location1 + +; RIVEN_PROJECTOR -- looking at projector +location0: + .byte RIVEN_PROJ_DOOR ; 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 projector_n_zx02 ; north bg + .word projector_s_zx02 ; south bg + .word $0000 ; east bg + .word $0000 ; west bg + .byte BG_NORTH|BG_SOUTH + .byte $FF ; special exit (none) + +; RIVEN_PROJ_DOOR -- doorway to projector room +location1: + .byte RIVEN_PROJECTOR ; 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 doorway_n_zx02 ; north bg + .word doorway_s_zx02 ; south bg + .word $0000 ; east bg + .word $0000 ; west bg + .byte BG_NORTH|BG_SOUTH + .byte DIRECTION_E ; special exit + .byte 9,29 ; special x + .byte 2,46 ; special y + .word location1-1 ; special function FIXME diff --git a/games/riven_hgr/loader.s b/games/riven_hgr/loader.s index e2c4642f..c6e164fd 100644 --- a/games/riven_hgr/loader.s +++ b/games/riven_hgr/loader.s @@ -195,11 +195,14 @@ copy_filename_done: filenames: .word title_filename .word dome_filename + .word projector_filename title_filename: .byte "TITLE",0 dome_filename: .byte "DOME",0 +projector_filename: + .byte "LEVEL_PROJECTOR",0 ;=================================================== ;===================================================