    .ifndef WITH_REFINEMENTS
    .equ WITH_REFINEMENTS,0
    .endif
| Clear the previous power-play display without losing either live team pointer.
| Native EASNLogo clobbers A2 with VRAM offset $030A; updatepwrplay still needs
| A2/A3 to compare penalty queues immediately after this call.
 .text
 .globl _start
_start:
 .if WITH_REFINEMENTS
 bra.w clear
 bra.w draw_box
clear:
 .endif
 bclr #5,0xFFFFC2EE
 beq.w done
 .if WITH_REFINEMENTS
 | Retire only the requested72x32pixel PP box above the existing clock frame.
 move.w %sr,-(%sp)
 movem.l %d0-%d2,-(%sp)
 ori.w #0x700,%sr
 move.w #0x8F02,0xC00004
 move.l #0x69800003,%d2             | row19,col0; nine cells like the clock below
 moveq #3,%d1
clear_row:
 move.l %d2,0xC00004
 moveq #8,%d0
clear_cell:
 move.w #0x07FF,0xC00000
 dbra %d0,clear_cell
 addi.l #0x00800000,%d2
 dbra %d1,clear_row
 movem.l (%sp)+,%d0-%d2
 move.w (%sp)+,%sr
 .endif
 movem.l %a2-%a3,-(%sp)
 jsr 0x12D70
 movem.l (%sp)+,%a2-%a3
done:
 rts
 .if WITH_REFINEMENTS
draw_box:
 move.w %sr,-(%sp)
 movem.l %d0-%d2/%a0,-(%sp)
 ori.w #0x700,%sr
 move.w #0x8F02,0xC00004
 lea box_words(%pc),%a0
 move.l #0x69800003,%d2
 moveq #3,%d1
draw_row:
 move.l %d2,0xC00004
 moveq #8,%d0
draw_cell:
 move.w (%a0)+,0xC00000
 dbra %d0,draw_cell
 addi.l #0x00800000,%d2
 dbra %d1,draw_row
 movem.l (%sp)+,%d0-%d2/%a0
 move.w (%sp)+,%sr
 bset #5,0xFFFFC2EE                | exact displaced native PP flag/CCR behavior
 jmp 0x12AD2                      | continue native club/timer/stat accounting
box_words:
 .word 0xA3FF,0xA400,0xA400,0xA400,0xA400,0xA400,0xA400,0xA400,0xA401
 .word 0xA402,0xA403,0xA403,0xA403,0xA403,0xA403,0xA403,0xA403,0xA404
 .word 0xA402,0xA403,0xA403,0xA403,0xA403,0xA403,0xA403,0xA403,0xA404
 .word 0xA405,0xA406,0xA406,0xA406,0xA406,0xA406,0xA406,0xA406,0xA407
 .endif
