| View previous topic :: View next topic |
| Author |
Message |
Shazz

Joined: 31 Aug 2004 Posts: 244 Location: Somewhere over the rainbow
|
Posted: Fri Nov 19, 2004 12:06 am Post subject: GIF DMA Packet, a black hole ? |
|
|
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... _________________ - TiTAN Art Division -
http://www.titandemo.org |
|
| Back to top |
|
 |
blackdroid
Joined: 17 Jan 2004 Posts: 564 Location: Sweden
|
Posted: Fri Nov 19, 2004 12:51 am Post subject: |
|
|
those bits are unused. _________________ Kung VU |
|
| Back to top |
|
 |
Shazz

Joined: 31 Aug 2004 Posts: 244 Location: Somewhere over the rainbow
|
Posted: Fri Nov 19, 2004 2:51 am Post subject: |
|
|
So can anybody explain me those few lines from GfxPipe ?
| Code: | 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 |
|
| Back to top |
|
 |
evilo

Joined: 22 Apr 2004 Posts: 230
|
Posted: Fri Nov 19, 2004 2:51 am Post subject: |
|
|
hmmm, I was actually convinced that it was using the SPR....
need to look back to source code... |
|
| Back to top |
|
 |
blackdroid
Joined: 17 Jan 2004 Posts: 564 Location: Sweden
|
Posted: Fri Nov 19, 2004 6:06 am Post subject: |
|
|
first dmatag, then giftag. _________________ Kung VU |
|
| Back to top |
|
 |
Shazz

Joined: 31 Aug 2004 Posts: 244 Location: Somewhere over the rainbow
|
Posted: Fri Nov 19, 2004 6:18 am Post subject: |
|
|
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 :
| Code: |
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);
} |
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 ??? _________________ - TiTAN Art Division -
http://www.titandemo.org |
|
| Back to top |
|
 |
|