dc v6 graphics

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

Moderators: cheriff, TyRaNiD

Post Reply
phobox
Posts: 127
Joined: Mon Mar 24, 2008 6:22 pm

Post by phobox »

about the page control....
what is the value of param "page" passed to the handle function?

thans
Ciao! from Italy
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

phobox wrote:about the page control....
what is the value of param "page" passed to the handle function?

thans
It is the number of the page. When no page control is present is reset to zero. In first page is zero, in next page 1, etc... You can see in idstools.c how according to the value of page, it does a different thing in the handler.
phobox
Posts: 127
Joined: Mon Mar 24, 2008 6:22 pm

Post by phobox »

moonlight wrote:
phobox wrote:about the page control....
what is the value of param "page" passed to the handle function?

thans
It is the number of the page. When no page control is present is reset to zero. In first page is zero, in next page 1, etc... You can see in idstools.c how according to the value of page, it does a different thing in the handler.
ok thanks, i was looking into flashformat.c (or somethinglike that) that has only 2 pages...
Ciao! from Italy
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

This is great. I've converted my password app to fully use VLF including the pages and stuff.

Now the only problem is it can't be unloaded :P after correct password without crashing.
phobox
Posts: 127
Joined: Mon Mar 24, 2008 6:22 pm

Post by phobox »

@Torch looking forward to see your program working.

@moonlight, please can you add png image format support? png images are used inside the psp: both in eboots and umds.
Ciao! from Italy
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

phobox wrote:@Torch looking forward to see your program working.

@moonlight, please can you add png image format support? png images are used inside the psp: both in eboots and umds.
moonlight has to complete VLF first. Its unable to be unloaded in its current state.

Can you add support for loading from PNG data in memory (Like if the file is already read into an array)?
krosk
Posts: 21
Joined: Sun Aug 24, 2008 8:54 pm

Post by krosk »

bug:
vlfguinetconfdialog doesn't work for me... I'm calling it with something like that:
if(vlfGuiNetConfDialog() < 0)
{
vlfGuiMessageDialog("Connection error.", VLF_MD_TYPE_ERROR | VLF_MD_BUTTONS_NONE);
}
else
{
RegisterDialog(1);
}

It doesn't show the Net Dialog, but shows the register dialog :S

also, a input text and implementation of the osk plugin will be so cool...
that's my suggestion of what to do now :)
(osk plugin loaded by psputility_osk.h doesn't work, crash the vlf...)

sorry for my bad english ;)
phobox
Posts: 127
Joined: Mon Mar 24, 2008 6:22 pm

Post by phobox »

is this the proper way to remove a fade?

Code: Select all

vlfGuiSetPictureFade&#40;picFocus, NULL, NULL, 0&#41;;
vlfGuiSetPictureVisibility&#40;picFocus, 0&#41;;
(in this case for pics).
Ciao! from Italy
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

I didn't provide a way to remove fade, as fade would normally be used without repeat flag and would eventually end, but I will probably add a function to cancel it.
krosk
Posts: 21
Joined: Sun Aug 24, 2008 8:54 pm

Post by krosk »

vlfGuiLoadResources don't work:

Code: Select all

	char *names&#91;2&#93;;
	void *datas&#91;2&#93;;
	int types&#91;2&#93;, sizes&#91;2&#93;;

	names&#91;0&#93; = "tex_game";
	names&#91;1&#93; = "tex_sdwn_game";
	types&#91;0&#93; = types&#91;1&#93; = RCO_GRAPHIC;

	int res = vlfGuiLoadResources&#40;"flash0&#58;/vsh/resource/topmenu_plugin.rco", 2, names, types, datas, sizes, NULL&#41;;
	if &#40;res != 2&#41;
	&#123;	
		char buffer &#91;50&#93;;
		int n;
		n = sprintf&#40;buffer, "Error 1&#58; %d", res&#41;;
		error1_text = vlfGuiAddText&#40;354, 190, buffer&#41;;
		if &#40;res > 0&#41;
		&#123;
			error2_text = vlfGuiAddText&#40;354, 190, "Error 2"&#41;;
			if &#40;datas&#91;0&#93;&#41;
				free&#40;datas&#91;0&#93;&#41;;
			if &#40;datas&#91;1&#93;&#41;
				free&#40;datas&#91;1&#93;&#41;;
		&#125;
	&#125;
	else
	&#123;
		void *gme;
		vlfGuiAddShadowedPicture&#40;&gme, datas&#91;0&#93;, sizes&#91;0&#93;, datas&#91;1&#93;, sizes&#91;1&#93;, 441, 4, 1, 1, 1&#41;;
		free&#40;datas&#91;0&#93;&#41;;
		free&#40;datas&#91;1&#93;&#41;;
	&#125;
the result of res is 0
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

krosk wrote:vlfGuiLoadResources don't work:

Code: Select all

	char *names&#91;2&#93;;
	void *datas&#91;2&#93;;
	int types&#91;2&#93;, sizes&#91;2&#93;;

	names&#91;0&#93; = "tex_game";
	names&#91;1&#93; = "tex_sdwn_game";
	types&#91;0&#93; = types&#91;1&#93; = RCO_GRAPHIC;

	int res = vlfGuiLoadResources&#40;"flash0&#58;/vsh/resource/topmenu_plugin.rco", 2, names, types, datas, sizes, NULL&#41;;
	if &#40;res != 2&#41;
	&#123;	
		char buffer &#91;50&#93;;
		int n;
		n = sprintf&#40;buffer, "Error 1&#58; %d", res&#41;;
		error1_text = vlfGuiAddText&#40;354, 190, buffer&#41;;
		if &#40;res > 0&#41;
		&#123;
			error2_text = vlfGuiAddText&#40;354, 190, "Error 2"&#41;;
			if &#40;datas&#91;0&#93;&#41;
				free&#40;datas&#91;0&#93;&#41;;
			if &#40;datas&#91;1&#93;&#41;
				free&#40;datas&#91;1&#93;&#41;;
		&#125;
	&#125;
	else
	&#123;
		void *gme;
		vlfGuiAddShadowedPicture&#40;&gme, datas&#91;0&#93;, sizes&#91;0&#93;, datas&#91;1&#93;, sizes&#91;1&#93;, 441, 4, 1, 1, 1&#41;;
		free&#40;datas&#91;0&#93;&#41;;
		free&#40;datas&#91;1&#93;&#41;;
	&#125;
the result of res is 0
Since 3.71, topmenu_plugin doesn't contain that icon, but "topmenu_icon" instead. Also it is "tex_sdwf_game", not ""tex_sdwn_game"
Anb btw, using vlfGuiAddShadowedPictureResource directly is easier :p
krosk
Posts: 21
Joined: Sun Aug 24, 2008 8:54 pm

Post by krosk »

Moonlight, I'm using vlf and dvemgr, but when I connect the slim tv cable, I see on the tv a image like this:

Image


Any way to fix it?
(I'm using components cable)
Gh0st-UPMS
Posts: 23
Joined: Sun Feb 17, 2008 12:32 am

Post by Gh0st-UPMS »

Hi moonlight, just want to ask how do we use this function and what exactly does it do.

vlfGuiAddIntegerSpinControl

Thanks
phobox
Posts: 127
Joined: Mon Mar 24, 2008 6:22 pm

Post by phobox »

have a look into dc 7 source....
Ciao! from Italy
Gh0st-UPMS
Posts: 23
Joined: Sun Feb 17, 2008 12:32 am

Post by Gh0st-UPMS »

Already looked in the source and no mention of that function in there.



EDIT:
Found the spin stuff in the DC source, missed it first of all.
Last edited by Gh0st-UPMS on Tue Sep 16, 2008 4:22 am, edited 1 time in total.
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

Any newer version which can be unloaded without crashing yet?
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

I will release this week a version with the unload problem fixed.
phobox
Posts: 127
Joined: Mon Mar 24, 2008 6:22 pm

Post by phobox »

it seems not to be possible to debug a vlf app with psplink..
am i right?

trying doing that, i see on the screen strange waves (black and white), a strange effect on the battery icon and the "psplink bootstrp.. etc ect" flashing on the screen...

how to solve that?

EDIT: here the screenshot
Image
a_noob
Posts: 97
Joined: Sun Sep 17, 2006 8:33 am
Location: _start: jr 0xDEADBEEF

Post by a_noob »

looks like you arent clearing the screen to me.

Code: Select all

.øOº'ºOø.
'ºOo.oOº'
cory1492
Posts: 216
Joined: Fri Dec 10, 2004 1:49 pm

Post by cory1492 »

moonlight: is it possible to exitVsh back to pspbtdnf*.bin?
Gh0st-UPMS
Posts: 23
Joined: Sun Feb 17, 2008 12:32 am

Post by Gh0st-UPMS »

phobox wrote:it seems not to be possible to debug a vlf app with psplink..
am i right?

trying doing that, i see on the screen strange waves (black and white), a strange effect on the battery icon and the "psplink bootstrp.. etc ect" flashing on the screen...

how to solve that?

EDIT: here the screenshot
Image
Looks like your trying to load a background image along with ReadFileAllocEx function. Might be wrong though as PSPlink works fine with VLF.
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

cory1492 wrote:moonlight: is it possible to exitVsh back to pspbtdnf*.bin?
No. That file is only loaded by the special ipl of DC7.
cory1492
Posts: 216
Joined: Fri Dec 10, 2004 1:49 pm

Post by cory1492 »

moonlight wrote:
cory1492 wrote:moonlight: is it possible to exitVsh back to pspbtdnf*.bin?
No. That file is only loaded by the special ipl of DC7.
Figured as much. So the btcnf param is now discarded? :/ Thanks for the quick answer moonlight.
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

http://www.sendspace.com/file/br9qxh

Sorry for delay, here is the version with support for termination, additionally i have included some defined types to make the prototypes more readable, and fixed a very critical bug that leaked memory each time something was loaded from a resource; also negative heaps other than -1 can now be specified.

Note: to terminate vlf, you need to stop the vlf.prx module from other thread. Because it seems that system needs some memory for that, when specifying a negative heap, don't specify -1, specify at least (mmm well is negative, so at most :p) -640.

There is included a vshmain replace sample which simply does stupid things with the waves on button presses, and exit with start. To make it work: put vlf.prx, intrafont.prx (get it from other release), and vsh_load.prx in ms0:/seplugins; change the name of real vshmain to vshmain_real.prx, and copy the vshmain.prx replacement to flash0:/vsh/module

Note for those that want to make vshmain.prx replacements: it seems that heaparea1.prx and heaparea2.prx have allocated lot of memory and leaving very small amount of memory (after vlf load, and specifying -640, you have 2 MB only, more or less). If you really need more memory, replace those modules with dummys, and load/start the real ones before loading/starting the real vshmain.prx.

Next release will be the first official one. I'll try to add the most important things that are missing: checkboxes, ip spin control, scrollbar, lateral menu, inputbox, osk (atm using utility), png support, fix the custom background code, and document everything (probably I'm missing some control :p)
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

Thanks. Time to start coding.

mod = sceKernelLoadModule("flash0:/vsh/module/vshmain_real.prx", 0, NULL); doesn't work in a 0x800 mode module. In your sample the loader is 0x1000 mode where the above works.

Can you give some additional info on the heaparea?.prx ? At which point is it loaded? Is it safe to unload them in the replacement vshmain.prx?
phobox
Posts: 127
Joined: Mon Mar 24, 2008 6:22 pm

Post by phobox »

thanks very much, for both this and the future release...

i think that now we'll se new xmb replacement projects and so on.

a question for you, you talked about you may have lost some controls, is the content browser, let's say of music, a menu?

btw good work, keep on going!!
krosk
Posts: 21
Joined: Sun Aug 24, 2008 8:54 pm

Post by krosk »

This is a example of what can be done with that library:

Image

Image


At the moment is a really bad shell, but I think that I will do a good job :)

The developement thread:
http://www.elotrolado.net/hilo_alpha-re ... ll_1085541
phobox
Posts: 127
Joined: Mon Mar 24, 2008 6:22 pm

Post by phobox »

since you haven't used iop.prx in your sample, is it still needed?
Ciao! from Italy
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

phobox wrote:since you haven't used iop.prx in your sample, is it still needed?
mmm, yes, I just forgot. Maybe this last sample won't work in a normal 4.01 M33, but in one installed from DC (wher all files are written with 0777 permissions).
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

Are all these libs required for just the wave background??
-lpsppower -lpsprtc -lvlfgui -lvlfgu -lvlfutils -lvlflibc -lpspreg -lpspsystemctrl_user -lpspkubridge -lpspwlan

And is this still required or is the path set automatically now?

Code: Select all

   char *path = &#40;char *&#41;argp;
   int last_trail = -1;
   int i;

   if &#40;path&#41;
   &#123;
      for &#40;i = 0; path&#91;i&#93;; i++&#41;
      &#123;
         if &#40;path&#91;i&#93; == '/'&#41;
            last_trail = i;
      &#125;
   &#125;

   if &#40;last_trail >= 0&#41;
      path&#91;last_trail&#93; = 0;

   sceIoChdir&#40;path&#41;;
   path&#91;last_trail&#93; = '/';
In the unload thread can't I just directly load vshmain_real.prx using kuKernelLoadModule or is there some problem with that?

EDIT: OK..Just understood that your freeing all the user memory and loading vshmain_real.prx from a kernel prx so that all memory is available to vshmain on startup.

Code: Select all

static int end_thread&#40;SceSize args, void *argp&#41;
&#123;
	sceKernelStopModule&#40;vlf_mod, 0, NULL, NULL, NULL&#41;;
	sceKernelUnloadModule&#40;vlf_mod&#41;;
	
	sceKernelStopModule&#40;if_mod, 0, NULL, NULL, NULL&#41;;
	sceKernelUnloadModule&#40;if_mod&#41;;

	// From here, you cannot use LIBC!

	SceUID mod = sceKernelLoadModule&#40;"ms0&#58;/seplugins/vsh_loader.prx", 0, NULL&#41;;
	sceKernelStartModule&#40;mod, MODNAME_LENGTH+1, MODNAME, NULL, NULL&#41;;
	
	return sceKernelExitDeleteThread&#40;0&#41;;
&#125;
I am detecting button presses using the sceCtrl functions in another thread. It works, but should that be avoided and should I use the VLF event handlers instead?

And I still don't understand what is LIBC T_T
Last edited by Torch on Wed Oct 01, 2008 2:59 pm, edited 1 time in total.
Post Reply