forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Error running prx by PSPLink

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
zydeoN



Joined: 09 May 2009
Posts: 45

PostPosted: Mon May 11, 2009 8:40 am    Post subject: Error running prx by PSPLink Reply with quote

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
View user's profile Send private message
jojojoris



Joined: 30 Mar 2008
Posts: 261

PostPosted: Tue May 12, 2009 12:00 am    Post subject: Reply with quote

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
View user's profile Send private message
zydeoN



Joined: 09 May 2009
Posts: 45

PostPosted: Tue May 12, 2009 4:40 am    Post subject: displaying image Reply with quote

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
View user's profile Send private message
psPea



Joined: 01 Sep 2007
Posts: 64

PostPosted: Tue May 12, 2009 6:27 am    Post subject: Reply with quote

add filpScreen() after blitAlphaImageToScreen
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
zydeoN



Joined: 09 May 2009
Posts: 45

PostPosted: Wed May 13, 2009 6:04 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group