Prev: 32719 Up: Map Next: 33153
32967: RedrawRoomView
Rebuilds the room-interior view for the current room: picks the layout template by room type, decompresses it into the grid buffer, draws walls/furniture, then walks the exit list drawing one door arm per neighbour (and grille arms for duct openings). Room type 4 (the alien's lair view) resets the encounter animation instead.
32967 LD A,(31243) A = room type
32970 CP 4 alien-lair view?
32972 JR NZ,32981
32974 CALL 39687 yes: reset alien body animation
32977 CALL 33421
32980 RET
32981 LD HL,25716 room type 0: layout template 0
32984 AND A
32985 JR Z,32997
32987 LD HL,25835
32990 CP 1
32992 JR Z,32997
32994 LD HL,25996
32997 CALL 33153
33000 CALL 33421
33003 CALL 33395
33006 CALL 33178
33009 LD HL,(31255) mark the room's anchor cell (attr 71:
33012 LD (HL),71 bright white) — the arms start here
33014 PUSH HL
33015 LD HL,(31259)
33018 PUSH HL
33019 LD A,(29632) 1st exit (menu strip cell 2)?
33022 CP 255
33024 JR Z,33054
33026 LD DE,65516 yes: walk the NORTH arm — heading -20
33029 LD (31246),DE (grid) / -32 (attr), starting one cell
33033 ADD HL,DE above the anchor
33034 LD (31259),HL
33037 LD HL,(31255)
33040 LD DE,65504 DE = -32 (screen stride: one cell up within a third)
33043 LD (31244),DE
33047 ADD HL,DE
33048 LD (31255),HL
33051 CALL 33223
33054 LD A,(29633) 2nd exit (menu strip cell 3)?
33057 CP 255
33059 JR Z,33088
33061 POP HL yes: walk the EAST arm — heading +1/+1,
33062 POP DE starting one cell right of the anchor
33063 PUSH DE
33064 PUSH HL
33065 LD BC,1
33068 INC HL
33069 LD (31259),HL
33072 INC DE
33073 LD (31255),DE
33077 LD (31244),BC
33081 LD (31246),BC
33085 CALL 33223
33088 LD A,(29634) 3rd exit (menu strip cell 4)?
33091 CP 255
33093 JR Z,33123
33095 POP HL yes: walk the SOUTH arm — heading +20/+32,
33096 POP DE starting one cell below the anchor
33097 PUSH DE
33098 PUSH HL
33099 LD BC,20
33102 LD (31246),BC
33106 ADD HL,BC
33107 LD (31259),HL
33110 LD HL,32
33113 LD (31244),HL
33116 ADD HL,DE
33117 LD (31255),HL
33120 CALL 33223
33123 POP HL
33124 POP DE
33125 LD A,(29635) 4th exit (menu strip cell 5)?
33128 CP 255
33130 RET Z
33131 DEC DE yes: walk the WEST arm — heading -1/-1,
33132 DEC HL starting one cell left of the anchor
33133 LD (31259),HL
33136 LD (31255),DE
33140 LD HL,65535
33143 LD (31244),HL
33146 LD (31246),HL
33149 CALL 33223
33152 RET
Prev: 32719 Up: Map Next: 33153