Prev: BAEE Up: Map Next: BB15
BAFB: MPRINT
Input
A Message number
BC Coordinates
MPRINT BAFB PUSH HL preserve HL, DE, and BC
BAFC PUSH DE
BAFD PUSH BC
BAFE LD H,$00 set HL to value in A (message number)
BB00 LD L,A
BB01 ADD HL,HL multiply HL by four because each row is 4 bytes
BB02 ADD HL,HL
BB03 LD DE,game_messages_1 add address of game messages table 1 to get address of desired row in game messages table
BB06 ADD HL,DE
BB07 LD E,(HL) load address of message into DE
BB08 INC HL
BB09 LD D,(HL)
BB0A INC HL load message length into C
BB0B LD C,(HL)
BB0C EX DE,HL swap DE into HL
BB0D LD E,C copy length into E
BB0E POP BC restore coordinates in BC
BB0F CALL print_string_loop call routine at print_string_loop to print string
BB12 POP DE restore DE and HL
BB13 POP HL
BB14 RET return
Prev: BAEE Up: Map Next: BB15