@echo off
setlocal

REM v113: READ CAPACITY data-in with one-shot 0x002C IRQ/status pulse,
REM then stop after the post-submit idle scheduler is observed several times.
REM This is a bounded diagnostic capture, not a new hardware side effect.
REM Run from scripts\toolchain\mn103s_emu_trace_v17 after extracting over repo root.

python run_direct_firmware.py ^
  --workspace D:\vscode-workspace\xbox-dvd-tools-v2 ^
  --bin D:\vscode-workspace\xbox-dvd-tools-v2\firmware\GDR-8050L\8050L_fw_plaintext_256k.bin ^
  --base 0x90000000 ^
  --entry 0x90000020 ^
  --model GDR-8050L ^
  --name "GDR-8050L v113 READ CAPACITY post-submit idle stop" ^
  --max-cycles 220000 ^
  --sp 0x003FF000 ^
  --preset gdr8050l-packet-full-cdb ^
  --clear-preset-stops ^
  --packet-cdb 0x25 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 ^
  --packet-data-in 0x00 0x34 0x5B 0x5F 0x00 0x00 0x08 0x00 ^
  --read8-advance "0x0000002C@0x90006608=0x01,0x01" "0x0000002D@0x90006608=0x04,0x00" ^
  --mem8 0x0003E7BA=0x01 ^
  --mem8 0x0003E7BB=0x01 ^
  --mem8 0x0003E7BC=0x00 ^
  --mem8 0x0003E7BD=0x06 ^
  --mem8 0x0003E7BE=0x06 ^
  --mem8 0x0003E7BF=0x00 ^
  --breakpoint 0x90006608 ^
  --breakpoint 0x90006618 ^
  --breakpoint 0x90006632 ^
  --breakpoint 0x9001B2A0 ^
  --breakpoint 0x9001B33D ^
  --breakpoint 0x9001EC28 ^
  --watchpoint 0x0000002C:2@access ^
  --watchpoint 0x00000144:1@access ^
  --watchpoint 0x0000014A:1@access ^
  --watchpoint 0x000005B1:1@access ^
  --watchpoint 0x000005B6:1@access ^
  --watchpoint 0x000005B7:1@access ^
  --watchpoint 0x000005C0:1@access ^
  --watchpoint 0x000006F1:1@access ^
  --watchpoint 0x0000D905:1@access ^
  --watchpoint 0x0000D955:1@access ^
  --watchpoint 0x0000D95C:1@access ^
  --watchpoint 0x0000DF2A:1@write ^
  --watchpoint 0x0000DF70:8@write ^
  --stop-pc 0x9001EC28 ^
  --stop-pc-hit-count 4 ^
  --stop-pc-min-cycle 54500 ^
  --trace-csv gdr8050l_readcap_route_probe_v113_post_submit_idle_stop_trace.csv ^
  --trace-summary ^
  --config-out gdr8050l_readcap_route_probe_v113_post_submit_idle_stop_config.json ^
  > gdr8050l_readcap_route_probe_v113_post_submit_idle_stop.output.txt 2>&1

python analyze_gdr8050l_v109_readcap_route.py ^
  gdr8050l_readcap_route_probe_v113_post_submit_idle_stop_trace.csv ^
  --out gdr8050l_readcap_route_probe_v113_post_submit_idle_stop_summary.md

endlocal
