Drag
Member
How do I acquire a lib####.a style library from this? Is there already one precompiled in the posted archive? I have no idea how to compile the source code on my own.
60Hz is what the LCD wants (or should be thereabouts - it's seems to sit around 58 on mine) I'll check in a bit if the LCD can cope with 50Hz, I know it doesn't like it if you try freezing the display...KaosOverride posted on Feb 13 2006 at 11:30 PM said:I'm now working on CaPriCe for Gp2x and have some "trouble" trying to speed up the emulator... It uses 2 surfaces instead of doublebuffer, but the CPC's are clocked to 50hz so 50 frames is the max. I have recoded to use double buffer and the emu gets 30FPS because the VBL at 60hz...
A double-buffered screen is slightly different than having 2 surfaces. If you're using two surfaces to emulate it and are blitting them to a single-buffered screen then yes you will avoid the forced vsync but you will get some tearing, although with luck it won't be too noticable / more preferable than forcing 30 / 60 fps.Declaring both surfaces as HWSURFACE may work at similar speed to one double buffer but without the 60FPS lock? Then, maybe I don't need to recode the doublebuffer...
If you're not double-buffering then (at the moment) you don't need to use SDL_Flip(). Removing the vsync more or less negates any benefit of double-buffering, but yes, removing the vsync's will remove the fps lock.If I want to remove the 60FPS lock, is just remove the "do {} while VBL "'s from the source?
If just the use of two surfaces declared in hardware is enought...
Anyway, thank you very much for the hardware SDL!!!
In the flags for SDL_CreateRGBSurface(), e.g.Epicenter posted on Feb 14 2006 at 03:47 AM said:Dumb question, but proving difficult to find. How does one allocate a hardware surface rather than a software one? And is there really any decent way to tell when the 5MB of VRAM allocated is full besides looking for crashes?
surface = SDL_CreateRGBSurface(SDL_HWSURFACE, 32, 32, 16, 0, 0, 0, 0);
hw_surface = SDL_DisplayFormat(sw_surface);
Hmm.. Could be tricky. Something to look into sometime I suppose...BradN posted on Feb 14 2006 at 06:21 AM said:Just an idea on the FPS range - if you have a program that wants 50hz, it might be possible to run it at 100 and then use some system timer trickery (or whatever) to figure out which 'half' of the frame a current vblank is for.
paeryn posted on Feb 13 2006 at 11:28 PM said:Hmm.. Could be tricky. Something to look into sometime I suppose...
Unrelated, Spent ages trying to figure out why my SW->HW blitting code's not working - only to find SDL's not even calling my routines. Strange since if it isn't calling mine it should be calling its own
Yes, I did know. But some neogeo roms are so big that i have to use it for sound data. I'm sure that if the upper mem is correctly configured with cache enabled, performance will be improved.paeryn posted on Feb 13 2006 at 09:20 PM said:You are aware that the upper memory is slow to access aren't you? If you're using it to hold often-used data then you'll be taking quite a performance hit. I think squidge clocked it at 65% the speed of normal malloc'ed memory.
I was always wondering why I've always got a rock-solid 58fps in my apps that are locked to the vsync. I thought I'd done something dodgy in my fps code.paeryn posted on Feb 14 2006 at 12:37 PM said:60Hz is what the LCD wants (or should be thereabouts - it's seems to sit around 58 on mine) I'll check in a bit if the LCD can cope with 50Hz, I know it doesn't like it if you try freezing the display...
You mean adding content to the Paeryn's_SDL pagesynkro posted on Feb 14 2006 at 12:11 PM said:someone (I'd like to say me, but atm impossible) should write down everything related to this SDL version and put it in the wiki.... please.
Wow! Cheers... And I'll swap the X / Y buttons in the next release - forgot all about that (not my code)mongolito404 posted on Feb 14 2006 at 01:23 PM said:You mean adding content to the Paeryn's_SDL pagesynkro posted on Feb 14 2006 at 12:11 PM said:someone (I'd like to say me, but atm impossible) should write down everything related to this SDL version and put it in the wiki.... please.
paeryn posted on Feb 14 2006 at 03:36 PM said:Wow! Cheers... And I'll swap the X / Y buttons in the next release - forgot all about that (not my code)
paeryn posted on Feb 14 2006 at 02:37 AM said:Don't forget that directly writing to a HWSURFACE (not counting SDL's BlitSurface & FillRect) is slower than to a SWSURFACE.
CreateRGBSurface should honour the surface type (you need to explicitly ask for HW). SetVideoMode always creates a HWSURFACE.KaosOverride posted on Feb 14 2006 at 06:14 PM said:The Caprice CPC emu writes the whoole screen directly to the back_surface->pixels + CPCscreen_offset in groups of 4 pixels per access, and then blits to the screen_surface once the frame is complete. back_surface is a hardware surface created by SDL_CreateRGBSurface with SDL_HWSURFACE flag, and screen_surface with the SDL_Setvideomode (SDL_HWSURFACE flag, no double buffer)
So if writing to a hardware surface is slower than software surface... Do you mean it's better to declare the back_surface as SWSURFACE rather than HWSURFACE and then blit?
EDIT: looks like there is no difference between HWSURFACE and SWSURFACE for the back_surface... Maybe SDL_CreateRGBSurface gives me same type of surface??
Flavor posted on Feb 11 2006 at 05:26 PM said:I grabbed the binary version, and it here's how my game worked.
1) Selected the game from the menu.
2) Got black screen.
3) Goto 2.
int main(int argc, char* argv[])
{
SDL_Surface *screen;
SDL_Init(SDL_INIT_AUDIO|SDL_INIT_VIDEO|SDL_INIT_JOYSTICK);
screen = SDL_SetVideoMode(320,240,16,SDL_HWSURFACE|SDL_DOUBLEBUF);
..
if ( SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_AUDIO) < 0 ) {
ComplainAndExit(); // If it wont start, kill it
}
screen = SDL_SetVideoMode(320, 240, 0, SDL_HWSURFACE|SDL_DOUBLEBUF);
if ( screen == NULL ) {
ComplainAndExit(); // if it fails kill it
}