From 52492350eef2c79db0416f00338f5a7e94754bb1 Mon Sep 17 00:00:00 2001 From: Asahi Lina Date: Wed, 17 Aug 2022 13:58:37 +0900 Subject: [PATCH] m1n1.fw.agx.cmdqueue: Add support for setting queue priority Signed-off-by: Asahi Lina --- proxyclient/m1n1/fw/agx/cmdqueue.py | 37 ++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/proxyclient/m1n1/fw/agx/cmdqueue.py b/proxyclient/m1n1/fw/agx/cmdqueue.py index 8f634459..96d384e4 100644 --- a/proxyclient/m1n1/fw/agx/cmdqueue.py +++ b/proxyclient/m1n1/fw/agx/cmdqueue.py @@ -439,18 +439,43 @@ class CommandQueueInfo(ConstructClass): self.gpu_rptr2 = 0 self.gpu_rptr3 = 0 self.unk_2c = -1 - self.unk_30 = 0x0 - self.unk_34 = 0x0 - self.unk_38 = 0xffffffffffff0000 - self.unk_40 = 0x1 - self.unk_44 = 0x0 - self.unk_48 = 0x1 self.unk_4c = -1 self.uuid = 0xdeadbeef # some kind of ID self.unk_54 = -1 self.unk_58 = 0x0 self.busy = 0x0 self.blocked_on_barrier = 0x0 + self.set_prio(0) + + def set_prio(self, p): + if p == 0: + self.unk_30 = 0 + self.unk_34 = 0 # 0-3? + self.unk_38 = 0xffff_ffff_ffff_0000 + self.unk_40 = 1 + self.unk_44 = 0 + self.unk_48 = 1 + elif p == 1: + self.unk_30 = 1 + self.unk_34 = 1 + self.unk_38 = 0xffff_ffff_0000_0000 + self.unk_40 = 0 + self.unk_44 = 0 + self.unk_48 = 0 + elif p == 2: + self.unk_30 = 2 + self.unk_34 = 2 + self.unk_38 = 0xffff_0000_0000_0000 + self.unk_40 = 0 + self.unk_44 = 0 + self.unk_48 = 2 + else: + self.unk_30 = 3 + self.unk_34 = 3 + self.unk_38 = 0x0000_0000_0000_0000 + self.unk_40 = 0 + self.unk_44 = 0 + self.unk_48 = 3 __all__.extend(k for k, v in globals().items() if (callable(v) or isinstance(v, type)) and v.__module__ == __name__)