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 

Minimal Setup to Show NetDialog/OSK

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



Joined: 20 Mar 2008
Posts: 9

PostPosted: Wed Apr 02, 2008 7:50 am    Post subject: Minimal Setup to Show NetDialog/OSK Reply with quote

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:

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?
Back to top
View user's profile Send private message
mrlinx



Joined: 20 Mar 2008
Posts: 9

PostPosted: Wed Apr 02, 2008 9:08 am    Post subject: Reply with quote

Solved.

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

      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.
Back to top
View user's profile Send private message
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Wed Apr 02, 2008 10:14 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
mrlinx



Joined: 20 Mar 2008
Posts: 9

PostPosted: Thu Apr 03, 2008 9:16 am    Post subject: Reply with quote

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:

   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?
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Thu Apr 03, 2008 11:23 am    Post subject: Reply with quote

Look at working code, then try commenting out portions until it quits working. At that point, you have a minimal setup. :)
Back to top
View user's profile Send private message AIM Address
mrlinx



Joined: 20 Mar 2008
Posts: 9

PostPosted: Thu Apr 03, 2008 11:32 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Thu Apr 03, 2008 12:40 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message AIM Address
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