dos33fsprogs/games/peasant/parse_input.s

115 lines
1.6 KiB
ArmAsm
Raw Normal View History

; parse input
parse_input:
; jsr hgr_save
lda input_buffer ; get first char FIXME
and #$DF ; make uppercase 0110 0001 -> 0100 0001
parse_copy:
cmp #'C'
2021-08-31 05:15:12 +00:00
bne parse_inventory
; want copy
lda #NEW_FROM_DISK
sta GAME_OVER
lda #LOAD_COPY_CHECK
sta WHICH_LOAD
jmp done_parse_message
2021-08-31 05:15:12 +00:00
parse_inventory:
cmp #'I'
bne parse_l
2021-08-31 05:15:12 +00:00
jsr show_inventory
jmp restore_parse_message
parse_l:
cmp #'L'
bne parse_talk
lda input_buffer+2
and #$DF ; make uppercase 0110 0001 -> 0100 0001
cmp #'O'
beq parse_look
parse_load:
jsr load_menu
2021-09-21 04:14:09 +00:00
jmp restore_parse_message
parse_look:
lda #<fake_error1
sta OUTL
lda #>fake_error1
jmp finish_parse_message
parse_talk:
cmp #'T'
2021-09-29 20:13:38 +00:00
bne parse_s
lda #<fake_error2
sta OUTL
lda #>fake_error2
jmp finish_parse_message
2021-09-29 20:13:38 +00:00
parse_s:
2021-08-24 17:38:03 +00:00
cmp #'S'
bne parse_version
2021-09-29 20:13:38 +00:00
lda input_buffer+2
and #$DF ; make uppercase 0110 0001 -> 0100 0001
cmp #'A'
beq parse_save
parse_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 20:13:38 +00:00
parse_save:
jsr save_menu
jmp restore_parse_message
parse_version:
cmp #'V'
bne parse_help
lda #<version_message
sta OUTL
lda #>version_message
jmp finish_parse_message
parse_help:
lda #<help_message
sta OUTL
lda #>help_message
finish_parse_message:
sta OUTH
jsr hgr_text_box
jsr wait_until_keypress
2021-08-31 05:15:12 +00:00
restore_parse_message:
jsr hgr_partial_restore
2021-08-24 17:38:03 +00:00
done_parse_message:
2021-08-24 17:38:03 +00:00
rts