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 

Image load failed... (prx)

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



Joined: 09 Jul 2008
Posts: 31

PostPosted: Sun Apr 26, 2009 6:04 pm    Post subject: Image load failed... (prx) Reply with quote

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:
#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(X, Y) ((X) > (Y) ? (X) : (Y))

//PSP_MODULE_INFO("APP", 0, 1, 1);
PSP_MODULE_INFO("APP", 0x800, 1, 0);
PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_VSH);




int main() {

  sceIoUnassign("flash0");
  sceIoAssign("flash0", "lflash0:0,0", "flashfat0:", IOASSIGN_RDWR, NULL, 0);
         
  char buffer[200];
  Image* test;
         
  pspDebugScreenInit();
  initGraphics();
         
  sprintf(buffer, "flash0:/test.png");
  test = loadImage(buffer);
         
  if (!test) {
    //Image load failed
    printf("Image load failed!\n");
  } else {
    sceDisplayWaitVblankStart(); 
    blitAlphaImageToScreen(0 ,0 ,200 , 200, test, 0, 0);

    flipScreen();
  }
 
  sceKernelSleepThread();
  return 0;
}



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

CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

BUILD_PRX = 1

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

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = test

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak


Thanks in advance! ;)


Last edited by -DaRealXecon- on Sun Apr 26, 2009 10:18 pm; edited 1 time in total
Back to top
View user's profile Send private message MSN Messenger
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Sun Apr 26, 2009 7:53 pm    Post subject: Reply with quote

You haven't defined the heap at all.
Back to top
View user's profile Send private message
-DaRealXecon-



Joined: 09 Jul 2008
Posts: 31

PostPosted: Sun Apr 26, 2009 10:28 pm    Post subject: Reply with quote

whats a "heap"? ._.
sorry for my very bad english :(
Back to top
View user's profile Send private message MSN Messenger
ardatan



Joined: 12 Jan 2008
Posts: 44

PostPosted: Mon Apr 27, 2009 2:20 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
-DaRealXecon-



Joined: 09 Jul 2008
Posts: 31

PostPosted: Mon Apr 27, 2009 3:54 am    Post subject: Reply with quote

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!!
Back to top
View user's profile Send private message MSN Messenger
Torch



Joined: 28 May 2008
Posts: 842

PostPosted: Mon Apr 27, 2009 11:03 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
-DaRealXecon-



Joined: 09 Jul 2008
Posts: 31

PostPosted: Sat May 02, 2009 12:22 am    Post subject: Reply with quote

Thanks for this tipp! ;)
Back to top
View user's profile Send private message MSN Messenger
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