sceAgcDcbResetQueue writes a different packet sequence on hardware than on main #1581
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-08T13:29:03Z.
sceAgcDcbResetQueueonmainwrites a single CLEAR_STATE packet (c0001200 <state>) and ignoresop. That comes from KytyPS5. I measured the real function on a PS5 (firmware 13.60) by loadinglibSceAgc.sprxwithdlopenfrom a homebrew payload and calling it on a command buffer I own. It writes something very different, and none of the three references gets it right:sceAgcDcbResetQueue(buf, op, state)c0001200 state(CLEAR_STATE),opignored0x79"ACB reset", single argumentop == 0x3FF && state == 0opbit (below)Title: New Joe & Mac: Caveman Ninja (PPSA02801) imports it. It is in OpenAGC's
game_compat.c, the list of AGC functions taken from that game'seboot.bin, which is the evidence accepted on #975/#977.What the console writes
The output is always wrapped in the same envelope:
The return value is the start of the envelope. With
op = 0it is 8 dwords.opbitc0039f00 00000000 00000000 80000000 00000000c0036300 00000000 00000000 80000000 00000000c0036400 00000000 00000000 80000000 00000000c0002f00 00000001c0017a00 20000243 00000480c0012600 00000000 00000000c0001300 ffffffffc0021102 00000001 00000000 00000000c0021100 00000001 00000000 00000000c0065800 86007fc0 fffffffe 000000ff 00000001 00000000 00000019 0000c3e1c0004600 0000002ec0004600 0000002cc0004600 00000407c0004600 00000410c0024600 00000138 07fffc00 00000000c0032200 00000000 00000000 00000000 0000000bc0001200 00000002c0071e00 40000267 00000000 00000000 00000000 00000001 00000000 00000000 00000006c0036400 00000000 00000000 80000000 00000000(the same as 0x004)stateis a value, not a mask. Of the values 0, 1, 2, 3, 4, 8 and 0xF, only two change the output.state = 2sets the envelope's flag dword to8.state = 3sets the second payload dword of the0x64group (bits 0x004 and 0x800) to00840f80.op = 0x3FF, which sharpemu suggests is what titles pass, is 61 dwords.sceAgcDcbClearStatematchedmainexactly (c0001200 command) in the same run.What
main's driver does with itI ran each measured packet through
AgcDriver::Pm4::Validate. 17 kinds pass and 4 are rejected:Pm4::Validateffff1000c0065800 86007fc0 fffffffe 000000ff …(ACQUIRE_MEM over the whole address space)c0024600 00000138 …(EVENT_WRITE event 56)c0071e00 …(opcode 0x1E)So writing the console's packets from the builder alone would make titles stop in the driver:
op = 0x3FFcontains 0x040 and 0x200. The order would have to be the driver first, then the builder.Proposed plan
statevariants. Keep throwing for 0x400 (opcode 0x1E is unknown to the driver), 0x8000, and thestatevalues not measured.I'll do these as separate PRs, unless you'd rather keep the current CLEAR_STATE approximation or take a different approach. Do you know whether Dreaming Sarah, or another title you test, goes through
sceAgcDcbResetQueue, and with whichop?Probe (ps5-payload-sdk v0.43,
prospero-clang -O1 -rdynamic)The table above combines three runs: the first stopped at bit 15, and the next ones skip it.
Raw output (
R|name|op|state|ret|cursor_up|cursor_down|callbacks|words)Imported from boykopovar/AnyPS5. Originally posted by aashishaxo on 2026-10-08T15:32:30Z.
Hi @hugodearaujo, thanks for the measurements. If you haven't started on step 1 yet, I'd like to take it (the driver accepting the one-dword NOP ffff1000). I have it ready locally: Pm4::FillerPacket also matches exactly 0xffff1000, so every walker steps over it as one dword, the same way
d4f7ddaahandled it for sceAgcSetRangePredication. Tests cover Validate, a submission with your measured op = 0 output, and a COND_EXEC range containing the pad. I'll leave steps 2 and 3 to you unless you want me to take one. Happy to drop it if you already have it.Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-08T20:19:42Z.
@aashishaxo Go ahead with step 1, I haven't started it. Thanks!
Status of the plan:
ffff1000): @aashishaxo.Imported from boykopovar/AnyPS5. Originally posted by aashishaxo on 2026-10-08T22:26:44Z.
Step 1 is up as #1862: the driver now steps over ffff1000 as one dword. CI passed on my fork; upstream checks are waiting for approval.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T08:15:24Z.
I tried step 2 in #2048, then closed it after reviewing the full diff. The whole-range
ACQUIRE_MEMvalidation was already covered by #1917. I also rechecked the measured EVENT_WRITE word0x138: PAL classifies event type0x38asPIXEL_PIPE_STAT_CONTROLand0x39asPIXEL_PIPE_STAT_DUMP(source). My first draft incorrectly called0x38a cache-flush timestamp and only validated its packet shape; that would accept an effect the driver does not model.So
0x200should remain unsupported in #1629 until the pixel-pipe statistics effect is understood and implemented. The0x040range portion is covered by #1917 once that PR lands; event type 56 is still open work.Imported from boykopovar/AnyPS5. Originally posted by EdouardSence on 2026-10-10T08:12:36Z.
A retail title that needs the bits that are still unsupported: Astro Bot (PPSA21567) calls
sceAgcDcbResetQueuewithop = 0xfff,state = 0.Linux, GCC, Release, RX 9070 XT, RADV / Mesa 26.2.4. The run is on
maina29bae31+ #2347, which is needed to get past the heap stop in #1789.sceAgcDcbResetQueue: unsupported op bit 0x40.mainnow) and the measured 0x040 group from the table above added toresetQueueGroupandorder: the driver accepts the group. It is the whole-rangeACQUIRE_MEMplusEVENT_WRITE0x2e and 0x2c with index 0, and those two events were already accepted. The title then stops on the next bit,unsupported op bit 0x200 (op 0xfff state 0). That is theEVENT_WRITE 0x38(PIXEL_PIPE_STAT_CONTROL) group that @MarcZX100 says should stay unsupported until its effect is modelled. After it comes 0x400.So since #1917, the 0x040 part is only the builder change. 0x200 and 0x400 still need someone who knows what the pixel-pipe statistics control and the 0x400 group do. I can't open a PR for the 0x040 change at the moment (
pr-intake). Whoever carries it is welcome to use this run as the title evidence.Tested and written by Claude (AI assistant) on a contributor's machine.