Prev: 58186 Up: Map Next: 58311
58230: Draw Message Character
Used by the routine at Centre_AndDrawMessageRow.
Draw one double-height message character from the buffer at IX into the attribute/screen pair at HL, then advance. Maps punctuation to fixed glyph indices and ASCII from 0 onward to even glyph slots (two 0008-byte halves per character in Font_MessageCharacters).
Input
HL Attribute-file address for this character
IX Pointer into the decoded message buffer
Stop on row/message terminators; otherwise map the character to a glyph index.
Draw_MessageCharacter 58230 LD A,(IX+0) Fetch the next buffer byte through IX, then advance the buffer pointer.
58233 INC IX
58235 CP 36 Is it $? If so, return (end of alternate/row run).
58237 RET Z
58238 CP 43 Is it a new-row marker (+)? If so, return.
58240 RET Z
58241 CP 93 Is it the message terminator (])? If so, return.
58243 RET Z
58244 PUSH HL Stash HL on the stack.
58245 CP 46 Is it a full stop (.)? If so, use glyph index 20 at Draw_MessageCharacter_FullStop.
58247 JR Z,Draw_MessageCharacter_FullStop
58249 CP 44 Is it a comma (,)? If so, use glyph index 22 at Draw_MessageCharacter_Comma.
58251 JR Z,Draw_MessageCharacter_Comma
58253 CP 33 Is it an exclamation mark (!)? If so, use glyph index 26 at Draw_MessageCharacter_Bang.
58255 JR Z,Draw_MessageCharacter_Bang
58257 CP 39 Is it an apostrophe (')? If so, use glyph index 24 at Draw_MessageCharacter_Apostrophe.
58259 JR Z,Draw_MessageCharacter_Apostrophe
58261 CP 32 Is it a space ( )? If so, keep index 32 at Draw_MessageCharacter_Plot.
58263 JR Z,Draw_MessageCharacter_Plot
58265 SUB 48 Convert ASCII ≥ 0 into an even glyph index.
58267 SLA A Double the glyph index to address the double-height font halves.
58269 JR Draw_MessageCharacter_Plot Jump to Draw_MessageCharacter_Plot to plot the letter glyph.
Map a full stop to glyph index 20 in the double-height message font.
Draw_MessageCharacter_FullStop 58271 LD A,20 Load glyph index 20.
58273 JR Draw_MessageCharacter_Plot Jump to Draw_MessageCharacter_Plot to plot the full-stop glyph.
Map a comma to glyph index 22 in the double-height message font.
Draw_MessageCharacter_Comma 58275 LD A,22 Load glyph index 22.
58277 JR Draw_MessageCharacter_Plot Jump to Draw_MessageCharacter_Plot to plot the comma glyph.
Map an exclamation mark to glyph index 26 in the double-height message font.
Draw_MessageCharacter_Bang 58279 LD A,26 Load glyph index 26.
58281 JR Draw_MessageCharacter_Plot Jump to Draw_MessageCharacter_Plot to plot the exclamation glyph.
Map an apostrophe to glyph index 24 in the double-height message font.
Draw_MessageCharacter_Apostrophe 58283 LD A,24 Load glyph index 24.
Plot the top 8 rows, step one attribute row down, plot the bottom 8 rows, then advance.
Draw_MessageCharacter_Plot 58285 LD E,A Keep the glyph index in E, then clear D.
58286 LD D,0
58288 LD A,8 Load A with 8, then call PseudoRandom (jitter / roll seed for 56735). Store the roll mode at 56735.
58290 CALL PseudoRandom
58293 LD (56735),A
58296 CALL Plot_MessageGlyphHalf Call Plot_MessageGlyphHalf to plot the top half of the glyph.
58299 LD BC,32 Step HL down one attribute row (0032 bytes).
58302 ADD HL,BC Step HL down one character row (0032 bytes).
58303 INC DE Advance the glyph index onto the bottom half.
58304 CALL Plot_MessageGlyphHalf Call Plot_MessageGlyphHalf to plot the bottom half.
58307 POP HL Restore HL from the stack.
58308 INC HL Advance the attribute address onto the next character column.
58309 JR Draw_MessageCharacter Jump to Draw_MessageCharacter to draw the next character.
Prev: 58186 Up: Map Next: 58311