You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
87 lines
1.2 KiB
87 lines
1.2 KiB
2 years ago
|
; Inform that the current guess is not in the dictionary
|
||
|
show_message_unknown:
|
||
|
ld de, message_unknown
|
||
|
ld b, 180
|
||
|
call show_message
|
||
|
ret
|
||
|
|
||
|
|
||
|
|
||
|
; Inform about the users victory
|
||
|
show_message_won:
|
||
|
ld de, message_won
|
||
|
ld b, 0
|
||
|
call show_message
|
||
|
ret
|
||
|
|
||
|
|
||
|
|
||
|
; Inform about the users loss
|
||
|
show_message_lost:
|
||
|
ld de, message_lost
|
||
|
ld b, 0
|
||
|
call show_message
|
||
|
|
||
|
; copy the correct word into the message
|
||
|
ld hl, obj_message_letters + 14
|
||
|
ld bc, current_word
|
||
|
|
||
|
REPT 5
|
||
|
ld a, [bc]
|
||
|
ld [hl], a
|
||
|
inc bc
|
||
|
inc hl
|
||
|
inc hl
|
||
|
inc hl
|
||
|
inc hl
|
||
|
ENDR
|
||
|
ret
|
||
|
|
||
|
|
||
|
|
||
|
; Displays a message to the user
|
||
|
; <- de
|
||
|
; <- b
|
||
|
show_message:
|
||
|
ld hl, obj_message_letters
|
||
|
ld c, 32
|
||
|
.loop:
|
||
|
ld a, [de]
|
||
|
ld [hl], a
|
||
|
inc hl
|
||
|
inc de
|
||
|
dec c
|
||
|
jp nz, .loop
|
||
|
|
||
|
ld a, b
|
||
|
ld [message_timeout], a
|
||
|
ret
|
||
|
|
||
|
|
||
|
|
||
|
; Checks if the current message has expired
|
||
|
check_message_timeout:
|
||
|
ld a, [message_timeout]
|
||
|
cp a, 0
|
||
|
jp z, .return
|
||
|
|
||
|
dec a
|
||
|
ld [message_timeout], a
|
||
|
cp a, 0
|
||
|
jp nz, .return
|
||
|
|
||
|
.timeout:
|
||
|
call clear_message
|
||
|
.return:
|
||
|
ret
|
||
|
|
||
|
|
||
|
|
||
|
; Clears the current message by overwriting with nothing
|
||
|
clear_message:
|
||
|
ld de, message_clear
|
||
|
ld b, 0
|
||
|
call show_message
|
||
|
ret
|
||
|
|