Prev: 44266 Up: Map Next: 44372
44294: Print Room Graphic
Used by the routine at Print_RoomImage.
Expand one compressed room picture into the display.
Input
IX Pointer to room image data
PrintRoomGraphic 44294 CALL SwitchToNormalScreenOutput Call SwitchToNormalScreenOutput to switch to the normal screen output.
44297 LD BC,6177 Park the cursor where the room picture is printed.
44300 CALL 3545 Call CL_SET.
Reset graphic display area.
44303 LD HL,23695 Point HL at ATTR_T which holds the current attribute value.
44306 LD A,(HL) Fetch the attribute byte.
44307 AND %00111000 Keep only the PAPER bits 3-5.
44309 RRA Move the PAPER bits into the INK bits.
44310 RRA
44311 RRA
44312 LD B,A Store the result in B.
44313 LD A,(HL) Fetch the attribute byte again.
44314 AND %11111000 Keep everything except the INK bits.
44316 OR B Combine the two values.
44317 LD (HL),A Write the result back to *ATTR_T.
44318 LD BC,512 Set a byte counter in BC of 0512.
Print_RoomGraphic_Loop 44321 PUSH BC Keep the byte counter on the stack.
44322 LD HL,44861 Point HL at the character-cell buffer.
44325 LD B,8 Take the eight pixel rows of this character cell.
44327 LD C,(IX+0) Take this cell's mask byte.
44330 INC IX Move past the mask byte.
44332 JR PrintRoomGraphic_1 Expand the first row of this cell.
PrintRoomGraphic_0 44334 INC HL Step to the next row of the cell.
PrintRoomGraphic_1 44335 SRL C Test the next mask bit.
44337 JR NC,PrintRoomGraphic_2 Skip the stored row when this mask bit is clear.
44339 LD A,(IX+0) Take the pixel row stored for this mask bit.
44342 INC IX Move past that pixel row.
44344 JR PrintRoomGraphic_3 Store the pixel row for this mask bit.
PrintRoomGraphic_2 44346 XOR A Use a blank pixel row when this mask bit is clear.
PrintRoomGraphic_3 44347 LD (HL),A Store the row in this cell.
44348 DJNZ PrintRoomGraphic_0 Repeat for all eight pixel rows of this character cell.
44350 LD DE,44861 Point DE at the character-cell buffer.
44353 CALL 2819 Call PO_FETCH.
44356 CALL 2943 Call PR_ALL at 2943 part of PO_ANY.
44359 CALL 2780 Call PO_STORE.
44362 POP BC Restore the byte counter from the stack.
44363 DEC BC Decrease the byte counter by one.
44364 LD A,C Jump back to Print_RoomGraphic_Loop until the byte counter is zero.
44365 OR B
44366 JR NZ,Print_RoomGraphic_Loop
44368 CALL 3405 Call TEMPS.
44371 RET Return.
View the equivalent code in;
Prev: 44266 Up: Map Next: 44372