![]()  | 
Routines | 
| Prev: B0DE | Up: Map | Next: B14A | 
| 
 
Used by the routine at DisplayImage_WoodedVale.
 
  | 
||||||||
| Print_RoomImage | B10B | PUSH IX | HL=IX (using the stack). | |||||
| B10D | POP HL | |||||||
| B10E | LD DE,$0200 | Add 0200 to the image data to skip the header. | ||||||
| B111 | ADD HL,DE | |||||||
| B112 | LD DE,$4000 | Initialise the screen buffer pointer in DE to 4000 (the beginning of the screen buffer). | ||||||
| B115 | LD BC,$0200 | Set a counter in BC for 0200 bytes to process. | ||||||
| DecompressPixelData_Loop | B118 | PUSH BC | Stash the byte counter on the stack. | |||||
| B119 | LD B,$08 | B=08. | ||||||
| B11B | LD C,(IX+$00) | C=*IX+00. | ||||||
| Print_RoomImage_0 | B11E | SLA C | Shift C left (with carry). | |||||
| B120 | JR NC,Print_RoomImage_1 | Jump to Print_RoomImage_1 if ?? is greater than or equal to 08. | ||||||
| B122 | LD A,(HL) | A=*HL. | ||||||
| B123 | LD (DE),A | Write A to *DE. | ||||||
| B124 | INC HL | Increment HL by one. | ||||||
| Print_RoomImage_1 | B125 | INC DE | Increment DE by one. | |||||
| B126 | DJNZ Print_RoomImage_0 | Decrease counter by one and loop back to Print_RoomImage_0 until counter is zero. | ||||||
| B128 | INC IX | Increment IX by one. | ||||||
| B12A | POP BC | Restore the byte counter from the stack. | ||||||
| B12B | DEC BC | Decrease the 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. | ||||||
| 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 |