Prev: 40057 Up: Map Next: 40229
40217: Get Blend Instruction
Gets the instruction that DrawGraphic uses to mix a graphic with what is on the screen, from bits 0-1 of the attribute.
Bits 0-1 Instruction
0 0 (NOP), which replaces what is on the screen
1 182 (OR (HL))
2 174 (XOR (HL))
3 174 (XOR (HL))
Input
B The attribute
Output
A The instruction
GetBlendInstruction 40217 LD A,B Fetch the attribute.
40218 AND %00000011 Keep only bits 0-1.
40220 RET Z Return if 0 (no blending).
40221 CP 1 Compare A with 1...
40223 LD A,174 A=174.
40225 RET NZ Return if the comparison was not zero (XOR blending).
40226 ADD A,8 A+=8.
40228 RET Return (OR blending).
Prev: 40057 Up: Map Next: 40229