Prev: 9776 Up: Map Next: 97D5
978B: Handler: ASCII Character
Used by the routine at Controller_CharacterPrinting.
Handler_ASCIICharacter 978B PUSH BC Stash BC and DE on the stack.
978C PUSH DE
978D SUB $20 A-=20.
978F LD L,A Create an offset in HL.
9790 LD H,$00
9792 ADD HL,HL HL*=08.
9793 ADD HL,HL
9794 ADD HL,HL
9795 LD DE,($F81A) HL+=*Font_Pointer.
9799 ADD HL,DE
979A PUSH HL Stash HL on the stack.
979B LD A,($F819) Multiply *F819 by 02 and store the result in A.
979E ADD A,A
979F LD HL,$99C5 HL=99C5.
97A2 ADD A,L L+=A.
97A3 LD L,A
97A4 JR NC,ASCIICharacter_NoCarry Jump to ASCIICharacter_NoCarry if there's no carry.
97A6 INC H Handle carry.
ASCIICharacter_NoCarry 97A7 LD E,(HL) E=*HL.
97A8 INC HL Increment HL by one.
97A9 LD D,(HL) D=*HL.
97AA LD A,($F818) A=*F818.
97AD EX DE,HL Exchange the DE and HL registers.
97AE ADD A,L A+=L.
97AF LD L,A L=A.
97B0 PUSH HL DE=HL (using the stack).
97B1 POP DE
97B2 POP HL Restore HL from the stack.
97B3 PUSH DE Stash DE on the stack.
97B4 LD B,$08 B=08.
Handler_ASCIICharacter_0 97B6 LD A,(HL) Write *HL to *DE.
97B7 LD (DE),A
97B8 INC D Increment D by one.
97B9 INC HL Increment HL by one.
97BA DJNZ Handler_ASCIICharacter_0 Decrease counter by one and loop back to Handler_ASCIICharacter_0 until counter is zero.
97BC POP HL Restore HL from the stack.
97BD LD A,H A=H.
97BE RRA RRA.
97BF RRA
97C0 RRA
97C1 AND %00000011 Keep only bits 0-1.
97C3 ADD A,(IY+$1D) A+=*IY+1D.
97C6 LD H,A H=A.
97C7 LD A,($F81E) A=*F81E.
97CA LD (HL),A Write A to *HL.
97CB INC L Increment L by one.
97CC LD (HL),A Write A to *HL.
97CD POP DE Restore DE and BC from the stack.
97CE POP BC
97CF LD HL,$F818 HL=F818.
97D2 JP $9818 Jump to 9818.
Prev: 9776 Up: Map Next: 97D5