Utility Dialogs (netdialog) Status codes TOTALLY UNreliable

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

Moderators: cheriff, TyRaNiD

Post Reply
KickinAezz
Posts: 328
Joined: Sun Jun 03, 2007 10:05 pm

Utility Dialogs (netdialog) Status codes TOTALLY UNreliable

Post by KickinAezz »

Hello,

I am totally confused.

This is what I have

Code: Select all


//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&#40;&#41;
&#123;
    done=0;
   	pspUtilityNetconfData data;

	memset&#40;&data, 0, sizeof&#40;data&#41;&#41;;
	data.base.size = sizeof&#40;data&#41;;
	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&#40;&adhocparam, 0, sizeof&#40;adhocparam&#41;&#41;;
	data.adhocparam = &adhocparam;

	sceUtilityNetconfInitStart&#40;&data&#41;;

	while&#40;1&#41;
	&#123;
		drawStuff&#40;&#41;;

		switch&#40;sceUtilityNetconfGetStatus&#40;&#41;&#41;
		&#123;
			case PSP_UTILITY_DIALOG_NONE&#58;
				break;

			case PSP_UTILITY_DIALOG_VISIBLE&#58;
				sceUtilityNetconfUpdate&#40;1&#41;;
				break;

			case PSP_UTILITY_DIALOG_QUIT&#58;
				sceUtilityNetconfShutdownStart&#40;&#41;;
				done=2;
				break;

			case PSP_UTILITY_DIALOG_FINISHED&#58;
				done = 1;
				break;

			default&#58;
				break;
		&#125;

		sceDisplayWaitVblankStart&#40;&#41;;
		sceGuSwapBuffers&#40;&#41;;

		if&#40;done&#41;
			break;
	&#125;

	return 1;
&#125;

Code: Select all


main&#40;&#41;
&#123;
netDialoginit&#40;&#41;;
  pspDebugScreenClear&#40;&#41;;
  pspDebugScreenClear&#40;&#41;;
  if &#40;done==1&#41; pspDebugScreenPrintf&#40;"Connected to AP. Press X to connect to server"&#41;;
  if &#40;done==2&#41; pspDebugScreenPrintf&#40;"Not Connected to AP! Press Rtrigger."&#41;;
&#125;


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.
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

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.
KickinAezz
Posts: 328
Joined: Sun Jun 03, 2007 10:05 pm

Post by KickinAezz »

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.
User avatar
Raphael
Posts: 646
Joined: Tue Jan 17, 2006 4:54 pm
Location: Germany
Contact:

Post by Raphael »

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
Post Reply