Prev: 917B Up: Map Next: 92D2
9240: Draws a pair of digits onto a door.
Each bitmap holds two digits.
Input
A Door number.
L Index of bitmap to blit digit too.
Output
Door_DrawDigits 9240 PUSH IX
9242 PUSH BC
9243 PUSH HL
Calculate 'unit' and 'tens' value of digit.
9244 LD B,$FF
Door_DrawDigits_0 9246 INC B
9247 SUB $0A
9249 JR NC,Door_DrawDigits_0
924B ADD A,$0A
924D LD C,A
924E LD HL,(BmpPtr_DigitSet)
9251 LD E,C
9252 LD D,$00
9254 SRL E
9256 ADD HL,DE
Copy left hand digit into memory.
9257 LD IX,Bitmap_temp
925B LD DE,$0005
925E PUSH BC
925F LD B,$08 Number of scans to copy.
Door_DrawDigits_1 9261 LD A,(HL) Get next scan in bitmap
9262 BIT 0,C Odd character or even digit.
9264 JR NZ,Door_DrawDigits_2
9266 RRA Even characters need shift to the right half of character cell.
9267 RRA
9268 RRA
9269 RRA
Door_DrawDigits_2 926A AND $0F Only need right hand nibble of bitmap.
926C LD (IX+$00),A Store result into memory
926F ADD HL,DE Next scan down.
9270 INC IX
9272 DJNZ Door_DrawDigits_1
Work out 'tens' digit.
9274 POP BC
9275 LD A,B
9276 AND A
9277 JR Z,Door_DrawDigits_5
9279 LD C,B
927A LD E,B
927B LD HL,(BmpPtr_DigitSet)
927E LD D,$00
9280 SRL E
9282 ADD HL,DE
9283 LD IX,Bitmap_temp Copy right hand digit.
9287 LD DE,$0005
928A LD B,$08
Door_DrawDigits_3 928C LD A,(HL) Get next bitmap scan.
928D BIT 0,C Check or odd or even digit.
928F JR Z,Door_DrawDigits_4
9291 RLA Shift od digits to left hand column.
9292 RLA
9293 RLA
9294 RLA
Door_DrawDigits_4 9295 AND $F0 Only need left hand nibble.
9297 RLA Adjust and merge with previous digit.
9298 OR (IX+$00)
929B LD (IX+$00),A
929E ADD HL,DE Next scan.
929F INC IX
92A1 DJNZ Door_DrawDigits_3
92A3 JR Door_DrawDigits_7
Door_DrawDigits_5 92A5 LD B,$08
92A7 LD HL,Bitmap_temp
Door_DrawDigits_6 92AA LD A,(HL)
92AB RLCA
92AC RLCA
92AD LD (HL),A
92AE INC HL
92AF DJNZ Door_DrawDigits_6
Copy digit to offset area of bitmap.
Door_DrawDigits_7 92B1 POP HL
92B2 CALL Bitmap_CopyFrame
92B5 LD HL,(Bitmap_InfoCache)
92B8 LD DE,$0052 Offset of bitmap, where to place the digits.
92BB ADD HL,DE
92BC LD DE,$0005
92BF LD IX,Bitmap_temp
92C3 LD B,$08
Door_DrawDigits_8 92C5 LD A,(IX+$00)
92C8 LD (HL),A
92C9 INC IX
92CB ADD HL,DE
92CC DJNZ Door_DrawDigits_8
92CE POP BC
92CF POP IX
92D1 RET
Prev: 917B Up: Map Next: 92D2