Prev: 33178 Up: Map Next: 33275
33223: DrawDoorArm
Highlights one exit path of the room-map view: walks the (invisibly drawn) wall glyphs from the room's anchor point, painting each visited attribute cell cyan (attr 5), until it reaches a grille or junction node. Per cell it reads the grid under RoomCellCursor, looks the glyph up in CellDrawTable (32934) and patches the handler into the CALL below (self-modifying). Straight segments keep the heading, corner glyphs 128-131 turn it, and node glyphs (125/142/143) end the walk via ArmEndNode (which pops the return address). The stride pair RoomAttrStep/RoomCellStep encodes the heading: attr +32/-32/+1/-1 = south/north/east/west (grid steps +20/-20/+1/-1 in lockstep, the grid being 20 cells wide).
33223 LD HL,(31259) read grid cell under the cursor
33226 LD A,(HL)
33227 LD HL,32934 find its 3-byte record in CellDrawTable
33230 CP (HL)
33231 JR Z,33238
33233 INC HL
33234 INC HL
33235 INC HL
33236 JR 33230
33238 INC HL fetch the handler word
33239 LD A,(HL)
33240 INC HL
33241 LD H,(HL)
33242 LD L,A
33243 LD (33247),HL patch it into the CALL below
33246 CALL 33275 steer/stop for this glyph
33249 LD HL,(31255) paint the attribute cell cyan
33252 LD (HL),5
33254 LD DE,(31244) step the attribute cursor by the heading
33258 ADD HL,DE
33259 LD (31255),HL
33262 LD HL,(31259) step the grid cursor in lockstep
33265 LD DE,(31246)
33269 ADD HL,DE
33270 LD (31259),HL
33273 JR 33223
Prev: 33178 Up: Map Next: 33275