Prev: 59130 Up: Map Next: 59262
59219: Write active spell message on scroll and draw energy bar
spell message text and energy bar
Print the appropriate message (28604) for the active spell on the scroll.
59219 LD A,(60134) Get the spell message number
59222 LD HL,(60259) Address of spell messages (28605)
59225 LD D,0 D = counter to check message number against
Get the address pointer to the correct spell text:
59227 CP D Check spell message number against current message counter
59228 JR Z,59238 If it's the same, we're at the right message so skip ahead to 59238
59230 LD B,(HL) Length of current text string
59231 INC B Increment for the following check loop
59232 INC HL Move address pointer along
59233 DJNZ 59232 ...to the next message
59235 INC D Increment the counter (to check spell message against)
59236 JR 59227 ...and keep checking
The HL register pair is now pointing to the active spell message text.
59238 LD (60138),HL Store the spell message text address pointer
59241 LD A,0
59243 LD (60361),A Reset the spell message text counter
Draw the energy bar:
59246 LD A,132 Graphics address pointer offset for 39113, which points at the energy bar graphic at 44787.
59248 CALL 57538 Set up graphics ready to draw
59251 LD DE,20679 Set screen display address to the bottom left of the scroll
59254 CALL 56612 Draw the energy bar
59257 LD A,24 This byte is set to 24 which indicates the energy bar has just been drawn - checked in routine at 58945
59259 LD (60129),A
Prev: 59130 Up: Map Next: 59262