Well, just cd into the directory of the .raw image and do bin2c.
Printable View
Well, just cd into the directory of the .raw image and do bin2c.
if you want to make a look-a-like desktop , will it be good enough to work with png images and the graphics.c?
I wouldn't suggest it as graphics.c is slow and has many bugs, but yes, it will work.
What library that works like graphics would you recommend PSPJunkie_ ?
++ B.
what do you suggest?
SDL is very good or, my personal choice, would be to write you own graphics functions so you can customize them to your needs.
Has anyone here tried vLib? I'd imagine that would be good.
Zetta worked really hard on vLib. I haven't seen him in a while, but just so you know, vLib is incomplete. He still needs to polish it up.
oslib is the best right now for 2d games/apps.
That's true, but I'd imagine it works much faster for what it can do than SDL because it's A) MEANT to run on an embedded device and B) not as big as SDL.
E] This is in response to PSPJunkie_
Okay PSPJunkie_, if SDL for psp is as powerful as the one for PC, i may start to learn how to use this lib.
++ B.
EDIt : so : OSlib or SDL ?^^
It really is up to you. I don't like using engines like OSLib or vLib, but that is just me. I also do not like the way SDL works (Not that you shouldn't use it). I'm going to go ahead and suggest GU from scratch.
^^Zitat:
Zitat von PSPJunkie_
hardest, but fastest way. Take a look at graphics.c, and see how it loads and displays images. then go search for other formats, and put them in.
how do you copy an array[x] to array[x][y];
for example
char array[16]
char array[4][4]
can you it just like this?
strcpy(array , array);
or will it be like this?
strcpy(array[0] , array);
strcat(array[1] , array);
strcat(array[2] , array);
strcat(array[3] , array);
Personally, I recommend using the Old School Library as, like said, it's much faster (not a sketchy port and uses the VFPU for most if not all of it's calculations) yet it can do the same as SDL (input, audio, graphics (hardware as well; rotation, scaling, etc.)) and also, you may find it to be less confusing as SDL (personal preference though).
Id say SDL and OSlib are up to par with each other, but if you will be developing strictly for the PSP, Id say go with OSlib as the PSP SDL implementation is much slower then it's PC counterpart (i believe SDL is all done in software :()
hallo - Depends what type of array.
Something like this works in just about all cases:
Code:int z = 0;
for(int i=0; i<4; i++)
for(int j=0; j<4; j++) {
array[i][j] = array[z];
z++;
}
If the readme is correct, then some of it is hardware accelerated although this also may depend on whether you use a HW_Surface or SW_Surface for the screen.Zitat:
Zitat von SG57
OSLib also has a PC version of the library so you should be able to easily build and debug on the PC and then do a recompile for the PSP for release.
OSLib doesn't really seem to be an engine, it is only slightly higher then SDL as an API.
What I would do is create an abstract layer for drawing (indirection) which separates all the API specific calls from the game/application engine. This means that I can use an API such as SDL to begin with and at a later stage, rip it out and replace with a GU based one without having to change a line of the engine code.
Meh, Damm it! :Cry: I have been trying to get this to work since the past 1.5 hrs. Tried installing zlib.... I has got all includes.Code:psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G0 -Wall -D_PSP_FW_VERSION=150
-c -o main.o main.c
main.c: In function 'main':
main.c:166: warning: control reaches end of non-void function
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G0 -Wall -D_PSP_FW_VERSION=150
-L. -L/usr/local/pspdev/psp/sdk/lib main.o framebuffer.o graphics.o vram.o -l
pspgum -lpspgu -lm -lz -lpng -lpsprtc -lpsppower -lpspdebug -lpspdisplay -lpspge
-lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver
-lpsputility -lpspuser -lpspkernel -o LessonFive.elf
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(png.o): In func
tion `png_reset_crc':
png.c:(.text+0x1b0): undefined reference to `crc32'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(png.o): In func
tion `png_calculate_crc':
png.c:(.text+0x1fc): undefined reference to `crc32'
png.c:(.text+0x228): undefined reference to `crc32'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(png.o): In func
tion `png_reset_zstream':
png.c:(.text+0xb98): undefined reference to `inflateReset'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngread.o): In
function `png_create_read_struct_2':
pngread.c:(.text+0x134): undefined reference to `inflateInit_'
pngread.c:(.text+0x27c): undefined reference to `inflateInit_'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngread.o): In
function `png_read_init_3':
pngread.c:(.text+0x4ac): undefined reference to `inflateInit_'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngread.o): In
function `png_read_row':
pngread.c:(.text+0xfbc): undefined reference to `inflate'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngread.o): In
function `png_read_destroy':
pngread.c:(.text+0x1d24): undefined reference to `inflateEnd'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngrtran.o): In
function `png_build_gamma_table':
pngrtran.c:(.text+0x1258): undefined reference to `pow'
pngrtran.c:(.text+0x1470): undefined reference to `pow'
pngrtran.c:(.text+0x1518): undefined reference to `pow'
pngrtran.c:(.text+0x1630): undefined reference to `pow'
pngrtran.c:(.text+0x170c): undefined reference to `pow'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngrtran.o):png
rtran.c:(.text+0x17f8): more undefined references to `pow' follow
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngrutil.o): In
function `png_decompress_chunk':
pngrutil.c:(.text+0x334): undefined reference to `inflate'
pngrutil.c:(.text+0x43c): undefined reference to `inflateReset'
pngrutil.c:(.text+0x584): undefined reference to `inflateReset'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngrutil.o): In
function `png_read_finish_row':
pngrutil.c:(.text+0x43d4): undefined reference to `inflate'
pngrutil.c:(.text+0x445c): undefined reference to `inflateReset'
pngrutil.c:(.text+0x44a4): undefined reference to `inflateReset'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngwrite.o): In
function `png_write_flush':
pngwrite.c:(.text+0x18d4): undefined reference to `deflate'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngwrite.o): In
function `png_write_destroy':
pngwrite.c:(.text+0x1998): undefined reference to `deflateEnd'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngwutil.o): In
function `png_text_compress':
pngwutil.c:(.text+0x298): undefined reference to `deflate'
pngwutil.c:(.text+0x37c): undefined reference to `deflate'
pngwutil.c:(.text+0x444): undefined reference to `deflate'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngwutil.o): In
function `png_write_compressed_data_out':
pngwutil.c:(.text+0x5d4): undefined reference to `deflateReset'
pngwutil.c:(.text+0x684): undefined reference to `deflateReset'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngwutil.o): In
function `png_write_IHDR':
pngwutil.c:(.text+0x8f8): undefined reference to `deflateInit2_'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngwutil.o): In
function `png_write_finish_row':
pngwutil.c:(.text+0x2cf4): undefined reference to `deflate'
pngwutil.c:(.text+0x2d30): undefined reference to `deflate'
pngwutil.c:(.text+0x2da0): undefined reference to `deflateReset'
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libpng.a(pngwutil.o): In
function `png_write_filtered_row':
pngwutil.c:(.text+0x3324): undefined reference to `deflate'
collect2: ld returned 1 exit status
make: *** [LessonFive.elf] Error 1
In lesson5, I am trying to use a png texture instead of TGA! :o Any help?
My Other hello worlds compile fine from scratch that use png's!!!
PLease help! :o
and what about pointersZitat:
Zitat von SG57
..
char *array[4][4];
char *array[16];
?
I hate to tell you this, but you're missing the psp version of zlib. How did you go about installing it
It's now fixed.Zitat:
Zitat von Archaemic
Put -lz -lm after -lpng
Either that, or the libs are in the wrong order.
Edit: Too late.
@hello: These two implementations are equivalent:
Code:char array[5][10];
char x = array[4][7];
Now think how you would properly copy an array. Also, as a note, you don't have to copy the array if you just want to access the elements differently. In that case you could just create a pointer to the structure.Code:char array[5*10];
char x = array[4*10 + 7];
Also, a char* array[x][y] is the same (in regards to memory usage and binary contents) as an int array[x][y], just that every int is actually a memory address (a pointer).Code:char array[x][y];
char* array2 = array;
array2[x*y-1] = 5; // same as array[x-1][y-1] = 5;
It exactly the same. I am more concerned on why you would want to do this as there will be problems such as non NULL terminated strings which can lead to severe buffer overruns.Zitat:
Zitat von hallo007
-= Double Post =-
Eg
Code:char aString[16] "Hello World";
char aString2[4][4];
int k = 0;
for( int i = 0; i < 4; i += 1 )
{
for( int j = 0; j < 4; j += 1, k +=1 )
{
aString2[i][j] = aString[k];
}
}
printf( "%s", aString2[0] ); // Buffer overrun, C string not NULL terminated
// Undefined behaviour. If you are lucky, it will just print out "Hello World"
this works fine for me:) , thnx;)Code:#include <stdio.h>
int main()
{
char *aString[4] = {"Hello World" , "nothing" , "nothing" , "nothing"};
char *aString2[2][2];
int k = 0;
for( int i = 0; i < 4; i += 1 )
{
for( int j = 0; j < 4; j += 1, k +=1 )
{
aString2[i][j] = aString[k];
}
}
printf( "%s", aString2[0][0] ); // Buffer overrun, C string not NULL terminated
// Undefined behaviour. If you are lucky, it will just print out "Hello World"
getchar();
}
Oh god. ... I just don't know what to say.....Zitat:
Zitat von hallo007
Remind me not to use any of your flashers.
uh? whats wrong ?
It's completely unsafe.
http://en.wikipedia.org/wiki/Buffer_overflow - Read up.
and what has that to do with my flasher :/ if i am asking something here , then i dindt tried it yet :/
Unsafe programming can lead to a myriad of problems, including writing the wrong data, writing too much data, security vulnerabilities, etc. If one of these problems affects a flasher...goodbye PSP!
If the quality of the code that you have shown here is the same as your flasher, then I dread to see what possible bugs exist in your flasher.
Either way, the code that you have shown in that last snippet doesn't give me any confidence that any of your programs are 'safe'. This isn't much of a problem if it was a game or an application, but since you mostly write flashers, this kind of error can lead to a PSP brick.
but i dindt use it in the app , but can you show mee how to mkae it safe?
He never said you did use it in your flashers. He's saying that the quality of that last snippet you posted was unsafe/horrible, leading him to believe all of your code quality is unsafe/horrible, even the flashers you write.
As for making it safe, you need some memory allocations, buffer overrun safeties (strncpy, strncat, snprintf,etc..) and seeing as how your using C++ (int i = 0 in for loop) Id use some of it's abilities
Now, im not 100% sure what it is you want to happen, as running your code spits out Hello World, no nothing, nothing, etc defeating the purpose of having the nothing's. This here spits out 'nothingnothing' AKA the last element in aString array because your 2 for loops (it sets aString2[0 & 1] to all 4 elements of aString array but over writes the last) Please elaborate on what you want it to do if this isnt it.Code:#include <iostream>
int main() {
const NUM_OF_ASTRING = 4,
NUM_OF_ASTRING2 = 2;
const std::string aString[NUM_OF_ASTRING] = {
"Hello World" , "nothing" , "nothing" , "anothing"
};
std::string aString2[NUM_OF_ASTRING2];
for( int i = 0; i < NUM_OF_ASTRING2; i++ )
for( int j = 0; j < NUM_OF_ASTRING; j++ )
aString2[i] = aString[j];
std::cout << aString2[0] << aString2[1] << std::endl;
system("PAUSE"); // you used 'getchar()' some im assuming your on PC
return 0;
}
I dont really understand that so i just going to explain for what i am goign to use it.
I call a function that gets all file paths in a folder
it will be stored to
char *filePaths[200];
now I want to use it and blit it to screen like a desktop
so structured in
X-as : 15 files
y-as : 10 files
(so 150 files)
to make the code a bit more clearly and easy,I will store it in something like
char *paths[15][10];
-= Double Post =-
nvm , i just had the change to chekc your cod
this is exactly what I need
Code:#include <iostream>
int main() {
const int NUM_OF_ASTRING = 4,
NUM_OF_ASTRING2 = 2;
int z = 0;
const std::string aString[NUM_OF_ASTRING] = {
"Hello World" , "nothing" , "nothing" , "anothing"
};
std::string aString2[2][2];
for( int i = 0; i < 2; i++ )
for( int j = 0; j < 2; j++ )
{
aString2[i][j] = aString[z];
z++;
}
std::cout << aString2[0][0] << " " << aString2[0][1] << std::endl;
std::cout << aString2[1][0] << " " << aString2[1][1] << std::endl;
system("PAUSE"); // you used 'getchar()' some im assuming your on PC
return 0;
}
Hi guys. I posted a while back and got no responce to this.
why doesn't this run?
It does compile but whenever i try to run it, it just freezes up. (not a crash, a freeze)
thanks for your help.
makefile:Code:#include <pspdisplay.h>
#include <stdlib.h>
#include <pspctrl.h>
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspgu.h>
#include <png.h>
#include <stdio.h>
#include <time.h>
#include <psppower.h>
#include <pspaudio.h>
#include <pspaudiolib.h>
#include "graphics.h"
#include "mp3player.h"
#define true 1
#define false 0
PSP_MODULE_INFO("DotsC v0.0.3 Alpha", 0, 0, 3);
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common) {
sceKernelExitGame();
return 0;
}
/* Callback thread */
int CallbackThread(SceSize args, void *argp) {
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void) {
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid >= 0) {
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
char *path[13] = { "Player.png", //0
"Background.png", //1
"Spot.png", //2
"zero.png", //3
"one.png", //4
"two.png", //5
"three.png", //6
"four.png", //7
"five.png", //8
"six.png", //9
"seven.png", //10
"eight.png", //11
"nine.png"}; //12
int main()
{
srand(time(NULL));
pspDebugScreenInit();
initGraphics();
int spotx = rand()%(465);
int spoty = rand()%(257);
int x=0;
int y=0;
int Scoreo=0;
int Scoret=0;
int Scoreh=0;
int Scoreth=0;
SceCtrlData pad;
Image* images[14];
int i;
for(i = 0; i > 13; i++)
{
images[i] = loadImage(path[i]);
}
while (1)
{
sceCtrlReadBufferPositive(&pad, 1);
blitAlphaImageToScreen(0 ,0 ,32 , 32, images[0], x, y);
blitAlphaImageToScreen(0 ,0 ,480 , 272, images[1], 0, 0);
blitAlphaImageToScreen(0 ,0 ,16 , 16, images[2], spotx, spoty);
blitAlphaImageToScreen(0, 0, 15 ,15, images[Scoreo + 3], 50, 1);
blitAlphaImageToScreen(0, 0, 15 ,15, images[Scoret + 3], 35, 1);
blitAlphaImageToScreen(0 ,0 ,15 ,15, images[Scoreh + 3], 20, 1);
blitAlphaImageToScreen(0 ,0 ,15 ,15, images[Scoreth + 3], 5, 1);
if (x + 32 > spotx && x < spotx + 16 && y + 32 > spoty && y < spoty + 16)
{
Scoreo = Scoreo + 2;
spotx = rand()%(465);
spoty = rand()%(257);
}
if (Scoreo == 10)
{
Scoreo = 0;
Scoret++;
}
if (Scoret == 10)
{
Scoret = 0;
Scoreh++;
}
if (Scoreh == 10)
{
Scoreh = 0;
Scoreth++;
}
if (x < 0)
{
x = 0;
}
if (y < 0)
{
y = 0;
}
if (x > 448)
{
x = 448;
}
if (y > 240)
{
y = 240;
}
if(pad.Buttons & PSP_CTRL_RIGHT)
{
x += 5;
}
else if(pad.Buttons & PSP_CTRL_LEFT)
{
x -= 5;
}
else if(pad.Buttons & PSP_CTRL_UP)
{
y -= 5;
}
else if(pad.Buttons & PSP_CTRL_DOWN)
{
y += 5;
}
else if(pad.Buttons & PSP_CTRL_START)
{
sceKernelExitGame();
}
flipScreen();
}
sceKernelSleepThread();
return 0;
}
Code:TARGET = Square_Game
OBJS = main.o graphics.o framebuffer.o mp3player.o
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LIBS = -lpspgu -lpng -lz -lm -lpsprtc -lmad -lpspaudiolib -lpspaudio -lpsppower
LDFLAGS =
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = DotsC v0.0.3 Alpha
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
Shouldn't it be i < 13 ?Code:for(i = 0; i > 13; i++)
{
images[i] = loadImage(path[i]);
}
++ B.
heh....
thats funny.
that guy tried to clean up my code, but he actually screwed it up... :)
well, thanks to both of you anyway.
yeah! it works!
thanks a lot.
my player wont move for some reason....
my start button exit works....
must be something with the graphics...
dont i need a sceWaitVblankStart() in there somewhere?
not sure, by all means it should, try loading any thing that has to move/sprites, normal way like,
Image* playerimg = loadImage("./sprites/player.png");
or something like that, im sure theres a work around for your problem so just wait till someone comes up with something better.....Zeegyboogydo
This is what I have, try it out. BTW your indentation is horrible..
Code:#include <pspdisplay.h>
#include <stdlib.h>
#include <pspctrl.h>
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspgu.h>
#include <png.h>
#include <stdio.h>
#include <time.h>
#include <psppower.h>
#include <pspaudio.h>
#include <pspaudiolib.h>
#include "graphics.h"
#include "mp3player.h"
#define true 1
#define false 0
PSP_MODULE_INFO("DotsC v0.0.3 Alpha", 0, 1, 1);
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common) {
sceKernelExitGame();
return 0;
}
/* Callback thread */
int CallbackThread(SceSize args, void *argp) {
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void) {
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid >= 0) {
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
char *path[13] = { "Player.png", //0
"Background.png", //1
"Spot.png", //2
"zero.png", //3
"one.png", //4
"two.png", //5
"three.png", //6
"four.png", //7
"five.png", //8
"six.png", //9
"seven.png", //10
"eight.png", //11
"nine.png"}; //12
int main()
{
srand(time(NULL));
SetupCallbacks();
pspDebugScreenInit();
initGraphics();
int spotx = rand()%(465);
int spoty = rand()%(257);
int x = 0;
int y = 0;
int Scoreo = 0;
int Scoret = 0;
int Scoreh = 0;
int Scoreth = 0;
SceCtrlData pad;
Image* images[14];
int i;
for(i = 0; i < 13; i++)
{
images[i] = loadImage(path[i]);
}
while(1)
{
if (x + 32 > spotx && x < spotx + 16 && y + 32 > spoty && y < spoty + 16)
{
Scoreo = Scoreo + 2;
spotx = rand()%(465);
spoty = rand()%(257);
}
if (Scoreo == 10)
{
Scoreo = 0;
Scoret++;
}
if (Scoret == 10)
{
Scoret = 0;
Scoreh++;
}
if (Scoreh == 10)
{
Scoreh = 0;
Scoreth++;
}
if (x < 0){x = 0;}
if (y < 0){y = 0;}
if (x > 448){x = 448;}
if (y > 240){y = 240;}
sceCtrlReadBufferPositive(&pad, 1);
if(pad.Buttons & PSP_CTRL_RIGHT){x += 5;}
if(pad.Buttons & PSP_CTRL_LEFT){x -= 5;}
if(pad.Buttons & PSP_CTRL_UP){y -= 5;}
if(pad.Buttons & PSP_CTRL_DOWN){y += 5;}
//image loop- I don't know if your character array is correct, didn't look. If if is correct this should work.
blitAlphaImageToScreen(0 ,0 ,32 , 32, images[0], x, y);
blitAlphaImageToScreen(0 ,0 ,480 , 272, images[1], 0, 0);
blitAlphaImageToScreen(0 ,0 ,16 , 16, images[2], spotx, spoty);
blitAlphaImageToScreen(0, 0, 15 ,15, images[Scoreo + 3], 50, 1);
blitAlphaImageToScreen(0, 0, 15 ,15, images[Scoret + 3], 35, 1);
blitAlphaImageToScreen(0 ,0 ,15 ,15, images[Scoreh + 3], 20, 1);
blitAlphaImageToScreen(0 ,0 ,15 ,15, images[Scoreth + 3], 5, 1);
flipScreen();
}
sceKernelSleepThread();
return 0;
}
I want to load recovery menu from a prx with an eboot. heres my code:
when I run the app this appears on my psp screenCode:#include <pspkernel.h>
#include <pspdebug.h>
#include <pspdisplay.h>
#include <pspsdk.h>
#include <string.h>
#include <pspctrl.h>
#include <stdio.h>
#include <stdlib.h>
PSP_MODULE_INFO("LAUNCH_RECOV", 0x1000, 1, 1);
PSP_MAIN_THREAD_ATTR(0);
#define printf pspDebugScreenPrintf
int exit_callback(int arg1, int arg2, void *arg)
{
sceKernelExitGame();
return 0;
}
void CallbackThread(void *arg)
{
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
}
int SetupCallbacks(void)
{
int thid = 0;
thid = sceKernelCreateThread("update_thread", (void*) CallbackThread, 0x11, 0xFA0, 0xa0000000, 0);
if(thid >= 0)
{
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
void restart()
{
sceKernelExitGame();
}
SceUID load_module(const char *path, int flags, int type)
{
SceKernelLMOption option;
SceUID mpid;
if (type == 0) {
mpid = 1;
} else {
mpid = 2;
}
memset(&option, 0, sizeof(option));
option.size = sizeof(option);
option.mpidtext = mpid;
option.mpiddata = mpid;
option.position = 0;
option.access = 1;
return sceKernelLoadModule(path, flags, type > 0 ? &option : NULL);
}
void *getModuleInfo(void);
int main(void)
{
SceUID modid;
SceModule *mod;
pspDebugScreenInit();
pspDebugInstallKprintfHandler(NULL);
pspDebugInstallErrorHandler(NULL);
pspDebugInstallStdoutHandler(pspDebugScreenPrintData);
pspSdkInstallNoPlainModuleCheckPatch();
SetupCallbacks();
while (1)
{
SceCtrlData pad; sceCtrlPeekBufferPositive(&pad, 1);
if (pad.Buttons & PSP_CTRL_WLAN_UP){
modid = load_module("ms0:/recovery.prx", 0, 0);
}
else {
sceKernelExitGame();
}
sceKernelExitDeleteThread(0);
}
return 0;
}
obviously there is an error loading the prx but i cant see why. please helpCode:stdio.c : stdoutReopen : id=0x00000001
stdio.c : stdoutReopen : id=0x00000002
since i went over to c++ i have a problem with includes , if the first .o includes a header , it wont be anymore included by the second and it says , undeclarded :-SCode:#ifndef DESKTOP_H
#define DESKTOP_H
#include <stdlib.h>
#include <malloc.h>
#include <pspdisplay.h>
#include <psputils.h>
#include <png.h>
#include <pspgu.h>
#include <string.h>
#include "../main.h"
#include "../graphics/graphics.h"
#define imageDrawAlpha blitImage
#define START 0
#define BALK 1
#define IMAGE_ICON 2
#define EXE_ICON 3
#define FLASH_ICON 4
#define PSPFILE_ICON 5
#define AUDIO_ICON 6
#define UNKNOW_ICON 7
#define THISPSP_ICON 8
#define TEXT_ICON 9
#define FOLDER_ICON 10
int mainMenu(SceSize args, void *argp);
#endif