    .ifndef WITH_REFINEMENTS
    .equ WITH_REFINEMENTS,0
    .endif
| 50% for hard puck impacts in flat far-end glass, native height band 19..31.
| Native caller already checked object=puck and height. A3=puck; D0/D1 wall normal.
| Keep near-end/curved corner/side-board handling and native break/out-of-play machinery.
    .equ PANE,0xFFF056                | word: pane centre X for native shadow/glass sprite
    .text
    .globl _start
_start:
    bra.w impact
    bra.w position
impact:
    .if WITH_REFINEMENTS
    cmpi.w #1,0xFFFFF8DA
    beq.w original_impact
    .endif
    movem.l %d0-%d2,-(%sp)
    move.w 0x14(%a3),%d0
    cmpi.w #280,%d0
    bge.s top
    movem.l (%sp)+,%d0-%d2
    jmp 0x14C2C                       | native near-end/side-board out-of-play path
 top:
    cmpi.w #0x1F00,0x2A(%a3)
    blt.s rebound
    cmpi.w #-64,(%a3)
    blt.s rebound                     | curved corners keep native behavior
    cmpi.w #64,(%a3)
    bgt.s rebound
    moveq #100,%d0
    jsr 0x11086                       | native RNG, 0..99, one draw for this hard outward impact
    cmpi.w #50,%d0
    bge.s rebound
    move.w (%a3),%d0
    addi.w #16,%d0
    asr.w #5,%d0
    asl.w #5,%d0
    move.w %d0,PANE                   | nearest 32-pixel pane centre, -64/-32/0/32/64
    movem.l (%sp)+,%d0-%d2
    jmp 0x14C04                       | native animation, sound, crowd, dead puck and faceoff
rebound:
    movem.l (%sp)+,%d0-%d2
    jmp 0x14C70                       | native wall rebound, no glass break
    .if WITH_REFINEMENTS
original_impact:
    cmpi.w #280,0x14(%a3)
    blt.w original_near
    cmpi.w #11,(%a3)
    blt.w original_rebound
    cmpi.w #18,(%a3)
    bgt.w original_rebound
    cmpi.w #0x1F00,0x2A(%a3)
    blt.w original_rebound
    jmp 0x14C04
original_near:
    jmp 0x14C2C
original_rebound:
    jmp 0x14C70
    .endif
position:
    .if WITH_REFINEMENTS
    cmpi.w #1,0xFFFFF8DA
    beq.w other_sprite
    .endif
    cmpi.w #0x28D,6(%a3)
    blt.s other_sprite
    cmpi.w #0x292,6(%a3)
    bge.s other_sprite
    move.w PANE,(%a3)
    bra.s set_y
other_sprite:
    clr.w (%a3)                       | native siren position remains centred
set_y:
    move.w #300,0x14(%a3)
    jmp 0x10328                       | native near/far Y and priority/Z adjustment
