Okay... I think I understood something, gfxpipe create a DMA GIF pipe, let say a memory space of 262144 bytes (magic number ? max size of a packet ? I thought that the max size was 1 Mb... 1 Mb is maybe too much for one VBL...)
Code: Select all
createGfxPipe(&thegp, (void *)0xF00000, 0x40000);
Then each time a drawing primitive is called, the DMA tags/values are added to the pipe using a packet pointer then the pipe fill level is checked :
When the pipe is nearly full, the packet is sent to the DMA channel 2 (Dma02) :
And a new empty pipe is initialized...
So if I'm not wrong, th e stategy is to minimize DMA communication using as few as little DMA packets as possible but full of DMA GIF Tags...
Is it the clue so ???
I still don't know what are :
Code: Select all
unsigned long *dmatadrA; // 'pipe 1' ... base of allotted pipeline memory
unsigned long *dmatadrB; // 'pipe 2' ... dmatadrA + (memsize / 2)
And is this strategy not dangerous if the number of things to draw in 1 VBL is less than the pipe size ??? Maybe they call the gp_hardflush(p); by default at each VBL interrupt..have to check.... ;-)
Understanding good code is really nice... it helps a newbie like me :D