Prev: 9A55 Up: Map Next: 9AEC
9AAB: Plots a face
Used by the routine at print_chatter.
Input
HL Address of face to plot (32x40 bitmap followed by 4x5 attribute bytes)
DE Address of screen location (real screen)
plot_face 9AAB LD BC,$00A0 Byte length of bitmap - counter
9AAE PUSH DE Save current screen address
pf_loop 9AAF PUSH DE Save screen address
9AB0 LDI Transfer four bytes
9AB2 LDI
9AB4 LDI
9AB6 LDI
9AB8 POP DE Restore source address
9AB9 JP PO,pf_attrs_bit If BC became zero then proceed to plotting the attributes (PO => BC == 0)
9ABC INC D Move down a scanline
9ABD LD A,D Loop until we've done 8 lines (we've overflowed into the band bits)
9ABE AND $07
9AC0 JR NZ,pf_loop
9AC2 LD A,E Move down a row (8 lines)
9AC3 ADD A,$20
9AC5 LD E,A
9AC6 JR C,pf_loop If carry then loop (overflow is ok)
9AC8 LD A,D Step back 8 lines (undo overflow)
9AC9 SUB $08
9ACB LD D,A
9ACC JR pf_loop Loop
This entry point is used by the routine at draw_mugshot.
pf_attrs_bit 9ACE POP DE Restore current screen address
9ACF LD A,D Extract line bits (0..7)
9AD0 RRCA
9AD1 RRCA
9AD2 RRCA
9AD3 AND $03
9AD5 ADD A,$58 Turn it into an attribute address (works for first band only?)
9AD7 LD D,A
9AD8 LD C,$14 Byte length of attributes - counter
pf_attrs_loop 9ADA LDI Transfer four attributes
9ADC LDI
9ADE LDI
9AE0 LDI
9AE2 RET PO If BC became zero then return
9AE3 LD A,E Move down an attribute row
9AE4 ADD A,$1C
9AE6 LD E,A
9AE7 JR NC,pf_attrs_loop If no carry then loop
9AE9 INC D Move down 8 attribute rows
9AEA JR pf_attrs_loop Loop
Prev: 9A55 Up: Map Next: 9AEC