| View previous topic :: View next topic |
| Author |
Message |
zydeoN
Joined: 09 May 2009 Posts: 45
|
Posted: Mon May 11, 2009 8:40 am Post subject: Error running prx by PSPLink |
|
|
Hey, new here, but guess u can help me. Im trying to run a prx with psplink. But when i make ./image.prx in pspsh (i am using Eclipse) it gives the error | Quote: | | libpng error: Decompression error | and my psp goes blank...
The source is right here http://codepad.org/4ZQ9LXuu.
Makefile:
| Code: | TARGET = image
OBJS = main.o graphics.o framebuffer.o
CFLAGS = -O2 -G0 -Wall -g -pg
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
BUILD_PRX = 1
LIBDIR =
LIBS = -lpspgu -lpng -lz -lm -lpspgum
LDFLAGS =
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = image
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak |
Should i add something to the makefile or to the source? Help.. |
|
| Back to top |
|
 |
jojojoris
Joined: 30 Mar 2008 Posts: 261
|
Posted: Tue May 12, 2009 12:00 am Post subject: |
|
|
I didn't look at your source but i think you have to add
PSP_HEAP_SIZE_KB(10*1024)
after
PSP_MODULE_INFO(........)
This code will give your program acces to more RAM. (10*1024kb=10MB)
Normaly without this code your prx wil only use about 64kb of ram memory. _________________
| Code: | int main(){
SetupCallbacks();
makeNiceGame();
sceKernelExitGame();
} |
|
|
| Back to top |
|
 |
zydeoN
Joined: 09 May 2009 Posts: 45
|
Posted: Tue May 12, 2009 4:40 am Post subject: displaying image |
|
|
Solved, thanks... :D Btw, im trying to run a simple prx that displays an image but the psp goes blank and nothing happens then... Well here is the code, without callback:
| Code: | #include <pspdisplay.h>
#include <pspctrl.h>
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspgu.h>
#include <png.h>
#include <stdio.h>
#include "graphics.h"
#define printf pspDebugScreenPrintf
PSP_HEAP_SIZE_KB(10*1024);
PSP_MODULE_INFO("Image Display Program", 0, 1, 1);
int main()
{
pspDebugScreenInit();
SetupCallbacks();
initGraphics();
char buffer[200];
Image* ourImage;
sprintf(buffer, "example.png");
ourImage = loadImage(buffer);
if (!ourImage)
{
//Image load failed
printf("Image load failed!\n");
} else
{
sceDisplayWaitVblankStart();
int x = 1;
while(x == 1)
{
blitAlphaImageToScreen(0 ,0 ,400 , 150, ourImage, 1, 1);
x++;
}
}
sceKernelSleepThread();
return 0;
} |
The image to be loaded is that one (with 400x150 resolution) :
What am i doing wrong? :P |
|
| Back to top |
|
 |
psPea
Joined: 01 Sep 2007 Posts: 64
|
Posted: Tue May 12, 2009 6:27 am Post subject: |
|
|
| add filpScreen() after blitAlphaImageToScreen |
|
| Back to top |
|
 |
zydeoN
Joined: 09 May 2009 Posts: 45
|
Posted: Wed May 13, 2009 6:04 am Post subject: |
|
|
I just added and built the prx but the output is very weird... Here it is:
Well the pic is not perfect, but the image i presented before is outputed more than once and i guess not in 400x150, cause psp has 480x272 and the pic is so small compared to the its resolution. What could actually be wrong? :P
EDIT: well, i discovered recently that some images work perfectly while anothers (such as the one above) dont work.. There must be a rule to specific images work. However i will start using oslib, but if u guys knew more about that, i would appreciate you posted a reply.
EDIT 2: Finally, i discovered my problem. The images i used were created in Corel Draw. So if anybody has the same problem as mine, you should the following: when exporting the image as PNG (in Corel Draw) you have must do it without "Interlace Image" which is an option that appears in the exporting menu. This way, you can blit images to the screen :D (You may close the thread) |
|
| Back to top |
|
 |
|