2020-02-28 15:55:57 -05:00
|
|
|
; Mist
|
|
|
|
|
|
|
|
; a version of Myst?
|
|
|
|
; (yes there's a subtle German joke here)
|
|
|
|
|
|
|
|
; by deater (Vince Weaver) <vince@deater.net>
|
|
|
|
|
|
|
|
; Zero Page
|
|
|
|
.include "zp.inc"
|
|
|
|
.include "hardware.inc"
|
2020-03-19 13:55:29 -04:00
|
|
|
.include "common_defines.inc"
|
2020-06-16 13:30:45 -04:00
|
|
|
.include "common_routines.inc"
|
2020-02-28 15:55:57 -05:00
|
|
|
|
|
|
|
mist_start:
|
|
|
|
;===================
|
|
|
|
; init screen
|
2020-06-16 13:30:45 -04:00
|
|
|
;===================
|
|
|
|
|
2020-02-28 15:55:57 -05:00
|
|
|
jsr TEXT
|
|
|
|
jsr HOME
|
|
|
|
bit KEYRESET
|
|
|
|
|
|
|
|
bit SET_GR
|
|
|
|
bit PAGE0
|
2020-03-02 16:50:00 -05:00
|
|
|
bit LORES
|
2020-02-28 15:55:57 -05:00
|
|
|
bit FULLGR
|
|
|
|
|
2020-06-16 13:30:45 -04:00
|
|
|
;=================
|
|
|
|
; set up location
|
|
|
|
;=================
|
|
|
|
|
|
|
|
lda #<locations
|
|
|
|
sta LOCATIONS_L
|
|
|
|
lda #>locations
|
|
|
|
sta LOCATIONS_H
|
|
|
|
|
2020-03-01 00:37:09 -05:00
|
|
|
lda #0
|
|
|
|
sta DRAW_PAGE
|
2020-03-08 14:11:11 -04:00
|
|
|
sta LEVEL_OVER
|
2020-02-28 15:55:57 -05:00
|
|
|
|
2020-03-01 12:45:24 -05:00
|
|
|
; init cursor
|
|
|
|
|
2020-03-01 00:37:09 -05:00
|
|
|
lda #20
|
|
|
|
sta CURSOR_X
|
|
|
|
sta CURSOR_Y
|
2020-02-28 15:55:57 -05:00
|
|
|
|
2020-03-01 13:14:49 -05:00
|
|
|
; set up initial location
|
2020-03-01 12:45:24 -05:00
|
|
|
|
2020-03-01 13:14:49 -05:00
|
|
|
jsr change_location
|
2020-02-28 15:55:57 -05:00
|
|
|
|
2020-03-01 13:28:04 -05:00
|
|
|
lda #1
|
|
|
|
sta CURSOR_VISIBLE ; visible at first
|
|
|
|
|
2020-03-24 00:36:53 -04:00
|
|
|
; init the clock bridge
|
|
|
|
jsr raise_bridge
|
2020-02-28 15:55:57 -05:00
|
|
|
|
2020-03-24 00:50:05 -04:00
|
|
|
; init the gear
|
|
|
|
jsr open_the_gear
|
|
|
|
|
2020-07-08 18:35:58 -04:00
|
|
|
; make the ship right
|
|
|
|
jsr adjust_ship
|
|
|
|
|
2020-03-24 00:50:05 -04:00
|
|
|
|
2020-03-01 00:37:09 -05:00
|
|
|
game_loop:
|
2020-03-01 13:14:49 -05:00
|
|
|
;=================
|
|
|
|
; reset things
|
|
|
|
;=================
|
|
|
|
|
|
|
|
lda #0
|
|
|
|
sta IN_SPECIAL
|
2020-03-01 15:18:10 -05:00
|
|
|
sta IN_RIGHT
|
|
|
|
sta IN_LEFT
|
2020-03-01 00:37:09 -05:00
|
|
|
|
|
|
|
;====================================
|
|
|
|
; copy background to current page
|
|
|
|
;====================================
|
|
|
|
|
|
|
|
jsr gr_copy_to_current
|
2020-02-28 15:55:57 -05:00
|
|
|
|
2020-03-07 13:07:42 -05:00
|
|
|
;====================================
|
|
|
|
; handle special-case forground logic
|
|
|
|
;====================================
|
|
|
|
|
2020-03-11 09:47:25 -04:00
|
|
|
; handle gear opening
|
|
|
|
|
2020-03-07 18:24:46 -05:00
|
|
|
lda GEAR_OPEN
|
|
|
|
beq not_gear_related
|
|
|
|
|
|
|
|
jsr check_gear_delete
|
|
|
|
not_gear_related:
|
2020-07-08 16:39:24 -04:00
|
|
|
; handl pillars
|
|
|
|
lda LOCATION
|
|
|
|
cmp #MIST_PILLAR_EYE
|
|
|
|
bcc check_if_clock
|
2020-03-07 18:24:46 -05:00
|
|
|
|
2020-07-08 16:39:24 -04:00
|
|
|
jsr draw_pillar
|
2020-03-11 09:47:25 -04:00
|
|
|
|
2020-07-08 16:39:24 -04:00
|
|
|
; handle clock puzzles
|
|
|
|
check_if_clock:
|
2020-03-07 13:07:42 -05:00
|
|
|
lda LOCATION
|
2020-03-19 17:25:20 -04:00
|
|
|
cmp #MIST_CLOCK_PUZZLE ; clock puzzle
|
2020-03-07 15:21:16 -05:00
|
|
|
beq location_clock
|
2020-03-19 17:25:20 -04:00
|
|
|
cmp #MIST_CLOCK_INSIDE
|
2020-03-07 15:21:16 -05:00
|
|
|
beq location_inside_clock
|
2020-07-08 13:53:46 -04:00
|
|
|
bne nothing_special
|
2020-03-07 13:07:42 -05:00
|
|
|
|
2020-03-07 15:21:16 -05:00
|
|
|
location_clock:
|
2020-03-07 13:07:42 -05:00
|
|
|
jsr draw_clock_face
|
2020-03-07 15:21:16 -05:00
|
|
|
jmp nothing_special
|
|
|
|
location_inside_clock:
|
|
|
|
jsr draw_clock_inside
|
2020-03-07 18:24:46 -05:00
|
|
|
jmp nothing_special
|
2020-03-07 13:07:42 -05:00
|
|
|
|
|
|
|
nothing_special:
|
2020-03-07 23:11:08 -05:00
|
|
|
|
2020-03-01 00:37:09 -05:00
|
|
|
;====================================
|
|
|
|
; draw pointer
|
|
|
|
;====================================
|
2020-03-01 13:28:04 -05:00
|
|
|
|
2020-03-07 23:11:08 -05:00
|
|
|
jsr draw_pointer
|
2020-03-01 13:28:04 -05:00
|
|
|
|
2020-03-01 00:37:09 -05:00
|
|
|
;====================================
|
|
|
|
; page flip
|
|
|
|
;====================================
|
2020-02-28 15:55:57 -05:00
|
|
|
|
2020-03-01 00:37:09 -05:00
|
|
|
jsr page_flip
|
2020-02-28 15:55:57 -05:00
|
|
|
|
2020-07-09 01:31:22 -04:00
|
|
|
|
|
|
|
;=================
|
|
|
|
; do this here (which is inefficient) because
|
|
|
|
; it lets the switch turn green before the noise
|
|
|
|
|
|
|
|
jsr check_change_ship
|
|
|
|
|
|
|
|
|
2020-03-01 00:37:09 -05:00
|
|
|
;====================================
|
|
|
|
; handle keypress/joystick
|
|
|
|
;====================================
|
2020-02-28 15:55:57 -05:00
|
|
|
|
2020-03-01 00:37:09 -05:00
|
|
|
jsr handle_keypress
|
2020-02-28 15:55:57 -05:00
|
|
|
|
|
|
|
|
2020-03-01 00:37:09 -05:00
|
|
|
;====================================
|
|
|
|
; inc frame count
|
|
|
|
;====================================
|
|
|
|
|
|
|
|
inc FRAMEL
|
|
|
|
bne room_frame_no_oflo
|
|
|
|
inc FRAMEH
|
|
|
|
room_frame_no_oflo:
|
|
|
|
|
2020-03-08 14:11:11 -04:00
|
|
|
;====================================
|
|
|
|
; check level over
|
|
|
|
;====================================
|
|
|
|
|
|
|
|
lda LEVEL_OVER
|
|
|
|
bne really_exit
|
2020-07-09 01:31:22 -04:00
|
|
|
|
2020-03-01 00:37:09 -05:00
|
|
|
jmp game_loop
|
|
|
|
|
2020-03-08 14:11:11 -04:00
|
|
|
really_exit:
|
|
|
|
jmp end_level
|
|
|
|
|
2020-03-19 01:59:09 -04:00
|
|
|
;=================
|
|
|
|
; special exits
|
2020-03-08 14:11:11 -04:00
|
|
|
|
2020-03-15 14:25:51 -04:00
|
|
|
go_to_meche:
|
2020-03-17 01:42:26 -04:00
|
|
|
lda #LOAD_MECHE
|
2020-03-08 14:11:11 -04:00
|
|
|
sta WHICH_LOAD
|
|
|
|
|
2020-03-23 19:16:38 -04:00
|
|
|
lda #MECHE_INSIDE_GEAR
|
|
|
|
sta LOCATION
|
|
|
|
|
|
|
|
lda #DIRECTION_E
|
|
|
|
sta DIRECTION
|
|
|
|
|
2020-03-26 14:17:10 -04:00
|
|
|
jmp set_level_over
|
2020-03-01 00:37:09 -05:00
|
|
|
|
2020-03-19 01:59:09 -04:00
|
|
|
pad_special:
|
2020-03-19 17:25:20 -04:00
|
|
|
lda #MIST_TOWER2_PATH
|
2020-03-19 01:59:09 -04:00
|
|
|
sta LOCATION
|
|
|
|
jsr change_location
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
leave_tower2:
|
2020-03-19 17:25:20 -04:00
|
|
|
lda #MIST_TOWER2_TOP
|
2020-03-19 01:59:09 -04:00
|
|
|
sta LOCATION
|
2020-03-19 11:43:59 -04:00
|
|
|
|
|
|
|
lda #DIRECTION_W
|
|
|
|
sta DIRECTION
|
|
|
|
|
|
|
|
jsr change_location
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
2020-03-19 01:59:09 -04:00
|
|
|
|
2020-07-03 20:32:58 -04:00
|
|
|
goto_dentist_steps:
|
|
|
|
|
|
|
|
lda #MIST_STEPS_DENTIST
|
|
|
|
sta LOCATION
|
|
|
|
|
|
|
|
lda #DIRECTION_N
|
|
|
|
sta DIRECTION
|
|
|
|
|
|
|
|
jmp change_location
|
2020-03-19 11:43:59 -04:00
|
|
|
|
|
|
|
|
2020-03-19 21:07:21 -04:00
|
|
|
enter_octagon:
|
|
|
|
|
|
|
|
lda #OCTAGON_TEMPLE_DOORWAY
|
|
|
|
sta LOCATION
|
|
|
|
|
|
|
|
lda #LOAD_OCTAGON
|
|
|
|
sta WHICH_LOAD
|
|
|
|
|
2020-03-26 14:17:10 -04:00
|
|
|
jmp set_level_over
|
2020-03-19 21:07:21 -04:00
|
|
|
|
2020-07-02 15:27:41 -04:00
|
|
|
goto_dentist:
|
|
|
|
|
|
|
|
lda #DENTIST_OUTSIDE
|
|
|
|
sta LOCATION
|
|
|
|
|
|
|
|
lda #LOAD_DENTIST
|
|
|
|
sta WHICH_LOAD
|
|
|
|
|
|
|
|
jmp set_level_over
|
|
|
|
|
|
|
|
|
2020-03-25 01:17:59 -04:00
|
|
|
enter_viewer:
|
|
|
|
|
|
|
|
lda #VIEWER_STEPS
|
|
|
|
sta LOCATION
|
|
|
|
|
|
|
|
lda #LOAD_VIEWER
|
|
|
|
sta WHICH_LOAD
|
|
|
|
|
2020-03-26 14:17:10 -04:00
|
|
|
jmp set_level_over
|
|
|
|
|
2020-04-15 13:30:23 -04:00
|
|
|
enter_channel_main:
|
|
|
|
|
2020-06-16 14:55:45 -04:00
|
|
|
lda #CABIN_OUTSIDE
|
2020-04-15 13:30:23 -04:00
|
|
|
sta LOCATION
|
|
|
|
|
2020-06-16 14:55:45 -04:00
|
|
|
lda #LOAD_CABIN
|
2020-04-15 13:30:23 -04:00
|
|
|
sta WHICH_LOAD
|
|
|
|
|
|
|
|
lda #DIRECTION_E
|
|
|
|
sta DIRECTION
|
|
|
|
|
|
|
|
jmp set_level_over
|
|
|
|
|
|
|
|
enter_channel_clock:
|
|
|
|
|
2020-06-16 14:55:45 -04:00
|
|
|
lda #CABIN_CLOCK_PATH
|
2020-04-15 13:30:23 -04:00
|
|
|
sta LOCATION
|
|
|
|
|
2020-06-16 14:55:45 -04:00
|
|
|
lda #LOAD_CABIN
|
2020-04-15 13:30:23 -04:00
|
|
|
sta WHICH_LOAD
|
|
|
|
|
|
|
|
lda #DIRECTION_N
|
|
|
|
sta DIRECTION
|
|
|
|
|
|
|
|
jmp set_level_over
|
|
|
|
|
2020-03-26 14:17:10 -04:00
|
|
|
enter_stoneyship:
|
|
|
|
lda #STONEY_SHIP_STERN
|
|
|
|
sta LOCATION
|
|
|
|
|
|
|
|
lda #DIRECTION_N
|
|
|
|
sta DIRECTION
|
|
|
|
|
|
|
|
lda #LOAD_STONEY
|
|
|
|
sta WHICH_LOAD
|
|
|
|
|
|
|
|
set_level_over:
|
2020-03-25 01:17:59 -04:00
|
|
|
lda #$ff
|
|
|
|
sta LEVEL_OVER
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
2020-07-03 23:06:11 -04:00
|
|
|
;===========================
|
|
|
|
; read letter from catherine
|
2020-03-25 01:17:59 -04:00
|
|
|
|
2020-07-03 23:06:11 -04:00
|
|
|
read_letter:
|
|
|
|
|
|
|
|
lda #MIST_CAT_LETTER
|
|
|
|
sta LOCATION
|
|
|
|
|
|
|
|
lda #DIRECTION_N
|
|
|
|
sta DIRECTION
|
|
|
|
|
|
|
|
jsr change_location
|
2020-03-01 00:37:09 -05:00
|
|
|
|
2020-07-03 23:06:11 -04:00
|
|
|
bit SET_TEXT
|
2020-03-02 11:49:55 -05:00
|
|
|
|
2020-07-03 23:06:11 -04:00
|
|
|
rts
|
2020-02-28 15:55:57 -05:00
|
|
|
|
2020-07-03 23:06:11 -04:00
|
|
|
;==========================
|
|
|
|
; includes
|
|
|
|
;==========================
|
2020-02-28 15:55:57 -05:00
|
|
|
|
2020-06-16 13:30:45 -04:00
|
|
|
; graphics data
|
|
|
|
.include "graphics_mist/mist_graphics.inc"
|
2020-03-07 11:06:29 -05:00
|
|
|
|
2020-06-16 13:30:45 -04:00
|
|
|
; puzzles
|
2020-03-07 11:06:29 -05:00
|
|
|
.include "clock_bridge_puzzle.s"
|
2020-03-07 11:16:44 -05:00
|
|
|
.include "marker_switch.s"
|
2020-07-08 13:53:46 -04:00
|
|
|
.include "mist_puzzles.s"
|
2020-03-07 11:16:44 -05:00
|
|
|
|
2020-06-16 13:30:45 -04:00
|
|
|
; level data
|
2020-03-15 14:25:51 -04:00
|
|
|
.include "leveldata_mist.inc"
|