| View previous topic :: View next topic |
| Author |
Message |
KickinAezz
Joined: 03 Jun 2007 Posts: 328
|
Posted: Sat Aug 02, 2008 12:53 am Post subject: Utility Dialogs (netdialog) Status codes TOTALLY UNreliable |
|
|
Hello,
I am totally confused.
This is what I have
| Code: |
//PSP_UTILITY_DIALOG_QUIT, /**< The dialog has been canceled and should be shut down */
//PSP_UTILITY_DIALOG_FINISHED /**< The dialog has successfully shut down */
int done = 0;
int netDialoginit()
{
done=0;
pspUtilityNetconfData data;
memset(&data, 0, sizeof(data));
data.base.size = sizeof(data);
data.base.language = PSP_SYSTEMPARAM_LANGUAGE_ENGLISH;
data.base.buttonSwap = PSP_UTILITY_ACCEPT_CROSS;
data.base.graphicsThread = 17;
data.base.accessThread = 19;
data.base.fontThread = 18;
data.base.soundThread = 16;
data.action = PSP_NETCONF_ACTION_CONNECTAP;
struct pspUtilityNetconfAdhoc adhocparam;
memset(&adhocparam, 0, sizeof(adhocparam));
data.adhocparam = &adhocparam;
sceUtilityNetconfInitStart(&data);
while(1)
{
drawStuff();
switch(sceUtilityNetconfGetStatus())
{
case PSP_UTILITY_DIALOG_NONE:
break;
case PSP_UTILITY_DIALOG_VISIBLE:
sceUtilityNetconfUpdate(1);
break;
case PSP_UTILITY_DIALOG_QUIT:
sceUtilityNetconfShutdownStart();
done=2;
break;
case PSP_UTILITY_DIALOG_FINISHED:
done = 1;
break;
default:
break;
}
sceDisplayWaitVblankStart();
sceGuSwapBuffers();
if(done)
break;
}
return 1;
}
|
| Code: |
main()
{
netDialoginit();
pspDebugScreenClear();
pspDebugScreenClear();
if (done==1) pspDebugScreenPrintf("Connected to AP. Press X to connect to server");
if (done==2) pspDebugScreenPrintf("Not Connected to AP! Press Rtrigger.");
}
|
When Done=2 is there,
it shows Not Connected to AP EVEN if it is connected.
Shows correcty when is really is Not connected (we cancelled the dialog).
When I remove the above statement. It works fine BUT it DOESNOT detect when we cancel the dialog (Press O). IT shows "Connected to AP."
HELP!!!! :(
When I _________________ Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming. |
|
| Back to top |
|
 |
Insert_witty_name
Joined: 10 May 2006 Posts: 376
|
Posted: Sat Aug 02, 2008 1:14 am Post subject: |
|
|
The PSP_UTILITY_DIALOG_QUIT case will match regardless of if the user cancelled or not, it's internal to how the dialog runs.
To get the actual result from the dialog, access the data.base.result member.
IIRC it's set as 0 for successfully connected, 1 if user cancelled and an error code if there was some error. |
|
| Back to top |
|
 |
KickinAezz
Joined: 03 Jun 2007 Posts: 328
|
Posted: Sat Aug 02, 2008 2:46 am Post subject: |
|
|
| Insert_witty_name wrote: | The PSP_UTILITY_DIALOG_QUIT case will match regardless of if the user cancelled or not, it's internal to how the dialog runs.
To get the actual result from the dialog, access the data.base.result member.
IIRC it's set as 0 for successfully connected, 1 if user cancelled and an error code if there was some error. |
/**< The dialog has been canceled and should be shut down */
Should have been
/**< The dialog has been canceled (NOT BY USER) and should be shut down */
Would be more helpful to others. _________________ Intrigued by PSP system Since December 2006.
Use it more for Development than for Gaming. |
|
| Back to top |
|
 |
Raphael

Joined: 17 Jan 2006 Posts: 646 Location: Germany
|
Posted: Sat Aug 02, 2008 3:03 am Post subject: |
|
|
| KickinAezz wrote: |
/**< The dialog has been canceled and should be shut down */
Should have been
/**< The dialog has been canceled (NOT BY USER) and should be shut down */
Would be more helpful to others. |
That wouldn't be correct and misleading though:
| IWN wrote: |
The PSP_UTILITY_DIALOG_QUIT case will match regardless of if the user cancelled or not
|
_________________ <Don't push the river, it flows.>
http://wordpress.fx-world.org - my devblog
http://wiki.fx-world.org - VFPU documentation wiki
Alexander Berl |
|
| Back to top |
|
 |
|