Prev: A842 Up: Map Next: A8B1
A865: Character routine: dawn in the trolls' clearing
The trolls turn to stone at dawn. Both trolls (objects 71 and 72) are killed (96DD) and made invisible, and whatever they carried - including the large key - is left behind (9CA8). The trolls' clearing (room 5) gets a new description script, 'in a clearing with two stone trolls', and the game announces 'day dawns.'
The first two bytes of the room 5 picture (the border and paper colours, see 8BE9) are set to 5 and $28: cyan. At the start of a game (6C27) they are set to 0, so the clearing is drawn in black until dawn, and in daylight colours afterwards.
A865 CALL $9C99 Dry run? Then stop here: it always works
A868 LD A,$47 Kill the hideous troll (object 71)...
A86A CALL $96DD
A86D LD A,$48 ...and the vicious troll (object 72) too
A86F CALL $96DD
A872 LD HL,$C535 The hideous troll becomes invisible...
A875 RES 7,(HL)
A877 LD HL,$C547 ...and so does the vicious troll
A87A RES 7,(HL)
A87C LD HL,$B154 "in a clearing with two stone trolls"
A87F LD ($B9B4),HL This becomes the clearing's new description script
A882 LD HL,$B9AC The clearing's "visited" flag is cleared...
A885 RES 6,(HL) ...so it will be described in full again, with the new text
A887 LD A,$47 Everything the hideous troll was carrying is left behind...
A889 CALL $9CA8
A88C LD A,$48 ...and likewise for the vicious troll
A88E CALL $9CA8
A891 LD HL,$B1FD "day dawns."
A894 LD A,$01 Make sure Bilbo sees this, wherever he is
A896 LD ($B5F3),A
A899 CALL $72D4
A89C LD IX,$CC00 Find the clearing's own picture...
A8A0 LD A,$05
A8A2 CALL $9D12
A8A5 LD L,(IX+$01) HL = its address
A8A8 LD H,(IX+$02)
A8AB LD (HL),$05 Its border colour becomes cyan...
A8AD INC HL
A8AE LD (HL),$28 ...and so does its background, so it is drawn in daylight from now on
A8B0 RET
Prev: A842 Up: Map Next: A8B1