Minimal Setup to Show NetDialog/OSK

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

Moderators: cheriff, TyRaNiD

Post Reply
mrlinx
Posts: 9
Joined: Thu Mar 20, 2008 3:24 am

Minimal Setup to Show NetDialog/OSK

Post by mrlinx »

Hi.

I've searched, but came out empty.

What's the minimum setup required to show NetDialog and/or OSK dialogs?

I've removed the cube drawing from the netdialog sample, and replaced it with some clear buffer code. The pool loop stays as:

Code: Select all

while(running)
	{
		sceGuClearColor(0xff554433);
		sceGuClearDepth(0);
		sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT);

		switch(sceUtilityNetconfGetStatus())
		{
		case PSP_UTILITY_DIALOG_NONE:
			break;

		case PSP_UTILITY_DIALOG_VISIBLE:
			sceUtilityNetconfUpdate(1);
			break;

		case PSP_UTILITY_DIALOG_QUIT:
			sceUtilityNetconfShutdownStart();
			break;

		case PSP_UTILITY_DIALOG_FINISHED:
			done = 1;
			break;

		default:
			break;
		}

		sceDisplayWaitVblankStart();
		sceGuSwapBuffers();

		if(done)
			break;
	}
But still, the dialog is showing with lots of flicker, and the buffers dont seem to be clearing.

I don't really know how sceUtilityNetconfInitStart works, but If it starts another thread to make and draw the dialog, Is possible this new thread is drawing faster than my own and thus the flicker?
mrlinx
Posts: 9
Joined: Thu Mar 20, 2008 3:24 am

Post by mrlinx »

Solved.

I've basicly just added an minimal render code (the step to add directly in to the list seems crutial):

Code: Select all

      sceGuStart(GU_DIRECT, list);
      sceGuClearColor(0xff000000);
      sceGuClearDepth(0);
      sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT);
      sceGuFinish();
      sceGuSync(0,0);
I still don't understand much about how these dialogs work, but Its working now.
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

You always need to call sceGuFinish() and sceGuSync() before updating the dialog in any way.

The utility dialogs save the current context, do there thing and then restore the context.
mrlinx
Posts: 9
Joined: Thu Mar 20, 2008 3:24 am

Post by mrlinx »

Thanks for your answer.

Unfortunately, it still isn't drawing 100%... Sound impressive, but it only draws half of the screen right...

My code right now is:

Code: Select all

	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(running)
	{
		sceGuStart(GU_DIRECT, list);
		sceGuClearColor(0xff000000);
		sceGuClearDepth(0);
		sceGuClear(GU_COLOR_BUFFER_BIT|GU_DEPTH_BUFFER_BIT);
		sceGuFinish();
		sceGuSync(0,0);
		
		switch(sceUtilityNetconfGetStatus())
		{
		case PSP_UTILITY_DIALOG_NONE:
			break;

		case PSP_UTILITY_DIALOG_VISIBLE:
			sceUtilityNetconfUpdate(1);
			break;

		case PSP_UTILITY_DIALOG_QUIT:
			sceUtilityNetconfShutdownStart();
			break;

		case PSP_UTILITY_DIALOG_FINISHED:
			done = 1;
			break;

		default:
			break;
		}
		
		sceDisplayWaitVblankStart();
		sceGuSwapBuffers();

		if(done)
			break;
	}
Can someone point me in the right direction?
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Look at working code, then try commenting out portions until it quits working. At that point, you have a minimal setup. :)
mrlinx
Posts: 9
Joined: Thu Mar 20, 2008 3:24 am

Post by mrlinx »

That's precisely what I've done.

Unfortunately, seems like removing a more larger renderization process to a smaller, makes the flicker happen. I would appreciate some know how about the dialog rendering, because I think this is a matter of syncing the render with my own render code.

Off course, I might just be wrong.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

I imagine the dialogs are mostly all the same. You could look at the rendering Doom for the PSP does for the OSK. There's also a PSP Dialog Library - pspdlg1.zip. That does the regular PSP dialogs, so I guess whatever it does is probably the minimum needed.
Post Reply