input, output and desc are as in the OSK sample only as class members. I've tried running the OSK sample on my PSP but it crashes every time on a 4.01M-33 Phat (compiled for 1.50 and OE)
Code: Select all
// Standard Library headers
#include <cstring>
#include <string>
using std::string;
// PSP SDK headers
#include <pspkernel.h>
#include <pspdisplay.h>
#include <pspgu.h>
#include <psptypes.h>
#include <psputility.h>
// SMF headers
#include "psputility/Keyboard.hh"
string Keyboard::show()
{
SceUtilityOskData osk_data[1];
SceUtilityOskParams osk_params;
unsigned short temp[32];
memset(osk_data, 0, sizeof(SceUtilityOskData));
osk_data->language = PSP_UTILITY_OSK_LANGUAGE_DEFAULT;
osk_data->lines = 1;
osk_data->unk_24 = 1;
osk_data->inputtype = PSP_UTILITY_OSK_INPUTTYPE_ALL; // Allow all input types
osk_data->desc = desc;
osk_data->intext = input;
osk_data->outtextlength = 32;
osk_data->outtextlimit = 32; // Limit input to 32 characters
osk_data->outtext = output;
memset(&osk_params, 0, sizeof(osk_params));
osk_params.base.size = sizeof(osk_params);
sceUtilityGetSystemParamInt(PSP_SYSTEMPARAM_ID_INT_LANGUAGE, &osk_params.base.language);
sceUtilityGetSystemParamInt(PSP_SYSTEMPARAM_ID_INT_UNKNOWN, &osk_params.base.buttonSwap);
osk_params.base.graphicsThread = 17;
osk_params.base.accessThread = 19;
osk_params.base.fontThread = 18;
osk_params.base.soundThread = 16;
osk_params.datacount = 1;
osk_params.data = osk_data;
sceUtilityOskInitStart(&osk_params);
bool done = false;
while(!done)
{
sceGuClearColor(0);
sceGuClearDepth(0);
sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT);
sceGuSync(0,0);
switch(sceUtilityOskGetStatus())
{
case PSP_UTILITY_DIALOG_INIT:
break;
case PSP_UTILITY_DIALOG_VISIBLE:
sceUtilityOskUpdate(1);
break;
case PSP_UTILITY_DIALOG_QUIT:
sceUtilityOskShutdownStart();
break;
case PSP_UTILITY_DIALOG_FINISHED:
break;
case PSP_UTILITY_DIALOG_NONE:
done = 1;
default :
break;
}
sceDisplayWaitVblankStart();
sceGuSwapBuffers();
}
return(uShortToString(osk_data->outtext));
}// show
Code: Select all
In file included from /home/anthony/Applications/pspdev/psp/sdk/include/psputility.h:32,
from include/psputility/Keyboard.hh:21,
from sabacc/src/game/GameBoot.cc:42:
/home/anthony/Applications/pspdev/psp/sdk/include/psputility_savedata.h:70: error: ‘SceSize’ does not name a type
/home/anthony/Applications/pspdev/psp/sdk/include/psputility_savedata.h:71: error: ‘SceSize’ does not name a type
/home/anthony/Applications/pspdev/psp/sdk/include/psputility_savedata.h:110: error: ‘SceSize’ does not name a type
/home/anthony/Applications/pspdev/psp/sdk/include/psputility_savedata.h:111: error: ‘SceSize’ does not name a type
TIA