| Chase H.Q. | Routines |
| Prev: 8E91 | Up: Map | Next: 8EE7 |
|
160 bytes, 32 by 5 pixels, are copied backwards from the byte before the attributes down into the back buffer, four at a time: four LDDs write one four byte slice across the width of the face, then the back buffer pointer steps to the previous scanline. The PUSH HL and POP HL keep the attributes pointer, which is still needed when the copy finishes and the routine falls into plot_face_attributes.
Used by the routine at draw_mugshots.
|
||||||||||||
| draw_mugshot | 8EB7 | PUSH BC | Preserve screen position (plot_face_attributes POPs it) | |||||||||
| 8EB8 | PUSH HL | Preserve address of mugshot attributes | ||||||||||
|
The bitmap data precedes the attribute bytes.
|
||||||||||||
| 8EB9 | DEC HL | Move back one byte to point at end of bitmap data | ||||||||||
| 8EBA | LD BC,$00A0 | Size of mugshot data (32x40 bitmap) | ||||||||||
| dm_loop | 8EBD | LD A,E | Save E | |||||||||
| 8EBE | LDD | Transfer four bytes (DE, HL and BC are decremented by 4) | ||||||||||
| 8EC0 | LDD | |||||||||||
| 8EC2 | LDD | |||||||||||
| 8EC4 | LDD | |||||||||||
| 8EC6 | LD E,A | Restore E | ||||||||||
| 8EC7 | JP PO,dm_plot_attrs | If BC becomes zero then proceed to dm_plot_attrs | ||||||||||
|
Move to previous buffer scanline.
|
||||||||||||
| 8ECA | LD A,D | Save for checking in a moment | ||||||||||
| 8ECB | DEC D | Move to next scanline (visually upwards) | ||||||||||
| 8ECC | AND $0F | Would it have rolled over into the top nibble? | ||||||||||
| 8ECE | JP NZ,dm_loop | No - continue | ||||||||||
|
It rolled over.
|
||||||||||||
| 8ED1 | LD A,D | Put back the bit stolen by rollover | ||||||||||
| 8ED2 | ADD A,$10 | |||||||||||
| 8ED4 | LD D,A | |||||||||||
| 8ED5 | LD A,E | Move to next chunk of 16 scanlines | ||||||||||
| 8ED6 | SUB $20 | |||||||||||
| 8ED8 | LD E,A | |||||||||||
| 8ED9 | JP NC,dm_loop | Continue if it didn't roll over | ||||||||||
| 8EDC | LD A,D | Otherwise move to the next chunk of 128 scanlines (would put us outside the back buffer) | ||||||||||
| 8EDD | SUB $10 | |||||||||||
| 8EDF | LD D,A | |||||||||||
| 8EE0 | JP dm_loop | Loop | ||||||||||
| dm_plot_attrs | 8EE3 | POP HL | Restore address of mugshot attributes | |||||||||
| 8EE4 | JP plot_face_attributes | Exit via plot_face_attributes | ||||||||||
| Prev: 8E91 | Up: Map | Next: 8EE7 |