2021-10-21 03:54:09 +00:00
|
|
|
.include "zp.inc"
|
|
|
|
.include "hardware.inc"
|
|
|
|
.include "qload.inc"
|
2021-10-21 03:21:00 +00:00
|
|
|
|
2021-10-21 03:54:09 +00:00
|
|
|
.include "version.inc"
|
|
|
|
.include "inventory.inc"
|
2021-10-21 03:21:00 +00:00
|
|
|
|
2021-09-30 03:51:04 +00:00
|
|
|
.include "tokens.inc"
|
|
|
|
|
2021-12-06 03:57:18 +00:00
|
|
|
parse_input_file_begin:
|
|
|
|
|
2021-10-21 03:21:00 +00:00
|
|
|
|
2021-09-30 03:51:04 +00:00
|
|
|
;==========================
|
2021-08-18 04:29:23 +00:00
|
|
|
; parse input
|
2021-09-30 03:51:04 +00:00
|
|
|
;==========================
|
|
|
|
; input is in input_buffer
|
2021-08-18 04:29:23 +00:00
|
|
|
|
|
|
|
parse_input:
|
2021-12-05 20:35:27 +00:00
|
|
|
;===========================
|
|
|
|
; speacial case: pot on head
|
2021-08-18 04:29:23 +00:00
|
|
|
|
2021-12-05 20:35:27 +00:00
|
|
|
lda GAME_STATE_1
|
|
|
|
and #POT_ON_HEAD
|
|
|
|
beq no_pot_on_head
|
|
|
|
|
|
|
|
ldx #<inside_inn_pot_on_head_message
|
|
|
|
ldy #>inside_inn_pot_on_head_message
|
|
|
|
jmp finish_parse_message
|
|
|
|
|
|
|
|
no_pot_on_head:
|
2021-10-18 20:55:10 +00:00
|
|
|
;==================
|
|
|
|
; uppercase the buffer
|
2021-09-30 03:51:04 +00:00
|
|
|
|
|
|
|
ldx #0
|
|
|
|
upcase_loop:
|
|
|
|
lda input_buffer,X
|
|
|
|
beq done_upcase_loop
|
2021-10-12 16:19:14 +00:00
|
|
|
cmp #' '|$80 ; skip uppercasing space
|
|
|
|
bne skip_uppercase
|
|
|
|
and #$DF ; uppercase
|
|
|
|
skip_uppercase:
|
2021-09-30 03:51:04 +00:00
|
|
|
sta input_buffer,X
|
|
|
|
inx
|
|
|
|
jmp upcase_loop
|
|
|
|
done_upcase_loop:
|
|
|
|
|
2021-09-30 04:25:03 +00:00
|
|
|
;=====================
|
|
|
|
; get the verb
|
|
|
|
|
2021-09-30 03:51:04 +00:00
|
|
|
jsr get_verb
|
|
|
|
|
2021-09-30 04:25:03 +00:00
|
|
|
;=====================
|
|
|
|
; get the noun
|
|
|
|
|
2021-10-18 20:55:10 +00:00
|
|
|
jsr get_noun
|
2021-09-30 03:51:04 +00:00
|
|
|
|
2021-12-06 05:08:01 +00:00
|
|
|
|
|
|
|
;===========================================
|
|
|
|
; this is turned to a "rts" in cases where
|
|
|
|
; we want to skip the verb table
|
|
|
|
; (mostly jhonka "yes/no" and maybe in trogdor cave
|
2021-11-27 06:36:40 +00:00
|
|
|
parse_input_smc:
|
|
|
|
nop
|
2021-09-30 04:25:03 +00:00
|
|
|
|
2021-12-06 05:00:08 +00:00
|
|
|
|
|
|
|
;================================
|
|
|
|
; check for "dan"
|
|
|
|
|
|
|
|
lda CURRENT_NOUN
|
|
|
|
cmp #NOUN_DAN
|
|
|
|
bne not_dan
|
|
|
|
|
|
|
|
ldx #<dan_message
|
|
|
|
ldy #>dan_message
|
|
|
|
jmp finish_parse_message
|
|
|
|
|
|
|
|
not_dan:
|
|
|
|
|
2021-12-06 06:17:58 +00:00
|
|
|
;=================================
|
|
|
|
; check if "look"ing at something in inventory
|
|
|
|
|
|
|
|
lda CURRENT_VERB
|
|
|
|
cmp #VERB_LOOK
|
|
|
|
bne not_look
|
|
|
|
|
|
|
|
jsr look_check_if_in_inventory
|
|
|
|
|
|
|
|
; if carry clear then can return early
|
|
|
|
|
|
|
|
bcs not_look
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
not_look:
|
|
|
|
|
2021-09-30 04:25:03 +00:00
|
|
|
;================================
|
2021-10-20 03:56:02 +00:00
|
|
|
; jump into verb table
|
2021-09-30 04:25:03 +00:00
|
|
|
|
2021-09-30 03:51:04 +00:00
|
|
|
lda CURRENT_VERB
|
|
|
|
|
2021-10-12 12:18:33 +00:00
|
|
|
; jump table
|
|
|
|
asl
|
|
|
|
tax
|
|
|
|
lda verb_table+1, X ; high byte first
|
|
|
|
pha
|
|
|
|
lda verb_table,X ; low byte next
|
|
|
|
pha
|
|
|
|
rts ; jump to routine
|
|
|
|
|
2021-10-04 01:59:24 +00:00
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
;==============================
|
|
|
|
;==============================
|
|
|
|
;==============================
|
|
|
|
;==============================
|
|
|
|
; common routines
|
|
|
|
;==============================
|
|
|
|
;==============================
|
|
|
|
;==============================
|
|
|
|
;==============================
|
2021-10-19 19:55:24 +00:00
|
|
|
|
|
|
|
|
2021-10-12 16:19:14 +00:00
|
|
|
;================
|
2021-10-20 03:56:02 +00:00
|
|
|
; ask
|
2021-10-12 16:19:14 +00:00
|
|
|
;================
|
2021-10-20 03:56:02 +00:00
|
|
|
parse_common_ask:
|
|
|
|
ldx #<unknown_ask_message
|
|
|
|
ldy #>unknown_ask_message
|
2021-10-12 16:19:14 +00:00
|
|
|
jmp finish_parse_message
|
|
|
|
|
|
|
|
;================
|
2021-10-20 03:56:02 +00:00
|
|
|
; boo
|
2021-10-12 16:19:14 +00:00
|
|
|
;================
|
2021-10-20 03:56:02 +00:00
|
|
|
parse_common_boo:
|
|
|
|
ldx #<boo_message
|
|
|
|
ldy #>boo_message
|
2021-10-12 16:19:14 +00:00
|
|
|
jmp finish_parse_message
|
|
|
|
|
|
|
|
;================
|
2021-10-20 03:56:02 +00:00
|
|
|
; cheat
|
2021-10-12 16:19:14 +00:00
|
|
|
;================
|
2021-10-20 03:56:02 +00:00
|
|
|
parse_common_cheat:
|
2021-10-12 16:19:14 +00:00
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
ldx #<cheat_message
|
|
|
|
ldy #>cheat_message
|
2021-10-12 16:19:14 +00:00
|
|
|
jmp finish_parse_message
|
|
|
|
|
|
|
|
;================
|
|
|
|
; climb
|
|
|
|
;================
|
2021-10-20 03:56:02 +00:00
|
|
|
parse_common_climb:
|
2021-10-12 16:19:14 +00:00
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
lda CURRENT_NOUN
|
|
|
|
cmp #NOUN_TREE
|
|
|
|
beq climb_tree
|
2021-10-12 16:19:14 +00:00
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
jmp parse_common_unknown
|
2021-10-12 16:19:14 +00:00
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
climb_tree:
|
2021-12-06 05:22:13 +00:00
|
|
|
lda GAME_STATE_1
|
|
|
|
and #NIGHT
|
|
|
|
beq climb_tree_day
|
|
|
|
|
|
|
|
climb_tree_night:
|
|
|
|
ldx #<climb_tree_night_message
|
|
|
|
ldy #>climb_tree_night_message
|
|
|
|
jmp finish_parse_message
|
|
|
|
|
|
|
|
climb_tree_day:
|
2021-10-20 03:56:02 +00:00
|
|
|
ldx #<climb_tree_message
|
|
|
|
ldy #>climb_tree_message
|
2021-10-12 16:19:14 +00:00
|
|
|
jmp finish_parse_message
|
|
|
|
|
2021-10-12 12:18:33 +00:00
|
|
|
;=================
|
|
|
|
; copy
|
|
|
|
;=================
|
2021-08-18 04:29:23 +00:00
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
parse_common_copy:
|
2021-08-18 04:29:23 +00:00
|
|
|
|
|
|
|
; want copy
|
|
|
|
lda #NEW_FROM_DISK
|
2021-10-27 19:20:58 +00:00
|
|
|
sta LEVEL_OVER
|
2021-08-18 04:29:23 +00:00
|
|
|
|
|
|
|
lda #LOAD_COPY_CHECK
|
|
|
|
sta WHICH_LOAD
|
|
|
|
|
|
|
|
jmp done_parse_message
|
|
|
|
|
2021-10-12 12:18:33 +00:00
|
|
|
;===================
|
|
|
|
; dance
|
|
|
|
;===================
|
2021-10-04 01:59:24 +00:00
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
parse_common_dance:
|
2021-10-04 01:59:24 +00:00
|
|
|
|
2021-10-19 03:42:02 +00:00
|
|
|
ldx #<dance_message
|
|
|
|
ldy #>dance_message
|
2021-10-04 01:59:24 +00:00
|
|
|
jmp finish_parse_message
|
|
|
|
|
2021-10-12 16:19:14 +00:00
|
|
|
;===================
|
|
|
|
; die
|
|
|
|
;===================
|
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
parse_common_die:
|
2021-10-13 05:04:05 +00:00
|
|
|
lda #LOAD_GAME_OVER
|
|
|
|
sta WHICH_LOAD
|
|
|
|
|
2021-10-27 19:20:58 +00:00
|
|
|
lda #NEW_FROM_DISK
|
|
|
|
sta LEVEL_OVER
|
2021-10-12 16:19:14 +00:00
|
|
|
|
2021-10-19 03:42:02 +00:00
|
|
|
ldx #<die_message
|
|
|
|
ldy #>die_message
|
2021-10-12 16:19:14 +00:00
|
|
|
jmp finish_parse_message
|
|
|
|
|
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
;================
|
|
|
|
; ditch/drop
|
|
|
|
;================
|
|
|
|
parse_common_ditch:
|
|
|
|
parse_common_drop:
|
|
|
|
lda CURRENT_NOUN
|
|
|
|
cmp #NOUN_BABY
|
|
|
|
beq ditch_baby
|
|
|
|
|
|
|
|
jmp parse_common_unknown
|
|
|
|
|
|
|
|
ditch_baby:
|
|
|
|
lda INVENTORY_1
|
2021-12-06 05:22:13 +00:00
|
|
|
and #INV1_BABY
|
2021-10-20 03:56:02 +00:00
|
|
|
beq no_baby
|
|
|
|
|
2021-12-06 05:39:07 +00:00
|
|
|
lda INVENTORY_1_GONE
|
|
|
|
and #INV1_BABY
|
|
|
|
bne no_baby
|
|
|
|
|
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
ldx #<ditch_baby_message
|
|
|
|
ldy #>ditch_baby_message
|
|
|
|
jmp finish_parse_message
|
|
|
|
|
|
|
|
no_baby:
|
|
|
|
ldx #<no_baby_message
|
|
|
|
ldy #>no_baby_message
|
|
|
|
jmp finish_parse_message
|
|
|
|
|
2021-10-12 12:18:33 +00:00
|
|
|
;=====================
|
|
|
|
; drink
|
|
|
|
;=====================
|
2021-10-04 01:59:24 +00:00
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
parse_common_drink:
|
2021-10-04 01:59:24 +00:00
|
|
|
|
2021-10-19 03:42:02 +00:00
|
|
|
ldx #<drink_message
|
|
|
|
ldy #>drink_message
|
2021-10-19 20:59:46 +00:00
|
|
|
jsr partial_message_step
|
2021-10-04 01:59:24 +00:00
|
|
|
|
2021-10-19 03:42:02 +00:00
|
|
|
ldx #<drink_message2
|
|
|
|
ldy #>drink_message2
|
2021-10-04 01:59:24 +00:00
|
|
|
|
|
|
|
jmp finish_parse_message
|
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
;================
|
|
|
|
; drop/throw
|
|
|
|
;================
|
|
|
|
parse_common_throw:
|
2021-12-06 05:22:13 +00:00
|
|
|
lda CURRENT_NOUN
|
|
|
|
cmp #NOUN_BABY
|
|
|
|
beq throw_baby
|
|
|
|
|
|
|
|
jmp parse_common_unknown
|
|
|
|
|
|
|
|
throw_baby:
|
|
|
|
lda INVENTORY_1
|
|
|
|
and #INV1_BABY
|
|
|
|
beq throw_baby_no_baby
|
|
|
|
|
2021-12-06 05:39:07 +00:00
|
|
|
lda INVENTORY_1_GONE
|
|
|
|
and #INV1_BABY
|
|
|
|
bne throw_baby_no_baby
|
|
|
|
|
2021-12-06 05:22:13 +00:00
|
|
|
throw_baby_yes_baby:
|
|
|
|
ldx #<throw_baby_yes_message
|
|
|
|
ldy #>throw_baby_yes_message
|
|
|
|
jmp finish_parse_message
|
|
|
|
|
|
|
|
throw_baby_no_baby:
|
2021-10-20 03:56:02 +00:00
|
|
|
ldx #<no_baby_message
|
|
|
|
ldy #>no_baby_message
|
|
|
|
jmp finish_parse_message
|
|
|
|
|
|
|
|
|
|
|
|
;================
|
|
|
|
; get/take/steal
|
|
|
|
;================
|
|
|
|
parse_common_get:
|
|
|
|
parse_common_take:
|
|
|
|
parse_common_steal:
|
2021-10-25 04:44:57 +00:00
|
|
|
lda CURRENT_NOUN
|
|
|
|
cmp #NOUN_PEBBLES
|
|
|
|
bne not_pebbles
|
|
|
|
|
|
|
|
was_pebbles:
|
|
|
|
lda INVENTORY_1
|
|
|
|
and #INV1_PEBBLES
|
|
|
|
beq not_pebbles
|
|
|
|
|
|
|
|
ldx #<get_pebbles_message
|
|
|
|
ldy #>get_pebbles_message
|
|
|
|
jmp finish_parse_message
|
|
|
|
|
|
|
|
not_pebbles:
|
2021-10-20 03:56:02 +00:00
|
|
|
ldx #<get_message
|
|
|
|
ldy #>get_message
|
|
|
|
jmp finish_parse_message
|
|
|
|
|
|
|
|
|
|
|
|
;================
|
|
|
|
; give
|
|
|
|
;================
|
|
|
|
parse_common_give:
|
|
|
|
ldx #<give_message
|
|
|
|
ldy #>give_message
|
|
|
|
jmp finish_parse_message
|
|
|
|
|
|
|
|
|
|
|
|
;================
|
|
|
|
; go
|
|
|
|
;================
|
|
|
|
parse_common_go:
|
|
|
|
ldx #<go_message
|
|
|
|
ldy #>go_message
|
|
|
|
jmp finish_parse_message
|
|
|
|
|
|
|
|
|
|
|
|
;================
|
|
|
|
; haldo
|
|
|
|
;================
|
|
|
|
parse_common_haldo:
|
|
|
|
ldx #<haldo_message
|
|
|
|
ldy #>haldo_message
|
|
|
|
jmp finish_parse_message
|
|
|
|
|
|
|
|
|
|
|
|
;================
|
|
|
|
; help
|
|
|
|
;================
|
|
|
|
parse_common_help:
|
|
|
|
ldx #<help_message
|
|
|
|
ldy #>help_message
|
|
|
|
jmp finish_parse_message
|
|
|
|
|
2021-10-04 01:59:24 +00:00
|
|
|
|
2021-10-12 12:18:33 +00:00
|
|
|
;====================
|
|
|
|
; inventory
|
|
|
|
;====================
|
2021-10-04 01:59:24 +00:00
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
parse_common_inventory:
|
2021-08-31 05:15:12 +00:00
|
|
|
|
2021-10-18 02:56:46 +00:00
|
|
|
; switch in LC bank2
|
|
|
|
|
|
|
|
lda LCBANK2
|
|
|
|
lda LCBANK2
|
|
|
|
|
2021-08-31 05:15:12 +00:00
|
|
|
jsr show_inventory
|
|
|
|
|
2021-10-18 02:56:46 +00:00
|
|
|
; switch back LC bank1
|
|
|
|
|
|
|
|
lda LCBANK1
|
|
|
|
lda LCBANK1
|
|
|
|
|
2021-08-31 05:15:12 +00:00
|
|
|
jmp restore_parse_message
|
|
|
|
|
2021-10-12 12:18:33 +00:00
|
|
|
;=====================
|
|
|
|
; load
|
|
|
|
;=====================
|
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
parse_common_load:
|
2021-08-18 04:29:23 +00:00
|
|
|
|
2021-09-19 22:49:00 +00:00
|
|
|
jsr load_menu
|
|
|
|
|
2021-09-21 04:14:09 +00:00
|
|
|
jmp restore_parse_message
|
2021-09-19 22:49:00 +00:00
|
|
|
|
2021-10-12 12:18:33 +00:00
|
|
|
;=================
|
|
|
|
; look
|
|
|
|
;=================
|
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
parse_common_look:
|
2021-09-19 22:49:00 +00:00
|
|
|
|
2021-10-19 03:42:02 +00:00
|
|
|
lda CURRENT_NOUN
|
2021-10-19 19:55:24 +00:00
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
cmp #NOUN_TREE
|
|
|
|
beq trees_look
|
2021-10-19 19:55:24 +00:00
|
|
|
|
2021-10-19 03:42:02 +00:00
|
|
|
irrelevant_look:
|
|
|
|
ldx #<look_irrelevant_message
|
|
|
|
ldy #>look_irrelevant_message
|
2021-08-18 04:29:23 +00:00
|
|
|
jmp finish_parse_message
|
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
trees_look:
|
|
|
|
ldx #<look_trees_message
|
|
|
|
ldy #>look_trees_message
|
2021-08-18 04:29:23 +00:00
|
|
|
jmp finish_parse_message
|
|
|
|
|
2021-10-19 20:59:46 +00:00
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
;================
|
|
|
|
; map
|
|
|
|
;================
|
|
|
|
parse_common_map:
|
2021-11-07 19:01:30 +00:00
|
|
|
|
|
|
|
lda INVENTORY_3
|
|
|
|
and #INV3_MAP
|
|
|
|
beq dont_have_map
|
|
|
|
|
|
|
|
do_have_map:
|
|
|
|
lda MAP_LOCATION
|
|
|
|
sta PREVIOUS_LOCATION
|
|
|
|
lda #LOAD_MAP
|
|
|
|
sta WHICH_LOAD
|
|
|
|
lda #LOCATION_MAP
|
|
|
|
sta MAP_LOCATION
|
|
|
|
lda #1
|
|
|
|
sta LEVEL_OVER
|
|
|
|
jmp done_parse_message
|
|
|
|
|
|
|
|
dont_have_map:
|
2021-10-20 03:56:02 +00:00
|
|
|
ldx #<map_message
|
|
|
|
ldy #>map_message
|
|
|
|
jmp finish_parse_message
|
2021-10-19 20:59:46 +00:00
|
|
|
|
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
;================
|
|
|
|
; party
|
|
|
|
;================
|
|
|
|
parse_common_party:
|
|
|
|
ldx #<party_message
|
|
|
|
ldy #>party_message
|
|
|
|
jmp finish_parse_message
|
2021-10-19 20:59:46 +00:00
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
;=====================
|
|
|
|
; pwd
|
|
|
|
;=====================
|
|
|
|
parse_common_pwd:
|
2021-10-19 20:59:46 +00:00
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
ldx MAP_LOCATION
|
|
|
|
lda location_names_l,X
|
|
|
|
sta INL
|
|
|
|
lda location_names_h,X
|
|
|
|
sta INH
|
2021-10-19 20:59:46 +00:00
|
|
|
|
2021-12-06 05:08:01 +00:00
|
|
|
lda #<(pwd_message_offset)
|
2021-10-20 03:56:02 +00:00
|
|
|
sta OUTL
|
2021-12-06 05:08:01 +00:00
|
|
|
lda #>(pwd_message_offset)
|
2021-10-20 03:56:02 +00:00
|
|
|
sta OUTH
|
2021-10-19 20:59:46 +00:00
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
ldy #0
|
|
|
|
pwd_loop:
|
|
|
|
lda (INL),Y
|
|
|
|
sta (OUTL),Y
|
|
|
|
beq pwd_done
|
|
|
|
iny
|
|
|
|
bne pwd_loop ; bra
|
2021-10-19 20:59:46 +00:00
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
pwd_done:
|
2021-10-19 20:59:46 +00:00
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
ldx #<pwd_message
|
|
|
|
ldy #>pwd_message
|
|
|
|
jmp finish_parse_message
|
2021-10-19 20:59:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
;================
|
|
|
|
; quit
|
|
|
|
;================
|
|
|
|
parse_common_quit:
|
|
|
|
ldx #<quit_message
|
|
|
|
ldy #>quit_message
|
2021-10-19 20:59:46 +00:00
|
|
|
jmp finish_parse_message
|
|
|
|
|
2021-10-12 12:18:33 +00:00
|
|
|
;===================
|
|
|
|
; save
|
|
|
|
;===================
|
2021-10-20 03:56:02 +00:00
|
|
|
parse_common_save:
|
2021-09-30 03:51:04 +00:00
|
|
|
|
|
|
|
jsr save_menu
|
|
|
|
|
|
|
|
jmp restore_parse_message
|
|
|
|
|
2021-10-12 12:18:33 +00:00
|
|
|
;===================
|
|
|
|
; show
|
|
|
|
;===================
|
2021-08-24 17:38:03 +00:00
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
parse_common_show:
|
2021-08-24 17:38:03 +00:00
|
|
|
|
2021-09-29 20:13:38 +00:00
|
|
|
bit LORES
|
|
|
|
bit PAGE1
|
2021-08-24 17:38:03 +00:00
|
|
|
|
2021-09-29 20:13:38 +00:00
|
|
|
jsr wait_until_keypress
|
|
|
|
|
|
|
|
bit PAGE2
|
|
|
|
bit HIRES
|
2021-08-24 17:38:03 +00:00
|
|
|
|
2021-09-29 20:13:38 +00:00
|
|
|
jmp done_parse_message
|
2021-09-29 04:17:39 +00:00
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
;================
|
|
|
|
; smell / sniff
|
|
|
|
;================
|
|
|
|
parse_common_smell:
|
|
|
|
parse_common_sniff:
|
|
|
|
ldx #<smell_message
|
|
|
|
ldy #>smell_message
|
|
|
|
jmp finish_parse_message
|
|
|
|
|
|
|
|
;===================
|
|
|
|
; talk
|
|
|
|
;===================
|
|
|
|
|
|
|
|
parse_common_talk:
|
|
|
|
|
|
|
|
; else, no one
|
|
|
|
talk_noone:
|
|
|
|
ldx #<talk_noone_message
|
|
|
|
ldy #>talk_noone_message
|
|
|
|
jmp finish_parse_message
|
|
|
|
|
|
|
|
;==================
|
|
|
|
; unknown
|
|
|
|
;=================
|
|
|
|
parse_common_unknown:
|
|
|
|
ldx #<unknown_message
|
|
|
|
ldy #>unknown_message
|
|
|
|
jmp finish_parse_message
|
|
|
|
|
2021-10-12 12:18:33 +00:00
|
|
|
;=====================
|
|
|
|
; version
|
|
|
|
;=====================
|
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
parse_common_version:
|
2021-08-18 04:29:23 +00:00
|
|
|
|
2021-10-19 03:42:02 +00:00
|
|
|
ldx #<version_message
|
|
|
|
ldy #>version_message
|
2021-08-18 04:29:23 +00:00
|
|
|
jmp finish_parse_message
|
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
|
|
|
|
;================
|
|
|
|
; wear
|
|
|
|
;================
|
|
|
|
parse_common_wear:
|
|
|
|
|
|
|
|
lda CURRENT_NOUN
|
2021-11-29 05:43:12 +00:00
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
cmp #NOUN_ROBE
|
2021-11-29 05:43:12 +00:00
|
|
|
beq parse_common_wear_robe
|
|
|
|
cmp #NOUN_BELT
|
|
|
|
beq parse_common_wear_belt
|
|
|
|
cmp #NOUN_MASK
|
|
|
|
beq parse_common_wear_mask
|
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
bne wear_unknown
|
|
|
|
|
2021-11-29 05:43:12 +00:00
|
|
|
parse_common_wear_belt:
|
|
|
|
; first see if have it
|
|
|
|
|
|
|
|
lda INVENTORY_1
|
|
|
|
and #INV1_KERREK_BELT
|
|
|
|
beq wear_unknown
|
|
|
|
|
|
|
|
ldx #<wear_belt_message
|
|
|
|
ldy #>wear_belt_message
|
|
|
|
jmp finish_parse_message
|
|
|
|
|
|
|
|
parse_common_wear_mask:
|
|
|
|
; first see if have it
|
|
|
|
|
|
|
|
lda INVENTORY_1
|
|
|
|
and #INV1_MONSTER_MASK
|
|
|
|
beq wear_unknown
|
|
|
|
|
|
|
|
ldx #<wear_mask_message
|
|
|
|
ldy #>wear_mask_message
|
|
|
|
jmp finish_parse_message
|
|
|
|
|
|
|
|
|
|
|
|
parse_common_wear_robe:
|
|
|
|
; first check if have it
|
|
|
|
|
|
|
|
lda INVENTORY_2
|
|
|
|
and #INV2_ROBE
|
|
|
|
beq parse_common_wear_robe_no_have
|
|
|
|
|
|
|
|
; next check if already wearing
|
|
|
|
|
|
|
|
lda GAME_STATE_1
|
|
|
|
and #WEARING_ROBE
|
2021-11-29 05:51:25 +00:00
|
|
|
bne parse_common_wear_robe_already
|
2021-11-29 05:43:12 +00:00
|
|
|
|
|
|
|
parse_common_wear_robe_do_have:
|
|
|
|
; wear the robe
|
|
|
|
|
|
|
|
lda GAME_STATE_1
|
|
|
|
ora #WEARING_ROBE
|
|
|
|
sta GAME_STATE_1
|
|
|
|
|
|
|
|
; get 3 points
|
|
|
|
|
|
|
|
lda #3
|
|
|
|
jsr score_points
|
|
|
|
|
|
|
|
ldx #<wear_robe_message
|
|
|
|
ldy #>wear_robe_message
|
|
|
|
jmp finish_parse_message
|
|
|
|
|
2021-11-29 05:51:25 +00:00
|
|
|
parse_common_wear_robe_already:
|
|
|
|
ldx #<wear_robe_already_message
|
|
|
|
ldy #>wear_robe_already_message
|
|
|
|
jmp finish_parse_message
|
2021-11-29 05:43:12 +00:00
|
|
|
|
|
|
|
parse_common_wear_robe_no_have:
|
2021-10-20 03:56:02 +00:00
|
|
|
ldx #<wear_robe_none_message
|
|
|
|
ldy #>wear_robe_none_message
|
|
|
|
jsr partial_message_step
|
|
|
|
|
|
|
|
ldx #<wear_robe_none_message2
|
|
|
|
ldy #>wear_robe_none_message2
|
|
|
|
jmp finish_parse_message
|
|
|
|
|
|
|
|
wear_unknown:
|
|
|
|
jmp parse_common_unknown
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;================
|
|
|
|
; this / what the
|
|
|
|
;================
|
|
|
|
parse_common_this:
|
|
|
|
parse_common_what:
|
|
|
|
ldx #<what_message
|
|
|
|
ldy #>what_message
|
|
|
|
jmp finish_parse_message
|
|
|
|
|
2021-10-12 12:18:33 +00:00
|
|
|
;=====================
|
|
|
|
; where
|
|
|
|
;=====================
|
2021-10-20 03:56:02 +00:00
|
|
|
parse_common_where:
|
2021-10-04 02:41:02 +00:00
|
|
|
|
|
|
|
ldx MAP_LOCATION
|
|
|
|
lda location_names_l,X
|
|
|
|
sta INL
|
|
|
|
lda location_names_h,X
|
|
|
|
sta INH
|
|
|
|
|
2021-11-21 06:16:03 +00:00
|
|
|
lda #<(where_message_offset)
|
2021-10-04 02:41:02 +00:00
|
|
|
sta OUTL
|
2021-11-21 06:16:03 +00:00
|
|
|
lda #>(where_message_offset)
|
2021-10-04 02:41:02 +00:00
|
|
|
sta OUTH
|
|
|
|
|
|
|
|
ldy #0
|
|
|
|
where_loop:
|
|
|
|
lda (INL),Y
|
|
|
|
sta (OUTL),Y
|
|
|
|
beq where_done
|
|
|
|
iny
|
|
|
|
bne where_loop ; bra
|
|
|
|
|
|
|
|
where_done:
|
|
|
|
|
2021-10-19 03:42:02 +00:00
|
|
|
ldx #<where_message
|
|
|
|
ldy #>where_message
|
2021-10-04 02:41:02 +00:00
|
|
|
jmp finish_parse_message
|
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
;================
|
|
|
|
; why
|
|
|
|
;================
|
|
|
|
parse_common_why:
|
|
|
|
ldx #<why_message
|
|
|
|
ldy #>why_message
|
2021-10-12 12:18:33 +00:00
|
|
|
jmp finish_parse_message
|
|
|
|
|
2021-08-18 04:29:23 +00:00
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-08-18 04:29:23 +00:00
|
|
|
finish_parse_message:
|
2021-10-19 03:42:02 +00:00
|
|
|
stx OUTL
|
|
|
|
sty OUTH
|
2021-10-04 01:59:24 +00:00
|
|
|
jsr print_text_message
|
2021-08-18 04:29:23 +00:00
|
|
|
|
|
|
|
jsr wait_until_keypress
|
|
|
|
|
2021-08-31 05:15:12 +00:00
|
|
|
|
|
|
|
restore_parse_message:
|
|
|
|
|
2021-08-18 04:29:23 +00:00
|
|
|
jsr hgr_partial_restore
|
|
|
|
|
2021-10-05 01:51:20 +00:00
|
|
|
|
2021-08-24 17:38:03 +00:00
|
|
|
done_parse_message:
|
2021-08-18 04:29:23 +00:00
|
|
|
|
|
|
|
|
2021-08-24 17:38:03 +00:00
|
|
|
rts
|
2021-09-30 03:51:04 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;===========================
|
|
|
|
; get verb
|
|
|
|
;===========================
|
2021-10-18 20:55:10 +00:00
|
|
|
; verb has to be the first word
|
|
|
|
|
2021-09-30 03:51:04 +00:00
|
|
|
get_verb:
|
|
|
|
lda #VERB_UNKNOWN ; default
|
|
|
|
sta CURRENT_VERB
|
|
|
|
|
|
|
|
lda #<verb_lookup ; reset verb pointer
|
|
|
|
sta get_verb_loop+1
|
|
|
|
lda #>verb_lookup
|
|
|
|
sta get_verb_loop+2
|
|
|
|
|
|
|
|
next_verb_loop:
|
2021-10-19 03:42:02 +00:00
|
|
|
ldx #0 ; set input pointer to zero
|
|
|
|
stx WORD_MATCH ; set match count to zero
|
2021-10-18 20:55:10 +00:00
|
|
|
|
2021-09-30 03:51:04 +00:00
|
|
|
get_verb_loop:
|
2021-10-18 20:55:10 +00:00
|
|
|
lda verb_lookup ; get char from verb
|
|
|
|
bmi done_verb ; if high bit set, done this verb
|
|
|
|
beq done_get_verb_loop ; if zero, we're totally done
|
|
|
|
|
|
|
|
cmp input_buffer,X ; compare verb char to buffer
|
|
|
|
beq verb_char_matched ;
|
2021-09-30 03:51:04 +00:00
|
|
|
verb_char_nomatch:
|
2021-10-18 20:55:10 +00:00
|
|
|
dec WORD_MATCH ; indicate no match
|
2021-09-30 03:51:04 +00:00
|
|
|
verb_char_matched:
|
2021-10-18 20:55:10 +00:00
|
|
|
jsr inc_verb_ptr ; matched, increment verb pointer
|
|
|
|
inx ; increment input pointer
|
|
|
|
jmp get_verb_loop ; (bra) loop
|
2021-09-30 03:51:04 +00:00
|
|
|
|
|
|
|
done_verb:
|
2021-10-18 20:55:10 +00:00
|
|
|
ldx WORD_MATCH ; check if we matched
|
|
|
|
beq found_verb ; if so, found
|
2021-09-30 03:51:04 +00:00
|
|
|
|
|
|
|
no_found_verb:
|
2021-10-18 20:55:10 +00:00
|
|
|
jsr inc_verb_ptr ; not found, point to next verb
|
|
|
|
jmp next_verb_loop ; try again
|
2021-09-30 03:51:04 +00:00
|
|
|
|
|
|
|
found_verb:
|
2021-10-18 20:55:10 +00:00
|
|
|
and #$7f ; found
|
|
|
|
sta CURRENT_VERB ; strip high bit and save found verb
|
2021-09-30 03:51:04 +00:00
|
|
|
|
|
|
|
done_get_verb_loop:
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
inc_verb_ptr:
|
|
|
|
inc get_verb_loop+1
|
|
|
|
bne inc_verb_ptr_noflo
|
|
|
|
inc get_verb_loop+2
|
|
|
|
inc_verb_ptr_noflo:
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
verb_lookup:
|
2021-10-18 18:01:13 +00:00
|
|
|
.byte "ASK",VERB_ASK|$80
|
2021-10-25 03:19:14 +00:00
|
|
|
.byte "ATTACK",VERB_ATTACK|$80
|
2021-10-12 16:19:14 +00:00
|
|
|
.byte "BOO",VERB_BOO|$80
|
2021-10-18 18:01:13 +00:00
|
|
|
.byte "BREAK",VERB_BREAK|$80
|
|
|
|
.byte "BUY",VERB_BUY|$80
|
2021-10-04 01:59:24 +00:00
|
|
|
.byte "CHEAT",VERB_CHEAT|$80
|
2021-10-12 16:19:14 +00:00
|
|
|
.byte "CLIMB",VERB_CLIMB|$80
|
2021-10-18 18:01:13 +00:00
|
|
|
.byte "CLOSE",VERB_CLOSE|$80
|
2021-09-30 03:51:04 +00:00
|
|
|
.byte "COPY",VERB_COPY|$80
|
2021-10-25 03:19:14 +00:00
|
|
|
.byte "CUT",VERB_CUT|$80
|
2021-10-04 01:59:24 +00:00
|
|
|
.byte "DANCE",VERB_DANCE|$80
|
2021-10-18 18:01:13 +00:00
|
|
|
.byte "DEPLOY",VERB_DEPLOY|$80
|
2021-10-12 16:19:14 +00:00
|
|
|
.byte "DIE",VERB_DIE|$80
|
2021-10-18 18:01:13 +00:00
|
|
|
.byte "DITCH",VERB_DITCH|$80
|
2021-10-04 01:59:24 +00:00
|
|
|
.byte "DRINK",VERB_DRINK|$80
|
2021-10-12 16:19:14 +00:00
|
|
|
.byte "DROP",VERB_DROP|$80
|
2021-10-18 18:01:13 +00:00
|
|
|
.byte "ENTER",VERB_ENTER|$80
|
|
|
|
.byte "FEED",VERB_FEED|$80
|
2021-10-12 16:19:14 +00:00
|
|
|
.byte "GET",VERB_GET|$80
|
|
|
|
.byte "GIVE",VERB_GIVE|$80
|
|
|
|
.byte "GO ",VERB_GO|$80
|
|
|
|
.byte "HALDO",VERB_HALDO|$80
|
|
|
|
.byte "HELP",VERB_HELP|$80
|
2021-10-25 03:19:14 +00:00
|
|
|
.byte "HIDE",VERB_HIDE|$80
|
|
|
|
.byte "HUG",VERB_HUG|$80
|
2021-09-30 03:51:04 +00:00
|
|
|
.byte "INV",VERB_INVENTORY|$80
|
2021-10-18 18:01:13 +00:00
|
|
|
.byte "JUMP",VERB_JUMP|$80
|
|
|
|
.byte "KICK",VERB_KICK|$80
|
|
|
|
.byte "KILL",VERB_KILL|$80
|
|
|
|
.byte "KNOCK",VERB_KNOCK|$80
|
|
|
|
.byte "LIGHT",VERB_LIGHT|$80
|
2021-09-30 03:51:04 +00:00
|
|
|
.byte "LOAD",VERB_LOAD|$80
|
|
|
|
.byte "LOOK",VERB_LOOK|$80
|
2021-10-18 18:01:13 +00:00
|
|
|
.byte "MAKE",VERB_MAKE|$80
|
2021-10-12 16:19:14 +00:00
|
|
|
.byte "MAP",VERB_MAP|$80
|
2021-10-25 03:19:14 +00:00
|
|
|
.byte "MOVE",VERB_MOVE|$80
|
2021-10-18 18:01:13 +00:00
|
|
|
.byte "NO",VERB_NO|$80
|
|
|
|
.byte "OPEN",VERB_OPEN|$80
|
2021-10-12 16:19:14 +00:00
|
|
|
.byte "PARTY",VERB_PARTY|$80
|
2021-10-18 18:01:13 +00:00
|
|
|
.byte "PET",VERB_PET|$80
|
|
|
|
.byte "PLAY",VERB_PLAY|$80
|
|
|
|
.byte "PULL",VERB_PULL|$80
|
|
|
|
.byte "PUNCH",VERB_PUNCH|$80
|
|
|
|
.byte "PUSH",VERB_PUSH|$80
|
|
|
|
.byte "PUT",VERB_PUT|$80
|
|
|
|
.byte "PWD",VERB_PWD|$80
|
2021-10-12 16:19:14 +00:00
|
|
|
.byte "QUIT",VERB_QUIT|$80
|
2021-10-18 18:01:13 +00:00
|
|
|
.byte "READ",VERB_READ|$80
|
|
|
|
.byte "RIDE",VERB_RIDE|$80
|
|
|
|
.byte "RING",VERB_RING|$80
|
|
|
|
.byte "SAVE",VERB_SAVE|$80
|
2021-11-01 04:13:47 +00:00
|
|
|
.byte "SAY",VERB_SAY|$80
|
2021-10-18 18:01:13 +00:00
|
|
|
.byte "SCARE",VERB_SCARE|$80
|
2021-11-19 04:54:25 +00:00
|
|
|
.byte "SEARCH",VERB_SEARCH|$80
|
2021-10-18 18:01:13 +00:00
|
|
|
.byte "SHOOT",VERB_SHOOT|$80
|
|
|
|
.byte "SHOW",VERB_SHOW|$80
|
|
|
|
.byte "SIT",VERB_SIT|$80
|
|
|
|
.byte "SKIP",VERB_SKIP|$80
|
|
|
|
.byte "SLEEP",VERB_SLEEP|$80
|
2021-10-12 16:19:14 +00:00
|
|
|
.byte "SMELL",VERB_SMELL|$80
|
|
|
|
.byte "SNIFF",VERB_SNIFF|$80
|
2021-10-18 18:01:13 +00:00
|
|
|
.byte "STEAL",VERB_STEAL|$80
|
|
|
|
.byte "SWIM",VERB_SWIM|$80
|
2021-10-12 16:19:14 +00:00
|
|
|
.byte "TAKE",VERB_TAKE|$80
|
2021-09-30 03:51:04 +00:00
|
|
|
.byte "TALK",VERB_TALK|$80
|
2021-10-12 16:19:14 +00:00
|
|
|
.byte "THIS",VERB_THIS|$80
|
|
|
|
.byte "THROW",VERB_THROW|$80
|
2021-10-18 18:01:13 +00:00
|
|
|
.byte "TRY",VERB_TRY|$80
|
|
|
|
.byte "TURN",VERB_TURN|$80
|
|
|
|
.byte "USE",VERB_USE|$80
|
2021-09-30 03:51:04 +00:00
|
|
|
.byte "VER",VERB_VERSION|$80
|
2021-10-18 18:01:13 +00:00
|
|
|
.byte "WAKE",VERB_WAKE|$80
|
|
|
|
.byte "WEAR",VERB_WEAR|$80
|
2021-10-12 16:19:14 +00:00
|
|
|
.byte "WHAT THE",VERB_WHAT|$80
|
2021-10-04 02:41:02 +00:00
|
|
|
.byte "WHERE",VERB_WHERE|$80
|
2021-10-12 16:19:14 +00:00
|
|
|
.byte "WHY",VERB_WHY|$80
|
2021-10-18 18:01:13 +00:00
|
|
|
.byte "YES",VERB_YES|$80
|
2021-09-30 03:51:04 +00:00
|
|
|
.byte $00
|
2021-10-04 01:59:24 +00:00
|
|
|
|
2021-10-31 04:01:12 +00:00
|
|
|
;==========================
|
|
|
|
; get noun again
|
|
|
|
;==========================
|
|
|
|
; skips "baby" and "pebbles" and tries again
|
|
|
|
; needed for Well scene
|
|
|
|
|
|
|
|
get_noun_again:
|
|
|
|
|
|
|
|
; point to alternate
|
|
|
|
|
|
|
|
lda #<noun_lookup_again
|
|
|
|
sta get_noun_src_smc1+1
|
|
|
|
lda #>noun_lookup_again
|
|
|
|
sta get_noun_src_smc2+1
|
|
|
|
|
|
|
|
jsr get_noun
|
|
|
|
|
|
|
|
; point back
|
|
|
|
|
|
|
|
lda #<noun_lookup
|
|
|
|
sta get_noun_src_smc1+1
|
|
|
|
lda #>noun_lookup
|
|
|
|
sta get_noun_src_smc2+1
|
2021-10-04 01:59:24 +00:00
|
|
|
|
2021-10-31 04:01:12 +00:00
|
|
|
rts
|
2021-10-18 20:55:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
;===========================
|
|
|
|
;===========================
|
|
|
|
; get noun
|
|
|
|
;===========================
|
|
|
|
;===========================
|
|
|
|
;
|
|
|
|
; assume command is "VERB SOMETHING SOMETHING SOMETHING"
|
|
|
|
; skip to first space, return NONE if nothing else
|
|
|
|
; parse for first matching noun
|
|
|
|
; return UNKNOWN if no matches
|
|
|
|
|
|
|
|
get_noun:
|
2021-10-19 03:42:02 +00:00
|
|
|
lda #NOUN_NONE ; if we have to second word, then none
|
2021-10-18 20:55:10 +00:00
|
|
|
sta CURRENT_NOUN
|
|
|
|
|
2021-10-19 03:42:02 +00:00
|
|
|
ldx #0 ; input pointer
|
|
|
|
|
|
|
|
try_next_word:
|
|
|
|
jsr noun_next_space
|
|
|
|
bcs done_get_noun_loop
|
|
|
|
|
|
|
|
stx TEMP0 ; save input pointer
|
|
|
|
|
2021-10-31 04:01:12 +00:00
|
|
|
get_noun_src_smc1:
|
2021-10-19 03:42:02 +00:00
|
|
|
lda #<noun_lookup ; reset noun pointer
|
2021-10-18 20:55:10 +00:00
|
|
|
sta get_noun_smc+1
|
2021-10-31 04:01:12 +00:00
|
|
|
get_noun_src_smc2:
|
2021-10-18 20:55:10 +00:00
|
|
|
lda #>noun_lookup
|
|
|
|
sta get_noun_smc+2
|
|
|
|
|
2021-10-19 03:42:02 +00:00
|
|
|
lda #NOUN_UNKNOWN ; at this point we have second word
|
|
|
|
sta CURRENT_NOUN ; so if we hit end it's unknown
|
|
|
|
|
2021-10-18 20:55:10 +00:00
|
|
|
next_noun_loop:
|
2021-10-19 03:42:02 +00:00
|
|
|
ldx TEMP0 ; reset to begin of current word
|
|
|
|
lda #0
|
|
|
|
sta WORD_MATCH ; set match count to zero
|
2021-10-18 20:55:10 +00:00
|
|
|
|
|
|
|
get_noun_loop:
|
|
|
|
|
|
|
|
get_noun_smc:
|
2021-10-19 03:42:02 +00:00
|
|
|
lda noun_lookup ; load byte from current noun
|
|
|
|
bmi done_noun ; if high bit set, hit end
|
|
|
|
beq try_next_word ; if zero, end of list
|
|
|
|
|
|
|
|
cmp input_buffer,X ; compare with input buffer
|
|
|
|
beq noun_char_matched ; see if matched
|
2021-10-18 20:55:10 +00:00
|
|
|
noun_char_nomatch:
|
2021-10-19 03:42:02 +00:00
|
|
|
dec WORD_MATCH ; indicate wasn't a match
|
2021-10-18 20:55:10 +00:00
|
|
|
noun_char_matched:
|
|
|
|
jsr inc_noun_ptr
|
|
|
|
inx
|
2021-10-19 03:42:02 +00:00
|
|
|
jmp get_noun_loop ; loop
|
2021-10-18 20:55:10 +00:00
|
|
|
|
|
|
|
done_noun:
|
2021-10-19 03:42:02 +00:00
|
|
|
ldx WORD_MATCH ; if we matched noun...
|
2021-10-18 20:55:10 +00:00
|
|
|
beq found_noun
|
|
|
|
|
|
|
|
no_found_noun:
|
|
|
|
jsr inc_noun_ptr
|
|
|
|
jmp next_noun_loop
|
|
|
|
|
|
|
|
found_noun:
|
2021-10-19 03:42:02 +00:00
|
|
|
and #$7f ; found, strip high bit and save
|
2021-10-18 20:55:10 +00:00
|
|
|
sta CURRENT_NOUN
|
|
|
|
|
|
|
|
done_get_noun_loop:
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
inc_noun_ptr:
|
|
|
|
inc get_noun_smc+1
|
|
|
|
bne inc_noun_ptr_noflo
|
|
|
|
inc get_noun_smc+2
|
|
|
|
inc_noun_ptr_noflo:
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
2021-10-19 03:42:02 +00:00
|
|
|
|
|
|
|
;=========================
|
|
|
|
; noun next space
|
|
|
|
;=========================
|
|
|
|
; point X to one past next space in input_buffer
|
|
|
|
; carry set if hit end
|
|
|
|
noun_next_space:
|
|
|
|
lda input_buffer,X
|
|
|
|
beq end_of_input
|
|
|
|
|
|
|
|
cmp #' '
|
|
|
|
beq end_of_word
|
|
|
|
|
|
|
|
inx
|
|
|
|
jmp noun_next_space
|
|
|
|
|
|
|
|
end_of_word:
|
|
|
|
inx ; point one past
|
|
|
|
clc
|
|
|
|
rts
|
|
|
|
|
|
|
|
end_of_input:
|
|
|
|
sec
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-10-18 20:55:10 +00:00
|
|
|
noun_lookup:
|
2021-10-31 04:01:12 +00:00
|
|
|
.byte "BABY",NOUN_BABY|$80 ; these are first
|
|
|
|
.byte "PEBBLES",NOUN_PEBBLES|$80 ; so at Well we can also
|
|
|
|
.byte "STONE",NOUN_STONE|$80 ; check for destination (bucket/well)
|
|
|
|
|
|
|
|
noun_lookup_again:
|
2021-10-18 20:55:10 +00:00
|
|
|
.byte "ARCHER",NOUN_ARCHER|$80
|
2021-10-25 03:19:14 +00:00
|
|
|
.byte "ARMS",NOUN_ARMS|$80
|
2021-10-19 19:55:24 +00:00
|
|
|
.byte "ARROW",NOUN_ARROW|$80
|
|
|
|
.byte "BEADS",NOUN_BEADS|$80
|
2021-10-31 04:01:12 +00:00
|
|
|
.byte "BED",NOUN_BED|$80
|
2021-10-19 19:55:24 +00:00
|
|
|
.byte "BELL",NOUN_BELL|$80
|
|
|
|
.byte "BELT",NOUN_BELT|$80
|
|
|
|
.byte "BERRIES",NOUN_BERRIES|$80
|
2021-10-25 03:19:14 +00:00
|
|
|
.byte "BLEED",NOUN_BLEED|$80
|
2021-10-19 19:55:24 +00:00
|
|
|
.byte "BOAT",NOUN_BOAT|$80
|
|
|
|
.byte "BONE",NOUN_BONE|$80
|
|
|
|
.byte "BOW",NOUN_BOW|$80
|
|
|
|
.byte "BROOM",NOUN_BROOM|$80
|
2021-10-25 03:19:14 +00:00
|
|
|
.byte "BUCKET",NOUN_BUCKET|$80
|
2021-10-25 02:13:58 +00:00
|
|
|
.byte "BUSH",NOUN_BUSH|$80
|
2021-10-19 19:55:24 +00:00
|
|
|
.byte "CANDLE",NOUN_CANDLE|$80
|
2021-10-31 04:01:12 +00:00
|
|
|
.byte "CARPET",NOUN_CARPET|$80
|
2021-10-19 19:55:24 +00:00
|
|
|
.byte "CAVE",NOUN_CAVE|$80
|
|
|
|
.byte "CHAIR",NOUN_CHAIR|$80
|
|
|
|
.byte "CLIFF",NOUN_CLIFF|$80
|
|
|
|
.byte "CLUB",NOUN_CLUB|$80
|
|
|
|
.byte "COLD",NOUN_COLD|$80
|
|
|
|
.byte "COTTAGE",NOUN_COTTAGE|$80
|
|
|
|
.byte "CRANK",NOUN_CRANK|$80
|
2021-10-28 17:57:48 +00:00
|
|
|
.byte "CURTAIN",NOUN_CURTAIN|$80
|
2021-10-19 19:55:24 +00:00
|
|
|
.byte "DAN",NOUN_DAN|$80
|
|
|
|
.byte "DESK",NOUN_DESK|$80
|
|
|
|
.byte "DINGHY",NOUN_DINGHY|$80
|
|
|
|
.byte "DOING",NOUN_DOING_SPROINGS|$80
|
2021-11-01 04:13:47 +00:00
|
|
|
.byte "DONGOLEV",NOUN_DONGOLEV|$80
|
2021-10-19 19:55:24 +00:00
|
|
|
.byte "DOOR",NOUN_DOOR|$80
|
|
|
|
.byte "DRAWER",NOUN_DRAWER|$80
|
|
|
|
.byte "DRESSER",NOUN_DRESSER|$80
|
|
|
|
.byte "DUDE",NOUN_DUDE|$80
|
|
|
|
.byte "FEED",NOUN_FEED|$80
|
|
|
|
.byte "FENCE",NOUN_FENCE|$80
|
|
|
|
.byte "FIRE",NOUN_FIRE|$80
|
|
|
|
.byte "FLIES",NOUN_FLIES|$80
|
|
|
|
.byte "FOOD",NOUN_FOOD|$80
|
|
|
|
.byte "FOOTPRINTS",NOUN_FOOTPRINTS|$80
|
|
|
|
.byte "GAME",NOUN_GAME|$80
|
|
|
|
.byte "GARY",NOUN_GARY|$80
|
2021-10-31 04:01:12 +00:00
|
|
|
.byte "GOLD",NOUN_GOLD|$80
|
2021-12-02 05:13:45 +00:00
|
|
|
.byte "GREASE",NOUN_GREASE|$80
|
2021-10-19 19:55:24 +00:00
|
|
|
.byte "GREEN",NOUN_GREEN|$80
|
|
|
|
.byte "GROUND",NOUN_GROUND|$80
|
|
|
|
.byte "GUY",NOUN_GUY|$80
|
2021-11-01 04:13:47 +00:00
|
|
|
.byte "HALDO",NOUN_HALDO|$80
|
2021-10-25 03:19:14 +00:00
|
|
|
.byte "IN HAY",NOUN_IN_HAY|$80
|
2021-10-19 19:55:24 +00:00
|
|
|
.byte "HAY",NOUN_HAY|$80
|
2021-12-06 06:17:58 +00:00
|
|
|
.byte "HELM",NOUN_HELM|$80
|
2021-10-19 19:55:24 +00:00
|
|
|
.byte "HOLE",NOUN_HOLE|$80
|
|
|
|
.byte "HORSE",NOUN_HORSE|$80
|
|
|
|
.byte "INN",NOUN_INN|$80
|
|
|
|
.byte "JHONKA",NOUN_JHONKA|$80
|
|
|
|
.byte "KERREK",NOUN_KERREK|$80
|
2021-10-18 20:55:10 +00:00
|
|
|
.byte "KNIGHT",NOUN_KNIGHT|$80
|
2021-10-19 19:55:24 +00:00
|
|
|
.byte "LADY",NOUN_LADY|$80
|
|
|
|
.byte "LAKE",NOUN_LAKE|$80
|
|
|
|
.byte "LANTERN",NOUN_LANTERN|$80
|
|
|
|
.byte "LEG",NOUN_LEG|$80
|
|
|
|
.byte "LIGHTNING",NOUN_LIGHTNING|$80
|
|
|
|
.byte "MAN",NOUN_MAN|$80
|
|
|
|
.byte "MAP",NOUN_MAP|$80
|
|
|
|
.byte "MASK",NOUN_MASK|$80
|
2021-10-31 04:01:12 +00:00
|
|
|
.byte "MATTRESS",NOUN_MATTRESS|$80
|
2021-10-25 03:19:14 +00:00
|
|
|
.byte "MENDELEV",NOUN_MENDELEV|$80
|
2021-10-31 04:01:12 +00:00
|
|
|
.byte "MONEY",NOUN_MONEY|$80
|
2021-10-19 19:55:24 +00:00
|
|
|
.byte "MUD",NOUN_MUD|$80
|
|
|
|
.byte "NED",NOUN_NED|$80
|
|
|
|
.byte "NOTE",NOUN_NOTE|$80
|
|
|
|
.byte "OPENINGS",NOUN_OPENINGS|$80
|
|
|
|
.byte "PAINTING",NOUN_PAINTING|$80
|
|
|
|
.byte "PAPER",NOUN_PAPER|$80
|
2021-10-31 04:01:12 +00:00
|
|
|
.byte "PARCHMENT",NOUN_PARCHMENT|$80
|
2021-10-19 19:55:24 +00:00
|
|
|
.byte "PEASANT",NOUN_PEASANT|$80
|
|
|
|
.byte "PILLOW",NOUN_PILLOW|$80
|
|
|
|
.byte "PILLS",NOUN_PILLS|$80
|
|
|
|
.byte "PLAGUE",NOUN_PLAGUE|$80
|
|
|
|
.byte "PLAQUE",NOUN_PLAQUE|$80
|
|
|
|
.byte "POT",NOUN_POT|$80
|
2021-10-25 03:19:14 +00:00
|
|
|
.byte "PUDDLE",NOUN_PUDDLE|$80
|
2021-10-19 19:55:24 +00:00
|
|
|
.byte "RICHES",NOUN_RICHES|$80
|
2021-10-25 03:19:14 +00:00
|
|
|
.byte "RIVER",NOUN_RIVER|$80
|
2021-10-19 19:55:24 +00:00
|
|
|
.byte "ROBE",NOUN_ROBE|$80
|
|
|
|
.byte "ROCK",NOUN_ROCK|$80
|
|
|
|
.byte "ROOM",NOUN_ROOM|$80
|
|
|
|
.byte "RUB",NOUN_RUB|$80
|
|
|
|
.byte "RUG",NOUN_RUG|$80
|
|
|
|
.byte "SANDWICH",NOUN_SANDWICH|$80
|
|
|
|
.byte "SAND",NOUN_SAND|$80
|
|
|
|
.byte "SHELF",NOUN_SHELF|$80
|
2021-12-06 06:17:58 +00:00
|
|
|
.byte "SHIELD",NOUN_SHIELD|$80
|
|
|
|
.byte "SHIRT",NOUN_SHIRT|$80
|
2021-10-18 20:55:10 +00:00
|
|
|
.byte "SIGN",NOUN_SIGN|$80
|
2021-10-19 19:55:24 +00:00
|
|
|
.byte "SKELETON",NOUN_SKELETON|$80
|
|
|
|
.byte "SKULL",NOUN_SKULL|$80
|
|
|
|
.byte "SMELL",NOUN_SMELL|$80
|
|
|
|
.byte "SODA",NOUN_SODA|$80
|
|
|
|
.byte "STUFF",NOUN_STUFF|$80
|
|
|
|
.byte "STUMP",NOUN_STUMP|$80
|
|
|
|
.byte "SUB",NOUN_SUB|$80
|
2021-12-06 06:17:58 +00:00
|
|
|
.byte "SWORD",NOUN_SWORD|$80
|
2021-10-19 19:55:24 +00:00
|
|
|
.byte "TARGET",NOUN_TARGET|$80
|
|
|
|
.byte "TRACKS",NOUN_TRACKS|$80
|
|
|
|
.byte "TREE",NOUN_TREE|$80
|
|
|
|
.byte "TRINKET",NOUN_TRINKET|$80
|
|
|
|
.byte "TROGDOR",NOUN_TROGDOR|$80
|
|
|
|
.byte "WATERFALL",NOUN_WATERFALL|$80
|
|
|
|
.byte "WATER",NOUN_WATER|$80
|
2021-10-24 01:14:29 +00:00
|
|
|
.byte "IN WELL",NOUN_IN_WELL|$80
|
2021-10-19 19:55:24 +00:00
|
|
|
.byte "WELL",NOUN_WELL|$80
|
|
|
|
.byte "WINDOW",NOUN_WINDOW|$80
|
2021-10-25 02:13:58 +00:00
|
|
|
.byte "WISH",NOUN_WISH|$80
|
2021-10-25 03:19:14 +00:00
|
|
|
.byte "WOMAN",NOUN_WOMAN|$80
|
2021-10-18 20:55:10 +00:00
|
|
|
.byte $00
|
|
|
|
|
|
|
|
|
2021-11-16 05:10:44 +00:00
|
|
|
.include "text/lookup.inc"
|
|
|
|
.include "text/common.inc.lookup"
|
2021-10-04 01:59:24 +00:00
|
|
|
|
|
|
|
|
2021-10-18 20:55:10 +00:00
|
|
|
;=======================
|
|
|
|
;=======================
|
2021-10-04 01:59:24 +00:00
|
|
|
; print text message
|
2021-10-18 20:55:10 +00:00
|
|
|
;=======================
|
|
|
|
;=======================
|
2021-10-04 01:59:24 +00:00
|
|
|
; OUTL/OUTH point to message
|
|
|
|
|
|
|
|
; first we need to calculate the size of the message (lines)
|
|
|
|
; next we need to set up the box
|
|
|
|
|
|
|
|
print_text_message:
|
|
|
|
jsr count_message_lines
|
|
|
|
|
2021-10-18 18:18:13 +00:00
|
|
|
lda #0 ; always 0
|
2021-10-04 01:59:24 +00:00
|
|
|
sta BOX_X1H
|
2021-10-18 18:18:13 +00:00
|
|
|
sta BOX_X2H
|
2021-10-04 01:59:24 +00:00
|
|
|
|
2021-10-18 18:18:13 +00:00
|
|
|
lda #35 ; always 35
|
2021-10-04 01:59:24 +00:00
|
|
|
sta BOX_X1L
|
|
|
|
|
2021-10-18 18:18:13 +00:00
|
|
|
lda #24 ; always 24
|
2021-10-04 01:59:24 +00:00
|
|
|
sta BOX_Y1
|
|
|
|
|
2021-10-18 18:18:13 +00:00
|
|
|
lda #253 ; always 253
|
2021-10-04 01:59:24 +00:00
|
|
|
sta BOX_X2L
|
|
|
|
|
2021-10-18 18:18:13 +00:00
|
|
|
; 1 2 3 4 5 6 7 8
|
|
|
|
;message_y2: .byte 54, 62, 70, 78, 86, 94, 102, 110
|
|
|
|
|
|
|
|
; y2 is 46+(8*(len))
|
|
|
|
|
|
|
|
lda message_len
|
|
|
|
asl
|
|
|
|
asl
|
|
|
|
asl
|
|
|
|
clc
|
|
|
|
adc #46
|
|
|
|
|
2021-10-04 01:59:24 +00:00
|
|
|
sta BOX_Y2
|
|
|
|
|
|
|
|
jsr hgr_partial_save
|
|
|
|
|
|
|
|
jsr draw_box
|
|
|
|
|
2021-10-18 20:55:10 +00:00
|
|
|
; print text at 7 (*7), 36
|
2021-10-04 01:59:24 +00:00
|
|
|
|
2021-10-18 18:18:13 +00:00
|
|
|
lda #7 ; always 7
|
2021-10-04 01:59:24 +00:00
|
|
|
sta CURSOR_X
|
|
|
|
|
2021-10-18 18:18:13 +00:00
|
|
|
lda #36 ; always 36
|
2021-10-04 01:59:24 +00:00
|
|
|
sta CURSOR_Y
|
|
|
|
|
|
|
|
jsr disp_put_string_cursor
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
2021-10-18 20:55:10 +00:00
|
|
|
;======================
|
2021-10-04 01:59:24 +00:00
|
|
|
;======================
|
|
|
|
; count message lines
|
2021-10-18 20:55:10 +00:00
|
|
|
;======================
|
|
|
|
;======================
|
2021-10-04 01:59:24 +00:00
|
|
|
; in OUTL/OUTH
|
|
|
|
count_message_lines:
|
|
|
|
ldy #0
|
|
|
|
sty message_len
|
|
|
|
count_message_lines_loop:
|
|
|
|
lda (OUTL),Y
|
|
|
|
beq count_message_done
|
|
|
|
cmp #13
|
|
|
|
bne count_message_not_cr
|
|
|
|
inc message_len
|
|
|
|
count_message_not_cr:
|
|
|
|
iny
|
|
|
|
bne count_message_lines_loop ; bra
|
|
|
|
|
|
|
|
count_message_done:
|
|
|
|
inc message_len ; increment for end of message too
|
|
|
|
|
|
|
|
rts
|
|
|
|
|
|
|
|
message_len:
|
|
|
|
.byte $0
|
2021-10-05 01:51:20 +00:00
|
|
|
|
|
|
|
last_bg_l: .byte $00
|
|
|
|
last_bg_h: .byte $00
|
|
|
|
|
2021-10-12 12:18:33 +00:00
|
|
|
|
2021-10-19 20:59:46 +00:00
|
|
|
;======================
|
|
|
|
;======================
|
|
|
|
; partial message step
|
|
|
|
;======================
|
|
|
|
;======================
|
|
|
|
partial_message_step:
|
|
|
|
stx OUTL
|
|
|
|
sty OUTH
|
|
|
|
jsr print_text_message
|
|
|
|
jsr wait_until_keypress
|
|
|
|
jsr hgr_partial_restore
|
|
|
|
rts
|
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
verb_table = $BF00
|
|
|
|
|
|
|
|
|
|
|
|
;=========================
|
|
|
|
;=========================
|
2021-10-27 19:20:58 +00:00
|
|
|
; setup default verb table
|
2021-10-20 03:56:02 +00:00
|
|
|
;=========================
|
|
|
|
;=========================
|
2021-10-27 19:20:58 +00:00
|
|
|
setup_default_verb_table:
|
2021-10-20 03:56:02 +00:00
|
|
|
|
|
|
|
;===========================
|
|
|
|
; first make it all unknown
|
|
|
|
|
|
|
|
ldx #0
|
|
|
|
unknown_loop:
|
|
|
|
lda #<(parse_common_unknown-1)
|
|
|
|
sta verb_table,X
|
|
|
|
lda #>(parse_common_unknown-1)
|
|
|
|
sta verb_table+1,X
|
|
|
|
inx
|
|
|
|
inx
|
2021-10-25 03:19:14 +00:00
|
|
|
cpx #(VERB_ALL_DONE*2)
|
2021-10-20 03:56:02 +00:00
|
|
|
bne unknown_loop
|
|
|
|
|
|
|
|
;=========================
|
|
|
|
; now add in common calls
|
|
|
|
|
2021-10-20 04:47:40 +00:00
|
|
|
lda #<common_verb_table
|
|
|
|
sta INL
|
|
|
|
lda #>common_verb_table
|
|
|
|
sta INH
|
|
|
|
|
2021-10-27 19:20:58 +00:00
|
|
|
; fallthrough
|
2021-10-20 04:47:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
;=========================
|
|
|
|
;=========================
|
|
|
|
; load custom verb table
|
|
|
|
;=========================
|
|
|
|
;=========================
|
|
|
|
; verb table to load in INL/INH
|
|
|
|
load_custom_verb_table:
|
|
|
|
|
|
|
|
|
|
|
|
ldy #0
|
2021-10-20 03:56:02 +00:00
|
|
|
common_verb_loop:
|
2021-10-20 04:47:40 +00:00
|
|
|
lda (INL),Y
|
2021-10-20 03:56:02 +00:00
|
|
|
beq done_verb_loop ; 0 means done
|
|
|
|
|
|
|
|
asl ; mul by 2
|
2021-10-20 04:47:40 +00:00
|
|
|
tax
|
|
|
|
iny
|
|
|
|
lda (INL),Y
|
|
|
|
sta verb_table,X
|
|
|
|
iny
|
|
|
|
lda (INL),Y
|
|
|
|
sta verb_table+1,X
|
|
|
|
iny
|
2021-10-20 03:56:02 +00:00
|
|
|
jmp common_verb_loop ; make this a bne (bra)?
|
|
|
|
|
|
|
|
done_verb_loop:
|
|
|
|
rts
|
|
|
|
|
2021-10-12 12:18:33 +00:00
|
|
|
|
2021-10-20 03:56:02 +00:00
|
|
|
common_verb_table:
|
|
|
|
.byte VERB_ASK
|
|
|
|
.word parse_common_ask-1
|
|
|
|
.byte VERB_BOO
|
|
|
|
.word parse_common_boo-1
|
|
|
|
.byte VERB_CHEAT
|
|
|
|
.word parse_common_cheat-1
|
|
|
|
.byte VERB_CLIMB
|
|
|
|
.word parse_common_climb-1
|
|
|
|
.byte VERB_COPY
|
|
|
|
.word parse_common_copy-1
|
|
|
|
.byte VERB_DANCE
|
|
|
|
.word parse_common_dance-1
|
|
|
|
.byte VERB_DIE
|
|
|
|
.word parse_common_die-1
|
|
|
|
.byte VERB_DITCH
|
|
|
|
.word parse_common_ditch-1
|
|
|
|
.byte VERB_DRINK
|
|
|
|
.word parse_common_drink-1
|
|
|
|
.byte VERB_DROP
|
|
|
|
.word parse_common_drop-1
|
|
|
|
.byte VERB_GET
|
|
|
|
.word parse_common_get-1
|
|
|
|
.byte VERB_GIVE
|
|
|
|
.word parse_common_give-1
|
|
|
|
.byte VERB_GO
|
|
|
|
.word parse_common_go-1
|
|
|
|
.byte VERB_HALDO
|
|
|
|
.word parse_common_haldo-1
|
|
|
|
.byte VERB_HELP
|
|
|
|
.word parse_common_help-1
|
|
|
|
.byte VERB_INVENTORY
|
|
|
|
.word parse_common_inventory-1
|
|
|
|
.byte VERB_LOAD
|
|
|
|
.word parse_common_load-1
|
|
|
|
.byte VERB_LOOK
|
|
|
|
.word parse_common_look-1
|
|
|
|
.byte VERB_MAP
|
|
|
|
.word parse_common_map-1
|
|
|
|
.byte VERB_PARTY
|
|
|
|
.word parse_common_party-1
|
|
|
|
.byte VERB_PWD
|
|
|
|
.word parse_common_pwd-1
|
|
|
|
.byte VERB_QUIT
|
|
|
|
.word parse_common_quit-1
|
|
|
|
.byte VERB_SAVE
|
|
|
|
.word parse_common_save-1
|
|
|
|
.byte VERB_SHOW
|
|
|
|
.word parse_common_show-1
|
|
|
|
.byte VERB_SMELL
|
|
|
|
.word parse_common_smell-1
|
|
|
|
.byte VERB_SNIFF
|
|
|
|
.word parse_common_sniff-1
|
|
|
|
.byte VERB_TAKE
|
|
|
|
.word parse_common_take-1
|
|
|
|
.byte VERB_TALK
|
|
|
|
.word parse_common_talk-1
|
|
|
|
.byte VERB_THIS
|
|
|
|
.word parse_common_this-1
|
|
|
|
.byte VERB_THROW
|
|
|
|
.word parse_common_throw-1
|
|
|
|
.byte VERB_VERSION
|
|
|
|
.word parse_common_version-1
|
|
|
|
.byte VERB_WEAR
|
|
|
|
.word parse_common_wear-1
|
|
|
|
.byte VERB_WHAT
|
|
|
|
.word parse_common_what-1
|
|
|
|
.byte VERB_WHERE
|
|
|
|
.word parse_common_where-1
|
|
|
|
.byte VERB_WHY
|
|
|
|
.word parse_common_why-1
|
|
|
|
.byte 0
|
2021-12-06 03:57:18 +00:00
|
|
|
|
2021-12-06 06:17:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
;===================================
|
|
|
|
; before looking
|
|
|
|
; check if item is/was in inventory
|
|
|
|
;===================================
|
|
|
|
; carry set if not found
|
|
|
|
; carry clear if found
|
|
|
|
look_check_if_in_inventory:
|
|
|
|
|
|
|
|
lda CURRENT_NOUN
|
|
|
|
|
|
|
|
ldx #INV1_ARROW
|
|
|
|
cmp #NOUN_ARROW
|
|
|
|
beq check_inventory_1
|
|
|
|
|
|
|
|
ldx #INV1_BABY
|
|
|
|
cmp #NOUN_BABY
|
|
|
|
beq check_inventory_1
|
|
|
|
|
|
|
|
ldx #INV1_KERREK_BELT
|
|
|
|
cmp #NOUN_BELT
|
|
|
|
beq check_inventory_1
|
|
|
|
|
|
|
|
ldx #INV1_CHICKEN_FEED
|
|
|
|
cmp #NOUN_FEED
|
|
|
|
beq check_inventory_1
|
|
|
|
|
|
|
|
ldx #INV1_BOW
|
|
|
|
cmp #NOUN_BOW
|
|
|
|
beq check_inventory_1
|
|
|
|
|
|
|
|
ldx #INV1_MONSTER_MASK
|
|
|
|
cmp #NOUN_MASK
|
|
|
|
beq check_inventory_1
|
|
|
|
|
|
|
|
ldx #INV1_PEBBLES
|
|
|
|
cmp #NOUN_PEBBLES
|
|
|
|
beq check_inventory_1
|
|
|
|
|
|
|
|
ldx #INV1_PILLS
|
|
|
|
cmp #NOUN_PILLS
|
|
|
|
beq check_inventory_1
|
|
|
|
|
|
|
|
ldx #INV2_RICHES
|
|
|
|
cmp #NOUN_RICHES
|
|
|
|
beq check_inventory_2
|
|
|
|
|
|
|
|
ldx #INV2_ROBE
|
|
|
|
cmp #NOUN_ROBE
|
|
|
|
beq check_inventory_2
|
|
|
|
|
|
|
|
ldx #INV2_SODA
|
|
|
|
cmp #NOUN_SODA
|
|
|
|
beq check_inventory_2
|
|
|
|
|
|
|
|
ldx #INV2_MEATBALL_SUB
|
|
|
|
cmp #NOUN_SUB
|
|
|
|
beq check_inventory_2
|
|
|
|
|
|
|
|
ldx #INV2_TRINKET
|
|
|
|
cmp #NOUN_TRINKET
|
|
|
|
beq check_inventory_2
|
|
|
|
|
|
|
|
ldx #INV2_TROGHELM
|
|
|
|
cmp #NOUN_HELM
|
|
|
|
beq check_inventory_2
|
|
|
|
|
|
|
|
ldx #INV2_TROGSHIELD
|
|
|
|
cmp #NOUN_SHIELD
|
|
|
|
beq check_inventory_2
|
|
|
|
|
|
|
|
ldx #INV2_TROGSWORD
|
|
|
|
cmp #NOUN_SWORD
|
|
|
|
beq check_inventory_2
|
|
|
|
|
|
|
|
ldx #INV3_SHIRT
|
|
|
|
cmp #NOUN_SHIRT
|
|
|
|
beq check_inventory_3
|
|
|
|
|
|
|
|
item_not_found:
|
|
|
|
sec
|
|
|
|
rts
|
|
|
|
|
|
|
|
check_inventory_1:
|
|
|
|
txa
|
|
|
|
and INVENTORY_1_GONE
|
|
|
|
bne inventory_gone
|
|
|
|
|
|
|
|
txa
|
|
|
|
and INVENTORY_1
|
|
|
|
bne inventory_there
|
|
|
|
|
|
|
|
sec
|
|
|
|
rts
|
|
|
|
|
|
|
|
check_inventory_2:
|
|
|
|
txa
|
|
|
|
and INVENTORY_2_GONE
|
|
|
|
bne inventory_gone
|
|
|
|
|
|
|
|
txa
|
|
|
|
and INVENTORY_2
|
|
|
|
bne inventory_there
|
|
|
|
|
|
|
|
sec
|
|
|
|
rts
|
|
|
|
|
|
|
|
check_inventory_3:
|
|
|
|
txa
|
|
|
|
and INVENTORY_3_GONE
|
|
|
|
bne inventory_gone
|
|
|
|
|
|
|
|
txa
|
|
|
|
and INVENTORY_3
|
|
|
|
bne inventory_there
|
|
|
|
|
|
|
|
sec
|
|
|
|
rts
|
|
|
|
|
|
|
|
inventory_gone:
|
|
|
|
ldx #<look_inventory_gone_message
|
|
|
|
ldy #>look_inventory_gone_message
|
|
|
|
jsr partial_message_step
|
|
|
|
clc
|
|
|
|
rts
|
|
|
|
inventory_there:
|
|
|
|
ldx #<look_inventory_there_message
|
|
|
|
ldy #>look_inventory_there_message
|
|
|
|
jsr partial_message_step
|
|
|
|
clc
|
|
|
|
rts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-12-06 03:57:18 +00:00
|
|
|
parse_input_file_end:
|
|
|
|
|
|
|
|
; make sure smaller than 4.5k
|
|
|
|
|
|
|
|
.assert (>parse_input_file_end - >parse_input_file_begin) < 18 , error, "peasant1 dialog too big"
|
|
|
|
|