Prev: A577 Up: Map Next: A5BB
A591: Character routine: the dragon comes for Bilbo
If Bilbo is in room 39, 41 or 44 (the dragon's domain) and the dragon (object 60, location at C033) is somewhere else, the dragon moves to Bilbo's room and 'the dragon enters.'
A591 LD A,($C01B) Is Bilbo in room 39 (the front gate)...
A594 CP $27
A596 JR Z,$A59F
A598 CP $2C ...room 44...
A59A JR Z,$A59F
A59C CP $29 ...or room 41 (the lower halls)?
A59E RET NZ No: nothing happens
A59F CALL $9C99 Dry run? Then stop: this would work
A5A2 LD A,($C01B) Is the dragon already there?
A5A5 LD HL,$C033
A5A8 CP (HL)
A5A9 RET Z Yes: nothing to do
A5AA LD (HL),A No: the dragon flies to Bilbo's room
A5AB LD A,$01 Make sure Bilbo sees it
A5AD LD ($B5F3),A
A5B0 LD HL,$C02B Push the dragon's name as the message parameter
A5B3 PUSH HL
A5B4 LD HL,$AF09 "the dragon enters."
This entry point is used by the routines at A5BB and A5D5.
A5B7 CALL $72D4 Print it
A5BA RET
Prev: A577 Up: Map Next: A5BB