dos33fsprogs/games/riven_hgr/disk39_files/level_maglev.s

167 lines
2.4 KiB
ArmAsm
Raw Normal View History

2024-05-17 04:10:29 +00:00
; Riven -- Dome Island, Inside Maglev
; by deater (Vince Weaver) <vince@deater.net>
; Zero Page
.include "../zp.inc"
.include "../hardware.inc"
.include "../common_defines.inc"
.include "../qload.inc"
.include "disk39_defines.inc"
2024-05-17 04:10:29 +00:00
riven_maglev:
;===================
; init screen
;===================
; jsr TEXT
jsr HOME
2024-05-17 04:10:29 +00:00
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
;===================================
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
2024-05-17 17:07:47 +00:00
;=====================================
; handle clicked facing west
2024-05-17 17:07:47 +00:00
;=====================================
; all we can do here is flip
2024-05-17 17:07:47 +00:00
; flip us to the east
; go lores and play the movie
handle1_clicked:
bit SPEAKER
lda STATE_MAGLEV ; set to 1
ora #MAGLEV1_DIRECTION
sta STATE_MAGLEV
2024-05-17 17:07:47 +00:00
lda #LOAD_MOVIE1
sta WHICH_LOAD
lda #1
sta LEVEL_OVER
bit SPEAKER
rts
2024-05-22 03:13:56 +00:00
;=====================================
; handle clicked facing east
2024-05-22 03:13:56 +00:00
;=====================================
; if x<27, go for maglev ride
; else, flip back west
2024-05-22 03:13:56 +00:00
handle2_clicked:
bit SPEAKER
lda CURSOR_X
cmp #27
bcc go_for_maglev
lda STATE_MAGLEV ; clear to 0
2024-08-15 14:51:31 +00:00
and #<(~MAGLEV1_DIRECTION)
sta STATE_MAGLEV
lda #LOAD_MOVIE1
jmp common_handle2
go_for_maglev:
2024-05-22 03:13:56 +00:00
lda #LOAD_MOVIE2
common_handle2:
2024-05-22 03:13:56 +00:00
sta WHICH_LOAD
lda #1
sta LEVEL_OVER
bit SPEAKER
rts
2024-05-17 04:10:29 +00:00
;==========================
; includes
;==========================
.include "graphics_maglev/maglev_graphics.inc"
.include "leveldata_maglev.inc"