![]() |
Routines |
| Prev: D33F | Up: Map | Next: D3A6 |
|
Used by the routines at GoldfishGame, GoldfishGame_PrintSprite, GoldfishGame_PrintShiftedSprite and GoldfishGame_AnimateSand.
Prints one colour UDG at the current screen position. Identical clone of PrintColourCharacter; the non-colour version is PrintUDG.
|
||||||||
|
Point HL' at this character's pixels and DE' at the current screen cell.
|
||||||||
| GoldfishGame_PrintColourUDG | D353 | EXX | Switch to the shadow registers. | |||||
| D354 | LD E,A | DE'=the character code*08. | ||||||
| D355 | LD D,$00 | |||||||
| D357 | SLA E | |||||||
| D359 | RL D | |||||||
| D35B | SLA E | |||||||
| D35D | RL D | |||||||
| D35F | SLA E | |||||||
| D361 | RL D | |||||||
| D363 | LD HL,($5C36) | HL'=*CHARS+DE'. | ||||||
| D366 | ADD HL,DE | |||||||
| D367 | LD DE,($5C84) | Advance *DF_CC and leave DE' on the cell just claimed. | ||||||
| D36B | INC DE | |||||||
| D36C | LD ($5C84),DE | |||||||
| D370 | DEC DE | |||||||
|
Copy the eight pixel rows into the screen buffer.
|
||||||||
| D371 | LD B,$08 | B'=08. | ||||||
| PrintColourUDG_Loop | D373 | LD A,(HL) | Copy one pixel row and move down one screen line. | |||||
| D374 | LD (DE),A | |||||||
| D375 | INC HL | |||||||
| D376 | INC D | |||||||
| D377 | DJNZ PrintColourUDG_Loop | Decrease the row counter and loop back to PrintColourUDG_Loop until all 08 rows are written. | ||||||
|
Write *ATTR_T into the matching attribute cell.
|
||||||||
| D379 | LD BC,($5C88) | BC'=*S_POSN. | ||||||
| D37D | LD HL,$5800 | HL'=5800. | ||||||
| D380 | DEC C | Advance the print column in *S_POSN. | ||||||
| D381 | LD ($5C88),BC | |||||||
| D385 | INC C | |||||||
| D386 | LD A,$21 | HL'+=21-C' (0-based column). | ||||||
| D388 | SUB C | |||||||
| D389 | LD E,A | |||||||
| D38A | LD D,$00 | |||||||
| D38C | ADD HL,DE | |||||||
| D38D | LD A,$18 | E'=18-B' (0-based row). | ||||||
| D38F | SUB B | |||||||
| D390 | LD E,A | |||||||
| D391 | SLA E | Multiply the row by 20 and add it to the attribute address. | ||||||
| D393 | SLA E | |||||||
| D395 | SLA E | |||||||
| D397 | SLA E | |||||||
| D399 | RL D | |||||||
| D39B | SLA E | |||||||
| D39D | RL D | |||||||
| D39F | ADD HL,DE | |||||||
| D3A0 | LD A,($5C8F) | Write *ATTR_T to that attribute cell. | ||||||
| D3A3 | LD (HL),A | |||||||
| D3A4 | EXX | Switch back to the normal registers. | ||||||
| D3A5 | RET | Return. | ||||||
| Prev: D33F | Up: Map | Next: D3A6 |