Prev: 85B3 Up: Map Next: 860D
85B7: Print a character in the input window
Used by the routine at PRINT_CHAR.
The bottom five rows, 19 to 23, in capitals with the ROM's font. A carriage return blanks the rest of the line and scrolls the window up; a backspace ($08) steps back, and up to the line before if it has to. The cursor is kept at INPUT_CURSOR and the columns left on the line at INPUT_COLUMNS.
INPUT_CHAR 85B7 POP AF
This entry point is used by the routine at START.
INPUT_CHAR_A 85B8 PUSH HL
85B9 PUSH AF
85BA LD HL,(INPUT_CURSOR) A carriage return: to the next line
85BD CP $0D
85BF JR NZ,INPUT_CHAR_0
85C1 LD A,$20
85C3 CALL ROM_FONT_CHAR
85C6 JR INPUT_CHAR_2
INPUT_CHAR_0 85C8 CP $08 Backspace
85CA JR Z,INPUT_CHAR_4
85CC CP $61 Lower case to capitals
85CE JR C,INPUT_CHAR_1
85D0 CP $7B
85D2 JR NC,INPUT_CHAR_1
85D4 AND $5F
INPUT_CHAR_1 85D6 CALL ROM_FONT_CHAR Print it
85D9 LD A,(INPUT_COLUMNS) End of the line?
85DC DEC A
85DD JR NZ,INPUT_CHAR_3
INPUT_CHAR_2 85DF LD L,$E0 Then scroll the window, and start again at the left
85E1 CALL SCROLL_INPUT
85E4 LD A,$20
INPUT_CHAR_3 85E6 LD (INPUT_COLUMNS),A The cursor after it
85E9 LD A,(CURSOR_CHAR)
85EC LD (INPUT_CURSOR),HL
85EF CALL ROM_FONT_CHAR
85F2 POP AF
85F3 POP HL
85F4 RET
INPUT_CHAR_4 85F5 LD A,$20 Backspace: blank the cursor, step back, and up a line if it has to
85F7 CALL ROM_FONT_CHAR
85FA DEC L
85FB DEC L
85FC LD A,(INPUT_COLUMNS)
85FF INC A
8600 CP $21
8602 JR NZ,INPUT_CHAR_3
8604 LD L,$FF
8606 CALL SCROLL_INPUT_BACK
8609 LD A,$01
860B JR INPUT_CHAR_3
Prev: 85B3 Up: Map Next: 860D