![]() |
Routines |
| Prev: E376 | Up: Map | Next: E42A |
|
Used by the routine at Draw_MessageCharacter.
|
||||||||||
|
Paint the attribute and resolve the screen and font addresses.
|
||||||||||
| Plot_MessageGlyphHalf | E3C7 | PUSH DE | Stash DE, HL and BC on the stack. | |||||||
| E3C8 | PUSH HL | |||||||||
| E3C9 | PUSH BC | |||||||||
| E3CA | LD A,($7307) | Fetch the current text attribute (CurrentTextAttribute). | ||||||||
| E3CD | OR %01000000 | Force bright (OR 40). | ||||||||
| E3CF | LD (HL),A | Write it at HL. | ||||||||
| E3D0 | LD A,H | Multiply the attribute high byte by 08. | ||||||||
| E3D1 | ADD A,A | |||||||||
| E3D2 | ADD A,A | |||||||||
| E3D3 | ADD A,A | |||||||||
| E3D4 | AND %01011011 | Keep only the screen-bitmap high bits (mask 5B). | ||||||||
| E3D6 | LD H,A | Write the result back to H. | ||||||||
| E3D7 | PUSH HL | Stash HL on the stack. | ||||||||
| E3D8 | EX DE,HL | Swap so HL holds the glyph index, multiply it by 08, and add the character-set base at Pointer_CurrentCharacterSet. | ||||||||
| E3D9 | ADD HL,HL | |||||||||
| E3DA | ADD HL,HL | |||||||||
| E3DB | ADD HL,HL | |||||||||
| E3DC | LD DE,($72F9) | |||||||||
| E3E0 | ADD HL,DE | |||||||||
| E3E1 | POP DE | Restore DE from the stack. | ||||||||
|
Nudge the font pointer for roll modes 02 / 03.
|
||||||||||
| E3E2 | LD A,($DD9F) | Fetch the roll mode (DD9F). Is it mode 02? If not, try mode 03 at Plot_MessageGlyphHalf_CheckMode3. | ||||||||
| E3E5 | CP $02 | |||||||||
| E3E7 | JR NZ,Plot_MessageGlyphHalf_CheckMode3 | |||||||||
| E3E9 | INC HL | Advance the font pointer by one (roll left source). | ||||||||
| E3EA | JR Plot_MessageGlyphHalf_Rows | Jump to Plot_MessageGlyphHalf_Rows to plot. | ||||||||
|
For roll mode 03, step the font pointer back one before plotting the half-glyph.
|
||||||||||
| Plot_MessageGlyphHalf_CheckMode3 | E3EC | CP $03 | Is it mode 03? If not, plot as-is at Plot_MessageGlyphHalf_Rows. Otherwise step the font pointer back by one (roll right source). | |||||||
| E3EE | JR NZ,Plot_MessageGlyphHalf_Rows | |||||||||
| E3F0 | DEC HL | |||||||||
|
Plot all 08 pixel rows of this half-glyph into the screen bitmap.
|
||||||||||
| Plot_MessageGlyphHalf_Rows | E3F1 | LD B,$08 | There are 08 pixel rows in a character. | |||||||
| Plot_MessageGlyphHalf_RowLoop | E3F3 | PUSH BC | Stash BC on the stack. | |||||||
| E3F4 | LD A,($DDA0) | Fetch the inverse shift count (DDA0). Is it zero (no thicken/shift)? If so, take the plain bitmap byte at Plot_MessageGlyphHalf_ShiftBuild. | ||||||||
| E3F7 | OR A | |||||||||
| E3F8 | JR NZ,Plot_MessageGlyphHalf_ShiftBuild | |||||||||
| E3FA | LD A,(HL) | Fetch the plain glyph row into A. | ||||||||
| E3FB | 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 DDA0.
|
||||||||||
| Plot_MessageGlyphHalf_ShiftBuild | E3FD | LD B,A | Keep the shift count in B. | |||||||
| E3FE | PUSH HL | Stash HL on the stack. | ||||||||
| E3FF | LD A,(HL) | Fetch the glyph row. Copy it into L. Mirror it into H for right-shift thickening. | ||||||||
| E400 | LD L,A | |||||||||
| E401 | LD H,A | |||||||||
|
OR left- and right-shifted copies into the thickened glyph bitmap.
|
||||||||||
| Plot_MessageGlyphHalf_ShiftLoop | E402 | SLA L | Shift left into L and OR. | |||||||
| E404 | OR L | OR in the left-shifted copy. | ||||||||
| E405 | DEC B | Decrease the shift count. | ||||||||
| E406 | JR Z,Plot_MessageGlyphHalf_ShiftDone | If done, finish at Plot_MessageGlyphHalf_ShiftDone. | ||||||||
| E408 | SRL H | Also shift right into H and OR (thicken both ways). | ||||||||
| E40A | OR H | OR in the right-shifted copy. | ||||||||
| E40B | DJNZ Plot_MessageGlyphHalf_ShiftLoop | Loop at Plot_MessageGlyphHalf_ShiftLoop. | ||||||||
|
Finish the thicken pass and continue into the roll/write path.
|
||||||||||
| Plot_MessageGlyphHalf_ShiftDone | E40D | POP HL | Restore HL from the stack. | |||||||
|
Apply roll mode 00 (left) or 01 (right) before writing the glyph row.
|
||||||||||
| Plot_MessageGlyphHalf_Roll | E40E | LD C,A | Keep the built bitmap in C. | |||||||
| E40F | LD A,($DD9F) | Fetch the roll mode (DD9F). Is it mode 00? If not, try mode 01 at Plot_MessageGlyphHalf_RollRight. | ||||||||
| E412 | OR A | |||||||||
| E413 | JR NZ,Plot_MessageGlyphHalf_RollRight | |||||||||
| E415 | SLA C | Shift the bitmap left one (roll mode 00). | ||||||||
| E417 | JR Plot_MessageGlyphHalf_WriteRow | Jump to Plot_MessageGlyphHalf_WriteRow to store. | ||||||||
|
Roll the glyph bitmap one bit right for mode 01.
|
||||||||||
| Plot_MessageGlyphHalf_RollRight | E419 | CP $01 | Is it mode 01? If not, store as-is at Plot_MessageGlyphHalf_WriteRow. Shift the bitmap right one. | |||||||
| E41B | JR NZ,Plot_MessageGlyphHalf_WriteRow | |||||||||
| E41D | SRL C | |||||||||
|
Write the finished glyph row to the screen and advance to the next pixel row.
|
||||||||||
| Plot_MessageGlyphHalf_WriteRow | E41F | LD A,C | Write the bitmap row to the screen. | |||||||
| E420 | LD (DE),A | Write the thickened glyph row to the screen. | ||||||||
| E421 | INC D | Move one pixel-row down. | ||||||||
| E422 | INC HL | Advance the font pointer. | ||||||||
| E423 | POP BC | Restore BC from the stack. | ||||||||
| E424 | DJNZ Plot_MessageGlyphHalf_RowLoop | Loop until all 08 rows are plotted. | ||||||||
| E426 | POP BC | Restore BC, HL and DE from the stack. | ||||||||
| E427 | POP HL | |||||||||
| E428 | POP DE | |||||||||
| E429 | RET | Return. | ||||||||
| Prev: E376 | Up: Map | Next: E42A |