Prev: 48725 Up: Map Next: 48812
48734: Print Room Graphic
Used by the routine at Print_RoomImage.
Unpack a room picture into the display, drawing it in the paper colour.
Input
IX Pointer to room image data
Print_RoomGraphic 48734 CALL SwitchToNormalScreenOutput Call SwitchToNormalScreenOutput to select the screen channel.
48737 LD BC,6177 Set the cursor to row 24, column 33.
48740 CALL 3545 Call CL_SET.
Draw the picture in the paper colour.
48743 LD HL,23695 Take the current attribute from *ATTR_T.
48746 LD A,(HL) Fetch the attribute byte.
48747 AND 56 Keep only the PAPER bits.
48749 RRA Move the PAPER bits into the INK bits.
48750 RRA
48751 RRA
48752 LD B,A Keep that ink colour.
48753 LD A,(HL) Fetch the attribute byte again.
48754 AND 248 Keep everything except the old INK bits.
48756 OR B Combine the two values.
48757 LD (HL),A Write the result back to *ATTR_T.
48758 LD BC,512 Count 512 picture bytes.
Print_RoomGraphic_Loop 48761 PUSH BC Keep the byte counter safe.
48762 LD HL,47941 Use the scanline buffer (47941).
48765 LD B,8 Count 8 bits.
48767 LD C,(IX+0) Read the next control byte and advance through the picture.
48770 INC IX
48772 JR Print_RoomGraphic_ShiftBit Jump to Print_RoomGraphic_ShiftBit to test the first control bit.
Print_RoomGraphic_NextByte 48774 INC HL Advance to the next byte of the scanline.
Print_RoomGraphic_ShiftBit 48775 SRL C Take the next control bit; a set bit means this scanline byte comes from the picture data.
48777 JR NC,Print_RoomGraphic_BlankByte Jump to Print_RoomGraphic_BlankByte when that bit is reset, so the byte is blank.
48779 LD A,(IX+0) Read the next picture byte and advance through the picture.
48782 INC IX
48784 JR Print_RoomGraphic_StoreByte Jump to Print_RoomGraphic_StoreByte to store the picture byte.
Print_RoomGraphic_BlankByte 48786 XOR A Use a blank byte.
Print_RoomGraphic_StoreByte 48787 LD (HL),A Store the byte in the scanline buffer.
48788 DJNZ Print_RoomGraphic_NextByte Repeat from Print_RoomGraphic_NextByte until the eight bits of this control byte are used.
48790 LD DE,47941 Take the finished scanline (47941).
48793 CALL 2819 Call PO_FETCH.
48796 CALL 2943 Call PR_ALL at 2943, part of PO_ANY.
48799 CALL 2780 Call PO_STORE.
48802 POP BC Restore the byte counter from the stack.
48803 DEC BC Step the byte counter down.
48804 LD A,C Jump back to Print_RoomGraphic_Loop until every picture byte has been drawn.
48805 OR B
48806 JR NZ,Print_RoomGraphic_Loop
48808 CALL 3405 Call TEMPS.
48811 RET Return.
View the equivalent code in;
Prev: 48725 Up: Map Next: 48812