Prev: E026 Up: Map Next: E09A
E038: Show a message under the room, and take it away again
Used by the routine at MAIN_LOOP.
Called once a pass by the main loop (MAIN_LOOP). A message is asked for by putting its number in IY+$07: 1 when the knight's way is blocked (CREATURE_UPDATE, BUMPED), 2 when a door is locked (BUMPED), 3 when what he would pick up is too heavy (PICK_UP_LOOK_ON). Message 1 prints a B and then shares message 2's word.
The message is printed at x 28, y 12, over LIFE's digits, and stays for ten passes, counted in IY+$08, while bit 6 of IY+$17 is set; then nine spaces clear it, and bit 0 of IY+$17 asks the main loop to print LIFE again.
SHOW_MESSAGE E038 LD HL,$0C1C Everything here prints at x 28, y 12.
E03B LD (PRINT_X),HL
E03E LD A,(MESSAGE) A new message?
E041 AND A
E042 JR NZ,SHOW_MESSAGE_0
E044 BIT 6,(IY+GAME_FLAGS-V) No: if one is showing, count down its passes.
E048 RET Z
E049 DEC (IY+MESSAGE_TIMER-V)
E04C RET NZ
E04D RES 6,(IY+GAME_FLAGS-V) Its time is up: clear it, and have LIFE printed again.
E051 SET 0,(IY+GAME_FLAGS-V)
E055 CALL PRINT
E058 DEFB $00,$00,$00,$00,$00,$00,$00,$00 " "
E060 DEFB $00
E061 DEFB $A4 End of the string
E062 RET
SHOW_MESSAGE_0 E063 LD (IY+MESSAGE_TIMER-V),$0A A new message: ten passes, and it has been taken.
E067 SET 6,(IY+GAME_FLAGS-V)
E06B LD (IY+MESSAGE-V),$00
E06F CP $01 Message 1: B...
E071 JR NZ,SHOW_MESSAGE_1
E073 CALL PRINT
E076 DEFB $02 "B"
E077 DEFB $A4 End of the string
E078 JR SHOW_MESSAGE_2
SHOW_MESSAGE_1 E07A CP $02 Message 2.
E07C JR NZ,SHOW_MESSAGE_3
SHOW_MESSAGE_2 E07E CALL PRINT
E081 DEFB $0C,$0F,$03,$0B,$05,$04 "LOCKED"
E087 DEFB $A4 End of the string
E088 RET
SHOW_MESSAGE_3 E089 CP $03 Message 3.
E08B RET NZ
E08C CALL PRINT
E08F DEFB $14,$0F,$0F,$00,$08,$05,$01,$16 "TOO HEAVY"
E097 DEFB $19
E098 DEFB $A4 End of the string
E099 RET
Prev: E026 Up: Map Next: E09A