![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
This is a discussion on coding/programming help.. within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; In C, how do you clear the screen, define RGB, and display the current dir?...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#2 |
![]() |
pspDebugScreenClear();
if your using the normal debug txt. and to display your current file structure???? i dont know
__________________
[CENTER]You can hyperlink quotes and the whole box will be a link: [URL=http://forums.qj.net/showthread.php?t=35215][COLOR=DarkRed][QUOTE=ANTONIO_424][CENTER][COLOR=DarkRed]Go for it, and remember, video tape every moment...........I gotta see this :D[/COLOR][/CENTER][/QUOTE][/COLOR][/URL][SIZE=1][B][U][URL=http://forums.qj.net/showthread.php?t=65979]A Ultimate QJ FAQ[/URL][/U][/B]-[B][U][URL=http://forums.qj.net/search.php?do=finduser&u=13500]Topics I'm in[/URL][/U][/B]-[B][U][URL=http://forums.qj.net/f-psp-development-forum-11/t-pps-game-66613.html]My qj game topic[/URL][/U][/B]-[B][U][URL=http://www.psp-programming.com/dev-forum/viewtopic.php?t=962]My psp-prog topic[/URL][/U][/B]-[B][U][URL=http://files.pspupdates.qj.net/cgi-bin/cfiles.cgi]Old QJ Download site[/URL][/U][/B]-[B][U][URL=http://forums.qj.net/showthread.php?t=46926]Only ISO topic[/URL][/U][/B][/SIZE] "You stayed up all night trying to make your psp crash? LOLOL!!" - my brother My PSN name is "icantthinkofone".[/CENTER] |
|
|
|
|
|
#3 |
![]() ![]() OMFG
|
By 'clearing the screen' it depends how you setup your framebuffer, etc. If you're just using the default graphics.c/h then it would be flipScreen(); , or perhaps clearScreen(0);
Code:
#define RGB(r, g, b) (0xFF000000 | ((b)<<16) | ((g)<<8) | (r)) Or if you mean just getting the current dir, it would be Code:
char path[255]; getcwd(path, 255); |
|
|
|
|
|
#4 | |
![]() likes kittens....awww....
Join Date: Sep 2006
Real First Name: Erik
Location: Detroit
Just Played: Call of Duty:World at War
Posts: 628
Trader Feedback: 0
|
Quote:
LOL-= Double Post =- how do you define a null variable?? Last edited by psphacker12.; 10-04-2006 at 03:04 PM.. Reason: Automerged Doublepost |
|
|
|
|
|
|
#5 |
![]() ![]() sceKernelExitGame();
|
bool variable = NULL;
I believe that would work, but I always get confused with the bools and NULL and nil and flase and true
__________________
|
|
|
|
|
|
#6 |
![]() ![]() Developer
|
You can't define a NULL variable (not in the literal sense). You can initialise the base datatypes (int, float, double, bool, etc) to 0 or a default value of your choosing. You can NULL a pointer so that it points to 'nothing' by:
Code:
int * pOddVariableName = NULL; // pointer is now NULLed pOddVariableName = NULL; // Or can assign the value to an existing pointer Code:
// Let's see if I can remember some C int * pNumber = malloc( sizeof(int) ); // Allocated 4 bytes on the heap *pNumber = 10; // Given it a value for the hell of it pNumber = NULL; // Does not free the memory on the heap *pNumbr = 13; // Runtime NULL exception error. Tried to give a value to 'nothing' Code:
// Let's see if I can remember some C int * pNumber = malloc( sizeof(int) ); // Allocated 4 bytes on the heap *pNumber = 10; // Given it a value for the hell of it free( pNumber ); // Freed the memory on the heap *pNumber = 13; // Runtime exception error because the memory that the pointer was pointing to is now free so the program can't assign the value pNumber = NULL; // Always NULL your pointers when you free them. Bugs are a lot easier to track this way. |
|
|
|
|
|
#8 |
![]() ![]() ...in a dream...
|
psphacker12 - Plesae use the appropraite thread for this. Also, there are plenty of converters out there... The links on the bottom of this site give you lots of resources...
http://www.colortools.net/article_web_colors.html
__________________
...you'll never know what it's like... spending your whole life in a dream...
Launch a Kitten out of a Cannon and win real cash! Checkout my newly updated site for all my projects (Kitten Cannon, BOXHEAD, Light Cycle 3D) |
|
|
|
|
|
#9 |
![]() |
http://www.psp-programming.com/tutorials/c/lesson05.htm
this little sample will doo all the colours you want. with all the txt and background colours you want.
__________________
[CENTER]You can hyperlink quotes and the whole box will be a link: [URL=http://forums.qj.net/showthread.php?t=35215][COLOR=DarkRed][QUOTE=ANTONIO_424][CENTER][COLOR=DarkRed]Go for it, and remember, video tape every moment...........I gotta see this :D[/COLOR][/CENTER][/QUOTE][/COLOR][/URL][SIZE=1][B][U][URL=http://forums.qj.net/showthread.php?t=65979]A Ultimate QJ FAQ[/URL][/U][/B]-[B][U][URL=http://forums.qj.net/search.php?do=finduser&u=13500]Topics I'm in[/URL][/U][/B]-[B][U][URL=http://forums.qj.net/f-psp-development-forum-11/t-pps-game-66613.html]My qj game topic[/URL][/U][/B]-[B][U][URL=http://www.psp-programming.com/dev-forum/viewtopic.php?t=962]My psp-prog topic[/URL][/U][/B]-[B][U][URL=http://files.pspupdates.qj.net/cgi-bin/cfiles.cgi]Old QJ Download site[/URL][/U][/B]-[B][U][URL=http://forums.qj.net/showthread.php?t=46926]Only ISO topic[/URL][/U][/B][/SIZE] "You stayed up all night trying to make your psp crash? LOLOL!!" - my brother My PSN name is "icantthinkofone".[/CENTER] |
|
|
|
|
|
#11 |
![]() ![]() I'm Baaaack!
|
Well, I just took a quick look at your error, and it amazes me you couldn't figure out that last one. It says error before ')' in line 56. Go to line 56 and you'll notice that you put this:
",); Take out the comma. I don't know how you couldn't figure that one out.
__________________
|
|
|
|
|
|
#12 | |
![]() likes kittens....awww....
Join Date: Sep 2006
Real First Name: Erik
Location: Detroit
Just Played: Call of Duty:World at War
Posts: 628
Trader Feedback: 0
|
Quote:
Code:
Dave@PREFERRE-FA8B50 ~ $ cd /pspdev Dave@PREFERRE-FA8B50 /pspdev $ make psp-gcc -I. -I/usr/psp/sdk/include -O2 -G0 -Wall -c -o main.o main.c main.c : In function 'main': main.c(48) : error: syntax error before 'bool' main.c : In function 'rand': main.c(52) : error: 'rn0' undeclared (first use in this function) main.c(52) : error: (Each undeclared identifier is reported only once main.c(52) : error: for each function it appears in.) main.c : In function 'main': main.c(67) : error: syntax error at end of input make: *** [main.o] Error 1 Dave@PREFERRE-FA8B50 /pspdev $ |
|
|
|
|
|
|
#13 | |
![]() |
Quote:
remove that line and the braces and probably would be a good idea to have rn0 as int rn0 = 0; You could also probably remove the if statement for if pad.Buttons is pressed as it is handled with the next if statement Code:
while (1) {
char buffer[200]
int rn0 = 0;
if(pad.Buttons & PSP_CTRL_CROSS) {
rn0=rand()%10000;
}
if (rn0 != 0) {
pspDebugScreenPrintf("Press 'X' to start.",);
}
|
|
|
|
|
|
|
#14 |
![]() ![]() AKA Homer
|
There is no such thing as a bool datatype in C, you either have to use BOOL (which really just is an int) or int.
|
|
|
|
![]() |
| Tags |
| coding or programming |
| Thread Tools | |
|
|