Skip to main content

Module command

Module command 

Source
Expand description

RDP command-stream decoding.

The front of the DP FIFO: given a command’s first word, how many 64-bit words does the whole command occupy? Getting this right for every opcode 0x000x3F is what keeps DPC_CURRENT aligned, so a multi-word primitive (a triangle, a texture rectangle) is consumed whole and the stream never desyncs the pointer mid-command.

Reference: n64brew_wiki/markdown/Reality Display Processor/Commands.md (the full opcode map). This module decodes length only — dispatching each opcode to a rasterizer handler is later Phase 3 work.

Functions§

command_len_words
The length, in 64-bit (8-byte) words, of the RDP command with opcode opcode (as returned by opcode_of). Includes the header word itself.
opcode_of
The opcode field of an RDP command: bits 61:56 of the command’s first 64-bit word, i.e. bits 29:24 of that word’s high half. Six bits, 0x000x3F.