Prev: 25574 Up: Map Next: 25731
25596: Plot Character
Used by the routines at ObeyCommand, DescribeLocation, PrintCharacter and PrintFlag.
Puts A on the screen. 12 rubs out the previous character. 13 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 25596 CP 12 Jump to PlotCharacter_Byte if this is not DELETE.
25598 JR NZ,PlotCharacter_Byte
25600 CALL PlotCharacter_Byte Call PlotCharacter_Byte.
25603 LD A,32 Plot a space.
25605 CALL PlotCharacter_Byte
25608 LD A,12 DELETE is the character that falls through.
Plot this byte, or handle ENTER and DELETE.
PlotCharacter_Byte 25610 PUSH HL Save the screen address and the character.
25611 PUSH BC
25612 PUSH DE
25613 PUSH AF
25614 CP 13 ENTER starts a new row.
25616 JP Z,PlotCharacter_Newline
25619 CP 12 Anything except DELETE is a glyph.
25621 JR NZ,PlotGlyph
25623 LD A,(23434) Jump to PlotCharacter_Back if *PrintColumn is not zero.
25626 OR A
25627 JR NZ,PlotCharacter_Back
25629 LD A,41 Write 41 to *PrintColumn.
25631 LD (23434),A
25634 LD A,(23433) Decrement *PrintRow.
25637 DEC A
25638 LD (23433),A
25641 JR PlotCharacter_Pixel Jump to PlotCharacter_Pixel.
Step one column left.
PlotCharacter_Back 25643 DEC A Decrement *PrintColumn.
25644 LD (23434),A
25647 AND %00000011 Keep only bits 0-1.
25649 CP 2 Jump to PlotGlyph_Done if the column is 2.
25651 JP Z,PlotGlyph_Done
Move the pixel address back one byte.
PlotCharacter_Pixel 25654 LD HL,(23431) Decrement *PrintAddress.
25657 DEC HL
25658 LD (23431),HL
25661 JP PlotGlyph_Done Jump to PlotGlyph_Done.
This entry point is used by the routine at PlotGlyph.
ENTER on row 19 while a description is on screen waits for a key. Below the window, the text scrolls.
PlotCharacter_Newline 25664 LD A,(23433) Jump to PlotCharacter_Low if *PrintRow is not 19.
25667 CP 19
25669 JR NZ,PlotCharacter_Low
25671 LD A,(24966) The pause only happens when PauseFlag is set.
25674 OR A
25675 JR Z,PlotCharacter_Low
25677 LD A,13 The pause row's bottom is 13.
25679 LD (23447),A
25682 CALL WaitKeyDown Call WaitKeyDown.
25685 CALL ScrollWindow Call ScrollWindow.
25688 LD A,19 Stay on row 19.
25690 JR PlotCharacter_Stay
Rows below the pause line.
PlotCharacter_Low 25692 CP 23 A row below 23 simply advances.
25694 JR C,PlotCharacter_Down
25696 CALL ScrollWindow Call ScrollWindow.
25699 LD A,23 Stay on row 23.
Stay on this row.
PlotCharacter_Stay 25701 LD (23433),A Write the row to PrintRow.
25704 CALL HomeRow Call HomeRow.
25707 XOR A Write 0 to PrintColumn.
25708 LD (23434),A
25711 JP PlotGlyph_Done Jump to PlotGlyph_Done.
Advance one row.
PlotCharacter_Down 25714 LD A,(23433) Increment *PrintRow.
25717 INC A
25718 LD (23433),A
25721 CALL HomeRow Call HomeRow.
25724 XOR A Write 0 to PrintColumn.
25725 LD (23434),A
25728 JP PlotGlyph_Done Jump to PlotGlyph_Done.
Prev: 25574 Up: Map Next: 25731