Need help with SDK OSK

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
goumba
Posts: 7
Joined: Thu Nov 20, 2008 8:59 am

Need help with SDK OSK

Post by goumba »

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: Select all


// Standard Library headers
#include <cstring>
#include <string>
using std&#58;&#58;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&#58;&#58;show&#40;&#41;
&#123;

  SceUtilityOskData osk_data&#91;1&#93;;
  SceUtilityOskParams osk_params;

  unsigned short temp&#91;32&#93;;

  memset&#40;osk_data, 0, sizeof&#40;SceUtilityOskData&#41;&#41;;

  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&#40;&osk_params, 0, sizeof&#40;osk_params&#41;&#41;;
  osk_params.base.size = sizeof&#40;osk_params&#41;;
  sceUtilityGetSystemParamInt&#40;PSP_SYSTEMPARAM_ID_INT_LANGUAGE, &osk_params.base.language&#41;;
  sceUtilityGetSystemParamInt&#40;PSP_SYSTEMPARAM_ID_INT_UNKNOWN, &osk_params.base.buttonSwap&#41;;
  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&#40;&osk_params&#41;;

  bool done = false;
	
  while&#40;!done&#41;
    &#123;
      sceGuClearColor&#40;0&#41;;
      sceGuClearDepth&#40;0&#41;;
      sceGuClear&#40;GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT&#41;;

      sceGuSync&#40;0,0&#41;;

      switch&#40;sceUtilityOskGetStatus&#40;&#41;&#41;
	&#123;
	case PSP_UTILITY_DIALOG_INIT&#58;
	  break;
			
	case PSP_UTILITY_DIALOG_VISIBLE&#58;
	  sceUtilityOskUpdate&#40;1&#41;;
	  break;
			
	case PSP_UTILITY_DIALOG_QUIT&#58;
	  sceUtilityOskShutdownStart&#40;&#41;;
	  break;
	  
	case PSP_UTILITY_DIALOG_FINISHED&#58;
	  break;
	  
	case PSP_UTILITY_DIALOG_NONE&#58;
	  done = 1;
	  
	default &#58;
	  break;
	&#125;
      
      sceDisplayWaitVblankStart&#40;&#41;;
      sceGuSwapBuffers&#40;&#41;;
    &#125;
  return&#40;uShortToString&#40;osk_data->outtext&#41;&#41;;
  
&#125;// show
And I get the following from the code calling the function:

Code: Select all

In file included from /home/anthony/Applications/pspdev/psp/sdk/include/psputility.h&#58;32,
                 from include/psputility/Keyboard.hh&#58;21,
                 from sabacc/src/game/GameBoot.cc&#58;42&#58;
/home/anthony/Applications/pspdev/psp/sdk/include/psputility_savedata.h&#58;70&#58; error&#58; ‘SceSize’ does not name a type
/home/anthony/Applications/pspdev/psp/sdk/include/psputility_savedata.h&#58;71&#58; error&#58; ‘SceSize’ does not name a type
/home/anthony/Applications/pspdev/psp/sdk/include/psputility_savedata.h&#58;110&#58; error&#58; ‘SceSize’ does not name a type
/home/anthony/Applications/pspdev/psp/sdk/include/psputility_savedata.h&#58;111&#58; error&#58; ‘SceSize’ does not name a type
I feel I missed something, but what?

TIA
ne0h
Posts: 386
Joined: Thu Feb 21, 2008 2:15 am

Post by ne0h »

#include <pspkerneltypes.h>
Post Reply