Zeige Ergebnis 8.551 bis 8.580 von 10174
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; You need to set PSPDEV. Read the readme. It's there for a reason....
-
05-20-2008, 01:40 PM #8551Developer

- Registriert seit
- Mar 2006
- Beiträge
- 1.026
- Points
- 7.577
- Level
- 58
- Downloads
- 0
- Uploads
- 0
You need to set PSPDEV.
Read the readme. It's there for a reason.

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
-
05-20-2008, 01:44 PM #8552QJ Gamer Silver

- Registriert seit
- May 2006
- Ort
- Behind you.
- Beiträge
- 1.814
- Points
- 10.921
- Level
- 69
- Downloads
- 0
- Uploads
- 0
What readme?
Calypso - Enjoy the excellent 2D space shooter:
http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195
"Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)
-
05-20-2008, 01:46 PM #8553Developer

- Registriert seit
- Mar 2006
- Beiträge
- 1.026
- Points
- 7.577
- Level
- 58
- Downloads
- 0
- Uploads
- 0
That readme.Code:ZeMac:~ david.perry$ cd psptoolchain ZeMac:~/psptoolchain david.perry$ ls build patches readme.txt toolchain-sudo.sh depends readme-ubuntu.txt scripts toolchain.sh ZeMac:~/psptoolchain david.perry$

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
-
05-20-2008, 02:09 PM #8554QJ Gamer Silver

- Registriert seit
- May 2006
- Ort
- Behind you.
- Beiträge
- 1.814
- Points
- 10.921
- Level
- 69
- Downloads
- 0
- Uploads
- 0
Still confused...
Calypso - Enjoy the excellent 2D space shooter:
http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195
"Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)
-
05-20-2008, 05:30 PM #8555
- Registriert seit
- Apr 2006
- Beiträge
- 28
- Points
- 4.137
- Level
- 40
- Downloads
- 0
- Uploads
- 0
I think you may need to add:
to your cygwin.bat file, above the line that says:Code:set path=%path%;C:/cygwin/usr/local/pspdev/bin set PSPSDK=C:/cygwin/usr/local/pspdev
Of course, that could be wrong. I was going to post the relevant part of the readme, but I couldn't find it on my system either. I probably got rid of it sometime during the install chaos or something.Code:bash --login -i
Also, I still need a tutor. :Cry:
-
05-20-2008, 06:35 PM #8556QJ Gamer Silver

- Registriert seit
- May 2006
- Ort
- Behind you.
- Beiträge
- 1.814
- Points
- 10.921
- Level
- 69
- Downloads
- 0
- Uploads
- 0
I already put that.
Calypso - Enjoy the excellent 2D space shooter:
http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195
"Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)
-
05-21-2008, 12:14 AM #8557Developer

- Registriert seit
- Mar 2006
- Beiträge
- 1.026
- Points
- 7.577
- Level
- 58
- Downloads
- 0
- Uploads
- 0
PSPDEV is not the same as PSPSDK...

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
-
05-21-2008, 02:11 AM #8558QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- USA SC/NC
- Beiträge
- 699
- Points
- 5.712
- Level
- 48
- Downloads
- 0
- Uploads
- 0
http://forums.ps2dev.org/viewtopic.p...er=asc&start=0
Just a suggestion, SuperBatXS.[CODE]Random Facts:
irc://irc.malloc.us #wtf #**********
[/CODE]
[SIZE="6"][FONT="Century Gothic"][COLOR="Blue"][URL="http://forums.**********.net"]http://forums.**********.net[/URL][/COLOR][/FONT][/SIZE]
-
05-21-2008, 07:07 AM #8559QJ Gamer Silver

- Registriert seit
- May 2006
- Ort
- Behind you.
- Beiträge
- 1.814
- Points
- 10.921
- Level
- 69
- Downloads
- 0
- Uploads
- 0
I love you, Moca...that's so awesome.
Another question, how do i use this (bin2c) with OSLib:
http://psp-coding.com/index.php?topic=24.0Calypso - Enjoy the excellent 2D space shooter:
http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195
"Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)
-
05-21-2008, 09:33 AM #8560QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- USA SC/NC
- Beiträge
- 699
- Points
- 5.712
- Level
- 48
- Downloads
- 0
- Uploads
- 0
You mean with an image...? Not "with OSLib". Anyway, bin2c just converts each byte in a file into it's hexadecimal equivalent and sticks it in an array.
Zitat von SuperBatXS
Just include the header containing the buffer so that you can use it in your code. The array is loaded into memory, so be wary of how big the array you are loading is.
#include "myFile.h"
From the "tutorial"
"There are ways to include other types of files, but I'll go over that later." - Just to let you know, this IS how you include "other types of files". The difference is how you deal with the file that you bin2c'd[CODE]Random Facts:
irc://irc.malloc.us #wtf #**********
[/CODE]
[SIZE="6"][FONT="Century Gothic"][COLOR="Blue"][URL="http://forums.**********.net"]http://forums.**********.net[/URL][/COLOR][/FONT][/SIZE]
-
05-21-2008, 11:03 AM #8561QJ Gamer Silver

- Registriert seit
- May 2006
- Ort
- Behind you.
- Beiträge
- 1.814
- Points
- 10.921
- Level
- 69
- Downloads
- 0
- Uploads
- 0
I got bin2c to convert my image into a header file, which i am supposed to include. My question is, how do i load the image from memory using OSLib, similiar to this code with the modified graphics lib on that website:
Zitat von Moca
Code:Image* background = loadImageFromMemory(Name_Of_Structure,sizeof(Name_Of_Structure);
Calypso - Enjoy the excellent 2D space shooter:
http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195
"Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)
-
05-21-2008, 11:39 AM #8562QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- USA SC/NC
- Beiträge
- 699
- Points
- 5.712
- Level
- 48
- Downloads
- 0
- Uploads
- 0
Just like you would load any other picture loaded in memory? I haven't used OSLib, but surely you can pass the address of a buffer containing the image to a function. Look in the oslib header file.
Zitat von SuperBatXS
A simple google search lead me to "oslLoadImageFile". I'm sure that function calls another function which takes an address of a buffer holding the image. Well, it should if the code was made to be reusable...[CODE]Random Facts:
irc://irc.malloc.us #wtf #**********
[/CODE]
[SIZE="6"][FONT="Century Gothic"][COLOR="Blue"][URL="http://forums.**********.net"]http://forums.**********.net[/URL][/COLOR][/FONT][/SIZE]
-
05-21-2008, 02:35 PM #8563words 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
Yes, oslib has a method to load an image internally (rather then externally). Heh, how do you think the intro function is done?
Read your documentation ;)
If you're too lazy here's a sample:
Code:// your 'text' image data const unsigned long text_data[] = { ... }; // your 'picture' image data const unsigned long picture_data[] = { ... }; // Your array of virtual files (rather then explain either look at your documentation, even still you should be able to understand this just by looking at it) const OSL_VIRTUALFILENAME ram_files[] = { {"ram:/text.png", (void*) text_data, sizeof(text_data), &VF_MEMORY}, {"ram:/picture.png", (void*)picture_data, sizeof(picture_data), &VF_MEMORY} }; ... // call this once before you attempt to load the images oslAddVirtualFileList((OSL_VIRTUALFILENAME*)ram_files, oslNumberof(ram_files)); // Then just call the load image function like an external image, just use the ram: device OSL_IMAGE *text = oslLoadImageFile("ram:/text.png", OSL_IN_RAM | OSL_SWIZZLED, OSL_PF_8888); oslAssert(text); OSL_IMAGE *picture = oslLoadImageFile("ram:/picture.png", OSL_IN_RAM | OSL_SWIZZLED, OSL_PF_5551); oslAssert(picture);
...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
-
05-21-2008, 03:57 PM #8564QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- USA SC/NC
- Beiträge
- 699
- Points
- 5.712
- Level
- 48
- Downloads
- 0
- Uploads
- 0
Seems like an overly complicated solution to a simple problem. Surely oslLoadImageFile is just a simple function that opens a file and reads it into a buffer. Then passes the address of that buffer to another function which does the real work.
Zitat von SG57
I'm saying that oslLoadImageFile's purpose should only be to read a file into memory and call another function to do all the image work. All SuperBatXS needs is that function that oslLoadImageFile calls which takes the address of a buffer. No need for overly complicated virtual files in memory.
I don't care much for OSLib since I have no need to use it, just giving advice.[CODE]Random Facts:
irc://irc.malloc.us #wtf #**********
[/CODE]
[SIZE="6"][FONT="Century Gothic"][COLOR="Blue"][URL="http://forums.**********.net"]http://forums.**********.net[/URL][/COLOR][/FONT][/SIZE]
-
05-21-2008, 04:59 PM #8565QJ Gamer Gold

- Registriert seit
- Jul 2005
- Ort
- everywhere
- Beiträge
- 3.526
- Points
- 17.453
- Level
- 84
- Downloads
- 1
- Uploads
- 0
superbat...can i ask why you'r including an image as a header...? especially using oslib, i highly dought your ganna need your image hard-coded into the program, if your that scared of others replacing the image, just load it into the program with oslLoadImageFile, but hey if you rly need to, do wat sg said
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
-
05-21-2008, 05:00 PM #8566QJ Gamer Silver

- Registriert seit
- May 2006
- Ort
- Behind you.
- Beiträge
- 1.814
- Points
- 10.921
- Level
- 69
- Downloads
- 0
- Uploads
- 0
I know what SG57 is saying, but i have no idea what you mean Moca. Could you give a snippet?
Thanks dude,
Sexy...er, SuperBatXS (wait, what's the difference)Calypso - Enjoy the excellent 2D space shooter:
http://dl.qj.net/Calypso-v1-PSP-Home...6542/catid/195
"Quoting yourself in your signature means you love to masterbate while looking at the mirror." -me (oh, wait...)
-
05-21-2008, 05:13 PM #8567QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- USA SC/NC
- Beiträge
- 699
- Points
- 5.712
- Level
- 48
- Downloads
- 0
- Uploads
- 0
Zitat von SuperBatXS
There should be a function similar to this:Code:OSL_IMAGE* oslLoadImageFile(char *filename, int location, int pixelFormat)
OSL_IMAGE* oslLoadImageBuffer(char *imageBuffer, int location, int pixelFormat)
Or something like that. It would be stupid to rewrite the image loading part of oslib over and over for each different function that blits an image.[CODE]Random Facts:
irc://irc.malloc.us #wtf #**********
[/CODE]
[SIZE="6"][FONT="Century Gothic"][COLOR="Blue"][URL="http://forums.**********.net"]http://forums.**********.net[/URL][/COLOR][/FONT][/SIZE]
-
05-22-2008, 06:47 AM #8568
Quick question:When reading from a text file how do you move on to the next line if a certain character is in the current line,something like ignoring comments in a .c file.
Example:
I have a .txt that has
Spoiler for myfile.txt:
and all I need is the two 255's
-
05-22-2008, 07:16 AM #8569
assuming your processing linefeeds/crs into nulls or using fgets or doing any kind of post processing etc...Code:p = strchr(line, '/'); if(p != NULL && p[1] == '/') *p = 0;
could answer this a million ways. there is a lot of context missing to know how to answer (ie: how are you reading it into memory).-- Code Monkey : Sarien, Fishguts, Cracks and Crevices --
"Did IQ's just drop sharply while I was away?" (Ripley)
-
05-22-2008, 02:35 PM #8570words 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
Well the virtual file system is meant for things like that, it offers great flexibility and fancy stuff. True it may seem overly complicated for such a simple thing but it accomplishes the same thing he's looking for and to my oslib knowledge (unmodified Oslib anyway) it's the only way (the data member of an OSL_IMAGE is private IIRC)
Zitat von Moca

...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
-
05-22-2008, 11:15 PM #8571QJ Gamer Bronze

- Registriert seit
- Sep 2006
- Ort
- france
- Beiträge
- 170
- Points
- 6.359
- Level
- 52
- Downloads
- 0
- Uploads
- 0
-
05-23-2008, 02:47 AM #8572words 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
The irony being you wrapped in PHP code tags lol

...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
-
05-24-2008, 09:52 PM #8573
thnx daaa57150!! it works perfectly. I wasn't able to use my comp for the past few days (sent for repair) so I didn't see your post.
-
05-28-2008, 05:00 AM #8574Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
God ... it's such a basic program and yet it doesn't work xD, someone tell me what the problem is please.
Its output is:Code:int main(){ system("Untitled1.exe"); //Program tested with and without this line FILE* text; text = fopen("crash.log", "w"); int i; char password[256]; fscanf(text,"%s", password); fclose(text); printf("%s", password); return 0; }
And it seems to be erasing the file crash.log aswell :/Code:-LIBGCCW32-EH-3-SJLJ-GTHR-MINGW32
-= Double Post =-
Nvm I know what the problem is, had it in write mode >_<Geändert von eldiablov (05-28-2008 um 07:29 AM Uhr) Grund: Automerged Doublepost
-
05-28-2008, 10:28 AM #8575QJ Gamer Bronze
- Registriert seit
- Apr 2008
- Ort
- Ireland
- Beiträge
- 978
- Points
- 6.517
- Level
- 52
- Downloads
- 0
- Uploads
- 0
I think this might help :)int main(){
system("Untitled1.exe"); //Program tested with and without this line
FILE* text;
text = fopen("crash.log", "w");
int i;
char password[256];
fscanf(text,"%s", password);
fclose(text);
printf("%s", password);
return 0;
}
int main()
{
system("Untitled1.exe"); //Program tested with and without this line
FILE* text;
text = fopen("crash.log", "w");
int i;
char password[256];
fscanf(text,"%s", password);
fclose(text);
printf("%s", password);
return 0;
}
Then again im new to C++
-
05-28-2008, 10:31 AM #8576QJ Gamer Platinum
- Registriert seit
- Feb 2006
- Ort
- National Front Disco
- Beiträge
- 13.057
- Points
- 66.627
- Level
- 100
- Downloads
- 0
- Uploads
- 0
He isn't writing that for the PSP...
Zitat von MiKeY188
-
05-28-2008, 10:32 AM #8577
your missing an unlink()/remove() to delete the log file once you are done with it.
-- Code Monkey : Sarien, Fishguts, Cracks and Crevices --
"Did IQ's just drop sharply while I was away?" (Ripley)
-
05-28-2008, 10:40 AM #8578QJ Gamer Bronze
- Registriert seit
- Apr 2008
- Ort
- Ireland
- Beiträge
- 978
- Points
- 6.517
- Level
- 52
- Downloads
- 0
- Uploads
- 0
Lol i still got loads to learn!
-
05-28-2008, 11:01 AM #8579Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
Well for one, you cant run EXE's on the PSP ... and that's C not C++
Zitat von MiKeY188
And ulink() ? Never used it before and i'm not gonna start now. Never heard of it ...
-
05-28-2008, 11:09 AM #8580
VSHMAIN.PRX replacement
Solved.
Geändert von Torch (05-31-2008 um 02:10 AM Uhr)



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