From bded85bc8fb8d91e1ae1fde83e35051ad31c715d Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Sun, 16 Jun 2024 00:47:15 -0400 Subject: [PATCH] riven: start hooking up disk40 --- .../riven_hgr/disk40_files/disk40_defines.inc | 10 ++ .../{ => disk40_files}/graphics_cart/Makefile | 0 .../graphics_cart/cart_e.png | Bin .../graphics_cart/cart_w.png | Bin games/riven_hgr/disk40_files/level_cart.s | 122 ++++++++++++++++++ .../riven_hgr/disk40_files/leveldata_cart.inc | 44 +++++++ 6 files changed, 176 insertions(+) create mode 100644 games/riven_hgr/disk40_files/disk40_defines.inc rename games/riven_hgr/{ => disk40_files}/graphics_cart/Makefile (100%) rename games/riven_hgr/{ => disk40_files}/graphics_cart/cart_e.png (100%) rename games/riven_hgr/{ => disk40_files}/graphics_cart/cart_w.png (100%) create mode 100644 games/riven_hgr/disk40_files/level_cart.s create mode 100644 games/riven_hgr/disk40_files/leveldata_cart.inc diff --git a/games/riven_hgr/disk40_files/disk40_defines.inc b/games/riven_hgr/disk40_files/disk40_defines.inc new file mode 100644 index 00000000..84934e0c --- /dev/null +++ b/games/riven_hgr/disk40_files/disk40_defines.inc @@ -0,0 +1,10 @@ +LOAD_TITLE = 0 +LOAD_CART = 1 + +;================================ +; Level definitions + +; Cart + +RIVEN_OUTSIDE_CART = 0 +RIVEN_IN_CART = 1 diff --git a/games/riven_hgr/graphics_cart/Makefile b/games/riven_hgr/disk40_files/graphics_cart/Makefile similarity index 100% rename from games/riven_hgr/graphics_cart/Makefile rename to games/riven_hgr/disk40_files/graphics_cart/Makefile diff --git a/games/riven_hgr/graphics_cart/cart_e.png b/games/riven_hgr/disk40_files/graphics_cart/cart_e.png similarity index 100% rename from games/riven_hgr/graphics_cart/cart_e.png rename to games/riven_hgr/disk40_files/graphics_cart/cart_e.png diff --git a/games/riven_hgr/graphics_cart/cart_w.png b/games/riven_hgr/disk40_files/graphics_cart/cart_w.png similarity index 100% rename from games/riven_hgr/graphics_cart/cart_w.png rename to games/riven_hgr/disk40_files/graphics_cart/cart_w.png diff --git a/games/riven_hgr/disk40_files/level_cart.s b/games/riven_hgr/disk40_files/level_cart.s new file mode 100644 index 00000000..b2c3b78f --- /dev/null +++ b/games/riven_hgr/disk40_files/level_cart.s @@ -0,0 +1,122 @@ +; Riven -- Jungle Island -- Outside the cart + +; by deater (Vince Weaver) + +; Zero Page + .include "../zp.inc" + .include "../hardware.inc" + .include "../common_defines.inc" + .include "../qload.inc" + .include "disk40_defines.inc" + +riven_cart: + + ;=================== + ; 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 + + ;================================== + ; call button clicked + ;================================== + ; just ignore this + +call_button_clicked: + bit SPEAKER + rts + + + ;========================== + ; includes + ;========================== + + +.include "graphics_cart/cart_graphics.inc" + +.include "leveldata_cart.inc" diff --git a/games/riven_hgr/disk40_files/leveldata_cart.inc b/games/riven_hgr/disk40_files/leveldata_cart.inc new file mode 100644 index 00000000..43c4d262 --- /dev/null +++ b/games/riven_hgr/disk40_files/leveldata_cart.inc @@ -0,0 +1,44 @@ +;=============================================== +; level data for Cart level +;=============================================== + +locations: + .word location0,location1 + +; RIVEN_OUTSIDE_CART -- just outside cart +location0: + .byte RIVEN_IN_CART ; north exit + .byte $ff ; south exit + .byte $ff ; east exit + .byte $ff ; west exit + .byte DIRECTION_E ; north exit_dir + .byte $ff ; south exit_dir + .byte $ff ; east exit_dir + .byte $ff ; west exit_dir + .word cart_n_zx02 ; north bg + .word cart_s_zx02 ; south bg + .word cart_e_zx02 ; east bg + .word cart_w_zx02 ; west bg + .byte BG_EAST|BG_NORTH|BG_SOUTH|BG_WEST ; all bgs + .byte $ff ; special exit + +; RIVEN_IN_CART -- sitting in cart +location1: + .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 $0000 ; north bg + .word $0000 ; south bg + .word in_cart_e_zx02 ; east bg + .word $0000 ; west bg + .byte BG_EAST ; all bgs + .byte DIRECTION_E ; special exit + .byte 32,34 ; special x + .byte 136,154 ; special y + .word call_button_clicked-1 +