Prev: B0DE Up: Map Next: B14A
B10B: Print Room Image
Used by the routine at DisplayImage_WoodedVale.
Input
IX Pointer to room image data
Print_RoomImage B10B PUSH IX HL=IX (using the stack).
B10D POP HL
B10E LD DE,$0200 Move HL past the 0200-byte mask to the pixel data.
B111 ADD HL,DE
B112 LD DE,$4000 Set DE to the start of the screen buffer (4000).
B115 LD BC,$0200 Set a counter in BC for 0200 bytes to process.
DecompressPixelData_Loop B118 PUSH BC Stash the mask byte counter on the stack.
B119 LD B,$08 Set B to 08 for the 08 bits in a byte.
B11B LD C,(IX+$00) Fetch the mask byte from *IX into C.
DecompressPixelBit_Loop B11E SLA C Shift C left (with carry).
B120 JR NC,DecompressPixelBit_Next Jump to DecompressPixelBit_Next if the mask bit was clear (those 08 pixels stay blank).
B122 LD A,(HL) Copy the next pixel byte onto the screen.
B123 LD (DE),A
B124 INC HL Move to the next pixel byte.
DecompressPixelBit_Next B125 INC DE Increment DE by one.
B126 DJNZ DecompressPixelBit_Loop Decrease the bit counter by one and loop back to DecompressPixelBit_Loop until the counter is zero.
B128 INC IX Increment IX by one.
B12A POP BC Restore the mask byte counter from the stack.
B12B DEC BC Decrease the mask byte counter by one.
B12C LD A,B Jump back to DecompressPixelData_Loop until all bytes have been processed.
B12D OR C
B12E JR NZ,DecompressPixelData_Loop
Decompress the attribute data.
B130 PUSH HL IX=HL (using the stack).
B131 POP IX
B133 LD HL,$5800 Initialise the attribute buffer pointer in HL to 5800 (the beginning of the attribute buffer).
DecompressAttributeData_Loop B136 LD A,(IX+$00) Fetch the attribute byte from *IX+00 and store it in A.
B139 LD B,(IX+$01) Fetch the repeat count from *IX+01 and store this in B (00 means 0100).
B13C INC IX Increment IX by two.
B13E INC IX
RepeatAttribute_Loop B140 LD (HL),A Write the attribute byte to the attribute buffer pointer.
B141 INC HL Increment the attribute buffer pointer by one.
B142 DJNZ RepeatAttribute_Loop Decrease the repeat counter by one and loop back to RepeatAttribute_Loop until the counter is zero.
Keep looping back until the end of the attribute buffer is reached.
B144 LD A,H Jump back to DecompressAttributeData_Loop until H is equal to 5A.
B145 CP $5A
B147 JR NZ,DecompressAttributeData_Loop
B149 RET Return.
Prev: B0DE Up: Map Next: B14A