Crash In Hw Blitting


Alain21

Still Fresh
Joined
Apr 14, 2007
Messages
15
I am trying to code an HW blitting .. and first thing i figure is that it hang on the very first line ...

CODE

while(gRegGP2X2DEng->blitter.BltRunBusy);



That is when I try to wait to see if its already in use. It also hang the telnet session!! i have to unplug and reboot the gp2x and replug.

Is there any thing i need to do before using the HW blitter ? I already Activate the GraphicProcessor & FastIO registry bits. (0x0C00 0904) & (0x0C00 090A)

Alain
 
A crash on that line usually indicates that you've not enabled the 2d accelerator clock properly. Double check your code.
 
Squidge said:
A crash on that line usually indicates that you've not enabled the 2d accelerator clock properly. Double check your code.
Hmm it works now ... and i don't really understand what i'd change. weird...

anyway .. the only trouble now is that All I can see is a white block instead of the sprite, a couple of pixel lower. and starting at X going to the left .. but the X_POS bit is set .. i think ehhe.

keep working on it
 
Last edited by a moderator:
Well i think I find the reason of my white block ... what is exaclty the bit IN_VIDEO ?? If my memory mng Use the upper 32 Meg ... is this consider In_Video ?? ... my assumption is no. So I need to use the FIFO to transfer.

now setting that IN_VIDEO bit off, no setting srcAdress and srcPitch. just pump the FIFO ...

However it doesnt not work ... it crash on the first write..
 
The upper 32MB is considered video memory, but remember that you must give it the physical memory address, not the mapped memory address. If you use mmap() to get access to the upper 32MB, subtract the value returned by mmap() from your sprite's memory address. Give this value to the blitter.

The FIFO is used if you only have mapped memory, for example, your sprite exists in the lower 32MB, or you want to generate the image on the fly.
 
I think that most of my trouble comes from the fact that I wanted to use a bitfield struct instead of array and bit manipulation.

I think that when I have that kind of struct

CODE

typedef struct tagTRegGp2xBlitter
{
vu32 /*DSTCTRL*/BltDstFractionBitUnit : 5;
vu32 /*DSTCTRL*/BltDstBitPerPixel : 1;
vu32 /*DSTCTRL*/BltDstEnable : 1;
vu32 /*DSTCTRL*/Reserved00 : 25;
....



and if I access every variable separatly .. the compiler internally read the value bitmask it automaticly. The problem is that we don't have a READ acces to most of these variables. So it just doesn't work.

I gonna convert everything back.
 
Me again ... still have problem... however when i try to copy others code it works ... and the only difference i have in mine is that I am using differents zone of upper memory .. 0x20000000 is this consider IN_VIDEO ... somebody told me yes .. but i start to doubt it .. everything work when i am using 0x3105 0000 to 0x3101 0000.

and yes I do convert virtual to physical adresses
 
Alain21 said:
Me again ... still have problem... however when i try to copy others code it works ... and the only difference i have in mine is that I am using differents zone of upper memory .. 0x20000000 is this consider IN_VIDEO ... somebody told me yes .. but i start to doubt it .. everything work when i am using 0x3105 0000 to 0x3101 0000.

and yes I do convert virtual to physical adresses

AH ha ... found it ... Actually I have two mmap in my code ... one that map All the Upper memo and skip the reserved zones

And One that mmap the FrameBuffer ..

I was thinking (read : assuming) the the offset from one zone would be the same using to distinct mmap.
 
Last edited by a moderator:
Back
Top