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; Can anybody tell me how I would go on about accessing flash0 via USB? Spoiler for main.c : Code: #include ...
-
03-16-2008, 03:51 PM #8191QJ Gamer Blue
- Registriert seit
- Oct 2007
- Ort
- Illinois
- Beiträge
- 158
- Points
- 3.734
- Level
- 38
- Downloads
- 0
- Uploads
- 0
Can anybody tell me how I would go on about accessing flash0 via USB?
Spoiler for main.c:
What would have to be edited so I can use flash0 on USB instead of Mem Stick? I think I might have to mount flash0, but im not sure how.
-
03-16-2008, 04:42 PM #8192OMFG

- Registriert seit
- Jul 2005
- Ort
- Toronto
- Beiträge
- 2.814
- Points
- 19.453
- Level
- 88
- Downloads
- 0
- Uploads
- 0
Nvm
Geändert von Slasher (03-17-2008 um 01:28 PM Uhr)
-
03-17-2008, 02:21 AM #8193QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Why a pointer?
Zitat von Xsjado7
[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-17-2008, 02:23 AM #8194QJ Gamer Bronze

- Registriert seit
- Aug 2007
- Ort
- Australia
- Beiträge
- 659
- Points
- 8.045
- Level
- 60
- Downloads
- 0
- Uploads
- 0
thats just the way its declared
Code:OSL_COLOR *white;
-
03-17-2008, 07:17 AM #8195QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
No it isn't, looking at the samples on his page (Super Patrick II), line 191:
Zitat von Xsjado7
It is a typedef base type so I honestly can't see a reason why it should be a pointer.Code:const OSL_COLOR couleurMasque = RGB(255, 0, 255);
[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-17-2008, 08:31 AM #8196QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
yaustar is correct as someone who uses the oslib for a gfx's library you can take my word, colors do not require pointer's even if images, fonts, and sounds do
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
-
03-17-2008, 09:20 AM #8197QJ Gamer Platinum
- Registriert seit
- Feb 2006
- Ort
- National Front Disco
- Beiträge
- 13.057
- Points
- 66.627
- Level
- 100
- Downloads
- 0
- Uploads
- 0
Thanks guys, I decided to bin the colours and use an arrow pointer.
-
03-17-2008, 09:28 AM #8198Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
*Grumbles at Moose*
-
03-17-2008, 09:32 AM #8199QJ Gamer Platinum
- Registriert seit
- Feb 2006
- Ort
- National Front Disco
- Beiträge
- 13.057
- Points
- 66.627
- Level
- 100
- Downloads
- 0
- Uploads
- 0
I might try colours again but not any time soon.
-
03-17-2008, 09:54 AM #8200
- Registriert seit
- Mar 2008
- Beiträge
- 12
- Points
- 2.680
- Level
- 31
- Downloads
- 0
- Uploads
- 0
hi again,
is it also possible to load instead of .png's .bmp's or .jpeg with a library???:o , because I can use it very well:Jump:
-
03-17-2008, 09:56 AM #8201Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
svn co svn://svn.ps2dev.org/psp/trunk/Jpeg
I think ...
-
03-17-2008, 10:11 AM #8202
- Registriert seit
- Mar 2008
- Beiträge
- 12
- Points
- 2.680
- Level
- 31
- Downloads
- 0
- Uploads
- 0
It doesn't exist
, some1 knows if it is possible??
-
03-17-2008, 10:16 AM #8203It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Lowercase j.
svn co svn://svn.ps2dev.org/psp/trunk/jpegpəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
03-17-2008, 10:44 AM #8204
- Registriert seit
- Mar 2008
- Beiträge
- 12
- Points
- 2.680
- Level
- 31
- Downloads
- 0
- Uploads
- 0
great! It works:)
I've installed the library, but which header files do I have to use (and add to my makefile)? And in the script, can I do excactly the same as with the .png's?
-
03-17-2008, 01:11 PM #8205
- Registriert seit
- Mar 2008
- Beiträge
- 1
- Points
- 2.612
- Level
- 31
- Downloads
- 0
- Uploads
- 0
if youre using SDL its the same line of code.
SDL_Surface *image;
image = IMG_Load(file);
-
03-17-2008, 01:57 PM #8206QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
hey question:
how can i make a function with passes that are optional?
i.e.:
void func(int x,int y,bool starter){
//some code
}
now than i don't always want to pass the starter bool, is their a way to make that an optional value?
edit: i figured it out nowGeändert von slicer4ever (03-17-2008 um 02:13 PM Uhr)
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
-
03-17-2008, 04:21 PM #8207It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
You need SDL_image for that, actually.
Zitat von ernos
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
03-17-2008, 04:35 PM #8208
Hey guys
Awhile back(don't remember what page) I asked for help on AIs'. I have done different things, but I haven't managed to pull of what I need to for something that I am working on...
1) I will ask if anyone knows of a good tutorial/guide for doing the obvious.
2) If all I would like to do is have an object moving vertically or horizontally to follow another object, do I really need any more than the x or y variables?[QUOTE=Archaemic]
[size=1]My manwich![/size][/QUOTE]
[QUOTE=mohaas05]lol i can't say d*ck?[/QUOTE]
-
03-17-2008, 04:53 PM #8209It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Mm? You mean like this thing I made three years ago? Yeah, all I used were x/y coordinates and trigonometry.
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
03-17-2008, 04:56 PM #8210
Zitat von Archaemic
The question is, is it in C++ that you wrote it? That was similar to what I was originally thinking, but if you have multiple objects following around, you would have to set it up so that they don't hover over each other...
Could you PM the code for it? If you can, I may just be able to tailor it to my needs.[QUOTE=Archaemic]
[size=1]My manwich![/size][/QUOTE]
[QUOTE=mohaas05]lol i can't say d*ck?[/QUOTE]
-
03-18-2008, 10:20 AM #8211QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
k i have a problem with 2 functions that i can't seem to fix:
Spoiler for first function:
Spoiler for second function:
now than inside the second function you can see the working way...and the non working way, as you can clearly see the working way contains the exact same code as the function it is calling in the non working way
as many of you well probably say:
hey your re-declaring the same variables
however i changed the variable names in the function as a test and it still crashes when that function is called and idk y so can someone help?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
-
03-18-2008, 10:31 AM #8212I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Is it possible to load an EBOOT with sceKernelLoadModule or another like function? Or, how could I strip the prx/elf from the EBOOT? I don't want to be loading the EBOOT with loadExec calls as that resets the rest of the system.
-Aura
-
03-18-2008, 12:04 PM #8213QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Put up the code for both Grid struct and Enemy struct. I would like to see what member variables in both structs.
Zitat von slicer4ever
Edit: Do you get a stack overflow exception?[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-18-2008, 12:26 PM #8214QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
no i don't get a stck overflow exception
structures:
Code:typedef struct{ OSL_IMAGE *image; float x; float y; int CT; int angle; int speed; int health; }Enemy; typedef struct { Tile Tiles[30*30]; int ST; int ET; int GSX; int GSY; }Grid;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
-
03-18-2008, 02:12 PM #8215QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
What is in the Tile struct?
Try this function:
Calling it with:Code:Enemy SetupEnemy( const Grid * pGrid ){ Enemy e; e.image = EnemyImages[CurrentWave]; e.x = pGrid->Tiles[pGrid->ST].x+pGrid->Tiles[pGrid->ST].w/2; e.y = pGrid->Tiles[pGrid->ST].y+pGrid->Tiles[pGrid->ST].h/2; if(pGrid->Tiles[pGrid->ST].dir==0){ e.angle=180; }else if(pGrid->Tiles[pGrid->ST].dir==1){ e.angle=90; }else if(pGrid->Tiles[pGrid->ST].dir==2){ e.angle=270; }else if(pGrid->Tiles[pGrid->ST].dir==3){ e.angle=0; } e.CT = pGrid->ST; e.speed=2; e.health=10; return e; }
Edit: You are using straight C and not C++ right?Code:e = SetupEnemy(&g);
[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-18-2008, 02:14 PM #8216
Well, you could load the ELF inside a 64-alligned buffer and use sceKernelLoadModuleBuffer ;)
Zitat von Auraomega
sceIoLseek to 0x20 inside the PBP, and you'll find the offset of the ELF inside there as little endian. For example, if it says 56 06 00 00, take a look at 0x00000656. Now look at 0x24 for the next part of the PBP, aka the end of the ELF :)
And there you have it, the ELF, load it into a 64-alligned buffer and use sceKernelLoadModuleBuffer and start it ;)
Will be quite tricky to put that into reality in C code though
Geändert von JumpR (03-18-2008 um 02:26 PM Uhr)
-
03-18-2008, 02:29 PM #8217
Alright, I have a quick question regarding plug-ins, what type of setup would I need to start writing some?
[QUOTE=Archaemic]
[size=1]My manwich![/size][/QUOTE]
[QUOTE=mohaas05]lol i can't say d*ck?[/QUOTE]
-
03-18-2008, 02:31 PM #8218QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
i'm using c++ but no more worries i'm using an alternative method
Zitat von yaustar
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
-
03-18-2008, 02:37 PM #8219QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Then please use classes and member functions. At the moment, all the code you have shown so far is C.
Zitat von slicer4ever
[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-18-2008, 02:45 PM #8220QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
bleh classes i prefer structures atm
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


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