Hello,
A simple question :
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 ;-))
So I wonder....
Thanx for helping my brain...
GIF DMA Packet, a black hole ?
GIF DMA Packet, a black hole ?
- TiTAN Art Division -
http://www.titandemo.org
http://www.titandemo.org
-
- Posts: 564
- Joined: Sat Jan 17, 2004 10:22 am
- Location: Sweden
- Contact:
So can anybody explain me those few lines from GfxPipe ?
Code: Select all
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;
}
- TiTAN Art Division -
http://www.titandemo.org
http://www.titandemo.org
-
- Posts: 564
- Joined: Sat Jan 17, 2004 10:22 am
- Location: Sweden
- Contact:
yep DMA tag then GIF tag, the thing is in the DMA tag, what this magic value stands for ? (SPR ?)
here is an example of a drawing call :
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.
So am I wrong ???
here is an example of a drawing call :
Code: Select all
void gp_line(gfxpipe *p, unsigned x1, unsigned y1, unsigned x2, unsigned y2, unsigned z, unsigned color)
{
unsigned long dt = *(p->curdmatadr);
*(p->curdmatadr) = (dt & 0xffffffffffff0000) | ((dt & 0xffff) + 3);
p->curgiftag[0] = 0x4400000000008001;
p->curgiftag[1] = 0xffffffffffff5d10;
p->curgiftag[2] = 0x0000000000000001;
p->curgiftag[3] = 0x3f80000000000000 | color;
p->curgiftag[4] = ((unsigned long)z << 32) | (y1 << 16) | x1;
p->curgiftag[5] = ((unsigned long)z << 32) | (y2 << 16) | x2;
p->curgiftag = &p->curgiftag[6]; // advance the packet pointer
gp_checkflush(p);
}
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.
So am I wrong ???
- TiTAN Art Division -
http://www.titandemo.org
http://www.titandemo.org