What stuff should be stored between bits 16 and 45 (between End Of Primitive EOP and PRE (?)) ???
I saw that GfxPipe sets the value (unit64) 0x0000000070000000 (funny magic number no ? looks like SPR...) at the beginning of the GIF TAG buffer, so if I'm not wrong, bits 28-29-30 are set (or I'll kill those silly indians ;-))
struct gfxpipe {
unsigned long *dmatadrA; // 'pipe 1' ... base of allocatted pipeline memory
unsigned long *dmatadrB; // 'pipe 2' ... dmatadrA + (memsize / 2)
unsigned int memsize; // # of bytes allocatted to the pipelines (total)
unsigned long *curpipe; // pointer to current 'pipe' .. may only be equal to
// either dmatadrA or dmatadrB
unsigned long *curdmatadr; // pointer to the the dma block currently being added to
unsigned long *curgiftag; // pointer to current "block" we can add prims to
// need to add state information of zbuffer, alpha test, etc. in here
int flags; // not implemented yet
};
[...]
int createGfxPipe(gfxpipe *pipeline, void *buffer, int size)
{
if ((int)buffer & 0xf)
return 0;
if (size < 0x1000)
return 0;
pipeline->dmatadrA = (unsigned long *)buffer;
pipeline->dmatadrB = pipeline->dmatadrA + (size >> 4);
pipeline->memsize = size;
initializeGfxPipe(pipeline->dmatadrA);
pipeline->curpipe = pipeline->curdmatadr = pipeline->dmatadrA;
pipeline->curgiftag = pipeline->dmatadrA + 2;
return 1;
}
void initializeGfxPipe(unsigned long *dmatadr)
{
//***** THOSE LINES *****
dmatadr[0] = 0x0000000070000000;
dmatadr[1] = 0;
//***** END *****
//dmatadr[2] = 0x1000000000008000;
//dmatadr[3] = 0x000000000000000e;
}
As you can see points by init on dmatadrA, so the first statement is used to set the NLOOP register in the DMA tag buffer (right ?), then the GIF tag is set up in this case to draw a line...
Note than the GIF tag buffer starts at dmatadrA + 2 (so that's ok, 128 bytes after) so DMA tag and GIF tag are set in the same buffer sequentially.