C/C++ Programming Help Thread
This is a discussion on C/C++ Programming Help Thread within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; The XMB does a lot of different things, and you should avoid calling those certain functions, best suggestion would be ...
-
12-08-2007, 08:47 AM #7051I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
The XMB does a lot of different things, and you should avoid calling those certain functions, best suggestion would be to look at the source code from the DSX library so you have some idea of what needs to be done. It would be best to look at how to draw a rectangle, as I think its a bit more detailed than the font.
Can any suggest what I need to do in order to load an alternative pspbtcnf.bin file, its still plauging me?
-Aura
-
12-08-2007, 05:09 PM #7052QJ Gamer Silver

- Registriert seit
- May 2006
- Ort
- Behind you.
- Beiträge
- 1.814
- Points
- 10.921
- Level
- 69
- Downloads
- 0
- Uploads
- 0
Quick question:
I have the oggplayer.c and .h files, but how do i install the libs and what do i put in my makefile? I searched insomniac's website, but his ogg player page wasn't opening. Thanks! ;)Calypso - Enjoy the excellent 2D space shooter:
http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195
"Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)
-
12-08-2007, 05:16 PM #7053I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
You just add the .o files to the "OBJS" section, for example:
and then include oggplayer.h in the headers...Code:TARGET = TARGET_NAME OBJS =\ main.o\ oggplayer.o
-Aura
-
12-08-2007, 06:36 PM #7054QJ Gamer Silver

- Registriert seit
- May 2006
- Ort
- Behind you.
- Beiträge
- 1.814
- Points
- 10.921
- Level
- 69
- Downloads
- 0
- Uploads
- 0
I have libtremor saved, but i click "make install" and nothing happens.
Calypso - Enjoy the excellent 2D space shooter:
http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195
"Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)
-
12-08-2007, 06:55 PM #7055OMFG

- Registriert seit
- Jul 2005
- Ort
- Toronto
- Beiträge
- 2.814
- Points
- 19.453
- Level
- 88
- Downloads
- 0
- Uploads
- 0
You should be cd'ing' into the libtremor folder with cygwin, and then typing 'make' then 'make install'
-
12-08-2007, 06:56 PM #7056QJ Gamer Silver

- Registriert seit
- May 2006
- Ort
- Behind you.
- Beiträge
- 1.814
- Points
- 10.921
- Level
- 69
- Downloads
- 0
- Uploads
- 0
I did that. But i found out how to work it. In fact, i also encountered something amazing!!!
http://forums.ps2dev.org/viewtopic.php?t=8829
Installing now....after all those years.........
-= Double Post =-
Ok, i installed libogg. Then libTremor. However, when i put "-lTremor" in my include file, the program says it can't find it (already followed the README.PSP)...?
Could anyone please help?
Still Struggling with this!!Geändert von SuperBatXS (12-10-2007 um 02:11 PM Uhr) Grund: Automerged Doublepost
Calypso - Enjoy the excellent 2D space shooter:
http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195
"Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)
-
12-10-2007, 06:45 PM #7057QJ Gamer Blue
- Registriert seit
- Aug 2006
- Ort
- c:\Program Files\World of Warcraft\WoW.exe
- Beiträge
- 98
- Points
- 4.031
- Level
- 40
- Downloads
- 0
- Uploads
- 0
Does anyone know anything about time-based animations?
I need to know some function that returns a time or something...
-
12-10-2007, 07:13 PM #7058
Look in:
Zitat von Nicko01
X:/cygwin/usr/local/pspdev/psp/sdk/include/psprtc.h
or
X:/cygwin/usr/local/pspdev/psp/include/time.h
The first are PSP specific functions, where the ones are universal for all C/C++.[IMG]http://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Zoso.svg/744px-Zoso.svg.png[/IMG]
Looking for some good C programming tutorials for the PSP? Look no further! [URL="http://psp-coding.com/"]PSP-Coding.com[/URL] is your source for all your PSP coding needs.
-
12-10-2007, 07:32 PM #7059QJ Gamer Silver

- Registriert seit
- May 2006
- Ort
- Behind you.
- Beiträge
- 1.814
- Points
- 10.921
- Level
- 69
- Downloads
- 0
- Uploads
- 0
Agh....after so many hours of waiting for an answer, i thought this was a response to my question. :Argh:
Calypso - Enjoy the excellent 2D space shooter:
http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195
"Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)
-
12-11-2007, 10:05 AM #7060I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Don't complain, I've been asking for a few days about how to load a pspbtcnf file, and no reply...
Zitat von TMNT
I've got this so far, I basically copied from the 3.40OE-A source code, and commented out the stuff I didn't need, but no luck:
Am I missing something blindingly obvious?Code:struct SceKernelLoadExecVSHParam param; //u32 vshmain_args[0x20/4]; memset(¶m, 0, sizeof(param)); //memset(vshmain_args, 0, sizeof(vshmain_args)); //vshmain_args[0/4] = 0x0400; //vshmain_args[4/4] = 0x20; //vshmain_args[0x14/4] = error; param.size = sizeof(param); //param.args = 0x400; //param.argp = vshmain_args; //param.vshmain_args_size = 0x400; //param.vshmain_args = vshmain_args; param.configfile = "/kn/pspbtcnf_p4bu.bin";
-Aura
-
12-11-2007, 12:45 PM #7061
- Registriert seit
- Feb 2007
- Beiträge
- 4
- Points
- 3.494
- Level
- 36
- Downloads
- 0
- Uploads
- 0
-
12-11-2007, 05:41 PM #7062QJ Gamer Silver

- Registriert seit
- May 2006
- Ort
- Behind you.
- Beiträge
- 1.814
- Points
- 10.921
- Level
- 69
- Downloads
- 0
- Uploads
- 0
Hey guys,
So i gave up on libogg since i couldn't get it installed. However, i tried using an mp3 decoder by cooleyes (http://forums.ps2dev.org/viewtopic.p...=mp3&start=30), and i always get this error:
undefined reference to sceAudiocodecCheckNeedMem .
If anyone could help me on this. Also, i tried to put comments on those lines that got me an error, and it compiled perfectly. I then ran the program, and the home button was working fine except the mp3 wasn't playing. Could someone please help? I am still having problems getting decent speed with my mp3's (without overclocking psp).Calypso - Enjoy the excellent 2D space shooter:
http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195
"Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)
-
12-11-2007, 05:44 PM #7063It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
-lpspaudiocodec
;)pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
12-11-2007, 05:46 PM #7064QJ Gamer Silver

- Registriert seit
- May 2006
- Ort
- Behind you.
- Beiträge
- 1.814
- Points
- 10.921
- Level
- 69
- Downloads
- 0
- Uploads
- 0
Makefile:
If you can help me get either this mp3 decoder or libogg working, i will NEVER forget you...Code:TARGET = hello OBJS = main.o ./includes/graphics.o ./includes/framebuffer.o ./includes/mp3player.o ./includes/wavloader.o CFLAGS = -O2 -G0 -Wall CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti ASFLAGS = $(CFLAGS) LIBDIR = LIBS = -lpspgu -lpng -lz -lm -lpsppower -lmad -lpspaudiolib -lpspaudio -lmikmod -lmmio -lpspaudiocodec -lpspmpeg -losl -lpspumd -lpspsdk -lpsprtc LDFLAGS = EXTRA_TARGETS = EBOOT.PBP PSP_EBOOT_TITLE = Blah Blah PSPSDK=$(shell psp-config --pspsdk-path) include $(PSPSDK)/lib/build.mak
Calypso - Enjoy the excellent 2D space shooter:
http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195
"Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)
-
12-11-2007, 05:51 PM #7065It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
I've gotten it working before...I can't see why I can't get it working now ._.
That should have done it. Still same error?
...also, why are you still linking libmad?pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
12-11-2007, 05:53 PM #7066QJ Gamer Silver

- Registriert seit
- May 2006
- Ort
- Behind you.
- Beiträge
- 1.814
- Points
- 10.921
- Level
- 69
- Downloads
- 0
- Uploads
- 0
Yes, i am linking libmad. New makefile:
Code:TARGET = hello OBJS = main.o CFLAGS = -O2 -G0 -Wall CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti ASFLAGS = $(CFLAGS) LIBDIR = LIBS = -lpspgu -lpng -lz -lm -lpsppower -lpspaudiolib -lpspaudio -lmikmod -lmmio -lpspaudiocodec -lpspmpeg -losl -lpspumd -lpspsdk -lpsprtc LDFLAGS = EXTRA_TARGETS = EBOOT.PBP PSP_EBOOT_TITLE = Blah PSPSDK=$(shell psp-config --pspsdk-path) include $(PSPSDK)/lib/build.mak
And thanks a LOT for trying to help! ;)
And same error, btw.Calypso - Enjoy the excellent 2D space shooter:
http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195
"Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)
-
12-11-2007, 05:55 PM #7067
Don't forget that some libs are reliant on others, so you may need to re-arrange the libs in order for it to work correctly.
[IMG]http://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Zoso.svg/744px-Zoso.svg.png[/IMG]
Looking for some good C programming tutorials for the PSP? Look no further! [URL="http://psp-coding.com/"]PSP-Coding.com[/URL] is your source for all your PSP coding needs.
-
12-11-2007, 05:59 PM #7068QJ Gamer Silver

- Registriert seit
- May 2006
- Ort
- Behind you.
- Beiträge
- 1.814
- Points
- 10.921
- Level
- 69
- Downloads
- 0
- Uploads
- 0
I just realized that, and i reordered my libs:
-lpsppower -lpspmpeg -lpspaudiocodec -lpspaudio -lm
That's the order in the makefile of the example of the mp3 decoder. However, even then i am getting the same error. I must be missing a file (no other logical reason). What files should i reinstall/install?Calypso - Enjoy the excellent 2D space shooter:
http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195
"Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)
-
12-11-2007, 06:32 PM #7069
Can you post your exact errors? (Or link to them if they've already been posted?)
Zitat von TMNT
[IMG]http://upload.wikimedia.org/wikipedia/commons/thumb/c/c5/Zoso.svg/744px-Zoso.svg.png[/IMG]
Looking for some good C programming tutorials for the PSP? Look no further! [URL="http://psp-coding.com/"]PSP-Coding.com[/URL] is your source for all your PSP coding needs.
-
12-11-2007, 06:34 PM #7070QJ Gamer Silver

- Registriert seit
- May 2006
- Ort
- Behind you.
- Beiträge
- 1.814
- Points
- 10.921
- Level
- 69
- Downloads
- 0
- Uploads
- 0
Sure:
Thank you for helping me!Code:[email protected] ~ $ cd projects/d [email protected] ~/projects/d $ make psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -L. -L/usr/local/ pspdev/psp/sdk/lib main.o -lpsppower -lpspmpeg -lpspaudiocodec -lpspaudio -lm -lpspgum -lpspgu -lpsprtc -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o hello.elf main.o: In function `main': main.c:(.text+0x2a0): undefined reference to `sceAudiocodecCheckNeedMem' collect2: ld returned 1 exit status make: *** [hello.elf] Error 1
Calypso - Enjoy the excellent 2D space shooter:
http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195
"Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)
-
12-11-2007, 06:43 PM #7071It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
make clean and then make and post the full results of that.
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
12-11-2007, 06:43 PM #7072QJ Gamer Silver

- Registriert seit
- May 2006
- Ort
- Behind you.
- Beiträge
- 1.814
- Points
- 10.921
- Level
- 69
- Downloads
- 0
- Uploads
- 0
Edit: Never Mind b/c.....
I finally got libogg working!!!
This is WAY smoother than libmad. It doesn't seem to slow down the FPS of my game at all.Geändert von SuperBatXS (12-11-2007 um 08:43 PM Uhr)
Calypso - Enjoy the excellent 2D space shooter:
http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195
"Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)
-
12-12-2007, 02:06 AM #7073I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
I have an electronics exam coming up after my January exams, and I'm basing certain parts on the PSP (hopefully), and I was wondering if anyone who knows about the remote control can tell me how fesible this is:
I load an app to read the remote control ports, and send a serial input at a relatively fast speed (about 1MHz) and after reading the inputs, decode it and display the data on the screen. I can make the app easy enough, but I'm not sure about the hardware, mainly, does the remote send a pulse, or does it infact send a series of pulses when a button is pressed? Is there anyway I could detect this? And is there any connectors that I can use to place in the headphone port, other than either making my own or disecting the supplied remote?
If anyone could help me I would be seriously thankful as I'd like to start work on it now :)
Thanks
-Aura
-
12-12-2007, 02:43 AM #7074QJ Gamer Bronze

- Registriert seit
- Aug 2007
- Ort
- Australia
- Beiträge
- 659
- Points
- 8.045
- Level
- 60
- Downloads
- 0
- Uploads
- 0
i think on ps2dev (i think) i saw a bit about some guys who pulled a part the headphone jack and stuff and had a whole stack of info and stuff about. i cant remember if it had anything about what your asking but it might be worth doing a search there
-
12-12-2007, 07:10 AM #7075I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Cheers, definatly sounds like the sort of thing I'm looking for, I'll take a look :)
-Aura
-
12-12-2007, 01:50 PM #7076QJ Gamer Silver

- Registriert seit
- May 2006
- Ort
- Behind you.
- Beiträge
- 1.814
- Points
- 10.921
- Level
- 69
- Downloads
- 0
- Uploads
- 0
Hey guys,
I just put my app into kernel mode, but now the home exit button doesn't work. Btw, i am using 3.52 M33, and i have my eboot in the GAME150 folder. Here is my callback:
Code:/* 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; } /* setup the callback thread */ int SetupCallbacks(void){ int thid = 0; thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0); if(thid >= 0) sceKernelStartThread(thid, 0, 0); return thid; }Calypso - Enjoy the excellent 2D space shooter:
http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195
"Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)
-
12-12-2007, 02:04 PM #7077It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Change the attributes of the thread so it starts in user mode.
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
12-12-2007, 02:26 PM #7078QJ Gamer Silver

- Registriert seit
- May 2006
- Ort
- Behind you.
- Beiträge
- 1.814
- Points
- 10.921
- Level
- 69
- Downloads
- 0
- Uploads
- 0
How? Could you show me?
Zitat von Archaemic
Calypso - Enjoy the excellent 2D space shooter:
http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195
"Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)
-
12-12-2007, 02:35 PM #7079
The remote port is a basic serial port:
Zitat von Auraomega
http://nil.rpc1.org/psp/remote.html
there are already nice functions for sending/recieving data from the serial port
look into the debug utility library and you'll find:
void pspDebugSioPutchar (int ch)
Put a character to the remote sio.
int pspDebugSioGetchar (void)
Get a character from the remote sio.
void pspDebugSioPuts (const char *str)
Write a string to the sio port.
int pspDebugSioPutData (const char *data, int len)
Write a set of data to the sio port.
int pspDebugSioPutText (const char *data, int len)
Write a set of data to the sio port converting single line feeds to CRLF and single CR to CRLF.
void pspDebugSioInit (void)
Initialise the remote SIO port (defaults to 4800 8N1).
void pspDebugSioSetBaud (int baud)
Set the baud rate of the SIO, e.g.
If you want to read input from the remote control see http://psp.jim.sh/pspsdk-doc/group__Hprm.htmlrobot mafia
-
12-12-2007, 04:30 PM #7080I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Thanks, the first link doesn't appear to work...
I'm looking mainly for a pinout connection, including the voltages required (I don't want to put more voltage into the PSP than is safe), and I'd like to find out what the minimum amount of pulses I can recieve is, say around a nibble (I don't need many options, maybe enough for BCD to make decoding easier).
-Aura


LinkBack URL
About LinkBacks

Mit Zitat antworten

Hello everyone I am new here and I am glad to be part of this amazing community and I think there...
New to forum