Prev: 9C79 Up: Map Next: 9D25
9D19: Choose the instruction that puts a sprite byte on the screen
Returns an opcode rather than a flag, for BLIT_SPRITE to write into the middle of its own loop. The drawing mode is packed into B: the low two bits pick the combining operation here, the top three pick which of the eight drawing routines runs.
Input
B Drawing mode
A $00 for NOP, $B6 for OR (HL), $AE for XOR (HL)
SPRITE_COMBINE_OPCODE 9D19 LD A,B Mode 0 leaves A zero -- a NOP, so the sprite byte is stored as it is.
9D1A AND $03
9D1C RET Z
9D1D CP $01 $AE is XOR (HL), which is how a sprite is drawn and then rubbed out again by drawing it a second time.
9D1F LD A,$AE
9D21 RET NZ Modes 2 and 3 both take it.
9D22 ADD A,$08 $AE + 8 is $B6, OR (HL) -- the sprite laid over what is already there.
9D24 RET
Prev: 9C79 Up: Map Next: 9D25