Routines

27419: Prepare one line of message in buffer


Used by routines at 20665 and 27462

DE Message address
HL Start address of buffer

27419 ED530BD6 LD (54795),DE Save message address
27423 E5 PUSH HL
27424 D9 EXX
27425 E1 POP HL

During startup:
27426 010000 LD BC,0

During the game (after the POKEs made by the startup routine at 21408):
27426 010040 LD BC,16384 B=64, C=0

The routine continues:
27429 71 LD (HL),C Create 64 (or 256) empty vertical
pixel lines in the buffer
27430 23 INC HL
27431 10FC DJNZ 27429
27433 2B DEC HL HL'=address of last byte in buffer
27434 D9 EXX
27435 26D6 LD H,214
27437 0E40 LD C,64
27439 CDCE66 CALL 26318 Get character code from message into A
27442 FE03 CP 3 Is character code 0, 1 or 2?
27444 3805 JR C,27451 Jump if so to end the line
27446 CDE669 CALL 27110 Place CHR$(A) in buffer
27449 18F4 JR 27439 Jump back to do next character
27451 CB39 SRL C Now C=half the number of vertical pixel lines left in the buffer
27453 C8 RET Z Return if zero
27454 CDF469 CALL 27124 Create C empty vertical pixel
lines in the buffer,
thus centring the message
27457 0D DEC C
27458 20FA JR NZ,27454
27460 C9 RET