No, it's not that, it's that you posted a huge image with black text on a dark gray background... Post something readable.
Printable View
No, it's not that, it's that you posted a huge image with black text on a dark gray background... Post something readable.
What am I doing wrong when trying to compile files? Am I missing something somewhere?
This is the error that appears when I type make;
[email protected] ~/psptoolchain/projects/helloworld
$ make
make: psp-config: Command not found
makefile:12: /lib/build.mak: No such file or directory
make: *** No rule to make target `/lib/build.mak'. Stop.
_________________________ _________________________ _______________
Don't know how to delete post sorry, but I accidentaly did this so just ignore this one
quick question, how do i clear a certain part of a screen with a color i choose?
example:
i want to fill a black square/rectangle right in the middle of the screen as a pause menu kinda, so f i can find that one code snippet for it, then i can have start clear the screen in the middle with the color black and then ill have text printed over it, and basically ahve a pause menu, that easyCode:clearScreen(black in the square made of the pixels: x >200, x < 400, y < 170 y > 220);
also, is NULL a recognized call? meaning if i had the X button do soemthing before, then if i say null after it, itll cancle X out and do nothing?
extern void fillScreenRect(Color color, int x0, int y0, int width, int height);
ok, i see now, defining colors isnt neccesary is it? i can just put RGB((R0, B0, G0,))?
or soemthing like that, i cna tremember the RGB way to pick a color in c, i know all 0s is black, but how do i call them again? ill just look at ur tut again, hope it describes em in there...and i ahve the RGB thing #defined in my source file
Yeah, that will be fine
ok, it freezes when i clear the screen, it complied with no error, o well ill keep trying
What's your code?
nvm i looked at ur tut that had hte colors defined and it worked, now i need to know about this null thing im talking about, is NULL a real call? so it wont give me an error if i call it to do nothing
What are you talking about? NULL is just a blank pointer, it means "nothing" or "empty" or "blank"
Ok i just followed tutorial 2 and copy and pasted all the code that i was instructed to do.
When i try to compile my helloworld i get these error messages:
http://i2.photobucket.com/albums/y12...rormessage.jpg
Im not sure what ive done wrong. Any help would be great. Cheers.
Just incase it helps heres my main.c code open in Dev-C++:
http://i2.photobucket.com/albums/y12...oworldcode.jpg
Your Makefile is Makefile.cpp.
Oh cheers fixed it :icon_cool :)Zitat:
Zitat von Yeldarb
Here my code is, i don´t know what´s wrong with it, :Argh: i need some help
_________________________ _________________________ _______________
// Hello World - My First App for the PSP
/*
This program was created by Kevin Skøtt (T-Devil) on 5th. february 2006
It is a simple "Hello World" Application.
*/
/* \comments */
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspdisplay.h>
#include <pspctrl.h>
/* \this is keeping the program "simple" */
PSP_MODULE_INFO("Hello World", 0, 1, 1);
/* \name and attributes */
#define printf pspDebugScreenPrintf
/* \printf definer for screen text */
/* 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);
sceKernelRegisterExitCall back(cbid);
sceKernelSleepThreadCB();
return 0;
}
/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void) {
int thid = 0;
thid = sceKernelCreateThread("up date_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid >= 0) {
sceKernelStartThread(thid , 0, 0);
}
return thid;
}
/* \this is for setting up the program to run on the PSP */
int main() {
/* \this is the main function */
pspDebugScreenInit();
SetupCallbacks();
/* \functions to set up the screen & to use earlier functions (always use semicolon) */
int counter = 0;
int i = 0; SceCtrlData pad;
printf("Press [X] To Start the Timer");
/* \printing hello world to the screen */
sceKernelSleepThread();
/* \this pauses the program until the home button is pressed */
return 0;
/* \the return value */
}
/* closing bracket */
while(1) {
sceCtrlReadBufferPositive (&pad, 1);
if(pad.Buttons & PSP_CTRL_CROSS) {
break;
}
}
while(1) {
sceCtrlReadBufferPositive (&pad, 1);
if(pad.Buttons & PSP_CTRL_CIRCLE) {
break;
}
pspDebugScreenClear();
printf("Press [O] To Stop the Timer\n");
printf("Counter: %i", counter);
counter++;
for(i=0; i<5; i++) {
sceDisplayWaitVblankStart ();
}
pspDebugScreenClear();
printf("Counter Finished.");
printf("Final Count: %i", counter);
)
)
And my Makefile
_________________________ _________________________ ______________________
TARGET = counter
OBJS = main.o
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Counter program
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
And the error you get?
w00t i finally got my pspsdk set up thanks yeldarb :D
here the error is :Argh........... Part 2 next page :Argh:
part 2 :Argh:
part 3 :Argh:
Part 4 :Argh:
People, you need to learn how to debug their own projects. It's really quite simple, as the compiler gives you line numbers on approx where it went wrong.
tdevil -
Line (approx) 67 - There's a stray } tag, closing your main function, removed it.
Something wrong with the callback threads, just replaced them.
Line 92 - Your close brackets { } were parenthesis ( ), big difference in programming
Finally, the
"sceKernelSleepThread ();
/* \this pauses the program until the home button is pressed */
return 0;
/* \the return value */"
needs to go at the end of your function.
After fixing all of this, I end up with -
But I reiterate to both you and everyone reading this thread. Learn to debug your source code. It is easy, the compiler tells you where you made your mistakes, you just have to fix them!Code:// Hello World - My First App for the PSP
/*
This program was created by Kevin Skøtt (T-Devil) on 5th. february 2006
It is a simple "Hello World" Application.
*/
/* \comments */
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspdisplay.h>
#include <pspctrl.h>
/* \this is keeping the program "simple" */
PSP_MODULE_INFO("Hello World", 0, 1, 1);
/* \name and attributes */
#define printf pspDebugScreenPrintf
/* \printf definer for screen text */
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common) {
sceKernelExitGame();
return 0;
}
// I +think+ that's saying it needs to keep telling the Kernel not to exit
/* Callback thread */
int CallbackThread(SceSize args, void *argp) {
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
// Executing the call exit_callback thread?
/* 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;
}
/* \this is for setting up the program to run on the PSP */
int main() {
/* \this is the main function */
pspDebugScreenInit();
SetupCallbacks();
/* \functions to set up the screen & to use earlier functions (always use semicolon) */
int counter = 0;
int i = 0; SceCtrlData pad;
printf("Press [X] To Start the Timer");
/* \printing hello world to the screen */
/* closing bracket */
while(1) {
sceCtrlReadBufferPositive (&pad, 1);
if(pad.Buttons & PSP_CTRL_CROSS) {
break;
}
}
while(1) {
sceCtrlReadBufferPositive (&pad, 1);
if(pad.Buttons & PSP_CTRL_CIRCLE) {
break;
}
pspDebugScreenClear();
printf("Press [O] To Stop the Timer\n");
printf("Counter: %i", counter);
counter++;
for(i=0; i<5; i++) {
sceDisplayWaitVblankStart ();
}
pspDebugScreenClear();
printf("Counter Finished.");
printf("Final Count: %i", counter);
}
sceKernelSleepThread();
/* \this pauses the program until the home button is pressed */
return 0;
/* \the return value */
}
Hope that helps you tdevil.
new error.. anyone?Code:12 [main] sh 64752 fork: child -1 - CreateProcessA failed, errno 11
/tmp/pspdev/binutils-2.16.1/libiberty/configure: fork: Resource temporarily unav
ailable
/tmp/pspdev/binutils-2.16.1/libiberty/configure: line 6530: /usr/bin/sed: Resour
ce temporarily unavailable
checking for psignal... /tmp/pspdev/binutils-2.16.1/libiberty/configure: line 65
33: ${+set}: bad substitution
/tmp/pspdev/binutils-2.16.1/libiberty/configure: line 6592: /usr/bin/cat: Resour
ce temporarily unavailable
/tmp/pspdev/binutils-2.16.1/libiberty/configure: line 6611: /usr/bin/sed: Resour
ce temporarily unavailable
/tmp/pspdev/binutils-2.16.1/libiberty/configure: line 6613: =no: command not fou
nd
/tmp/pspdev/binutils-2.16.1/libiberty/configure: line 6615: /usr/bin/rm: Resourc
e temporarily unavailable
/tmp/pspdev/binutils-2.16.1/libiberty/configure: line 6618: ${}: bad substitutio
n
/tmp/pspdev/binutils-2.16.1/libiberty/configure: line 6619: ${}: bad substitutio
n
11 [main] sh 50184 child_copy: stack write copy failed, 0x22DC20..0x230000,
done 0, windows pid 2284372, Win32 error 5
/tmp/pspdev/binutils-2.16.1/libiberty/configure: fork: No error
14012 [main] sh 50184 child_copy: stack write copy failed, 0x22D670..0x230000,
done 0, windows pid 2282916, Win32 error 5
/tmp/pspdev/binutils-2.16.1/libiberty/configure: fork: No error
27016 [main] sh 50184 child_copy: stack write copy failed, 0x22DAD0..0x230000,
done 0, windows pid 2284036, Win32 error 5
/tmp/pspdev/binutils-2.16.1/libiberty/configure: fork: No error
40606 [main] sh 50184 child_copy: stack write copy failed, 0x22D520..0x230000,
done 0, windows pid 2282580, Win32 error 5
/tmp/pspdev/binutils-2.16.1/libiberty/configure: fork: No error
make: *** [configure-libiberty] Error 1
ERROR BUILDING BINUTILS
Zitat:
Zitat von Smerity
superb... havent tried it but this is like the first code i get... u explain very well in ur comments... i know java... so very understandable... ppl apparently have to write long*ss comments that make no sense in some tutorials... hey can u also put a tutorial on how to load a PNG or JPG file and render it to screen with DOUBLE buffer... thx man
In an effort to make it easier to set up next time, and perhaps make it easier for others
to install, I zipped my whole working cygwin directory down to around 400Mb,
and sent it over LAN to another PC in the house.
The idea is that a 400 Mb zip file with everything already set up could be seeded
with a torrent program.
When trying to run it on another PC, it fails of course, because the other computer
is not named 'Thinkcentre' among other reasons that I might not be aware of.
Could anyone point me in the right direction toward getting this working if they are
aware of something that I need to edit specificaly.
I haven't renamed the computer, but have tried editing the computer name in the password file.
Art.
wtf..
I don't know how cygwin became associated in any way with that stupid PSPide
program, but it looks in that folder for files at compile time.
If I uninstall PSPide (as I have done) cygwin errors out and won't compile lesson3.
The compiled program done in this screenshot worked, but you can see it looking in the PSPide folder.
Now i get this :Argh:
Art, sorry, not a clue (on why GCC is associated with PSPSide or even what PSPSide is). The only thing I can suggest is to ensure the path to Cygwin is the correct one.
-=-=-=-=-=-=-=-
t-devil, dude, what did I tell you!
If you get an error, go to the line specificied in the compile error and have a look around! I don't mind helping you out as this is becoming a bit of a dev help thread, but later when you're making your own homebrew it will become increasingly difficult to get help...
There are problems with displaying code on this forum as spaces seem to be randomly added around the place.
So, let's try it once again the way I suggested.
Go to line 31, as specificied in the compile error, and you'll see -
sceKernelRegisterExitCall back(cbid); //(see the huge gaping space?)
Remove that space, compile again and it should work.
The End of File warning is just that, a warning, and quite easy to fix, just add a new line (enter on keyboard) at the end of the file.
But to seriously become an abled coder, one of the main abilities you need is the ability to debug, especially on the PSP with very few tools to help you.
Good luck, and I hope you read the compile errors more carefully next time! :icon_smil
-Edit-
Also, please note, unless you are on a 1.0 PSP you need to type in make kxploit to make it work on a 1.5 PSP.
ok, back with another problem needing an answer, i have a score (not really but for example use it), and say i wanted to print it to the screen, but it has a variable in it (%i), so far get it? Ok, i call printf("iasjdkfsjk %i", score); ok, now this works, except it just scrolls by really fast by the screen with this black bar under it, i want it to just stay where i put, but i nat no matter what, so i looked in graphics.h and found printtextimage or whatever and it works!, but it is behind the images before it a little bit and i cant use an integer call or anythng in it, anyone want to point in the right direction for printing text to the screen above multiple images, that can hold an integer argument? also, one more question, how do i get .mp3 music to stop and not play and not freeze and such if i go back and forth etween source files in a game?
When I get to the last part and type in "make" it says...
make: psp-config: Command not found
makefile:12: /lib/build.mak: No such file or directory
make: ***No rule to make target '/lib/build.mak'. Stop.
Rooster have u put the line
into bashrc file located at cygwin/home/username/bashrcZitat:
## PSPDEV PATH SETTINGS
export PATH="/usr/local/pspdev/bin:$PATH"
just open the folder with a notepad or wordpad..
Paradox
btw ppl i got it workin :) yay! thx for the ppl who tried to help me and not so much to the ones who complened >_>
It didnt work but thanks anyway, anyone else have ideas.
(See Bolded Portion Above)Zitat:
Zitat von Rooster Cogburn
Whoops spelling mistake in my post. I went into the libs folder and I didnt find that build.mak file. Is that what I need?
No. Did you remember to set your path at the end of Lesson 01?
For some reason whe I executed toolchain.sh it didnt fully work, I think my computer went into sleep mode and it stopped. But im running it now and ill check it in the morning. Thanks for the help and nice tutorial, very easy to follow.
Thanks; hope it works out for you.
Sorry for the double post, but I wanted #1000 in the thread =) :party: