| Prev: 6B73 | Up: Map | Next: 6BB0 |
6B7B: Render special terrain fragment (bridge/road area)
|
Handles terrain lines with bit 7 set in profile byte, indicating bridge/road sections. These use full-width 32-byte sprites instead of edge rendering. Dispatches based on profile byte value: $80 = canal (river side), $E0 = canal (road side), $F0 = road, else = bridge.
|
||||
|
After copying the 32-byte sprite to screen, sets state_bridge_section for attribute handling. If bridge was destroyed, clears a 4-byte hole in the middle of the road sprite.
|
||||
| handle_special_terrain_fragment | 6B7B | CP $80 | Dispatch: $80=load_canal_river_side, $E0=load_canal_road_side, $F0=load_road_sprite, else=bridge (A=1). | |
| 6B7D | JP Z,load_canal_river_side | |||
| 6B80 | CP $E0 | |||
| 6B82 | JP Z,load_canal_road_side | |||
| 6B85 | CP $F0 | |||
| 6B87 | JP Z,load_road_sprite | |||
| 6B8A | LD A,$01 | Load bridge sprite (sprite_road_and_bridge_pixels), A = 1 (bridge section). | ||
| 6B8C | LD HL,$8351 | |||
|
This entry point is used by the routines at load_canal_river_side, load_canal_road_side and load_road_sprite.
|
||||
| handle_special_terrain_fragment_continue | 6B8F | LD DE,($5F7B) | Copy 32-byte sprite row to screen via LDIR. Store A to state_bridge_section. | |
| 6B93 | LD BC,$0020 | |||
| 6B96 | LDIR | |||
| 6B98 | LD ($5F6C),A | If state_bridge_destroyed = 0, return (bridge intact). | ||
| 6B9B | LD A,($5F6D) | |||
| 6B9E | CP $00 | |||
| 6BA0 | RET Z | |||
| 6BA1 | LD HL,($5F7B) | Load screen_ptr for destroyed bridge clearing. | ||
|
This entry point is used by the routine at check_collision.
|
||||
| clear_destroyed_bridge | 6BA4 | LD DE,$000E | Set up loop to clear 4 bytes at offset $0E. | |
| 6BA7 | LD B,$04 | |||
| 6BA9 | ADD HL,DE | |||
| clear_bridge_bytes_loop | 6BAA | LD (HL),$00 | Clear byte, advance pointer, loop 4 times. | |
| 6BAC | INC HL | |||
| 6BAD | DJNZ clear_bridge_bytes_loop | |||
| 6BAF | RET | |||
| Prev: 6B73 | Up: Map | Next: 6BB0 |