Routines |
Prev: 54034 | Up: Map | Next: 54219 |
This routine uses the same technique as seen in the routine at 47709 to convert from an attribute file address to a display file address. See the notes in that routine for more details.
|
||||||||||||||
54144 | SET 6,A | Set BRIGHT flag | ||||||||||||
54146 | LD (IX+0),A | Load attribute value into current attribute file address | ||||||||||||
54149 | XOR A | Load HL with double graphic set index | ||||||||||||
54150 | LD L,B | |||||||||||||
54151 | LD H,A | |||||||||||||
54152 | ADD HL,HL | |||||||||||||
54153 | LD DE,27000 | Add double graphic set index as an offset to the address of the table of graphic sets' start addresses (in HL) | ||||||||||||
54156 | ADD HL,DE | |||||||||||||
54157 | LD E,(HL) | Load DE with start address of this graphic set | ||||||||||||
54158 | INC HL | |||||||||||||
54159 | LD D,(HL) | |||||||||||||
54160 | LD L,C | Load HL with graphic index | ||||||||||||
54161 | LD H,A | |||||||||||||
54162 | ADD HL,HL | Load DE with start address of graphic set plus eight times graphic index | ||||||||||||
54163 | ADD HL,HL | |||||||||||||
54164 | ADD HL,HL | |||||||||||||
54165 | ADD HL,DE | |||||||||||||
54166 | EX DE,HL | |||||||||||||
54167 | PUSH IX | Load HL with attribute file address | ||||||||||||
54169 | POP HL | |||||||||||||
54170 | LD A,H | Multiply the most significant byte (MSB) of the attribute file address by eight to put it on the same scale as the MSB of the display file address MSB (see notes) and drop the most significant bit to point to the correct location in display file | ||||||||||||
54171 | ADD A,A | |||||||||||||
54172 | ADD A,A | |||||||||||||
54173 | ADD A,A | |||||||||||||
54174 | AND 91 | |||||||||||||
54176 | LD H,A | |||||||||||||
54177 | EX DE,HL | Switch DE (now display file address) and HL (now pointer to graphic data) | ||||||||||||
54178 | BIT 7,(IX+0) | If mirror flag is set for attribute file at current location then skip ahead to 54194 to draw mirrored version | ||||||||||||
54182 | JP NZ,54194 | |||||||||||||
54185 | LD B,8 | Copy eight bytes of data from address in HL (graphic data) to successive display file rows starting at address in DE | ||||||||||||
54187 | LD A,(HL) | |||||||||||||
54188 | LD (DE),A | |||||||||||||
54189 | INC D | |||||||||||||
54190 | INC HL | |||||||||||||
54191 | DJNZ 54187 | |||||||||||||
54193 | RET | Return | ||||||||||||
Draw mirrored graphic character block to display file
|
||||||||||||||
54194 | RES 7,(IX+0) | Reset bit 7 (FLASH flag) | ||||||||||||
54198 | LD B,8 | Prepare to draw eight pixel rows | ||||||||||||
54200 | PUSH BC | Store BC (remaining rows to draw) | ||||||||||||
54201 | LD A,(HL) | Load A with graphic data byte | ||||||||||||
54202 | PUSH HL | Store HL (pointer to graphic data) | ||||||||||||
54203 | LD HL,27030 | Load A with mirrored graphic byte | ||||||||||||
54206 | LD C,A | |||||||||||||
54207 | LD B,0 | |||||||||||||
54209 | ADD HL,BC | |||||||||||||
54210 | LD A,(HL) | |||||||||||||
54211 | POP HL | Restore HL (pointer to graphic data) | ||||||||||||
54212 | LD (DE),A | Write mirrored graphic data to display file, advance down to next row in display file and advance to next byte of graphic data | ||||||||||||
54213 | INC D | |||||||||||||
54214 | INC HL | |||||||||||||
54215 | POP BC | Restore BC (remaining rows to draw) | ||||||||||||
54216 | DJNZ 54200 | Loop back for next row of pixels | ||||||||||||
54218 | RET | Return |
Prev: 54034 | Up: Map | Next: 54219 |