Prev: A6C4 Up: Map Next: A786
A6FA: Draw mini characters to the wall sign.
Used by the routines at Bg_DrawColumn and 9FCD.
Input
HL Address of special string.
B Length of special string.
Draw a string of mini-characters into the sign bitmap. Mini characters are only 4 pixels wide, so two fit within a character cell.
String_DrawToSign A6FA PUSH IX
A6FC PUSH AF
A6FD CALL String_WriteSpecial Expand special string into buffer.
A700 LD HL,_5b00_buffer
A703 LD DE,$5B0C
A706 LD A,(HL)
A707 SRL A
A709 NEG
A70B ADD A,$06
A70D JR Z,String_DrawToSign_1
A70F LD B,A
A710 LD A,$7B Paddout left of string to centre word within sign.
String_DrawToSign_0 A712 LD (DE),A
A713 INC DE
A714 DJNZ String_DrawToSign_0
String_DrawToSign_1 A716 LD C,(HL)
A717 LD A,C
A718 AND A
A719 JR Z,String_DrawToSign_2
A71B LD B,$00
A71D INC HL
A71E LDIR
String_DrawToSign_2 A720 LD B,$07
A722 LD A,$7B
String_DrawToSign_3 A724 LD (DE),A
A725 INC DE
A726 DJNZ String_DrawToSign_3
A728 LD A,$08 Get the sign bitmap.
A72A LD ($A770),A
A72D POP AF
A72E LD L,A
A72F CALL Bitmap_GetData
A732 LD HL,(Bmp_DataBuffer)
A735 LD DE,$0009 Offset to where the letters will start to be drawn.
A738 ADD HL,DE
A739 EX DE,HL
A73A LD IX,$5B0C
A73E LD B,$0C
This entry point is used by the routine at A786.
String_DrawToSign_4 A740 PUSH BC
A741 PUSH DE }
A742 LD A,(IX+$00) Get next letter
A745 CP $20 If it is a space, convet it to a '{'.
A747 JR NZ,String_DrawToSign_5
A749 LD A,$7B
String_DrawToSign_5 A74B SUB $57 Convert from ASCII to
A74D JR NC,String_DrawToSign_6
A74F SUB $D9
String_DrawToSign_6 A751 LD C,A
A752 AND $FE
A754 ADD A,A
A755 ADD A,A
A756 LD HL,($C8AC) Get the start of the mini-character bitmaps.
A759 ADD A,L Add offset for character required.
A75A LD L,A
A75B LD A,H
A75C ADC A,$00
A75E LD H,A
A75F EX DE,HL DE is start of bitmap.
A760 LD B,$06 Height of a character bitmap.
String_DrawToSign_7 A762 INC DE Get Next line of bitmap.
A763 LD A,(DE)
A764 BIT 0,C Determine if we need the right hand character (within bitmap)
A766 JR NZ,String_DrawToSign_8
A768 RRCA or right hand character, by shifting it into the right hand nibble.
A769 RRCA
A76A RRCA
A76B RRCA
String_DrawToSign_8 A76C RLD Shift the right hand nibble into sign bitmap.
A76E LD A,L Add 6 bytes for the next...
A76F ADD A,$06
A771 LD L,A
A772 LD A,H
A773 ADC A,$00
A775 LD H,A
A776 DJNZ String_DrawToSign_7
A778 INC IX Next character in word
A77A POP DE
A77B POP BC
A77C BIT 0,B For even characters we stay in the same chaacter column.
A77E JR Z,String_DrawToSign_9
A780 INC DE Next position in sign bitmap.
String_DrawToSign_9 A781 DJNZ String_DrawToSign_4
A783 POP IX
A785 RET
Prev: A6C4 Up: Map Next: A786