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; I think he is refering to an int. You can either cast it straight to an int which will truncate ...
-
03-14-2008, 06:16 PM #8161QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
I think he is refering to an int. You can either cast it straight to an int which will truncate the float value (e.g 5.9 will become 5) or round it and then cast it to an int.
[Blog] [Portfolio]
[Homebrew Illuminati - Serious Homebrew Development Forums]
[I want to make Homebrew FAQ] [How I broke into the Games Industry]
[Programming Book List] [Programming Article List]
-
03-14-2008, 07:01 PM #8162words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
Anti-QJ - a decimal is technically a float/double with infinite precision (pi, e, etc). Floats, doubles, long doubles, etc. have limited precision for obvious reasons. since some machines have no real use for incredibly high precision, there isnt hardware dedicated directly to it (the PSP for example, it can't handle doubles in hardware so they are handled in software, so you loose a little performance using doubles. The PSP isnt a graphing calculator after all :o

...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
03-14-2008, 07:16 PM #8163lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
ok, thanx for teh help.
-
03-15-2008, 01:18 AM #8164
- Registriert seit
- Mar 2008
- Beiträge
- 12
- Points
- 2.680
- Level
- 31
- Downloads
- 0
- Uploads
- 0
problem images
Hi, I just began programming on the psp, but I have a little problem. I have a script that loads a .png and plays a .mp3, but if I want to write text it goes under the png. I just want it above
, so some1 knows how to do this??
-
03-15-2008, 05:32 AM #8165QJ Gamer Bronze

- Registriert seit
- Aug 2007
- Ort
- Australia
- Beiträge
- 659
- Points
- 8.045
- Level
- 60
- Downloads
- 0
- Uploads
- 0
Since you said script im guessing your using LUA. Theres a LUA help thread a thread-or-so below this one for any help you may have. Anyway, in your main loop/where the text and images are printed have your text preint first and then the image.
Quick question about AI. Iv never worked with it and i really dont want to but i have to for my game otherwise it'll never see the light of day. All im gonna be doing is generating a random number between 0 and 1000 with the mersenne twister or whatever its called. From there i simply do a check to see what the random number is and also how far away the player is for example 200 pixels. Then, if the random number is > 500, stand still else move forward. Is that what simple AI is based around? Iv read Vaza's first tutorial on planning and stuff but i cant really be bothered reading the others seeing as though they're about a tic-tac-toe game and im making a 2d fighter. I just wanna know if im going the right wayGeändert von Xsjado7 (03-15-2008 um 05:53 AM Uhr)
-
03-15-2008, 05:45 AM #8166
This tutorial shows you how to make use of the printTextScreen function.
Zitat von devos50
http://psp-coding.com/index.php?topic=7.0[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.
-
03-15-2008, 07:32 AM #8167
- Registriert seit
- Mar 2008
- Beiträge
- 12
- Points
- 2.680
- Level
- 31
- Downloads
- 0
- Uploads
- 0
thank you! It works great now:):Jump:
-= Double Post =-
Hi, another small problem. When I want to compile it it gives an error at the last line: expected declaration or statement at the end of input. This is my code:
Spoiler for click to uncover:
its a program with a background (2 png's) and a selection menu with some text. Someone knows what i'm doing wrong??Geändert von devos50 (03-15-2008 um 08:57 AM Uhr) Grund: Automerged Doublepost
-
03-15-2008, 09:10 AM #8168QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
What is the EXACT error and line number?
[Blog] [Portfolio]
[Homebrew Illuminati - Serious Homebrew Development Forums]
[I want to make Homebrew FAQ] [How I broke into the Games Industry]
[Programming Book List] [Programming Article List]
-
03-15-2008, 09:29 AM #8169QJ Gamer Bronze
- Registriert seit
- Mar 2007
- Beiträge
- 758
- Points
- 8.665
- Level
- 62
- Downloads
- 0
- Uploads
- 0
I'm pretty sure you forgetting 1 or 2 closing braces somewhere. If you indented your code, you would know that.
-
03-15-2008, 09:31 AM #8170
- Registriert seit
- Mar 2008
- Beiträge
- 12
- Points
- 2.680
- Level
- 31
- Downloads
- 0
- Uploads
- 0
it's in the last line, with the
}
Here is the error in cygwin:
main.c: in function 'main';
main.c:142: error: expected declaration or statement at the end of input;
make: *** [main.o] Error 1
someone knows how to solve it?
-
03-15-2008, 09:54 AM #8171QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Yep:
Zitat von michaelp
Code:#include <pspkernel.h> #include <pspctrl.h> #include <pspdebug.h> #include <pspaudio.h> #include <pspaudiolib.h> #include <psppower.h> #include <pspdisplay.h> #include <pspgu.h> #include <png.h> #include <stdio.h> #include "graphics.h" #include "mp3player.h" PSP_MODULE_INFO("Mp3 Player", 0, 1, 1); #define printf pspDebugScreenPrintf #define prints printTextScreen #define RGB(r, g, b) ((r)|((g)<<8)|((b)<<16)) /* 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() { scePowerSetClockFrequency (333, 333, 166); pspDebugScreenInit(); SetupCallbacks(); initGraphics(); pspAudioInit(); SceCtrlData pad; Color white = RGB(255,255,255); Color red = RGB(255,0,0); int i; int selComponent = 0; MP3_Init(1); MP3_Load("test.mp3"); Image* background; Image* gw; background = loadImage("background.png "); gw = loadImage("gw.png"); blitAlphaImageToScreen(0 ,0 ,480 , 272, background, 0, 0); blitAlphaImageToScreen(0 ,0 ,136 , 170, gw, 300, 50); prints(0,0,"Now playing: -The Tarnished Coast (GW soundtrack)-",white); prints(0,10,"Made by: Devos50",white); while (1) { sceCtrlReadBufferPositive (&pad, 1); if (pad.Buttons & PSP_CTRL_UP) { if (selComponent > 0) { selComponent--; } for (i=0; i<10; i++) { sceDisplayWaitVblankStart (); } } else if (pad.Buttons & PSP_CTRL_DOWN) { if (selComponent < 2) { selComponent++; } for (i=0; i<10; i++) { sceDisplayWaitVblankStart (); } } if (pad.Buttons & PSP_CTRL_CROSS) { switch (selComponent) { case 0: MP3_Play(); break; case 1: MP3_Pause(); break; case 2: MP3_Stop(); break; default: break; } } else if (pad.Buttons & PSP_CTRL_LEFT) { switch (selComponent) { case 0: break; case 1: break; case 2: break; default: break; } if (selComponent == 0) { prints(0, 20,"Play",white); } else { prints(0,20,"Play",red); } if (selComponent == 1) { prints(0, 30,"Pause",white); } else { prints(0,30,"Pause",red); } if (selComponent == 2) { prints(0, 40,"Stop",white); } else { prints(0,40,"Stop",red); } flipScreen(); sceKernelSleepThread(); return 0; }[Blog] [Portfolio]
[Homebrew Illuminati - Serious Homebrew Development Forums]
[I want to make Homebrew FAQ] [How I broke into the Games Industry]
[Programming Book List] [Programming Article List]
-
03-15-2008, 10:11 AM #8172
- Registriert seit
- Mar 2008
- Beiträge
- 12
- Points
- 2.680
- Level
- 31
- Downloads
- 0
- Uploads
- 0
still get the same error
. I've looked up the script but can't find what I forgot. Some1 can find it???
-
03-15-2008, 10:14 AM #8173QJ Gamer Platinum
- Registriert seit
- Feb 2006
- Ort
- National Front Disco
- Beiträge
- 13.057
- Points
- 66.627
- Level
- 100
- Downloads
- 0
- Uploads
- 0
I think you forgot one right at the end:
Code:#include <pspkernel.h> #include <pspctrl.h> #include <pspdebug.h> #include <pspaudio.h> #include <pspaudiolib.h> #include <psppower.h> #include <pspdisplay.h> #include <pspgu.h> #include <png.h> #include <stdio.h> #include "graphics.h" #include "mp3player.h" PSP_MODULE_INFO("Mp3 Player", 0, 1, 1); #define printf pspDebugScreenPrintf #define prints printTextScreen #define RGB(r, g, b) ((r)|((g)<<8)|((b)<<16)) /* 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() { scePowerSetClockFrequency (333, 333, 166); pspDebugScreenInit(); SetupCallbacks(); initGraphics(); pspAudioInit(); SceCtrlData pad; Color white = RGB(255,255,255); Color red = RGB(255,0,0); int i; int selComponent = 0; MP3_Init(1); MP3_Load("test.mp3"); Image* background; Image* gw; background = loadImage("background.png "); gw = loadImage("gw.png"); blitAlphaImageToScreen(0 ,0 ,480 , 272, background, 0, 0); blitAlphaImageToScreen(0 ,0 ,136 , 170, gw, 300, 50); prints(0,0,"Now playing: -The Tarnished Coast (GW soundtrack)-",white); prints(0,10,"Made by: Devos50",white); while (1) { sceCtrlReadBufferPositive (&pad, 1); if (pad.Buttons & PSP_CTRL_UP) { if (selComponent > 0) { selComponent--; } for (i=0; i<10; i++) { sceDisplayWaitVblankStart (); } } else if (pad.Buttons & PSP_CTRL_DOWN) { if (selComponent < 2) { selComponent++; } for (i=0; i<10; i++) { sceDisplayWaitVblankStart (); } } if (pad.Buttons & PSP_CTRL_CROSS) { switch (selComponent) { case 0: MP3_Play(); break; case 1: MP3_Pause(); break; case 2: MP3_Stop(); break; default: break; } } else if (pad.Buttons & PSP_CTRL_LEFT) { switch (selComponent) { case 0: break; case 1: break; case 2: break; default: break; } if (selComponent == 0) { prints(0, 20,"Play",white); } else { prints(0,20,"Play",red); } if (selComponent == 1) { prints(0, 30,"Pause",white); } else { prints(0,30,"Pause",red); } if (selComponent == 2) { prints(0, 40,"Stop",white); } else { prints(0,40,"Stop",red); } flipScreen(); sceKernelSleepThread(); return 0; } }
-
03-15-2008, 11:18 AM #8174QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Of course you do. It is exactly the same code but properly indented. It should be obvious where you left the missing brace.
Zitat von devos50
Code:#include <pspkernel.h> #include <pspctrl.h> #include <pspdebug.h> #include <pspaudio.h> #include <pspaudiolib.h> #include <psppower.h> #include <pspdisplay.h> #include <pspgu.h> #include <png.h> #include <stdio.h> #include "graphics.h" #include "mp3player.h" PSP_MODULE_INFO("Mp3 Player", 0, 1, 1); #define printf pspDebugScreenPrintf #define prints printTextScreen #define RGB(r, g, b) ((r)|((g)<<8)|((b)<<16)) /* 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() { scePowerSetClockFrequency (333, 333, 166); pspDebugScreenInit(); SetupCallbacks(); initGraphics(); pspAudioInit(); SceCtrlData pad; Color white = RGB(255,255,255); Color red = RGB(255,0,0); int i; int selComponent = 0; MP3_Init(1); MP3_Load("test.mp3"); Image* background; Image* gw; background = loadImage("background.png "); gw = loadImage("gw.png"); blitAlphaImageToScreen(0 ,0 ,480 , 272, background, 0, 0); blitAlphaImageToScreen(0 ,0 ,136 , 170, gw, 300, 50); prints(0,0,"Now playing: -The Tarnished Coast (GW soundtrack)-",white); prints(0,10,"Made by: Devos50",white); while (1) { sceCtrlReadBufferPositive (&pad, 1); if (pad.Buttons & PSP_CTRL_UP) { if (selComponent > 0) { selComponent--; } for (i=0; i<10; i++) { sceDisplayWaitVblankStart (); } } else if (pad.Buttons & PSP_CTRL_DOWN) { if (selComponent < 2) { selComponent++; } for (i=0; i<10; i++) { sceDisplayWaitVblankStart (); } } if (pad.Buttons & PSP_CTRL_CROSS) { switch (selComponent) { case 0: MP3_Play(); break; case 1: MP3_Pause(); break; case 2: MP3_Stop(); break; default: break; } } else if (pad.Buttons & PSP_CTRL_LEFT) { switch (selComponent) { case 0: break; case 1: break; case 2: break; default: break; } if (selComponent == 0) { prints(0, 20,"Play",white); } else { prints(0,20,"Play",red); } if (selComponent == 1) { prints(0, 30,"Pause",white); } else { prints(0,30,"Pause",red); } if (selComponent == 2) { prints(0, 40,"Stop",white); } else { prints(0,40,"Stop",red); } } // This one flipScreen(); sceKernelSleepThread(); } // and this one return 0; }[Blog] [Portfolio]
[Homebrew Illuminati - Serious Homebrew Development Forums]
[I want to make Homebrew FAQ] [How I broke into the Games Industry]
[Programming Book List] [Programming Article List]
-
03-15-2008, 01:09 PM #8175
- Registriert seit
- Mar 2008
- Beiträge
- 12
- Points
- 2.680
- Level
- 31
- Downloads
- 0
- Uploads
- 0
ok, I can compile it now, but when I want to start it on my psp, it won't run. My psp freezes and shut down. Where is the error?? I've looked again at the script but can't find it:o
ps: I found an error in the callback thread. There was a space, but I saw that while I was compiling and fixed it, so that isn't the error, and I'm sure I've copied the test.mp3 and gw.png and background.png in the EBOOT folders, and have all the necessary headers.
-
03-15-2008, 01:36 PM #8176QJ Gamer Blue
- Registriert seit
- Oct 2007
- Ort
- Illinois
- Beiträge
- 158
- Points
- 3.734
- Level
- 38
- Downloads
- 0
- Uploads
- 0
I was looking at the 1.50 POC source code, and was wondering how I would go on about changing this:
so it would read from ms0:/PSP/GAME150 instead of /GAME. I've tried changing the string to /GAME150 but it still reads everything from /GAME.Code:if (strcmp(dirname, "ms0:/PSP/GAME") == 0) { theuid = res; }
Anybody?
-
03-15-2008, 02:01 PM #8177QJ Gamer Bronze
- Registriert seit
- Jan 2007
- Ort
- Right here
- Beiträge
- 179
- Points
- 5.354
- Level
- 47
- Downloads
- 0
- Uploads
- 0
you also have to change both paths in the dread and dopen functions
Zitat von Mirzab14
Code:int dopen_patch(const char *dirname) { int res = sceIoDopen(dirname); if (strcmp(dirname, "ms0:/PSP/GAME150") == 0) { theuid = res; } return res; } int dread_patch(SceUID dfd, SceIoDirent *dir) { char path[512]; if (dfd != theuid) return sceIoDread(dfd, dir); while (1) { int res = sceIoDread(dfd, dir); if (res <= 0) return res; snprintf(path, 512, "ms0:/PSP/GAME150/%s/EBOOT.PBP", dir->d_name); SceUID fd = sceIoOpen(path, PSP_O_RDONLY, 0777); if (fd > 0) { u32 signature; sceIoRead(fd, &signature, 4); sceIoClose(fd); if (signature == PBP_SIGNATURE) return res; } } return 0; }sudo rm -rf /
PSN ID: FigMan13
-
03-15-2008, 02:42 PM #8178QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Hint: What does sceKernelSleepThread do? Where is it being called?
Zitat von devos50
[Blog] [Portfolio]
[Homebrew Illuminati - Serious Homebrew Development Forums]
[I want to make Homebrew FAQ] [How I broke into the Games Industry]
[Programming Book List] [Programming Article List]
-
03-15-2008, 02:49 PM #8179QJ Gamer Blue
- Registriert seit
- Oct 2007
- Ort
- Illinois
- Beiträge
- 158
- Points
- 3.734
- Level
- 38
- Downloads
- 0
- Uploads
- 0
Thanks, but still doesn't work. Maybe its something that can't be edited?
Zitat von FigMan
-
03-15-2008, 06:01 PM #8180
I was wondering if anyone knows how to get the title of a PSP Game while using a PRX?
I'm wanting to make my own simple universal cheat device and I need the title for each game.Atheist, because I just won't believe in what doesn't show itself to me.
-
03-15-2008, 06:38 PM #8181QJ Gamer Bronze

- Registriert seit
- Aug 2007
- Ort
- Australia
- Beiträge
- 659
- Points
- 8.045
- Level
- 60
- Downloads
- 0
- Uploads
- 0
Either find the address of it in memory or maybe read the param.sfo of the currently playing game
-
03-15-2008, 07:02 PM #8182It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Yeah, read the PARAM.SFO. disc0:/PSP_GAME/PARAM.SFO is where it is for every PSP game.
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
03-15-2008, 09:00 PM #8183
Thanks.
Do you know exactly where in the file it is located?Atheist, because I just won't believe in what doesn't show itself to me.
-
03-15-2008, 10:16 PM #8184It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
If I'm not mistaken, it varies. You'll have to parse some of the file to get exactly where in the file it's located.
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
03-16-2008, 03:32 AM #8185Developer

- Registriert seit
- Mar 2006
- Beiträge
- 1.026
- Points
- 7.577
- Level
- 58
- Downloads
- 0
- Uploads
- 0
Check out the source for mksfo in the SDK.

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
-
03-16-2008, 08:53 AM #8186QJ Gamer Platinum
- Registriert seit
- Feb 2006
- Ort
- National Front Disco
- Beiträge
- 13.057
- Points
- 66.627
- Level
- 100
- Downloads
- 0
- Uploads
- 0
I'm having some trouble compiling this code. I didn't want to have to post it here but I have asked a few people and none know what the problem is. I get these errors/warnings:Code:#include <oslib/oslib.h> #imclude <pspkernel.h> PSP_MODULE_INFO("OSLib Sample", 0, 1, 1); PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU); OSL_IMAGE *background; int main() { oslInit(0); oslInitGfx(OSL_PF_8888, 1); Color pink = RGB(255,0,255); Color white = RGB(255,255,255); background = oslLoadImageFile("menuback.png", OSL_IN_RAM, OSL_PF_5551); background->x = 0; background->y = 0; if (!background) { oslDebug("Image file: 'menuback.png' has not been found."); } int menustatus; menustatus = 1 oslReadKeys(); oslStartDrawing(); oslDrawImage(background); oslPrintf_xy(0,0,"Play Game", white); oslPrintf_xy(0,20,"Options", white); oslPrintf_xy(0,40,"Exit", white); if(menustatus = 1) { oslPrintf_xy(0,0,"Play Game", pink); { if (osl_keys->pressed.cross) game(); } } if(menu status = 2) { oslPrintf_xy(0,20,"Options", pink); if (osl_keys->pressed.cross) { options(); } } if (menustatus = 3) { oslPrintf_xy(0,60,"Credits", pink); if (osl_keys->pressed.cross) { credits(); } } if(menustatus = 4) { oslPrintf_xy(0,40,"Exit", pink); if (osl_keys->pressed.cross) { sceKernelExitGame(); } } if (osl_pad.pressed.down) { menustatus ++; } if (osl_pad.pressed.up) { menustatus --; } } void options() { Color pink = RGB(255,0,255); Color white = RGB(255,255,255); background = oslLoadImageFile("menuback.png", OSL_IN_RAM, OSL_PF_5551); background->x = 0; background->y = 0; oslInit(0); oslInitGfx(OSL_PF_8888, 1); if (!background) { oslDebug("Image file: 'menuback.png' has not been found."); } int menustatus; menustatus = 1 oslReadKeys(); oslStartDrawing(); oslDrawImage(background); oslPrintf_xy(50,50,"Kirby: All Pink - Options", white); oslPrintf_xy(50,70,"Version 0.1", white); if (menustatus = 1) { oslPrintf_xy(50,100,"omg not done yet", pink); if (osl_pad.pressed.down) { menustatus ++; } if (osl_pad.pressed.up) { menustatus --; } }
Code:[email protected] ~/menu $ make psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G4 -Wall -O2 -D_PSP_FW_VERSION =150 -c -o main.o main.c main.c: In function 'main': main.c:4: error: 'Color' undeclared (first use in this function) main.c:4: error: (Each undeclared identifier is reported only once main.c:4: error: for each function it appears in.) main.c:4: error: expected ';' before 'pink' main.c:5: error: expected ';' before 'white' main.c:7: error: 'background' undeclared (first use in this function) main.c:7: warning: implicit declaration of function 'oslLoadImageFile' main.c:7: error: 'OSL_IN_RAM' undeclared (first use in this function) main.c:7: error: 'OSL_PF_5551' undeclared (first use in this function) main.c:12: warning: implicit declaration of function 'oslInit' main.c:13: warning: implicit declaration of function 'oslInitGfx' main.c:13: error: 'OSL_PF_8888' undeclared (first use in this function) main.c:17: warning: implicit declaration of function 'oslDebug' main.c:23: error: expected ';' before 'oslReadKeys' main.c:25: warning: implicit declaration of function 'oslStartDrawing' main.c:26: warning: implicit declaration of function 'oslDrawImage' main.c:28: warning: implicit declaration of function 'oslPrintf_xy' main.c:28: error: 'white' undeclared (first use in this function) main.c:32: warning: suggest parentheses around assignment used as truth value main.c:34: error: 'pink' undeclared (first use in this function) main.c:36: error: 'osl_keys' undeclared (first use in this function) main.c:38: warning: implicit declaration of function 'game' main.c:42: error: 'menu' undeclared (first use in this function) main.c:42: error: expected ')' before 'status' main.c:48: warning: implicit declaration of function 'options' main.c:53: warning: suggest parentheses around assignment used as truth value main.c:59: warning: implicit declaration of function 'credits' main.c:63: warning: suggest parentheses around assignment used as truth value main.c:69: warning: implicit declaration of function 'sceKernelExitGame' main.c:74: error: 'osl_pad' undeclared (first use in this function) main.c: At top level: main.c:87: warning: conflicting types for 'options' main.c:48: warning: previous implicit declaration of 'options' was here main.c: In function 'options': main.c:88: error: 'Color' undeclared (first use in this function) main.c:88: error: expected ';' before 'pink' main.c:89: error: expected ';' before 'white' main.c:91: error: 'background' undeclared (first use in this function) main.c:91: error: 'OSL_IN_RAM' undeclared (first use in this function) main.c:91: error: 'OSL_PF_5551' undeclared (first use in this function) main.c:97: error: 'OSL_PF_8888' undeclared (first use in this function) main.c:107: error: expected ';' before 'oslReadKeys' main.c:112: error: 'white' undeclared (first use in this function) main.c:115: warning: suggest parentheses around assignment used as truth value main.c:117: error: 'pink' undeclared (first use in this function) main.c:119: error: 'osl_pad' undeclared (first use in this function) main.c:128:2: warning: no newline at end of file main.c:128: error: expected declaration or statement at end of input main.c: In function 'main': main.c:83: warning: control reaches end of non-void function make: *** [main.o] Error 1
-
03-16-2008, 09:57 AM #8187QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
The compiler says there is no datatype of Color. Are you sure it is defined in the headers you have included? Normally it is a u32 IIRC. That will solve most of the errors.
[Blog] [Portfolio]
[Homebrew Illuminati - Serious Homebrew Development Forums]
[I want to make Homebrew FAQ] [How I broke into the Games Industry]
[Programming Book List] [Programming Article List]
-
03-16-2008, 10:00 AM #8188QJ Gamer Platinum
- Registriert seit
- Feb 2006
- Ort
- National Front Disco
- Beiträge
- 13.057
- Points
- 66.627
- Level
- 100
- Downloads
- 0
- Uploads
- 0
I'm sorry but what is a u32 IIRC?
-
03-16-2008, 10:05 AM #8189QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
u32 = Unsigned 32 bit integer. If you look in the PSP SDK, you will see a typedef in one of the headers like this:
Or similar.Code:typedef u32 unsigned int;
IIRC = If I Recall Correctly.[Blog] [Portfolio]
[Homebrew Illuminati - Serious Homebrew Development Forums]
[I want to make Homebrew FAQ] [How I broke into the Games Industry]
[Programming Book List] [Programming Article List]
-
03-16-2008, 12:34 PM #8190QJ Gamer Bronze

- Registriert seit
- Aug 2007
- Ort
- Australia
- Beiträge
- 659
- Points
- 8.045
- Level
- 60
- Downloads
- 0
- Uploads
- 0
with OSL you declare it like:
Code:OSL_COLOR*


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