psplinkusb access other files
psplinkusb access other files
I have a SDL program that loads external bmp files. It works well when I compile it as EBOOT.PBP and transfer it to the PSP and run it the normal way. I then compiled it as prx and tried to run it with psplinkusb. The program starts, but it can't seem to find the bmp. What should I do to fix that?
Many thanks
EDIT: this is firmware 3.90 M33 with psplinkusb svn checked out yesterday, running the 3.0 OE version on the PSP.
Many thanks
EDIT: this is firmware 3.90 M33 with psplinkusb svn checked out yesterday, running the 3.0 OE version on the PSP.
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am
isn't the problem loading the image?
make sure is in the correct path.
if it is ./something/image.bmp
make sure its in inside the folder something which must be in the same directory as your EBOOT.PBP.
if it is ms0:/lalala, make the image is in there.
otherwise if you are sure hte path is correct. tell me if it says "error loading image" if you are doing any check like if (!image) print "error loading image"
do what I said if your problem is the last one I said
make sure is in the correct path.
if it is ./something/image.bmp
make sure its in inside the folder something which must be in the same directory as your EBOOT.PBP.
if it is ms0:/lalala, make the image is in there.
otherwise if you are sure hte path is correct. tell me if it says "error loading image" if you are doing any check like if (!image) print "error loading image"
do what I said if your problem is the last one I said
One thing to check, if you are running it on a *nix host make sure you match filename case. By default on systems with case sensitive file systems such as linux then the host file system is also case sensitive, ms fat fs is case insensitive.
You can disable case sensitivity in usbhostfs_pc with either the shell 'nocase on' command or the -c switch.
If this isn't your issue then make sure you are using relative paths from your location. As long as you are using an normal 'main' function then it will have set the current directory to the location where your application started, which should be host in this case. The current directory should work fine through sceIoOpen or open/fopen
And yes stdout/stderr should be hooked up to pspsh, so using printf or fprintf(stderr, ...) should display direct to your pc.
You can disable case sensitivity in usbhostfs_pc with either the shell 'nocase on' command or the -c switch.
If this isn't your issue then make sure you are using relative paths from your location. As long as you are using an normal 'main' function then it will have set the current directory to the location where your application started, which should be host in this case. The current directory should work fine through sceIoOpen or open/fopen
And yes stdout/stderr should be hooked up to pspsh, so using printf or fprintf(stderr, ...) should display direct to your pc.
Thanks for the replies.
The host is 64-bit x86 Linux.
I am assuming everything is case sensitive (everything is in lower case everywhere).
I am using SDL's SDL_LoadBMP(). It works fine if I copy the whole dir to PSP in USB Mode and run it from there (the EBOOT.PBP version).
My main:
The host is 64-bit x86 Linux.
I am assuming everything is case sensitive (everything is in lower case everywhere).
I am using relative paths (just the file name, in the working dir)If this isn't your issue then make sure you are using relative paths from your location. As long as you are using an normal 'main' function then it will have set the current directory to the location where your application started, which should be host in this case. The current directory should work fine through sceIoOpen or open/fopen
I am using SDL's SDL_LoadBMP(). It works fine if I copy the whole dir to PSP in USB Mode and run it from there (the EBOOT.PBP version).
My main:
Code: Select all
extern "C" {
int main(void);
}
int main(void) {
...
}
Ah, I see. I will give it a try once I get back to my development machine. I tried iostream and it didn't work. Nothing was printed (I did flush the stream with endl, as the first line of main).And yes stdout/stderr should be hooked up to pspsh, so using printf or fprintf(stderr, ...) should display direct to your pc.
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am
Still no luck printing to pspsh. I have simplified my code down to this
Nothing is printed on pspsh. I am calling the program from pspsh.
I can verify that the prx is actually updated by changing the module name (it is reflected here).
my Makefile:
I have commented out the SDL part.
Thanks
Code: Select all
#include <pspkernel.h>
#include <pspdisplay.h>
#include <cstdio>
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common) {
sceKernelExitGame();
return 0;
}
/* Callback thread */
int CallbackThread(SceSize args, void *argp) {
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void) {
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid >= 0) {
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
PSP_HEAP_SIZE_MAX();
PSP_MODULE_INFO("Hello World", 0, 1, 1);
extern "C" {
int main();
}
int main() {
SetupCallbacks();
printf("a\n");
sceKernelExitGame();
}
Code: Select all
host0:/proj/Test/> ./Test.prx
Load/Start host0:/proj/Test/Test.prx UID: 0x03EE3D7F Name: "Hello World"
host0:/proj/Test/> Resetting psplink
my Makefile:
Code: Select all
TARGET = Test
OBJS = main.o
BUILD_PRX=1
INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LDFLAGS =
LIBS = -L/usr/local/pspsdk/lib -lfreetype -lstdc++
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Test
PSPSDK=$(shell psp-config --pspsdk-path)
PSPBIN = $(PSPSDK)/../bin
#CFLAGS += $(shell $(PSPBIN)/sdl-config --cflags)
#CXXFLAGS += $(shell $(PSPBIN)/sdl-config --cflags)
#LIBS += $(shell $(PSPBIN)/sdl-config --libs)
include $(PSPSDK)/lib/build.mak
Thanks
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am