riven: start hooking up disk40

This commit is contained in:
Vince Weaver 2024-06-16 00:47:15 -04:00
parent 71998c47c0
commit bded85bc8f
6 changed files with 176 additions and 0 deletions

View File

@ -0,0 +1,10 @@
LOAD_TITLE = 0
LOAD_CART = 1
;================================
; Level definitions
; Cart
RIVEN_OUTSIDE_CART = 0
RIVEN_IN_CART = 1

View File

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -0,0 +1,122 @@
; Riven -- Jungle Island -- Outside the cart
; by deater (Vince Weaver) <vince@deater.net>
; 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_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:
rts
;==================================
; call button clicked
;==================================
; just ignore this
call_button_clicked:
bit SPEAKER
rts
;==========================
; includes
;==========================
.include "graphics_cart/cart_graphics.inc"
.include "leveldata_cart.inc"

View File

@ -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