Prev: 63E6 Up: Map Next: 6483
63FC: Plot Character
Used by the routines at ObeyCommand, DescribeLocation, PrintCharacter and PrintFlag.
Puts A on the screen. 0C rubs out the previous character. 0D moves to the next row, pausing and scrolling when the text hits the bottom of the window.
DELETE is printed as a space and then another DELETE, so the cursor steps back.
PlotCharacter 63FC CP $0C DELETE prints a space and then rubs it out.
63FE JR NZ,PlotCharacter_Byte
6400 CALL PlotCharacter_Byte Plot the space, then pass DELETE on.
6403 LD A,$20
6405 CALL PlotCharacter_Byte
6408 LD A,$0C DELETE is the character that falls through.
PlotCharacter_Byte 640A PUSH HL Save the screen address and the character.
640B PUSH BC
640C PUSH DE
640D PUSH AF
640E CP $0D ENTER starts a new row.
6410 JP Z,PlotCharacter_Newline
6413 CP $0C Anything except DELETE is a glyph.
6415 JR NZ,PlotGlyph
6417 LD A,($5B8A) Column 0 wraps to the previous row.
641A OR A
641B JR NZ,PlotCharacter_Back
641D LD A,$29 Column 29 of the row above.
641F LD ($5B8A),A
6422 LD A,($5B89) The previous row, then the pixel address moves back.
6425 DEC A
6426 LD ($5B89),A
6429 JR PlotCharacter_Pixel
PlotCharacter_Back 642B DEC A Step one column left.
642C LD ($5B8A),A
642F AND $03 A column whose low bits are 2 does not move the pixel address.
6431 CP $02
6433 JP Z,PlotGlyph_Done
PlotCharacter_Pixel 6436 LD HL,($5B87) Otherwise the pixel address moves back one byte.
6439 DEC HL
643A LD ($5B87),HL
643D JP PlotGlyph_Done
This entry point is used by the routine at PlotGlyph.
ENTER on row 13 while a description is on screen waits for a key. Below the window, the text scrolls.
PlotCharacter_Newline 6440 LD A,($5B89) Row 13 is the pause row while a description is on screen.
6443 CP $13
6445 JR NZ,PlotCharacter_Low
6447 LD A,($6186) The pause only happens when PauseFlag is set.
644A OR A
644B JR Z,PlotCharacter_Low
644D LD A,$0D The pause row's bottom is 0D.
644F LD ($5B97),A
6452 CALL WaitKeyDown Wait for a key and scroll.
6455 CALL ScrollWindow
6458 LD A,$13 Stay on row 13.
645A JR PlotCharacter_Stay
PlotCharacter_Low 645C CP $17 A row below 17 simply advances.
645E JR C,PlotCharacter_Down
6460 CALL ScrollWindow Row 17 scrolls and stays put.
6463 LD A,$17
PlotCharacter_Stay 6465 LD ($5B89),A Home the cursor on that row.
6468 CALL HomeRow
646B XOR A
646C LD ($5B8A),A
646F JP PlotGlyph_Done Return to the plotter.
PlotCharacter_Down 6472 LD A,($5B89) Advance one row.
6475 INC A
6476 LD ($5B89),A
6479 CALL HomeRow Home the cursor on it.
647C XOR A
647D LD ($5B8A),A
6480 JP PlotGlyph_Done Return to the plotter.
Prev: 63E6 Up: Map Next: 6483