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; Posting all the errors would be the best option. We can't see your screen from way over here....
-
06-11-2008, 02:16 PM #8671Developer

- Registriert seit
- Mar 2006
- Beiträge
- 1.026
- Points
- 7.577
- Level
- 58
- Downloads
- 0
- Uploads
- 0
Posting all the errors would be the best option.
We can't see your screen from way over here.

Check out my homebrew & C tutorials at http://insomniac.0x89.org/
Coder formerly known as Insomniac197
tshirtz: what is irshell ??
Atarian_: it's where people who work for the IRS go when they die
-
06-11-2008, 02:35 PM #8672NetGameOrb Maker

- Registriert seit
- Jan 2008
- Ort
- New York
- Beiträge
- 683
- Points
- 6.138
- Level
- 50
- My Mood
-
- Downloads
- 2
- Uploads
- 0
GameLive name changed to NetGameOrb, Project is now online in Beta stage. Everyone encourage to register so they get news about the project and ability to play the games with NetGameOrb Support online. More info on site.
Stats Blog:http://netgameorb.blogspot.com/
Website:http://www.netgameorb.com/
-
06-11-2008, 03:28 PM #8673QJ Gamer Green
- Registriert seit
- May 2008
- Beiträge
- 96
- Points
- 3.008
- Level
- 33
- Downloads
- 0
- Uploads
- 0
-
06-12-2008, 03:48 AM #8674QJ Gamer Green
- Registriert seit
- May 2008
- Beiträge
- 96
- Points
- 3.008
- Level
- 33
- Downloads
- 0
- Uploads
- 0
-
06-12-2008, 04:29 AM #8675Developer

- Registriert seit
- Mar 2006
- Beiträge
- 1.026
- Points
- 7.577
- Level
- 58
- Downloads
- 0
- Uploads
- 0
Install mikmod.

Check out my homebrew & C tutorials at http://insomniac.0x89.org/
Coder formerly known as Insomniac197
tshirtz: what is irshell ??
Atarian_: it's where people who work for the IRS go when they die
-
06-12-2008, 05:14 AM #8676QJ Gamer Green
- Registriert seit
- May 2008
- Beiträge
- 96
- Points
- 3.008
- Level
- 33
- Downloads
- 0
- Uploads
- 0
I've installed mikmod still getting SAME errors, I've installed same as this guy on the ps2dev forum: http://forums.ps2dev.org/viewtopic.p...a145725347af27
-
06-12-2008, 10:05 AM #8677QJ Gamer Green
- Registriert seit
- May 2008
- Beiträge
- 96
- Points
- 3.008
- Level
- 33
- Downloads
- 0
- Uploads
- 0
Error Lines 74 till 92 are fixed, I just need the last line to be fixed...
-
06-13-2008, 01:12 PM #8678NetGameOrb Maker

- Registriert seit
- Jan 2008
- Ort
- New York
- Beiträge
- 683
- Points
- 6.138
- Level
- 50
- My Mood
-
- Downloads
- 2
- Uploads
- 0
GameLive name changed to NetGameOrb, Project is now online in Beta stage. Everyone encourage to register so they get news about the project and ability to play the games with NetGameOrb Support online. More info on site.
Stats Blog:http://netgameorb.blogspot.com/
Website:http://www.netgameorb.com/
-
06-14-2008, 01:38 PM #8679
- Registriert seit
- Apr 2008
- Beiträge
- 47
- Points
- 2.658
- Level
- 31
- Downloads
- 0
- Uploads
- 0
I've been having some trouble with the "sceRtcGetCurrentClockLoc alTime" function from <psprtc.h>. I wrote a brief program to test whether it works at all and I keep getting a compiler error.
Here's the code: (callbacks and module info are in main.h)
and I keep getting this error:Code:#include <pspkernel.h> #include <pspdebug.h> #include <pspdisplay.h> #include <pspctrl.h> #include <psprtc.h> #include "main.h" int main() { pspDebugScreenInit(); SetupCallbacks(); pspTime now; while(1) { sceRtcGetCurrentClockLocalTime(&now); pspDebugScreenClear(); pspDebugScreenPrintf("%i:%i", now.hour, now.minutes); } }
main.o: In function `main':
main.c
.text+0x78): undefined reference to `sceRtcGetCurrentClockLoc alTime'
collect2: ld returned 1 exit status
make: *** [clock.elf] Error 1
Anyone know how I can get past this?
-
06-14-2008, 01:43 PM #8680QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
make sure your linking to the rtc library
1. Failed....again...
2. http://slicer.gibbocool.com/ stay updated on all my projects
3. it'll be 5 years in june, that's nearly 1/4 of my life on this planet that i've visited these forums, what a ride it has been
-
06-14-2008, 01:46 PM #8681
- Registriert seit
- Apr 2008
- Beiträge
- 47
- Points
- 2.658
- Level
- 31
- Downloads
- 0
- Uploads
- 0
I don't know how to do that. Should I put something in the makefile? I don't understand why it wouldn't work the same way the other includes from the same library do. Sorry, I'm still sort of a noob.
-
06-14-2008, 02:13 PM #8682Developer

- Registriert seit
- Mar 2006
- Beiträge
- 1.026
- Points
- 7.577
- Level
- 58
- Downloads
- 0
- Uploads
- 0
Add -lpsprtc to the LIBS line in your makefile.

Check out my homebrew & C tutorials at http://insomniac.0x89.org/
Coder formerly known as Insomniac197
tshirtz: what is irshell ??
Atarian_: it's where people who work for the IRS go when they die
-
06-14-2008, 02:19 PM #8683
- Registriert seit
- Apr 2008
- Beiträge
- 47
- Points
- 2.658
- Level
- 31
- Downloads
- 0
- Uploads
- 0
Thanks, guys.
-
06-15-2008, 05:46 AM #8684QJ Gamer Bronze
- Registriert seit
- Apr 2008
- Ort
- Ireland
- Beiträge
- 978
- Points
- 6.517
- Level
- 52
- Downloads
- 0
- Uploads
- 0
Ok guys so say i wanted to make a hello world with an image. For example heres what i want it to do.
instead of the text hello world!
i want it to be an image saying hello world!
ok so would i do this?
I know im doing something wrong if someone could fix the code or tell me what im doing wrong that would be great.Code:#include <pspkernel.h> // PSP kernel functions include file. #include <pspdebug.h> // PSP debug functions include file. // Set the Application Information PSP_MODULE_INFO("Hello World", 0, 1, 1); #define printf pspDebugScreenPrintf // Exit Callback int exit_callback(int arg1, int arg2, void *common) { sceKernelExitGame(); // Exit the app return 0; } // Callback thread. int CallbackThread(SceSize args, void *argp) { // Local vars int cbid; // Create the exit callback in for the PSP shell. cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL); sceKernelRegisterExitCallback(cbid); // Sleep the kernel until we tell it to exit. sceKernelRegisterExitCallback(cbid); //NEW sceKernelSleepThreadCB(); // Return success. return 0; } // Set up the callback thread and return the thread ID. int SetupCallbacks(void) { // Local vars. int thid = 0; // ** Thread ID. ** // Create the thread. thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0); if (thid >= 0) { sceKernelStartThread(thid, 0, 0); } //NEW return 0; } // Main Function. int main() { pspDebugScreenInit(); SetupCallbacks(); loadImage("HelloWorld.png"); sceKernelSleepThread(); return 0; }
-
06-15-2008, 05:50 AM #8685Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
Go look at psp-programming for graphics tutorials or use oslib on large projects ...
-
06-15-2008, 07:48 AM #8686It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
*facepalm*
Loading an image means it goes into RAM. YOU ACTUALLY HAVE TO TELL IT TO DISPLAY THE PICTURE FOR IT TO GO ON THE SCREEN.
Also, the function loadImage is neither standard C nor in any of the headers you included.pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
06-15-2008, 07:59 AM #8687Developer

- Registriert seit
- Mar 2006
- Beiträge
- 1.026
- Points
- 7.577
- Level
- 58
- Downloads
- 0
- Uploads
- 0
Follow all the tutorials, then come and ask if you still need help.

Check out my homebrew & C tutorials at http://insomniac.0x89.org/
Coder formerly known as Insomniac197
tshirtz: what is irshell ??
Atarian_: it's where people who work for the IRS go when they die
-
06-15-2008, 10:26 AM #8688QJ Gamer Bronze
- Registriert seit
- Apr 2008
- Ort
- Ireland
- Beiträge
- 978
- Points
- 6.517
- Level
- 52
- Downloads
- 0
- Uploads
- 0
Ok thanks guys i got it to work thanks eldiablov for the link to psp-programming.
-
06-15-2008, 10:26 AM #8689Local Tech
- Registriert seit
- Oct 2007
- Ort
- home
- Beiträge
- 1.821
- Points
- 9.044
- Level
- 63
- Downloads
- 1
- Uploads
- 0
so what header has loadImage and image display?
-
06-15-2008, 12:13 PM #8690QJ Gamer Green
- Registriert seit
- Sep 2006
- Ort
- Cape Town, South Africa
- Beiträge
- 714
- Points
- 5.795
- Level
- 49
- Downloads
- 0
- Uploads
- 0
graphics.h. Or oslib/oslib.h if you're using oslib (the function's not called loadImage then). Or... (insert any library you want here).
-
06-15-2008, 01:55 PM #8691QJ Gamer Green
- Registriert seit
- May 2008
- Beiträge
- 96
- Points
- 3.008
- Level
- 33
- Downloads
- 0
- Uploads
- 0
-
06-15-2008, 07:05 PM #8692NetGameOrb Maker

- Registriert seit
- Jan 2008
- Ort
- New York
- Beiträge
- 683
- Points
- 6.138
- Level
- 50
- My Mood
-
- Downloads
- 2
- Uploads
- 0
GameLive name changed to NetGameOrb, Project is now online in Beta stage. Everyone encourage to register so they get news about the project and ability to play the games with NetGameOrb Support online. More info on site.
Stats Blog:http://netgameorb.blogspot.com/
Website:http://www.netgameorb.com/
-
06-16-2008, 03:27 PM #8693QJ Gamer Green
- Registriert seit
- May 2008
- Beiträge
- 96
- Points
- 3.008
- Level
- 33
- Downloads
- 0
- Uploads
- 0
-
06-17-2008, 03:31 AM #8694QJ Gamer Green
- Registriert seit
- Sep 2006
- Ort
- Cape Town, South Africa
- Beiträge
- 714
- Points
- 5.795
- Level
- 49
- Downloads
- 0
- Uploads
- 0
Hi. I'm working on a new version of 4^2, and I'd like it to be slim compatible. My PSPSDK is outdated so I can't compile it for the 3.90 kernel myself. I'd update it, but bandwidth isn't exactly cheap where I live, and AFAIK updating the PSPSDK is a fairly large download (installing it in the first place was). So I need someone to compile it for the 3.90 kernel. I would send you the source when its ready, and you would send back the EBOOT. AFAIK, all you'd need to do is change the makefile and type make. I'd give you credit.
EDIT: nvm, turns out that by some fluke it happens to work on the slim anyway :) .Geändert von coolguy5678 (06-19-2008 um 07:26 AM Uhr)
-
06-18-2008, 04:03 PM #8695lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
I can do it.
Anyways, I'm making a PRX file and I want it to take up all memory so that other PRXs loaded from seplugins wont be able to run at the same time.
Possible?
-
06-18-2008, 04:39 PM #8696
-
06-18-2008, 10:33 PM #8697QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- USA SC/NC
- Beiträge
- 699
- Points
- 5.712
- Level
- 48
- Downloads
- 0
- Uploads
- 0
... that would be stupid. Not sure whether the path for a prx is stored in memory when you load it... but if it is then you can search through all the loaded modules and kill them 1 by one.
Or, you can:
* Read vsh/game.txt in seplugins into an array. Hook sceKernelLoadModule or whatever loads prxes. Each time a file is loaded, loop through all files in vsh/game.txt and return without executing the file.
This is all assuming that your prx is loaded first. You could reorganize the vsh/game.txt then reboot the PSP so that your plugin is loaded first as a temporary solution.[CODE]Random Facts:
irc://irc.malloc.us #wtf #**********
[/CODE]
[SIZE="6"][FONT="Century Gothic"][COLOR="Blue"][URL="http://forums.**********.net"]http://forums.**********.net[/URL][/COLOR][/FONT][/SIZE]
-
06-19-2008, 08:02 AM #8698NetGameOrb Maker

- Registriert seit
- Jan 2008
- Ort
- New York
- Beiträge
- 683
- Points
- 6.138
- Level
- 50
- My Mood
-
- Downloads
- 2
- Uploads
- 0
GameLive name changed to NetGameOrb, Project is now online in Beta stage. Everyone encourage to register so they get news about the project and ability to play the games with NetGameOrb Support online. More info on site.
Stats Blog:http://netgameorb.blogspot.com/
Website:http://www.netgameorb.com/
-
06-19-2008, 08:33 AM #8699Developer

- Registriert seit
- Mar 2006
- Beiträge
- 1.026
- Points
- 7.577
- Level
- 58
- Downloads
- 0
- Uploads
- 0

Check out my homebrew & C tutorials at http://insomniac.0x89.org/
Coder formerly known as Insomniac197
tshirtz: what is irshell ??
Atarian_: it's where people who work for the IRS go when they die
-
06-19-2008, 09:49 AM #8700
- Registriert seit
- Apr 2008
- Beiträge
- 47
- Points
- 2.658
- Level
- 31
- Downloads
- 0
- Uploads
- 0
I've placed a 'free memory report' in a project I'm working on and it
seems to work fine. It queries sceKernelTotalFreeMemSize () from
<pspsysmem.h> and returns a uint with the number of free bytes.
I'm curious, though as it seems that it always reports the same number,
being 1032192. I wondered if it was doing that just because my program
was allocating specifically that much memory and then not any more or
less as it ran (which would be odd), so I made a note of the number and
continued developing. However, now I've added two char arrays and
changed some of the routines and when I run the program it still reports
1032192 bytes free. Is this simply reporting the amount of memory not
allocated to my heap and stack? My intention for this feature is to sort
of keep track of how much memory I'm not using. I suppose both stack
and non-allocated, though I suppose I'd want to look at them seperately.
I intend to use it primarily as a debugging tool so I can see the impact of
mallocs and such, as I'm about to implement a system that will create an
unknown number of structs (for tracking net player info) and it will need
to keep track of its memory-use to prevent crashes. I also want to have
this thing as RAM optimized as possible before I implement said system
and I was hoping to use this method of memory reporting to keep track
of that. Any advice on how to properly use this or other useful functions?


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