Vince Weaver 9f31ed98be riven: figured out how to allow split-directions for going forward
engine actually more or less supported it already
2024-08-03 22:37:49 -04:00

147 lines
2.1 KiB
ArmAsm

; Riven -- Middle of Steps
; by deater (Vince Weaver) <vince@deater.net>
; Zero Page
.include "../zp.inc"
.include "../hardware.inc"
.include "../common_defines.inc"
.include "../qload.inc"
.include "disk02_defines.inc"
steps1_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_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
;==========================
; handle split dir
;==========================
handle_split_dir:
; if 19 or less, go N
; if 20 or more, go E
lda #LOAD_TOP
sta WHICH_LOAD
lda #RIVEN_TOP
sta LOCATION
lda CURSOR_X
cmp #20
bcs go_east
go_north:
lda #DIRECTION_N
bne done_dir ; bra
go_east:
lda #DIRECTION_E
done_dir:
sta DIRECTION
lda #1
sta LEVEL_OVER
rts
;==========================
; includes
;==========================
.include "graphics_steps3/steps3_graphics.inc"
.include "leveldata_steps3.inc"