It gives me this errors:
Code: Select all
psp-gcc -I. -IC:/pspsdk/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=400 -c
-o main.o main.c
main.c: In function 'Audio_Play':
main.c:106: warning: comparison between pointer and integer
main.c:106: warning: comparison with string literal results in unspecified behav
ior
main.c:109: warning: comparison between pointer and integer
main.c:109: warning: comparison with string literal results in unspecified behav
ior
main.c:117: warning: assignment makes integer from pointer without a cast
main.c:124: warning: assignment makes integer from pointer without a cast
main.c: In function 'Audio_Pause':
main.c:132: warning: comparison between pointer and integer
main.c:132: warning: comparison with string literal results in unspecified behav
ior
main.c:135: warning: comparison between pointer and integer
main.c:135: warning: comparison with string literal results in unspecified behav
ior
main.c: In function 'Audio_Stop':
main.c:143: warning: comparison between pointer and integer
main.c:143: warning: comparison with string literal results in unspecified behav
ior
main.c:146: warning: comparison between pointer and integer
main.c:146: warning: comparison with string literal results in unspecified behav
ior
main.c:152: warning: assignment makes integer from pointer without a cast
main.c:153: warning: control reaches end of non-void function
main.c: In function 'Audio_Pause':
main.c:139: warning: control reaches end of non-void function
main.c: In function 'Audio_Play':
main.c:129: warning: control reaches end of non-void function
psp-gcc -I. -IC:/pspsdk/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=400 -c
-o graphics.o graphics.c
psp-gcc -I. -IC:/pspsdk/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=400 -c
-o framebuffer.o framebuffer.c
psp-gcc -I. -IC:/pspsdk/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=400 -c
-o mp3player.o mp3player.c
psp-gcc -I. -IC:/pspsdk/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=400 -c
-o oggplayer.o oggplayer.c
oggplayer.c: In function 'OGGCallback':
oggplayer.c:73: warning: format '%d' expects type 'int', but argument 2 has type
'long unsigned int'
oggplayer.c: In function 'OGG_Load':
oggplayer.c:126: warning: unused variable 'size'
oggplayer.c: In function 'OGG_Init':
oggplayer.c:164: warning: passing argument 2 of 'pspAudioSetChannelCallback' fro
m incompatible pointer type
oggplayer.c: In function 'OGG_Play':
oggplayer.c:175: warning: assignment makes integer from pointer without a cast
oggplayer.c: In function 'OGG_Stop':
oggplayer.c:184: warning: assignment makes integer from pointer without a cast
oggplayer.c: In function 'OGG_Pause':
oggplayer.c:192: warning: assignment makes integer from pointer without a cast
oggplayer.c:197: warning: assignment makes integer from pointer without a cast
psp-gcc -I. -IC:/pspsdk/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=400 -L.
-LC:/pspsdk/psp/sdk/lib -specs=C:/pspsdk/psp/sdk/lib/prxspecs -Wl,-q,-TC:/pspsd
k/psp/sdk/lib/linkfile.prx main.o graphics.o framebuffer.o mp3player.o oggplay
er.o C:/pspsdk/psp/sdk/lib/prxexports.o -laac -lFLAC -lmad -lvorbisidec -lpspgu
-lpng -ljpeg -lz -lm -lmad -lpspaudiolib -lpspaudio -lpsphprm -lpspusb -lpspusbs
tor -lpspaudio -lpspaudiocodec -lpspkubridge -lpspsdk -lpspctrl -lpspumd -lpsprt
c -lpsppower -lpspgu -lpspaudiolib -lpspaudio -lm -lpspdebug -lpspdisplay -lpspg
e -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver
-lpsputility -lpspuser -lpspkernel -o FileBrowser.elf
psp-fixup-imports FileBrowser.elf
psp-prxgen FileBrowser.elf FileBrowser.prx
mksfo 'File Browser' PARAM.SFO
pack-pbp EBOOT.PBP PARAM.SFO NULL \
NULL NULL NULL \
NULL FileBrowser.prx NULL
[0] 408 bytes | PARAM.SFO
[1] 0 bytes | NULL
[2] 0 bytes | NULL
[3] 0 bytes | NULL
[4] 0 bytes | NULL
[5] 0 bytes | NULL
[6] 665838 bytes | FileBrowser.prx
[7] 0 bytes | NULL
main:
Code: Select all
#define VERS 1
#define REVS 0
#define MODE_REPEAT 1
extern char *RequestFile(char *);
PSP_MODULE_INFO("File browser", 0, VERS, REVS);
PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER);
PSP_HEAP_SIZE_MAX();
int exit_callback(int arg1, int arg2, void *common) {
sceKernelExitGame();
return 0;
}
int CallbackThread(SceSize args, void *argp) {
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
int SetupCallbacks(void) {
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid >= 0) {
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
int Audio_Play(char *filename){
char* suffix = strrchr(filename, '.');
if(MediaType=="mp3"){
MP3_End();
}
else if(MediaType=="ogg"){
OGG_End();
}
if (stricmp(suffix, ".mp3") == 0) {
MP3_Init(1);
MP3_Load(filename);
MediaType = "mp3";
MP3_Play();
}
else if (stricmp(suffix, ".ogg") == 0) {
OGG_Init(1);
OGG_Load(filename);
MediaType = "ogg";
OGG_Play();
}
//Doesnt work :(
}
int Audio_Pause(){
if(MediaType=="mp3"){
MP3_Pause();
}
else if(MediaType=="ogg"){
OGG_Pause();
}
}
int Audio_Stop(){
if(MediaType=="mp3"){
MP3_End();
}
else if(MediaType=="ogg"){
OGG_End();
}
MediaType=0;
MediaStatus = "stop";
}
int main()
{
pspDebugScreenInit();
SetupCallbacks();
initGraphics();
pspAudioInit();
char fileToPlay[257] = "";
Audio_Play(fileToPlay);
char * testDirectory = dirBrowse("ms0:");
for(;;)
{
fillScreenRect(WHITE, 0, 0, 480, 272);
centerText(480/2, 272/2, testDirectory, 50, 0); // Show the path that 'testDirectory' was supposed to recieve from dirBrowse();
flipScreen();
sceDisplayWaitVblankStart();
}
pspAudioEnd();
sceKernelSleepThread();
return 0;
}
Code: Select all
TARGET = FileBrowser
OBJS = main.o graphics.o framebuffer.o mp3player.o oggplayer.o
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBS = -laac -lmad -lvorbisidec -lpspgu -lpng -ljpeg -lz -lm -lpspaudiolib -lpspaudio -lpsphprm -lpspusb -lpspusbstor -lpspaudio -lpspaudiocodec -lpspkubridge \
-lpspsdk -lpspctrl -lpsppower
PSP_FW_VERSION = 400
BUILD_PRX = 1
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = File Browser
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
Code: Select all