Image load failed... (prx)

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

Moderators: cheriff, TyRaNiD

Post Reply
-DaRealXecon-
Posts: 31
Joined: Wed Jul 09, 2008 7:50 am

Image load failed... (prx)

Post by -DaRealXecon- »

Hi,

i would like to create my own custom xmb...
but when i flash my prx file (named vshmain.prx) the image can't be loaded... :(

heres my source... :P

Code: Select all

#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
#define MAX&#40;X, Y&#41; &#40;&#40;X&#41; > &#40;Y&#41; ? &#40;X&#41; &#58; &#40;Y&#41;&#41; 

//PSP_MODULE_INFO&#40;"APP", 0, 1, 1&#41;; 
PSP_MODULE_INFO&#40;"APP", 0x800, 1, 0&#41;;
PSP_MAIN_THREAD_ATTR&#40;PSP_THREAD_ATTR_VSH&#41;; 




int main&#40;&#41; &#123;

  sceIoUnassign&#40;"flash0"&#41;;
  sceIoAssign&#40;"flash0", "lflash0&#58;0,0", "flashfat0&#58;", IOASSIGN_RDWR, NULL, 0&#41;; 
          
  char buffer&#91;200&#93;;
  Image* test; 
          
  pspDebugScreenInit&#40;&#41;;
  initGraphics&#40;&#41;; 
          
  sprintf&#40;buffer, "flash0&#58;/test.png"&#41;;
  test = loadImage&#40;buffer&#41;; 
          
  if &#40;!test&#41; &#123;
    //Image load failed
    printf&#40;"Image load failed!\n"&#41;;
  &#125; else &#123; 
    sceDisplayWaitVblankStart&#40;&#41;;  
    blitAlphaImageToScreen&#40;0 ,0 ,200 , 200, test, 0, 0&#41;;

    flipScreen&#40;&#41;;
  &#125; 
  
  sceKernelSleepThread&#40;&#41;;
  return 0;
&#125;

Code: Select all

TARGET = vshmain
OBJS = main.o graphics.o framebuffer.o

CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $&#40;CFLAGS&#41; -fno-exceptions -fno-rtti
ASFLAGS = $&#40;CFLAGS&#41;

BUILD_PRX = 1

LIBDIR =
LIBS = -lpspgu -lpng -lz -lm
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = test

PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;
include $&#40;PSPSDK&#41;/lib/build.mak 
Thanks in advance! ;)
Last edited by -DaRealXecon- on Sun Apr 26, 2009 10:18 pm, edited 1 time in total.
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

You haven't defined the heap at all.
-DaRealXecon-
Posts: 31
Joined: Wed Jul 09, 2008 7:50 am

Post by -DaRealXecon- »

whats a "heap"? ._.
sorry for my very bad english :(
ardatan
Posts: 44
Joined: Sat Jan 12, 2008 8:47 am

Post by ardatan »

PSP_HEAP_SIZE_KB(-256);
or
PSP_HEAP_SIZE_MAX();
defines the heap memory which will be allocated...
You can look for the words which you don't know in your dictionary etc...
I'm sorry for my bad English.
-DaRealXecon-
Posts: 31
Joined: Wed Jul 09, 2008 7:50 am

Post by -DaRealXecon- »

IT WORKS!! THANKS A LOT!! :)

after a year it works finally!
Next time, I must ask immediately here. :D

I love this day! :) <3

Thanks!!
User avatar
Torch
Posts: 825
Joined: Wed May 28, 2008 2:50 am

Post by Torch »

You will have only 2.5MiB free on a Phat and around 27MiB free on a Slim if you simply replace vshmain.prx.

You should also dummy paf.prx to prevent allocation of memory, then you will have a lot more free space.
-DaRealXecon-
Posts: 31
Joined: Wed Jul 09, 2008 7:50 am

Post by -DaRealXecon- »

Thanks for this tipp! ;)
Post Reply