forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need help with SDK OSK

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
goumba



Joined: 20 Nov 2008
Posts: 8

PostPosted: Sat Jan 03, 2009 4:41 am    Post subject: Need help with SDK OSK Reply with quote

I'm trying to use the OSK in my game, but to no avail. the code is as follows:

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:


// 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


And I get the following from the code calling the function:

Code:

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


I feel I missed something, but what?

TIA
Back to top
View user's profile Send private message
ne0h



Joined: 21 Feb 2008
Posts: 386

PostPosted: Sat Jan 03, 2009 6:54 am    Post subject: Reply with quote

#include <pspkerneltypes.h>
_________________
Get Xplora!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group