GSP Shared Memory: Difference between revisions

Kynex7510 (talk | contribs)
m Fix misinformation
Kynex7510 (talk | contribs)
m lil redesign
Line 98: Line 98:
See [[Configuration Memory]].
See [[Configuration Memory]].


= Command Queue =
= GX Command Queue =


The command queue is located at sharedMemBase + 0x800 + (clientID * 0x200). It consists of an header followed by at most 15 command entries. Each command entry is of size 0x20 and has an header followed by command specific parameters.
This command queue is located at sharedMemBase + 0x800 + (clientID * 0x200). It consists of an header followed by at most 15 command entries.


After adding a command, [[GSPGPU:TriggerCmdReqQueue|TriggerCmdReqQueue]] must be used to start command processing (official code does so when the total commands field is 1).
The queue header has the following structure:
 
== Command Queue Header ==


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 126: Line 124:
| Result code for the last command which failed
| Result code for the last command which failed
|}
|}
After adding a command, [[GSPGPU:TriggerCmdReqQueue|TriggerCmdReqQueue]] must be used to start command processing (official code does so when the total commands field is 1).


GSP checks for status.bit0 and optionally avoids handling further commands, however the check is done by equality, which means it will always fail if status.bit7 is also set (and thus other commands will be processed). This bug prevents the halting logic from working propertly, but can be worked around by keeping bit0 of word3 set, as that will force halting on each iteration.
GSP checks for status.bit0 and optionally avoids handling further commands, however the check is done by equality, which means it will always fail if status.bit7 is also set (and thus other commands will be processed). This bug prevents the halting logic from working propertly, but can be worked around by keeping bit0 of word3 set, as that will force halting on each iteration.


== Command Header ==
== Commands ==
 
A command entry is made of 8 words. The first word is the command header, subsequent words represent command specific parameters.
 
The command header has the following structure:


{| class="wikitable" border="1"
{| class="wikitable" border="1"
Line 149: Line 153:
|}
|}


== Commands ==
Addresses specified in command parameters are virtual addresses. Depending on the command, there might be constraints on the accepted parameters. In general, some commands require parameters to be aligned, and addresses are expected to be on [[Memory_Management#Memory_Mapping|linear]], [[Memory_layout#0x1F000000_.28New_3DS_only.29|QTM]] or VRAM memory.
 
Addresses specified in parameters are virtual addresses. Depending on the command, there might be constraints on the accepted parameters. In general, some commands require parameters to be aligned, and addresses are expected to be on [[Memory_Management#Memory_Mapping|linear]], [[Memory_layout#0x1F000000_.28New_3DS_only.29|QTM]] or VRAM memory.


=== Trigger DMA Request ===
=== Trigger DMA Request ===