i want to write a psp plugin to check your battery percentage and equivalent time while playing a game.
i'm very new to writing programs to a psp.. but i have lots of experience in programming...
my question is how do i get the psp's battery percentage and it's equivalent time?
i got this so far:
#include <pspkernel.h>
#include <psppower.h>
#include <pspdebug.h>
PSP_MODULE_INFO("Hello World", 0, 1, 1);
#define printf pspDebugScreenPrintf
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common) {
sceKernelExitGame();
return 0;
}
/* Callback thread */
int CallbackThread(SceSize args, void *argp) {
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void) {
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid >= 0) {
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
int main() {
pspDebugScreenInit();
SetupCallbacks();
printf("Battery Remaining: %i (%i)\n", scePowerGetBatteryLifePercent(), scePowerGetBatteryLifeTime());
printf("Battery Temperature: %i\n", scePowerGetBatteryTemp());
printf("Battery Voltage: %i", scePowerGetBatteryVolt());
sceKernelSleepThread();
return 0;
}
it won't compile.. i have installed psptoochain and got other projects to run.. but this one says "undefined referece to scePowerGetBatteryLifePercent"