Prev: 45895 Up: Map Next: 45965
45899: Populate primary display buffer with layout data for current character's current room
Used by the routine at 34438.
45899 LD HL,(34279) Modify instruction at 46045 with address of primary display buffer...
45902 LD (46046),HL ...
45905 LD A,(34230) Load C with depth of current character's current room...
45908 LD C,A ...
45909 LD A,(34218) Load B with index of current character's current room...
45912 LD B,A ...
45913 LD D,0 Load D with zero
Start drawing simple entities
45915 LD IX,(34236) Load IX with start address of current level's simple state data
45919 LD E,6 Load DE with 6 (as simple state data entries are 6 bytes wide)
45921 LD A,(IX+0) Load first byte of current simple state data entry into A
45924 CP 255 If this is 255 (end marker for complex state data)...
45926 JR Z,45961 ...then skip ahead to 45961
45928 CP 254 If it is not 254 (end marker for level's simple state data)...
45930 JR NZ,45939 ...then skip ahead to 45939
At this point, we have passed the end marker for the simple state data block and are now at the start of the complex state data block whose entries are 13 bytes wide.
45932 LD E,13 Load DE with 13
45934 INC IX Advance IX to start of complex state data block
45936 LD A,(IX+0) Load A with entity's room index
At this point, A holds the index of the room to which the simple or complex entity belongs
45939 CP B If entity's room is not the same as the current character's current room...
45940 JR NZ,45957 ...then skip ahead to 45957
45942 LD A,C If entity's depth is not the same as current depth in C...
45943 CP (IX+1) ...
45946 JR NZ,45957 ...then skip ahead to 45957
45948 EXX Switch registers
45949 PUSH IX Store IX (pointer to current entry in simple/complex state data)
45951 CALL 45965 Load primary display buffer with graphic layout data for current entity
45954 POP IX Restore IX (pointer to current entry in simple/complex state data)
45956 EXX Switch registers
45957 ADD IX,DE Advance IX to next entity's state data
45959 JR 45921 Loop back to 45921
45961 DEC C Decrease current depth (i.e. closer to screen)
45962 JR NZ,45915 If depth is not zero (i.e. still depth levels to process) then loop back to 45915
45964 RET Return
Prev: 45895 Up: Map Next: 45965