Prev: 58230 Up: Map Next: 58410
58311: Plot Message Glyph Half
Used by the routine at Draw_MessageCharacter.
Write one 0008-byte half-glyph from the message font into the screen bitmap under attribute address HL. Applies the roll/shift mode in 56735 and the inverse shift count in 56736.
Input
HL Attribute-file address for this character
DE Glyph half-index (×0008 into Pointer_CurrentCharacterSet)
Paint the attribute and resolve the screen and font addresses.
Plot_MessageGlyphHalf 58311 PUSH DE Stash DE, HL and BC on the stack.
58312 PUSH HL
58313 PUSH BC
58314 LD A,(29447) Fetch the current text attribute (CurrentTextAttribute).
58317 OR %01000000 Force bright (OR 64).
58319 LD (HL),A Write it at HL.
58320 LD A,H Multiply the attribute high byte by 8.
58321 ADD A,A
58322 ADD A,A
58323 ADD A,A
58324 AND %01011011 Keep only the screen-bitmap high bits (mask 91).
58326 LD H,A Write the result back to H.
58327 PUSH HL Stash HL on the stack.
58328 EX DE,HL Swap so HL holds the glyph index, multiply it by 8, and add the character-set base at Pointer_CurrentCharacterSet.
58329 ADD HL,HL
58330 ADD HL,HL
58331 ADD HL,HL
58332 LD DE,(29433)
58336 ADD HL,DE
58337 POP DE Restore DE from the stack.
Nudge the font pointer for roll modes 2 / 3.
58338 LD A,(56735) Fetch the roll mode (56735). Is it mode 2? If not, try mode 3 at Plot_MessageGlyphHalf_CheckMode3.
58341 CP 2
58343 JR NZ,Plot_MessageGlyphHalf_CheckMode3
58345 INC HL Advance the font pointer by one (roll left source).
58346 JR Plot_MessageGlyphHalf_Rows Jump to Plot_MessageGlyphHalf_Rows to plot.
For roll mode 3, step the font pointer back one before plotting the half-glyph.
Plot_MessageGlyphHalf_CheckMode3 58348 CP 3 Is it mode 3? If not, plot as-is at Plot_MessageGlyphHalf_Rows. Otherwise step the font pointer back by one (roll right source).
58350 JR NZ,Plot_MessageGlyphHalf_Rows
58352 DEC HL
Plot all 8 pixel rows of this half-glyph into the screen bitmap.
Plot_MessageGlyphHalf_Rows 58353 LD B,8 There are 8 pixel rows in a character.
Build or roll one glyph row using the inverse shift in 56736 and the mode in 56735.
Plot_MessageGlyphHalf_RowLoop 58355 PUSH BC Stash BC on the stack.
58356 LD A,(56736) Fetch the inverse shift count (56736). Is it zero (no thicken/shift)? If so, take the plain bitmap byte at Plot_MessageGlyphHalf_ShiftBuild.
58359 OR A
58360 JR NZ,Plot_MessageGlyphHalf_ShiftBuild
58362 LD A,(HL) Fetch the plain glyph row into A.
58363 JR Plot_MessageGlyphHalf_Roll Jump to Plot_MessageGlyphHalf_Roll to apply left/right roll.
Thicken the glyph row by OR-shifting left and right by the count in 56736.
Plot_MessageGlyphHalf_ShiftBuild 58365 LD B,A Keep the shift count in B.
58366 PUSH HL Stash HL on the stack.
58367 LD A,(HL) Fetch the glyph row. Copy it into L. Mirror it into H for right-shift thickening.
58368 LD L,A
58369 LD H,A
OR left- and right-shifted copies into the thickened glyph bitmap.
Plot_MessageGlyphHalf_ShiftLoop 58370 SLA L Shift left into L and OR.
58372 OR L OR in the left-shifted copy.
58373 DEC B Decrease the shift count.
58374 JR Z,Plot_MessageGlyphHalf_ShiftDone If done, finish at Plot_MessageGlyphHalf_ShiftDone.
58376 SRL H Also shift right into H and OR (thicken both ways).
58378 OR H OR in the right-shifted copy.
58379 DJNZ Plot_MessageGlyphHalf_ShiftLoop Loop at Plot_MessageGlyphHalf_ShiftLoop.
Finish the thicken pass and continue into the roll/write path.
Plot_MessageGlyphHalf_ShiftDone 58381 POP HL Restore HL from the stack.
Apply roll mode 0 (left) or 1 (right) before writing the glyph row.
Plot_MessageGlyphHalf_Roll 58382 LD C,A Keep the built bitmap in C.
58383 LD A,(56735) Fetch the roll mode (56735). Is it mode 0? If not, try mode 1 at Plot_MessageGlyphHalf_RollRight.
58386 OR A
58387 JR NZ,Plot_MessageGlyphHalf_RollRight
58389 SLA C Shift the bitmap left one (roll mode 0).
58391 JR Plot_MessageGlyphHalf_WriteRow Jump to Plot_MessageGlyphHalf_WriteRow to store.
Roll the glyph bitmap one bit right for mode 1.
Plot_MessageGlyphHalf_RollRight 58393 CP 1 Is it mode 1? If not, store as-is at Plot_MessageGlyphHalf_WriteRow. Shift the bitmap right one.
58395 JR NZ,Plot_MessageGlyphHalf_WriteRow
58397 SRL C
Write the finished glyph row to the screen and advance to the next pixel row.
Plot_MessageGlyphHalf_WriteRow 58399 LD A,C Write the bitmap row to the screen.
58400 LD (DE),A Write the thickened glyph row to the screen.
58401 INC D Move one pixel-row down.
58402 INC HL Advance the font pointer.
58403 POP BC Restore BC from the stack.
58404 DJNZ Plot_MessageGlyphHalf_RowLoop Loop until all 8 rows are plotted.
58406 POP BC Restore BC, HL and DE from the stack.
58407 POP HL
58408 POP DE
58409 RET Return.
Prev: 58230 Up: Map Next: 58410