Prev: 8EB3 Up: Map Next: 8EE6
8EC7: Print Handler: Select Font
Select font parameter handler. Called on the byte immediately following a 1A control code. Copies the six-byte font configuration for the selected font index (00–03) from the table at FontConfig_Table into the font state at 800C and loads the font bitmap pointer into 8008.
PrintHandler_SelectFont 8EC7 LD B,$04 B=04 (mask limit: font indices 00–03).
8EC9 CALL PrintHandler_MaskParam Call PrintHandler_MaskParam to reset PrintState_Handler and mask B to the font index.
8ECC LD H,$00 H=00.
8ECE LD L,B L=B (font index as a 16-bit value in HL).
8ECF LD DE,$8FE6 DE=FontConfig_Table (font configuration table base).
Multiply the font index by 08 (the size of each font table entry) to compute the byte offset into the font table.
8ED2 ADD HL,HL Multiply HL by 08 (three left shifts).
8ED3 ADD HL,HL
8ED4 ADD HL,HL
8ED5 ADD HL,DE HL=FontConfig_Table + (font index × 08) — pointer to the selected font entry.
8ED6 LD DE,$800C DE=800C (font state destination).
8ED9 LD BC,$0006 BC=06 (six bytes of font configuration to copy).
8EDC LDIR Copy six bytes of font configuration to 800C–8011.
8EDE LD E,(HL) Read the two-byte font bitmap pointer from bytes 07–08 of the entry.
8EDF INC HL
8EE0 LD D,(HL)
8EE1 LD ($8008),DE Write the font bitmap pointer to *PrintState_FontPtr.
8EE5 RET Return.
Prev: 8EB3 Up: Map Next: 8EE6