Prev: D5E6 Up: Map Next: D610
D5FA: Merge Gun Shot Onto Background
Used by the routines at Merge_Shot_Alias, Draw_GunShot_Mask and Draw_GunShot.
Merge_Shot D5FA PUSH BC Store BC and HL for later.
D5FB PUSH HL
Merge_Shot_Loop D5FC LD A,(DE) Loads the contents of the source address held in DE.
D5FD XOR (HL) Performs a bit-by-bit XOR comparison against the contents of the destination address held by HL.
A register bit Comparison bit A bit set to
0 0 0
0 1 1
1 0 1
1 1 0
D5FE LD (HL),A Stores the result at the destination address.
D5FF INC HL Increase the source and destination addresses by one, decrease the counter by one. Loop back to Merge_Shot_Loop until the C counter is zero.
D600 INC DE
D601 DEC C
D602 JR NZ,Merge_Shot_Loop
D604 POP HL Restore HL with the original destination address.
D605 INC H Increase the high-order byte of HL by one, if this is on a screen third boundary (@todo what's the term for this?) then call Calc_Attribute.
D606 LD A,H
D607 AND $07
D609 CALL Z,Calc_Attribute
D60C POP BC Decrease the B counter by one and loop back to Merge_Shot until it is zero.
D60D DJNZ Merge_Shot
D60F RET Return.
Prev: D5E6 Up: Map Next: D610