From 6f3ffefef60bae19408a01fbf8182afe137b4921 Mon Sep 17 00:00:00 2001 From: Lucas Fryzek Date: Thu, 8 Aug 2024 08:37:39 +0100 Subject: drv: Document PixelShader address encoding in PDS --- src/drv.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/drv.c') diff --git a/src/drv.c b/src/drv.c index e3252af..8a446ee 100644 --- a/src/drv.c +++ b/src/drv.c @@ -474,6 +474,15 @@ static void register_hw_render_ctx(struct driver_state *state) { void patch_memory(struct driver_state *state) { /* Patch PDS Pixel Code Data 0 buffer */ + /* I think Pixel Shader address is encoded like so + * ((num & 0xf0) << 4) | + * ((num & 0xf00) << 4) | + * ((num & 0x7000) << 4) | + * ((num & 0x78000) >> 11) | + * ((num & 0x80000) >> 19) + * This was determined by experimentation to see where each bit ends up + * in the PDS buffer after modifying the address returned by the driver + */ //pds_pcd[0] = ; uint32_t modified_pds_addr = -- cgit