Skip to content

Commit 6761cd2

Browse files
committed
m1n1.fw.agx: Blit stuff for G14X
Just hacking on the structures to get it to dump, this probably broke other firmware combinations... Signed-off-by: Asahi Lina <[email protected]>
1 parent 788a5b9 commit 6761cd2

2 files changed

Lines changed: 67 additions & 33 deletions

File tree

proxyclient/m1n1/fw/agx/cmdqueue.py

Lines changed: 7 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -374,36 +374,13 @@ class WorkCommandBlit(ConstructClass):
374374
"event_control" / ROPointer(this.event_control_addr, EventControl),
375375
"unk_10" / Hex(Int32ul),
376376
"unk_14" / Int32ul,
377-
"unk_18" / Int64ul,
378-
"unk_20" / Int64ul,
379-
"unk_28" / Int64ul,
380-
"unk_30" / Int64ul,
381-
"unk_38" / Int64ul,
382-
"unk_40" / Int64ul,
383-
"unk_48" / HexDump(Bytes(0xa0)),
384-
"unkptr_e8" / Int64ul,
385-
"unk_f0" / Int64ul,
386-
"unkptr_f8" / Int64ul,
387-
"pipeline_base" / Int64ul,
388-
"unk_108" / Int64ul,
389-
"unk_110" / HexDump(Bytes(0x248)),
390-
"unk_358" / Int32ul,
391-
"unk_35c" / Int32ul,
392-
"unk_360" / Int32ul,
393-
"unk_364" / Int32ul,
394-
"unk_368" / Float32l,
395-
"unk_36c" / Float32l,
396-
"unk_370" / Int64ul,
397-
"unk_378" / Int64ul,
398-
"unk_380" / Int64ul,
399-
"unk_388" / Int64ul,
400-
"unk_390" / HexDump(Bytes(0xd8)),
401-
"unk_468" / Int64ul,
402-
"unk_470" / Int64ul,
403-
"unk_478" / Int32ul,
404-
"unk_47c" / Int32ul,
405-
"unk_480" / Int64ul,
406-
"unk_488" / Int64ul,
377+
Ver("G < G14X", "blit_info" / BlitInfo),
378+
Ver("G >= G14X", "registers" / Array(128, RegisterDefinition)),
379+
Ver("G >= G14X", "unk_g14x" / Default(Array(64, Int32ul), [0]*64)),
380+
"registers_addr" / Int64ul,
381+
"register_count" / Int16ul,
382+
"registers_length" / Int16ul,
383+
"blit_info2" / BlitInfo2,
407384
"microsequence_ptr" / Hex(Int64ul),
408385
"microsequence_size" / Hex(Int32ul),
409386
"microsequence" / ROPointer(this.microsequence_ptr, MicroSequence),

proxyclient/m1n1/fw/agx/microsequence.py

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -775,12 +775,52 @@ class FinalizeComputeCmd(ConstructClass):
775775
Ver("V >= V13_0B4", "pad_79" / ZPadding(7)),
776776
)
777777

778+
class BlitInfo(ConstructClass):
779+
subcon = Struct(
780+
"unk_18" / Int64ul,
781+
"unk_20" / Int64ul,
782+
"unk_28" / Int64ul,
783+
"unk_30" / Int64ul,
784+
"unk_38" / Int64ul,
785+
"unk_40" / Int64ul,
786+
"unk_48" / HexDump(Bytes(0xa0)),
787+
"unkptr_e8" / Int64ul,
788+
"unk_f0" / Int64ul,
789+
"unkptr_f8" / Int64ul,
790+
"pipeline_base" / Int64ul,
791+
"unk_108" / Int64ul,
792+
"unk_110" / HexDump(Bytes(0x248)),
793+
"unk_358" / Int32ul,
794+
"unk_35c" / Int32ul,
795+
"unk_360" / Int32ul,
796+
"unk_364" / Int32ul,
797+
"unk_368" / Float32l,
798+
"unk_36c" / Float32l,
799+
"unk_370" / Int64ul,
800+
"unk_378" / Int64ul,
801+
"unk_380" / Int64ul,
802+
"unk_388" / Int64ul,
803+
"unk_390" / HexDump(Bytes(0xa8)),
804+
)
805+
806+
class BlitInfo2(ConstructClass):
807+
subcon = Struct(
808+
"unk_0" / HexDump(Bytes(0x24)),
809+
"unk_24" / Int64ul,
810+
"unk_470" / Int64ul,
811+
"unk_478" / Int32ul,
812+
"unk_47c" / Int32ul,
813+
"unk_480" / Int64ul,
814+
"unk_488" / Int64ul,
815+
)
816+
778817
class StartBlitCmd(ConstructClass):
779818
subcon = Struct(
780819
"magic" / Const(0x26, Int32ul),
781820
"unkptr_4" / Int64ul,
782821
"unkptr_c" / Int64ul,
783-
"unk_14" / Int64ul,
822+
"registers_addr" / Int64ul,
823+
Ver("G >= G14X", "unk_1c_0" / Int32ul),
784824
"unkptr_1c" / Int64ul,
785825
"unkptr_24" / Int64ul,
786826
"context_id" / Int32ul,
@@ -792,10 +832,12 @@ class StartBlitCmd(ConstructClass):
792832
"unkptr_44" / Int64ul,
793833
"unkptr_4c" / Int64ul,
794834
"uuid" / Int32ul,
795-
"unk_2c" / Int32ul,
835+
Ver("G < G14X", "unk_2c" / Int32ul),
796836
"attachments" / Array(16, Attachment),
797837
"num_attachments" / Int32ul,
798838
"unk_160" / Int32ul,
839+
Ver("V >= V13_0B4", "counter" / Int64ul),
840+
Ver("V >= V13_0B4", "unkptr_19c" / Int64ul),
799841
)
800842

801843
class FinalizeBlitCmd(ConstructClass):
@@ -807,13 +849,28 @@ class FinalizeBlitCmd(ConstructClass):
807849
"unk_18" / Int32ul,
808850
"unkptr_1c" / Int64ul,
809851
"uuid" / Int32ul,
810-
"unk_28" / Int32ul,
852+
Ver("V < V13_3", "unk_28" / Int32ul),
811853
"stamp_addr" / Int64ul,
812854
"stamp" / ROPointer(this.stamp_addr, StampCounter),
813855
"stamp_value" / Int32ul,
814856
"unk_38" / HexDump(Bytes(0x24)),
815857
"restart_branch_offset" / Int32sl, # relative
816858
"unk_60" / Int32ul,
859+
Ver("V >= V13_0B4", "unk_5d8_0" / Int32ul),
860+
Ver("V >= V13_0B4", "unk_5d8_4" / Int8ul),
861+
Ver("V >= V13_0B4", "evctl_buf_addr" / Int64ul),
862+
Ver("V >= V13_0B4", "unk_5d8_4" / Array(3, Int8ul)),
863+
Ver("V >= V13_0B4", "unk_0" / Int32ul),
864+
Ver("V >= V13_0B4", "unkptr_1" / Int64ul),
865+
Ver("V >= V13_0B4", "unkptr_2" / Int64ul),
866+
Ver("V >= V13_0B4", "unkptr_3" / Int64ul),
867+
Ver("V >= V13_0B4", "unkptr_4" / Int64ul),
868+
Ver("V >= V13_0B4", "unkptr_5" / Int64ul),
869+
Ver("V >= V13_0B4", "unk_9c" / Int64ul),
870+
Ver("V >= V13_0B4", "unkptr_6" / Int64ul),
871+
Ver("V >= V13_0B4", "unk_ac" / HexDump(Bytes(0x30))),
872+
Ver("V >= V13_0B4", "unk_dc" / Int32ul),
873+
Ver("V >= V13_0B4", "unk_e0" / HexDump(Bytes(0x14))),
817874
)
818875

819876
class EndCmd(ConstructClass):

0 commit comments

Comments
 (0)