| View previous topic :: View next topic |
| Author |
Message |
borix
Joined: 18 Jul 2007 Posts: 5
|
Posted: Sun Aug 26, 2007 7:13 pm Post subject: PRX plugin breaks video and browser |
|
|
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: | #include <pspkernel.h>
#include <pspdisplay.h>
#include <pspgu.h>
#include <time.h>
#include "graphics.h"
PSP_MODULE_INFO("bnr", 0, 1, 0);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
int binary(int arg){
int vysledok = 0;
int jan = 1;
while(arg>0){
if(arg %2 == 1)
vysledok += jan;
arg /= 2;
jan *= 10;
}
return vysledok;
}
int main(){
sceKernelDelayThread(4000000);
time_t cas;
initGraphics();
int minuty, hodiny, i;
while(1){
cas = time(NULL);
minuty = binary((cas/60)%60);
hodiny = binary((cas/60/60+2)%24);
for(i=0; i<6; i++){
if(hodiny%10 == 1)
fillScreenRect(0xffffffff, 330, 35 - 6 * i, 5, 5);
hodiny /= 10;
}
for(i=0; i<6; i++){
if(minuty%10 == 1)
fillScreenRect(0xffffffff, 336, 35 - 6 * i, 5, 5);
minuty /= 10;
}
flipScreen();
sceDisplayWaitVblankStart();
sceKernelDelayThread(10000);
}
return 0;
}
|
|
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Sun Aug 26, 2007 7:17 pm Post subject: |
|
|
| Video player and browser probably need all possible user memory... and your module is an user one, so you are probably eating them space. |
|
| Back to top |
|
 |
borix
Joined: 18 Jul 2007 Posts: 5
|
Posted: Sun Aug 26, 2007 7:43 pm Post subject: |
|
|
So is there a way how to solve it?
In kernel mode(with kernel libs) can I use time() function? |
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Sun Aug 26, 2007 7:56 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
KickinAezz
Joined: 03 Jun 2007 Posts: 328
|
Posted: Mon Aug 27, 2007 12:29 am Post subject: |
|
|
| oops. |
|
| Back to top |
|
 |
|