| View previous topic :: View next topic |
| Author |
Message |
-DaRealXecon-
Joined: 09 Jul 2008 Posts: 31
|
Posted: Sun Apr 26, 2009 6:04 pm Post subject: Image load failed... (prx) |
|
|
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 |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Sun Apr 26, 2009 7:53 pm Post subject: |
|
|
| You haven't defined the heap at all. |
|
| Back to top |
|
 |
-DaRealXecon-
Joined: 09 Jul 2008 Posts: 31
|
Posted: Sun Apr 26, 2009 10:28 pm Post subject: |
|
|
whats a "heap"? ._.
sorry for my very bad english :( |
|
| Back to top |
|
 |
ardatan
Joined: 12 Jan 2008 Posts: 44
|
Posted: Mon Apr 27, 2009 2:20 am Post subject: |
|
|
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 |
|
 |
-DaRealXecon-
Joined: 09 Jul 2008 Posts: 31
|
Posted: Mon Apr 27, 2009 3:54 am Post subject: |
|
|
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 |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Mon Apr 27, 2009 11:03 pm Post subject: |
|
|
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 |
|
 |
-DaRealXecon-
Joined: 09 Jul 2008 Posts: 31
|
Posted: Sat May 02, 2009 12:22 am Post subject: |
|
|
| Thanks for this tipp! ;) |
|
| Back to top |
|
 |
|