Minilib + Hw Blitter


redguy2x

Still Fresh
Joined
Jan 4, 2007
Messages
3
Hello everybody,

Is there a way to get the hardware blitter working together with minilib,
I've tried it a few times before, but everytime the GP2X hangs,
Can someone please help me?

Friendly regards, Redguy2x
 
Hello everybody,

Is there a way to get the hardware blitter working together with minilib,
I've tried it a few times before, but everytime the GP2X hangs,
Can someone please help me?

Friendly regards, Redguy2x
It sounds like you haven't enabled either FastIO which is needed to read/write the blitter registers and/or GrpClk which is needed for the blitter to do its job. You need to do both before attempting to read/write the blitter registers, the default state (from the GP2X menu) is for them both to be off.

hwreg[0x0904>>1] |= 1<<10; // hwreg[SYSCLKENREG] |= FASTIOCLK;
hwreg[0x090A>>1] |= 1<<2; // hwreg[VCLKENREG] |= GRPCLK;

Hope that helps, Paeryn.
 
Last edited by a moderator:
That code ENABLES HW BLITTING with MINILIB?!?!?!

... I thought HW Accelerated SDL was the only thing that could so far...

But oh well, i can definitely live with this. Now i don't have to make another implementation on the GP2X.

Quick question, HW SDL will do the above 2 lines on init right?
 
Those two lines, plus many more. The minilib currently available does not have native support for the blitter, so you have to set all the registers for the blitter yourself. I've got HW blitting in my engine, which was loosely based on minilib, and I don't use SDL.

Native HW support is being implemented in the next version of the minilib.
 
Thanks paeryn,
I'll try it out,

However, in your Hw-SDL addresses to video surfaces are passed trough a special function, GP2X_Phys()
Is there a way to write such a function for minilib?

(Sorry for the bad english)

Friendly regards, Redguy2x
 
If your talking about Rlyeh's minilib, just wait for version 0.C which has built in support for the blitter :) Should be released in a week or so.
 
However, in your Hw-SDL addresses to video surfaces are passed trough a special function, GP2X_Phys()
Is there a way to write such a function for minilib?
The GP2X_Phys() function just converts the virtual address of surfaces (which Linux sees and we can use in our programs) into actual physical addresses (which the hardware uses) because the hardware doesn't have access to the MMU. It simply takes a virtual address (in the surface memory area) subtracts the base virtual address of the surface memory to get an offset and then adds it to the physical memory address of the surface area.
The minilib will either have these support functions, or automatically handle the translations for you.
 
Last edited by a moderator:
Back
Top