dos33fsprogs/monkey/update_bottom.s

157 lines
2.4 KiB
ArmAsm
Raw Normal View History

2020-09-16 03:45:02 +00:00
;====================================
;====================================
; update bottom of screen
;====================================
;====================================
update_bottom:
2020-09-18 03:39:02 +00:00
jsr normal_text
jsr clear_bottom
lda LOCATION
cmp #MONKEY_MAP
bne not_the_map
map_noun:
lda VALID_NOUN
beq done_map_noun
lda NOUN_L
sta OUTL
lda NOUN_H
sta OUTH
jsr move_and_print
done_map_noun:
rts
not_the_map:
2020-09-18 03:39:02 +00:00
;=======================
; if message, print it
lda DISPLAY_MESSAGE
beq no_message
lda MESSAGE_L
sta OUTL
lda MESSAGE_H
sta OUTH
jsr move_and_print
rts
2020-09-16 03:45:02 +00:00
2020-09-18 03:39:02 +00:00
no_message:
2020-09-16 03:45:02 +00:00
; draw first line
; it's verb followed by noun
jsr normal_text
; first clear line
lda #<clear_line
sta OUTL
lda #>clear_line
sta OUTH
jsr move_and_print
lda CURRENT_VERB
asl
tay
lda verb_names,Y
sta OUTL
lda verb_names+1,Y
sta OUTH
jsr move_and_print
lda VALID_NOUN
beq no_noun
2020-09-16 03:45:02 +00:00
lda NOUN_L
sta OUTL
lda NOUN_H
sta OUTH
jsr move_and_print
2020-09-16 03:45:02 +00:00
no_noun:
;========================
; draw command bars
2020-09-18 03:39:02 +00:00
draw_command_bars:
2020-09-16 03:45:02 +00:00
jsr inverse_text
ldx #0
bottom_loop:
lda bottom_strings,X
sta OUTL
lda bottom_strings+1,X
sta OUTH
jsr move_and_print
inx
inx
cpx #18
bne bottom_loop
rts
;0123456789012345678901234567890123456789
;
;GIVE PICK UP USE
;OPEN LOOK AT PUSH
;CLOSE TALK TO PULL
bottom_strings:
.word bottom_give
.word bottom_open
.word bottom_close
.word bottom_pick_up
.word bottom_look_at
.word bottom_talk_to
.word bottom_use
.word bottom_push
.word bottom_pull
bottom_give: .byte 0,21,"GIVE ",0
bottom_open: .byte 0,22,"OPEN ",0
bottom_close: .byte 0,23,"CLOSE",0
bottom_pick_up: .byte 6,21,"PICK UP",0
bottom_look_at: .byte 6,22,"LOOK AT",0
bottom_talk_to: .byte 6,23,"TALK TO",0
bottom_use: .byte 15,21,"USE ",0
bottom_push: .byte 15,22,"PUSH",0
bottom_pull: .byte 15,23,"PULL",0
verb_names:
.word verb_give
.word verb_open
.word verb_close
.word verb_pick_up
.word verb_look_at
.word verb_talk_to
.word verb_use
.word verb_push
.word verb_pull
.word verb_walk
verb_give: .byte 15,20,"GIVE ",0
verb_open: .byte 15,20,"OPEN ",0
verb_close: .byte 14,20,"CLOSE ",0
verb_pick_up: .byte 12,20,"PICK UP ",0
verb_look_at: .byte 12,20,"LOOK AT ",0
verb_talk_to: .byte 12,20,"TALK TO ",0
verb_use: .byte 16,20,"USE ",0
verb_push: .byte 15,20,"PUSH ",0
verb_pull: .byte 15,20,"PULL ",0
verb_walk: .byte 12,20,"WALK TO ",0
clear_line: .byte 12,20," ",0