My computer ran out of space when installing the program thing at the start, I never realized it was that big.
Printable View
My computer ran out of space when installing the program thing at the start, I never realized it was that big.
okay now im getting a problem that whenever i go to type in "./toolchain.sh" it says "Error: Please make sure you have GNU 'make' installed" how do i fix that?
Run the cygwin installer again, and make sure you select the box to install 'make'. You must have forgotten to tick the box when you ran it before.
OOoOoo okay thanks A LOT
iBall - The tutorial is actually for linux; the CYGWIN step makes windows emulate linux. Since OSX is a UNIX based distro, so long as you have all of the dependencies, I think you should be able to build the toolchain from a Terminal window but I'm not sure since I don't have a Mac. If you'd like to donate me a max with OSX, I could write you a tutorial :P
Loved tutorial #4! :Jump: How do you get the pic inside the eboot?
Shadow.Box that was the old way to do it; it was much more cumbersome because you had to convert the image to a C object first. It was a pain. This way it's much easier to change your images later and it allows your users to customize your program if they'd like :P
But if you're intested, check out my Snakman game (the link is in my signature), it uses outdated code that I originally got from Shine's Snake game in C.
Ok, thx! This way will work, I was just wondering. Great tutorials!
Thanks, glad you like them.
I followed everything in the second tutorial and attempted to "make" the eboot
this is what happened....
http://img509.imageshack.us/img509/6999/problem4hu.png
i followed lesson 03 and everything worked fine......I don't understand what I did incorrectly, please help....if so, please post the entire source code for lesson 02, if you don't want to find out what I did wrong, I shall
Those variables are only used in Lesson 03. You forgot to add the following lines:
int counter = 0;
int i = 0; SceCtrlData pad;
above the line "printf("Press [X] To Start the Timer");".
I still recieve an error in function 'main' "
I get "syntax error at end of input"
and also this error "make: ***[main.o] Error 1
here is my source code :
// Counter
/*
This program was created by Zachary H on 01/01/06
It is a simple counter
*/
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspdisplay.h>
#include <pspctrl.h>
#define printf pspDebugScreenPrintf
/* 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;
}
int main() {
pspDebugScreenInit();
SetupCallbacks();
int counter = 0;
int i = 0; SceCtrlData pad;
printf("Press [X] To Start the Timer");
return 0;
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);
}
}
You have a '}' missing at the end. It is a good idea to indent it, it makes it easier to see these small problems:
Original -
Fixed -Code:int main() {
pspDebugScreenInit();
SetupCallbacks();
int counter = 0;
int i = 0; SceCtrlData pad;
printf("Press [X] To Start the Timer");
return 0;
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);
}
}
With the indenting, you can see in a quick glance where symbols are missing.Code:int main() {
pspDebugScreenInit();
SetupCallbacks();
int counter = 0;
int i = 0; SceCtrlData pad;
printf("Press [X] To Start the Timer");
return 0;
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);
}
}
}
thankx, I needed help, and question, how do you make it so that you can come up to text, then click "X" and go onto the next screen, I will attemp to figure it out on my own first, but some help would be nice...
Hi there!
I get everything up and running and compiled. I initially got an error when I tried running the program on the psp. It came right back out and gave me an error 80020001. I figured it was something to do with my firmware so I came here and read the beginning of this thread. Sure enough it was suggested that f/w 1.5 was the problem and one sollution to fix the problem (that worked for me) was to use KXploit.
Someone else suggested you don't need to use KXploit though and that you just needed to copy the files in the 1.5 directory? I'd like to be able to do this though I've no idea where the 1.5 directory is. I know that the files need to be coppied into psp/game/ but when I complie does it actually create a 1.5 build directory somewhere? If so where? It's not in the project folder.
It'd be nice to be able to keep my own backgrounds, icons and sound for the program rather than the one that KXploit replaces it all with
Hi everyone!
Kezz - take a look for Sei PSP Tool and use that to replace your background images/icon, convert your eboot to 1.5 etc.
How would I go about clearing images?
pspDebugScreenClear(); ?
graphics.c(line 226):
void clearImage(Color color, Image* image)
You can also completely clean the buffer completely by using clearScreen(0), although really that should not be necessary. Mind if I ask what you are trying to do?
If by any chance you need the DEFINE line to generate the color code, here is the one I use: #define RGB(r, g, b) (0xFF000000 | ((b)<<16) | ((g)<<8) | (r))
Ok, thanks. Im trying to port over something Ive made in lua, while also trying to learn C. Ive got the cursor showing but when I move it around, It keeps the old image. I thought a clear screen in the loop would catch it, but it hasnt.Zitat:
Zitat von Psilocybeing
http://img445.imageshack.us/img445/9...ture0032jo.jpg
It does that. Here's the main function, maybe someone can help.
int main() {
char buffer[200];
Image* thecursor;
char buffer2[200];
Image* bg;
pspDebugScreenInit();
SetupCallbacks();
initGraphics();
sprintf(buffer, "cursor.png");
thecursor = loadImage(buffer);
sprintf(buffer2, "bg.png");
bg = loadImage(buffer2);
if (!thecursor) {
if (!bg) {
printf("Image load failed!\n");
}
} else {
SceCtrlData pad;
int cursorx = 480/2;
int cursory = 272/2;
int cursorheight = 12;
int cursorwidth = 7;
int cursorxstep = 3;
int cursorystep = 3;
sceDisplayWaitVblankStart ();
while(1) {
clearScreen(0);
blitAlphaImageToScreen(0 ,0 ,480 , 272, bg, 0, 0);
blitImageToImage(0 ,0 ,cursorwidth , cursorheight, thecursor, cursorx, cursory, bg);
sceCtrlReadBufferPositive (&pad, 1);
if (pad.Buttons & PSP_CTRL_CROSS){
sceKernelExitGame();
}
if (pad.Buttons & PSP_CTRL_UP){
cursory = cursory - cursorystep;
}
if (pad.Buttons & PSP_CTRL_DOWN){
cursory = cursory + cursorystep;
}
if (pad.Buttons & PSP_CTRL_LEFT){
cursorx = cursorx - cursorxstep;
}
if (pad.Buttons & PSP_CTRL_RIGHT){
cursorx = cursorx + cursorxstep;
}
if (cursorx < 0) cursorx=0;
if (cursorx > 480) cursorx=480;
if (cursory < 0) cursory=0;
if (cursory > 272) cursory=272;
sceDisplayWaitVblankStart ();
flipScreen();
}
}
sceKernelSleepThread();
return 0;
}
[EDIT]
SORRY, I tried putting code tags around it but its not working. Another thing, is there an easier way of loading an image into a string beside using the buffer. Or can I use the same string for various different images?
You are blitting the cursor image to the background image pointer every time, so instead of moving it you are simply adding to the image buffer every time. Simply blit the cursor to the screen directly, instead of blitting to the background image :)
blitAlphaImageToScreen(0 ,0 ,480 , 272, bg, 0, 0);
blitImageToImage(0 ,0 ,cursorwidth , cursorheight, thecursor, cursorx, cursory, bg);
to:
blitAlphaImageToScreen(0 ,0 ,480 , 272, bg, 0, 0);
blitAlphaImageToScreen(0 ,0 ,cursorwidth , cursorheight, thecursor, cursorx, cursory);
wow...lol, thanks.
Do you know how the analog stick works?. I tried looking at source code for something else, but I don't understand. Maybe you can simplify it?
Sure thing, here is how you read the status of the analogue stick:
To wrap around the cursor like you're doing at the moment, just use the same method. the only thing that changes here is where you get the input from :). You can see which state is which by looking at what is being done to the position variables.Code:SceCtrlData pad;
sceCtrlSetSamplingCycle(0);
sceCtrlSetSamplingMode(PSP_CTRL_MODE_ANALOG);
sceCtrlReadBufferPositive(&pad, 1);
if (pad.Lx == 255){
cursorPosX = cursorPosX+8;
}
if (pad.Lx == 0){
cursorPosX = cursorPosX-8;
}
if (pad.Ly== 255){
cursorPosY = cursorPosY+8;
}
if (pad.Ly == 0){
cursorPosY = cursorPosY-8;
}
can I make it more sensitive?, It seems as though I need to push the analog stick ALL the way to the side that I want it to go, would I raise the 255, or lower it? or should I be fooling with the 0?
You could simply have a lesser than/greater than case, and change the ammount it moves the cursor relative to the position the analog stick is in.
Alright. Thanks for all your help! I really appreciate it
No worries, I'm not positive about the last comment, I've not actually tried something like that.
the new psptoolchain-20051202 is a tgz file and i cant extract it with winrar. ive tried to rename it to .rar but it wont work.
For all of you having problems extracting that file, use this in a cygwin bash shell instead of using winRar:
Code:tar xfvz psptoolchain-20051023.tgz
EDIT- Sorry did not look hard enough, found what I wanted.
Hi,
i am insterested in programming for the psp but i have little knowledge of c and c++. Is there any way of programming it in c# and compiling to eboot or couldn't i convert c# to c? any help would be greatly appreciated
thankyou
Well, I have read your tutorials and I have started to combine tutorial three and four and make a simple program where you move an image around. I got it as far as setting the screens edges as boundries and moving the image used in tutorial four. Now, is there any function made to clear an image from the screen? I looked all through the graphics.h file and saw nothing. When I got to the clearScreen() function I got my hopes up but no, :( all it does is set a transparency. So, if there is a function that clears images from the screen, as to not leave trails, please ket me know.
Ravine: put this at the top,
And then use this to clear the screen:Code:#define RGB(r, g, b) (0xFF000000 | ((b)<<16) | ((g)<<8) | (r))
Maddox: I don't know anything about C#, sorry.Code:clearScreen(RGB(0, 0, 0));
Thank you for the macro, hopefully I will get to something I can actually release. :)
Glad to help.
I have a released a little something that I have made, I made a topic called "A work in progress" if you would like to check it out. Or if you are like me and would prefer a dl link right here, then here ya go. PNG_MOVE.rar
And, Yeldarb, I would love to donate to you but I really don't like using my credit card for paypal and stuff like that. So my donation to you for your wonderful tutorials, is you are welcome to upload any size, any type, file you would like on my site. Bascially amazing free file hosting. :) Just PM whenver you need to upload something. I can also ,make you an FTP account for my site.
I have just completed your wonderful tutorial (tutorial 4) and I wanted to try to add some text (like "Created by SodR" or womething) on the image just to see what's happening. But the text I wanted to display only shows up on the screen for a milisecond or so. So i put "sceKernelSleepThread ();" after my printf command but when I did so the image didn't show up on the screen... What in the code should I add to make the text viewable?? And where should I put the printf command? In the image processing, after it or in the beginning of the code?
btw. It would also be nice to know how to display images on images, like a background pic and then a smaller pic (like a arrow or something) on it.
Thanks for the great tutorials!!
A great thing to add should be how the code looks like when it is complete, in the end of evry single lession page.
What I think you could do, well two things. First, if you want a scrolling background, make a premade "map" and make sure it is bigger than the psp screen. Then display that picture, and draw your "character's" image next. Now for what I think would make it scroll, just to let you know this is not tested but does not seem to hard to code. When the character gets to 10 pixles from that side of the screen, move the "map" imagea little bit towards the opposite direction the character is walking. If you just want to make it so you have a plain image that fits the screen as the background, tiled would be a little different (if it is one smaller image, you could tile it like it as done in the tutorial). So just load that "map" image that fits the screen and load everything that goes on top of it after the "map" image is displayed. I haven't looked into it much but in the graphics.h file there is a function defined that draws an image to an image. You could work with it that way also, that would seem more likely to work than just drawing the images in order of them being displayed.
Now for writing text, right now I'm not at my compuer where I can see the exact function, but once again it is in the graphics.h file. It is something ike disableGraphics() You have to do that first so it will not think that you are drawing an image. Then you can do a printf() or you can use the print command in the graphics.h file. Then to start drawing again reinitalize te graphics like you did the first time. There is also a function that is drawTextToImage() which, well does what it says, you can see the parameters in the graphics.h file.
What I have figured out is those files are very limited, the abiliy to move an image is probably near it's limits. For my project I am going to use SDL. So I thought I might just warn you before you get too involved with those files.
@Maddocks: Well, if you know C#, from what I have heard, it should not be very hard for you to pickup C. I can understand that you have probably formed a habit of certain things to do with C#, but just looking at sets of C code will help you quite a bit. For example, my program is fully in C, where I have never used it before, I have only known a little bit of C++.
Wait a second, can SDL be used on the PSP? I was pretty sure it could. If it can be I would like to know how to link it inside of the Makefile.
Delete