Prev: 9AEE Up: Map Next: 9B9E
9B21: Draws a string, as a bitmap, into another bitmap, such as a sign.
Used by the routine at Bg_BlitWordIntoBitmap.
Input
A Bitmap to draw string into.
HL Ptr to text index string.
B Length of text index string, number of words to draw.
Output
Draw_StringIntoOther 9B21 PUSH IX
9B23 PUSH AF
9B24 CALL Str_Decode Convert data into a string.
9B27 LD HL,ScratchPad
9B2A LD DE,$5B0C
9B2D LD A,(HL) Get string length
9B2E SRL A
9B30 NEG
9B32 ADD A,$05
9B34 JR Z,Draw_StringIntoOther_1
9B36 LD B,A
9B37 LD A,$7B
Draw_StringIntoOther_0 9B39 LD (DE),A
9B3A INC DE
9B3B DJNZ Draw_StringIntoOther_0
Draw_StringIntoOther_1 9B3D LD C,(HL) String length.
9B3E LD A,C
9B3F AND A
9B40 JR Z,Draw_StringIntoOther_2
9B42 LD B,$00
9B44 INC HL Start of string.
9B45 LDIR Copy string.
Draw_StringIntoOther_2 9B47 LD B,$07 Add seven 0x7B chars to end of string copy.
9B49 LD A,$7B
Draw_StringIntoOther_3 9B4B LD (DE),A
9B4C INC DE
9B4D DJNZ Draw_StringIntoOther_3
9B4F POP AF Get index of bitmap to write string to.
9B50 LD L,A
9B51 CALL Bitmap_CopyFrame Cache the info on the bitmap.
9B54 LD HL,(Bitmap_InfoCache) Offset bitmap address to start of area to draw string to.
9B57 LD DE,$0009
9B5A ADD HL,DE
9B5B EX DE,HL
9B5C LD IX,$5B0C Start of string to draw as a bitmap.
9B60 LD B,$0C
Draw_StringIntoOther_4 9B62 PUSH BC
9B63 PUSH DE
9B64 LD A,(IX+$00) Get next character in sting and convert into bitmap.
9B67 SUB $61
9B69 AND $FE
9B6B LD L,A
9B6C LD H,$00
9B6E ADD HL,HL
9B6F ADD HL,HL
9B70 LD BC,(BmpPtr_LettersThin)
9B74 ADD HL,BC
9B75 EX DE,HL
9B76 LD B,$06 Height if character bitmap.
Draw_StringIntoOther_5 9B78 INC DE Get scan if bitmap.
9B79 LD A,(DE)
9B7A BIT 0,(IX+$00) Each bitmap holds two lefts (left / right), so check if the left or right image is required.
9B7E JR Z,Draw_StringIntoOther_6
9B80 RRCA Shift bits in order to left hand half of image.
9B81 RRCA
9B82 RRCA
9B83 RRCA
Draw_StringIntoOther_6 9B84 RLD
9B86 LD A,L
9B87 ADD A,$08
9B89 LD L,A
9B8A LD A,H
9B8B ADC A,$00
9B8D LD H,A
9B8E DJNZ Draw_StringIntoOther_5
9B90 INC IX
9B92 POP DE
9B93 POP BC
9B94 BIT 0,B
9B96 JR Z,Draw_StringIntoOther_7
9B98 INC DE
Draw_StringIntoOther_7 9B99 DJNZ Draw_StringIntoOther_4
9B9B POP IX
9B9D RET
Prev: 9AEE Up: Map Next: 9B9E