PRX plugin breaks video and browser

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

Moderators: cheriff, TyRaNiD

Post Reply
borix
Posts: 5
Joined: Wed Jul 18, 2007 6:25 pm

PRX plugin breaks video and browser

Post by borix »

I'm working on prx plugin for psp, but when I allow the plugin in recovery it breaks video player and browser. I'm using modified graphics.c graphics.h files(i removed all unnecessary functions from them).
Here is the prx source code:

Code: Select all

#include <pspkernel.h>
#include <pspdisplay.h>
#include <pspgu.h>
#include <time.h>
#include "graphics.h"

PSP_MODULE_INFO&#40;"bnr", 0, 1, 0&#41;;
PSP_MAIN_THREAD_ATTR&#40;THREAD_ATTR_USER | THREAD_ATTR_VFPU&#41;;

int binary&#40;int arg&#41;&#123;
	int vysledok = 0;
	int jan = 1;
	while&#40;arg>0&#41;&#123;
		if&#40;arg %2 == 1&#41;
			vysledok += jan;
		arg /= 2;
		jan *= 10;
	&#125;
	return vysledok;
&#125;


int main&#40;&#41;&#123;
	sceKernelDelayThread&#40;4000000&#41;;
	time_t cas;
	initGraphics&#40;&#41;;
	int minuty, hodiny, i;
	while&#40;1&#41;&#123;
		cas = time&#40;NULL&#41;;
		minuty = binary&#40;&#40;cas/60&#41;%60&#41;;
		hodiny = binary&#40;&#40;cas/60/60+2&#41;%24&#41;;
		for&#40;i=0; i<6; i++&#41;&#123;
			if&#40;hodiny%10 == 1&#41;
				fillScreenRect&#40;0xffffffff, 330, 35 - 6 * i, 5, 5&#41;;
			hodiny /= 10;
		&#125;
		for&#40;i=0; i<6; i++&#41;&#123;
			if&#40;minuty%10 == 1&#41;
				fillScreenRect&#40;0xffffffff, 336, 35 - 6 * i, 5, 5&#41;;
			minuty /= 10;
		&#125;
		flipScreen&#40;&#41;;
		sceDisplayWaitVblankStart&#40;&#41;;
		sceKernelDelayThread&#40;10000&#41;; 
	&#125;
	return 0;
&#125;

moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

Video player and browser probably need all possible user memory... and your module is an user one, so you are probably eating them space.
borix
Posts: 5
Joined: Wed Jul 18, 2007 6:25 pm

Post by borix »

So is there a way how to solve it?
In kernel mode(with kernel libs) can I use time() function?
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

borix wrote:So is their a way how to solve it?
In kernel mode(with kernel libs) can I use time() function?
I doubt, but anyways you can use the sony functions for time purposes (look at psprtc.h) and add -lpsprtc_driver in that case to the library list.
KickinAezz
Posts: 328
Joined: Sun Jun 03, 2007 10:05 pm

Post by KickinAezz »

oops.
Post Reply