Prev: ACEA Up: Map Next: AD54
AD06: 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 AD06 CALL SwitchToNormalScreenOutput Call SwitchToNormalScreenOutput to switch to the normal screen output.
AD09 LD BC,$1821 Park the cursor where the room picture is printed.
AD0C CALL $0DD9 Call CL_SET.
Reset graphic display area.
AD0F LD HL,$5C8F Point HL at ATTR_T which holds the current attribute value.
AD12 LD A,(HL) Fetch the attribute byte.
AD13 AND %00111000 Keep only the PAPER bits 3-5.
AD15 RRA Move the PAPER bits into the INK bits.
AD16 RRA
AD17 RRA
AD18 LD B,A Store the result in B.
AD19 LD A,(HL) Fetch the attribute byte again.
AD1A AND %11111000 Keep everything except the INK bits.
AD1C OR B Combine the two values.
AD1D LD (HL),A Write the result back to *ATTR_T.
AD1E LD BC,$0200 Set a byte counter in BC of 0200.
Print_RoomGraphic_Loop AD21 PUSH BC Keep the byte counter on the stack.
AD22 LD HL,$AF3D Point HL at the character-cell buffer.
AD25 LD B,$08 Take the eight pixel rows of this character cell.
AD27 LD C,(IX+$00) Take this cell's mask byte.
AD2A INC IX Move past the mask byte.
AD2C JR PrintRoomGraphic_1 Expand the first row of this cell.
PrintRoomGraphic_0 AD2E INC HL Step to the next row of the cell.
PrintRoomGraphic_1 AD2F SRL C Test the next mask bit.
AD31 JR NC,PrintRoomGraphic_2 Skip the stored row when this mask bit is clear.
AD33 LD A,(IX+$00) Take the pixel row stored for this mask bit.
AD36 INC IX Move past that pixel row.
AD38 JR PrintRoomGraphic_3 Store the pixel row for this mask bit.
PrintRoomGraphic_2 AD3A XOR A Use a blank pixel row when this mask bit is clear.
PrintRoomGraphic_3 AD3B LD (HL),A Store the row in this cell.
AD3C DJNZ PrintRoomGraphic_0 Repeat for all eight pixel rows of this character cell.
AD3E LD DE,$AF3D Point DE at the character-cell buffer.
AD41 CALL $0B03 Call PO_FETCH.
AD44 CALL $0B7F Call PR_ALL at 0B7F part of PO_ANY.
AD47 CALL $0ADC Call PO_STORE.
AD4A POP BC Restore the byte counter from the stack.
AD4B DEC BC Decrease the byte counter by one.
AD4C LD A,C Jump back to Print_RoomGraphic_Loop until the byte counter is zero.
AD4D OR B
AD4E JR NZ,Print_RoomGraphic_Loop
AD50 CALL $0D4D Call TEMPS.
AD53 RET Return.
View the equivalent code in;
Prev: ACEA Up: Map Next: AD54