Prev: AD47 Up: Map Next: AD98
AD6F: Print Menu Strings
Print a menu printer stream from BC. Fragment headers are three bytes (address low/high, attribute); & (26) starts a new fragment; ] (5D) ends the stream. Uses the character set at Pointer_CurrentCharacterSet.
Entry: pop the CALL return address into BC as the printer-stream pointer.
Print_Menu_Strings AD6F POP BC Pop the stream pointer into BC.
Read the next menu-string fragment header: screen address and attribute into CurrentTextAttribute.
Print_Menu_Strings_FetchByte AD70 LD A,(BC) Fetch a byte through the pointer in BC.
AD71 LD L,A Keep the screen-address low byte in L.
AD72 INC BC Advance the stream pointer in BC by one.
AD73 LD A,(BC) Fetch a byte through the pointer in BC.
AD74 LD H,A Keep the screen-address high byte in H.
AD75 INC BC Advance the counter/pointer in BC by one.
AD76 LD A,(BC) Fetch a byte through the pointer in BC.
AD77 LD ($7307),A Set the temporary room/state byte (CurrentTextAttribute).
AD7A INC BC Advance the counter/pointer in BC by one.
AD7B LD D,$00 Clear D (high byte of a pointer/offset).
Fetch the next glyph: 26 starts a new fragment, 5D ends the stream, else print it.
Print_Menu_Strings_FetchGlyph AD7D LD A,(BC) Fetch a byte through the pointer in BC.
AD7E INC BC Advance the counter/pointer in BC by one.
AD7F CP $26 Is A equal to 26? If so, jump to Print_Menu_Strings_FetchByte.
AD81 JR Z,Print_Menu_Strings_FetchByte
AD83 CP $5D Is A equal to 5D? If not, jump to Print_Menu_Strings_PrintGlyph.
AD85 JR NZ,Print_Menu_Strings_PrintGlyph
AD87 PUSH BC Stash BC on the stack.
AD88 RET Return.
Print one menu glyph and loop for the next, then clear the display buffers on the fall-through path.
Print_Menu_Strings_PrintGlyph AD89 LD E,A Keep the glyph code in E for Print_Character.
AD8A CALL Print_Character Call Print_Character to print Character.
AD8D INC HL Advance the current pointer by one byte.
AD8E JR Print_Menu_Strings_FetchGlyph Jump to Print_Menu_Strings_FetchGlyph to print the next menu glyph.
AD90 CALL Clear_BothDisplayBuffers Call Clear_BothDisplayBuffers to clear both display buffers.
AD93 LD A,$12 Load A with 12.
AD95 CALL Clear_AttributeFile Call Clear_AttributeFile to clear Attribute File.
Prev: AD47 Up: Map Next: AD98