Hello everyone.
I'm developing a shell for the PSP that looks like the iPhone OS, and ironically, the shell is called iPhone OS. I first used blitAlphaImageToScreen to blit the empty springboard to the screen, then I use it again in my sceDisplayWaitVblankStart replacement, iPhoneOS_IdleWorker. iPhoneOS_IdleWorker() is supposed to update a battery image in the top left corner of the screen depending on the battery status, and it's not even blitting the image. Here's the contents of the iPhoneOS_IdleWorker function:
The bold line (or somewhere around there) is supposed to render the image on the screen, however it's not.
I also used the psp-programming.com graphics.h/graphics.c.
Includes:
(note: had to remove the greater-than-less-than signs otherwise they won't display)
Anyone have any ideas at all?
Okay, I got it to work. Now the springboard keeps flickering because the battery meter is updating too much... is there a way to fix this?
I'm developing a shell for the PSP that looks like the iPhone OS, and ironically, the shell is called iPhone OS. I first used blitAlphaImageToScreen to blit the empty springboard to the screen, then I use it again in my sceDisplayWaitVblankStart replacement, iPhoneOS_IdleWorker. iPhoneOS_IdleWorker() is supposed to update a battery image in the top left corner of the screen depending on the battery status, and it's not even blitting the image. Here's the contents of the iPhoneOS_IdleWorker function:
Code:
void iPhoneOS_IdleWorker()
{
// my custom idle func that i use instead of sceDisplayWaitVblankStart
char buffer[200];
if(scePowerIsBatteryExist() == 1)
{
int battery = scePowerGetBatteryLifePercent();
// what img to use for battery meter?
if(battery >= 80)
{
// almost full
sprintf(buffer, "img/battery/battery_full.png");
}
else if(battery >= 30 && battery <= 79)
{
sprintf(buffer, "img/battery/battery_half.png");
}
else if(battery <= 29)
{
sprintf(buffer, "img/battery/battery_low.png");
}
else
{
sprintf(buffer, "img/battery/battery_none.png");
}
}
else
{
sprintf(buffer, "img/battery/battery_none.png");
}
Image* batteryImage;
batteryImage = loadImage(buffer);
if(!batteryImage) { printf("Failed to load battery image."); }
else {
[B]blitAlphaImageToScreen(0,0,18,22,batteryImage,0,0);[/B]
flipScreen();
freeImage(batteryImage);
}
sceDisplayWaitVblankStart();
}
I also used the psp-programming.com graphics.h/graphics.c.
Includes:
(note: had to remove the greater-than-less-than signs otherwise they won't display)
Code:
#include psppower.h
#include pspdisplay.h
#include pspctrl.h
#include pspkernel.h
#include pspdebug.h
#include pspgu.h
#include png.h
#include stdio.h
#include "graphics.h"
Anyone have any ideas at all?
Okay, I got it to work. Now the springboard keeps flickering because the battery meter is updating too much... is there a way to fix this?