Skip to main content

command_len_words

Function command_len_words 

Source
pub const fn command_len_words(opcode: u8) -> u32
Expand description

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.

Every command is a single word except:

  • Fill Triangle (0x080x0F): a 4-word base plus optional coefficient blocks. The opcode’s low three bits are the enable flags — bit 2 shade, bit 1 texture, bit 0 z-buffer (the very bits 58/57/56 the wiki also lists by name in word 0) — appending 8, 8, and 2 words respectively, in that order. So 0x08 (plain) is 4 words and 0x0F (shade+texture+z) is 22.
  • Texture Rectangle / Texture Rectangle Flip (0x24/0x25): 2 words.

Every other opcode — including the no-operation ranges (0x000x07, 0x100x23, 0x31) and any not-yet-handled command — is a single word, so an unrecognized command consumes exactly its header and the FIFO keeps its alignment.