Sherlock: annotated disassembly

Routines

Prev: C267 Up: Map Next: C29C
C271: Scroll the command window up one line and clear the bottom line
Copies the text rows of the bottom third of the screen up by one character row ($5080 to $5060, 8 pixel lines) and blanks the last line.
Output
The command window scrolled up one line and its bottom row cleared
HL, DE, BC Kept
C271 PUSH HL Save HL on the stack - Rows 20-23 of the screen...
C272 PUSH DE Save DE on the stack
C273 PUSH BC Save BC on the stack
C274 LD HL,$5080 Load HL with $5080 - ...up one character row to rows 19-22
C277 LD DE,$5060 Load DE with $5060
C27A LD A,$08 Load A with $08 - For each of the eight pixel lines:
C27C PUSH HL Save HL on the stack
C27D PUSH DE Save DE on the stack
C27E LD BC,$0080 Load BC with $0080 - move four character rows (128 bytes)
C281 LDIR Copy BC bytes from where HL points to where DE points, counting up
C283 POP DE Restore DE from the stack
C284 POP HL Restore HL from the stack
C285 INC H Add one to H - Next pixel line
C286 INC D Add one to D
C287 DEC A Subtract one from A
C288 JR NZ,$C27C If A is not zero, go back to C27C
C28A LD HL,$50E0 Clear the bottom row, row 23
This entry point is used by the routine at C29C.
C28D LD B,$24 Load B with $24 - 36 spaces, from pixel shift 1
C28F LD C,$01 Load C with $01
C291 LD A,$20 Load A with $20
C293 CALL $C388 Call the routine "PLOT-CHAR: draw one character glyph at HL, shifted by..." (C388)
C296 DJNZ $C293 Count B down and, while it is not zero, go back to C293
C298 POP BC Restore BC from the stack
C299 POP DE Restore DE from the stack
C29A POP HL Restore HL from the stack
C29B RET Return to the caller
Prev: C267 Up: Map Next: C29C