| Routines

50B9: Print a message centred across the entire screen

Used by the routine at 52A0.
Input
A | Message number
50B9 | LD HL,$5000 | 5000=display file address
This entry point is used by the routines at 51A0, 52A0, 53B1 and 54A0 with HL holding the appropriate display file address.
50BC | PUSH HL | Save the display file address
50BD | LD L,A | L=message number
50BE | BIT 7,A | Is the message number < 0x80?
50C0 | JR Z,$50C8 | Jump if so
50C2 | LD H,$50 | Point HL at the appropriate entry in the message address table at 50F4
50C4 | LD E,(HL) | E=LSB of the message address
50C5 | INC HL | Point HL at the MSB
50C6 | JR $50CC |
50C8 | LD H,$FE | Use the regular message address table for message numbers < 0x80
50CA | LD E,(HL) | E=LSB of the message address
50CB | INC H | Point HL at the MSB
50CC | LD D,(HL) | Now DE=address of the message to print
50CD | LD HL,$5B00 | Prepare the message in screen-ready form in the buffer at 5B00
50D0 | PUSH HL
50D1 | CALL $6B1B
50D4 | POP HL
50D5 | POP DE | Restore the display file address to DE
50D6 | PUSH DE | Display the message on-screen
50D7 | LD C,$20
50D9 | LDIR
50DB | POP DE
50DC | INC D
50DD | BIT 0,H
50DF | JR NZ,$50D6
50E1 | RET |