Function: this function compares a value A set in the command against a value B stored in DMEM. In case value A would be less than value B, the next command in the displaylist will be skipped. Value B is normally a 32 bits work but it is possible to truncated such a word to do a comparison between 8 bits or 16 bits value.
As G_COMPARE can be used for many purposes and new macros created by users, it is better to explain it its structure at microcode level. it is however important to apprehend what data are stored in DMEM.
Structure of the command:
HHSSDDDD
VVVVVVVV
HH: header of the command
SS: shift value to be applied to the word loaded from DMEM (0x00 would be for a word, 0x10 for for a 16 bits value, 0x18 for a 8 bits value)
DDDD: DMEM address where the word to be loaded (value B)
VVVVVVVV: value to be tested against (value A).
Related GBI commands:
gSPBranchLessZrg/gsSPBranchLessZrg/gSPBranchLessZ/gsSPBranchLessZ/gSPBranchLessZraw/gsSPBranchLessZraw (same than Fast3D, though done by emulation).
G_COMPARE
Header: 0x16
Function: this function compares a value A set in the command against a value B stored in DMEM. In case value A would be less than value B, the next command in the displaylist will be skipped. Value B is normally a 32 bits work but it is possible to truncated such a word to do a comparison between 8 bits or 16 bits value.
As G_COMPARE can be used for many purposes and new macros created by users, it is better to explain it its structure at microcode level. it is however important to apprehend what data are stored in DMEM.
Structure of the command:
HHSSDDDD VVVVVVVV
HH: header of the command
SS: shift value to be applied to the word loaded from DMEM (0x00 would be for a word, 0x10 for for a 16 bits value, 0x18 for a 8 bits value)
DDDD: DMEM address where the word to be loaded (value B)
VVVVVVVV: value to be tested against (value A).
Related GBI commands:
gSPBranchLessZrg/gsSPBranchLessZrg/gSPBranchLessZ/gsSPBranchLessZ/gSPBranchLessZraw/gsSPBranchLessZraw (same than Fast3D, though done by emulation).