Post: PSL1GHT - Cairo sample framerate small fix
08-05-2011, 04:24 PM #1
El Nomeo
I am error
(adsbygoogle = window.adsbygoogle || []).push({}); Anybody who is dabbling with Cairo in the psl1ght V2 would have noticed that it has a poor framerate which is caused by the framebuffer not being hardware accelerated. I'm working on putting this into a SPU thread.

For the time being if you just want to dabble but are frustrated when you go to quit and it is really slow try the below code:

Add this section any where in your main.c, preferably at the top.
Add in #include <sysutil/sysutil.h> too.

    
// Globals are Bad
int xmb_status = 0;

void
sysutil_callback(u64 status, u64 param, void *userdata)
{
(void)param;
(void)userdata;
if(status == SYSUTIL_EXIT_GAME)
{
exit(0);// exit app
}
else if(status == SYSUTIL_MENU_OPEN)
{
xmb_status = 1; // XMB open
}
else if(status == SYSUTIL_MENU_CLOSE)
{
xmb_status = 0; // XMB close
}
}

void
appCleanup()
{
sysUtilUnregisterCallback(SYSUTIL_EVENT_SLOT0);
}


And add this section of code in your main.c, main function:

    
atexit(appCleanup);
sysUtilRegisterCallback(SYSUTIL_EVENT_SLOT0, sysutil_callback, NULL);


Then, add this into the while loop within the main function:
    
setRenderTarget(context, &buffers[currentBuffer]);

if(xmb_status == 0)
{
drawFrame (&buffers[currentBuffer], frame++, selectedAppstate); // Draw into the unused buffer
}
waitFlip ();
flip (context, buffers[currentBuffer].id); // Flip buffer onto screen

currentBuffer++;

if (currentBuffer >= MAX_BUFFERS)
{
currentBuffer = 0;
}

sysUtilCheckCallback();



I've added the whole chunk there just to make it easier for people to understand/copy over. the only difference is the if statement around the draw function and the sysUtilCheckCallback() function call.

All its doing is stopping the draw function from being called when the XMB is open, the framerate issue STILL exists when the game/program is running, this just allows exiting less of a pain.

Im not claiming to fix this issue just merely trying to make someones developing a little easier.
(adsbygoogle = window.adsbygoogle || []).push({});

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo