![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
This is a discussion on Adding MP3 within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; can some add the mp3 player code in my source or give me the code. I tried it my self ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
|
can some add the mp3 player code in my source or give me the code. I tried it my self i and i cant get it. Oh and i want it to reapet.
Here is my source if you want it: Code:
/* HALO COMBAT EVOLVED
BY PSPFREAK9 FINISHED AT **-**-**
*/
#include <pspdisplay.h>
#include <pspctrl.h>
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspgu.h>
#include <png.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pspaudio.h>
#include <pspaudiolib.h>
#include <psppower.h>
#include <mp3player.h>
#include "graphics.h"
#define printf pspDebugScreenPrintf
#define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
PSP_MODULE_INFO("HALO COMBAT EVOLVED", 0, 1, 1);
/* 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;
}
int CursorXPosition = 0;
int CursorY = 0;
int imagesareloaded =0;
char buffer[200];
Image* ourImage;
Image* cursor;
void load_images(){
if(imagesareloaded ==0){
sprintf(buffer, "halo/Halo.png");
ourImage = loadImage(buffer);
sprintf(buffer, "cursor.PNG");
cursor = loadImage(buffer);
imagesareloaded =1;
}
}
int main() {while(1)
clearScreen(0);
sceCtrlReadBufferPositive(&pad, 1);
load_images();
if (!ourImage) {
//Image load failed
printf("Image load failed!\n");
} else {
int x = 0;
int y = 0;
sceDisplayWaitVblankStart();
while (x < 480) {
while (y < 272) {
blitAlphaImageToScreen(0 ,0 ,480 , 272, ourImage, x, y);
y += 272;
}
x += 480;
y = 0;
}
}
if (!cursor) {
//Image load failed
printf("Image load failed!\n");
} else {
sceDisplayWaitVblankStart();
blitAlphaImageToScreen(0 ,0 ,10 , 16, cursor, CursorXPosition += (pad.Lx -128) /30, CursorY += (pad.Ly -128) /30);
flipScreen();
}
}
sceKernelSleepThread();
return 0;
}
__________________
Need a GFX Guy for EBOOT ICONS, BACkGROUNDS?? I can help you there. Just see some of my work. PM me for GFX. |
|
|
|
|
|
|
#3 |
|
something like
main.o: In function `main': main.c .text+0x1f8): undefined reference to `MP3_Init'main.c .text+0x204): undefined reference to `MP3_Load'main.c .text+0x20c): undefined reference to `MP3_Play'main.c .text+0x240): undefined reference to `MP3_EndOfStream'main.c .text+0x35c): undefined reference to `MP3_Stop'main.c .text+0x364): undefined reference to `MP3_FreeTune'main.c .text+0x39c): undefined reference to `MP3_Pause'main.c .text+0x3b8): undefined reference to `MP3_EndOfStream'main.c .text+0x3cc): undefined reference to `MP3_Stop'collect2: ld returned 1 exit status make: *** [hello.elf] Error 1 By the way i deleted all my code of mP3 player from the source i gave you -= Double Post =- sry but the error happens to have symbols in it
Last edited by pspfreak9; 12-22-2006 at 02:14 PM.. Reason: Automerged Doublepost |
|
|
|
|
|
|
#5 |
|
Makefile:
TARGET = hello OBJS = main.o graphics.o framebuffer.o CFLAGS = -O2 -G0 -Wall CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti ASFLAGS = $(CFLAGS) LIBDIR = LIBS = -lpspgu -lpng -lz -lm -lmad -lpspaudiolib -lpspaudio -lpsppower LDFLAGS = EXTRA_TARGETS = EBOOT.PBP PSP_EBOOT_TITLE = HALO COMBAT EVOLVED PSP_EBOOT_ICON = ICON0.PNG PSPSDK=$(shell psp-config --pspsdk-path) include $(PSPSDK)/lib/build.mak |
|
|
|
|
|
|
#6 |
![]() ![]() QJ Gamer Silver
|
Assuming that you are compiling the C files, you need to link the mp3player object to this line:
Code:
OBJS = main.o graphics.o framebuffer.o Code:
OBJS = main.o mp3player.o graphics.o framebuffer.o |
|
|
|
|
|
#7 |
|
Man I'm so stupid i cant belive i didnt see that
-= Double Post =- Wait when I play my game it plays the music on a black screen that says play at *i cant remember the number*MHZ But i want it to play in the background of my game. -= Double Post =- anyone?? Last edited by pspfreak9; 12-22-2006 at 02:59 PM.. Reason: Automerged Doublepost |
|
|
|
|
![]() |
| Tags |
| adding , mp3 |
| Thread Tools | |
|
|