Prev: 36531 Up: Map Next: 36582
36551: Print Handler: Select Font
Select font parameter handler. Called on the byte immediately following a 26 control code. Copies the six-byte font configuration for the selected font index (0–3) from the table at FontConfig_Table into the font state at 32780 and loads the font bitmap pointer into 32776.
PrintHandler_SelectFont 36551 LD B,4 B=4 (mask limit: font indices 0–3).
36553 CALL PrintHandler_MaskParam Call PrintHandler_MaskParam to reset PrintState_Handler and mask B to the font index.
36556 LD H,0 H=0.
36558 LD L,B L=B (font index as a 16-bit value in HL).
36559 LD DE,36838 DE=FontConfig_Table (font configuration table base).
Multiply the font index by 8 (the size of each font table entry) to compute the byte offset into the font table.
36562 ADD HL,HL Multiply HL by 8 (three left shifts).
36563 ADD HL,HL
36564 ADD HL,HL
36565 ADD HL,DE HL=FontConfig_Table + (font index × 8) — pointer to the selected font entry.
36566 LD DE,32780 DE=32780 (font state destination).
36569 LD BC,6 BC=6 (six bytes of font configuration to copy).
36572 LDIR Copy six bytes of font configuration to 32780–32785.
36574 LD E,(HL) Read the two-byte font bitmap pointer from bytes 7–8 of the entry.
36575 INC HL
36576 LD D,(HL)
36577 LD (32776),DE Write the font bitmap pointer to *PrintState_FontPtr.
36581 RET Return.
Prev: 36531 Up: Map Next: 36582