RotatoCAM 5X Control, Mach3 Edition v0.2 - static safety audit
Written against the built package, not against intentions. Anything that cannot
be proven without Mach3 running on the machine says so.

PASS   Visual asset references
       392 records, 298 PNG assets, every referenced file exists in
       Mach3\Bitmaps\RotatoCAM5X and every asset on disk is referenced.
       No absolute paths: every path is RotatoCAM5X\<name>.png. No JPEG.
       No stock Mach3 bitmap is overwritten; nothing is written outside the
       RotatoCAM5X folder.

PASS   File integrity
       The writer re-parses its own output and compares all 20 fields of all
       392 records against the intended values, and the same parser round-trips
       C:\Mach3\1024.set and C:\Mach3\Plasma.set byte for byte. The 40 byte
       trailer is carried through unchanged.

PASS   Controls on screen
       Every rectangle is inside 0,0 to 1920,1080. The only geometry change
       from v0.1 is the RUN toolpath bottom edge, 560 to 540, to seat the MDI
       label. No control was moved off screen and no page lost a control.

PASS   A STEP command strings
       A STEP -  Code "G1 A-" & StepDeg & " F" & Feed
       A STEP +  Code "G1 A"  & StepDeg & " F" & Feed
       The literal strings AStep, A-Step, BStep and B-Step do not appear
       anywhere in the file.

PASS   B STEP command strings
       B STEP -  Code "G1 B-" & StepDeg & " F" & Feed
       B STEP +  Code "G1 B"  & StepDeg & " F" & Feed

PASS   Reserved identifier
       No script declares a variable named Step. "Step" is a keyword in the
       BASIC engine (ENABLE40.DLL keyword table), so the four step scripts use
       StepDeg.

PASS   M5 available during motion
       The SPINDLE STOP script is a comment block plus Code "M5". It contains
       no IsMoving() call and no E-stop gate.

PASS   ZERO A+B motion guard
       Refuses when IsMoving(), keeps the confirmation dialog, then calls
       DoButton(11) and DoButton(12) only. No motion command in the script.

PASS   ZERO, GO and REF stay separate
       No ZERO script contains a Code "G0 or Code "G1. No GO or STEP script
       contains a DoButton(8..13). No REF script writes a DRO.

PASS   No hand-written machine coordinates
       SetOEMDRO appears exactly once in the whole file: SetOEMDRO(802, Thick)
       in the probe script.

PASS   Modal state
       Every script that issues G90 or G91 reads GetOEMLED(49) first and
       restores the previous distance mode, and restores the modal feedrate
       from GetOEMDRO(55) (DROCodes.txt: "55 FeedRate").

PASS   Wait loops are bounded
       No bare While IsMoving() / Wend remains. Every loop sleeps 10 ms per
       poll and exits after a fixed count: 4 minutes for a move, 3 minutes per
       axis for REF ALL, and both report with Message on expiry.

PASS   OEM codes
       Every DRO code is in C:\Mach3\DROCodes.txt, every LED code is in
       C:\Mach3\LEDCodes.txt, every DoButton index matches C:\Mach3\Buttons.txt
       counted from zero (which stock 1024.set's own REF ALL script confirms),
       and every OEM button code in the file also appears in 1024.set, except
       screen-select code 4, which is page 4 in a series where 1, 2, 3, 5 and 6
       are all present in 1024.set. No code was invented in v0.2. No code was
       changed from v0.1.

PASS   B continuous jog still absent
       No OEM code was invented for a B hold jog. 1024.set has JogButtonA+ 313
       and JogButtonA- 314 and no B jog bitmap, so B keeps step and preset
       moves only. Policy unchanged.

PASS   Probe DRO verified
       SetOEMDRO(802, Thick) is correct: DROCodes.txt line 212 reads
       "802   Z Position". It was not changed. The probe script also reads
       LED 802 "Inch Mode Active" to choose metric or imperial defaults, which
       is a different namespace and is also correct.

PARTIAL   Motion guards on ZERO
       Only ZERO A+B is a script, so only ZERO A+B can refuse while moving.
       ZERO X, ZERO Y, ZERO Z, ZERO A and ZERO B are native Mach3 buttons
       (button function indexes 8 to 12). A native button cannot carry a guard,
       so Mach3's own behaviour applies to them. They still never move an axis.

NEEDS LIVE TEST   Sleep() units - read this first
       Every wait loop in v0.2 polls with Sleep(10) after a Sleep(60) settle.
       Mach3 exposes Sleep to scripts (it is in Mach3.exe's script symbol table,
       next to SetTimer and GetTimer, and Mach3 imports kernel32 Sleep, which is
       milliseconds), and the v0.2 brief itself asks for Sleep(10) in the wait
       loop. But this install has no stock script that calls Sleep: 1024.set,
       Plasma.set, C:\Mach3\macros and C:\Mach3\Addons contain none, so the
       unit could not be confirmed from a known-good file on this PC.
       How to tell on the first press: put STEP DEG on 5 and press A STEP +.
       Milliseconds, which is expected, feels instant. If instead the button
       sits for a minute or two doing nothing before the move reports, Sleep is
       not milliseconds on this build. Nothing unsafe happens either way, the
       script just waits. Say so and the sleeps can be stripped back to the
       bounded v0.1-style loop in a couple of minutes.

NEEDS LIVE TEST   REF ALL sequencing
       Whether DoButton() returns before the home completes is not documented.
       v0.2 assumes it can return early and waits on IsMoving(). If Mach3
       already blocks, the waits cost nothing. Watch one REF ALL through all
       five axes before trusting it, especially with no rotary home switch
       fitted: in that case the axis should finish or time out, not hang.

NEEDS LIVE TEST   MDI label on the RUN page
       The type 9 control under the toolpath is labelled MDI on the strength of
       stock 1024.set putting exactly one type 9 control on its MDI page in the
       input position. Click it and type G0 A45. If nothing happens, the label
       is wrong and should be removed; nothing else depends on it.

NEEDS LIVE TEST   Feed override OEM 108 and 109
       Carried over from v0.1 and unverified there as well. Watch the feed
       override DRO while pressing FRO - and FRO +.

NEEDS LIVE TEST   Probe cycle on real hardware
       Static reading only: probe clear, thickness greater than zero, G31 down,
       trip proven before Z is written, retract after. Test with the probe held
       in hand before touching a plate.

NEEDS LIVE TEST   Rotary direction and step size
       Press A STEP + with STEP DEG at 5 and confirm the tilt moves five
       degrees in the direction you call positive, then the same for B.

NOT IMPLEMENTED   MACHINE COORDINATES banner
       The brief asked for a banner that appears when the DROs show machine
       coordinates. An LED control can carry a bitmap (stock uses
       BoxLEDGreen.png), but the fields controlling when that bitmap is drawn
       differ between 1024.set and Plasma.set for the same asset, so the draw
       semantics are unverified. A banner that might be stuck on is worse than
       no banner, so the MACH COORD chip and its LED in the top strip carry
       that state instead.

NOT IMPLEMENTED   Selected jog step highlight
       A Mach3 bitmap button holds a single image and no pressed or active
       variant (verified: all 98 type 8 records in 1024.set leave the second
       bitmap field as "None"). The selected step is shown by the STEP DEG DRO,
       which the scripts read, so the indicator cannot disagree with behaviour.

NOT IMPLEMENTED   Hover and pressed button bitmaps
       Same reason: the record carries one bitmap field.

NOT IMPLEMENTED   OPEN MOTOR TUNING shortcut
       No verified OEM code opens that dialog. The SETTINGS page says so.

BY DESIGN, KNOW ABOUT IT   GO and STEP do not retract Z
       A GO preset or a STEP move tilts A or spins B from wherever the machine
       is standing. Nothing in the screen lifts Z first, and nothing checks
       what the tool is buried in. Tilting at cutting depth swings the part
       into a parked cutter. That belongs to the operator here, the same way it
       belongs to the post-processor in a program: retract Z before any GO or
       STEP. An automatic Z move was not added because a screen that moves an
       axis the operator did not ask for is the worse hazard.
