Prev: 8E91 Up: Map Next: 8EE7
8EB7: Draws a mugshot
Used by the routine at draw_mugshots.
Input
BC Screen position (used for attributes)
DE Address of last byte of bitmap data to be written (in back buffer)
HL Address of start of mugshot attributes / end of bitmap data
draw_mugshot 8EB7 PUSH BC Preserve screen position
8EB8 PUSH HL Preserve address of mugshot attributes
We assume that 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 next 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 pf_attrs_bit Exit via pf_attrs_bit
Prev: 8E91 Up: Map Next: 8EE7