| Prev: 8C0B | Up: Map | Next: 8C3C |
8C1B: Self-modifying blending operation (erasure).
|
This byte is patched to change blending mode: OR B for XOR mode, NOP for OR mode.
|
||||
| sprite_erase_op | 8C1B | OR B | Apply blend, store result, advance pointers, loop. | |
| 8C1C | XOR $FF | |||
| 8C1E | LD (HL),A | |||
| 8C1F | INC DE | |||
| 8C20 | INC HL | |||
| 8C21 | DEC C | |||
| 8C22 | JR NZ,render_erase_loop | |||
| 8C24 | LD A,($8B1A) | |||
| 8C27 | LD C,A | |||
| 8C28 | LD HL,($8B12) | |||
| 8C2B | LD DE,($8B10) | |||
|
Second pass: draw new sprite (OR with screen), check collision.
|
||||
| sprite_draw_loop | 8C2F | PUSH DE | Read sprite byte; collision fires when sprite AND screen share set bits (both non-zero after AND): computes (screen OR sprite) and (screen XOR sprite), jumps to dispatcher if they differ (i.e. screen AND sprite != 0). | |
| 8C30 | LD A,(DE) | |||
| 8C31 | LD B,A | |||
| 8C32 | LD A,(HL) | |||
| 8C33 | XOR B | |||
| 8C34 | LD D,A | |||
| 8C35 | XOR B | |||
| 8C36 | OR B | |||
| 8C37 | CP D | |||
| 8C38 | JP NZ,jp_collision_dispatcher | If collision detected, jump to collision dispatcher. | ||
|
This entry point is used by the routines at collision_dispatcher and reset_gameplay_mode.
|
||||
| handle_collision_mode_none | 8C3B | LD A,(HL) | ||
| Prev: 8C0B | Up: Map | Next: 8C3C |