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; Zitat von vodkkaa what is the function to erase the entire nand. no i am not making a bricker (pointless ...
-
08-24-2007, 03:29 PM #6211QJ Gamer Green
- Registriert seit
- Apr 2006
- Ort
- England ~¦¦¦|+|¦¦¦~
- Beiträge
- 1.112
- Points
- 9.165
- Level
- 64
- My Mood
-
- Downloads
- 0
- Uploads
- 0
Zitat von vodkkaa
???Code:sceNandEraseAllBlock();
pspnand_driver.h as a header... Youd need to make it a kernel app etc...
...Just Returned To The Scene...
-
08-24-2007, 03:31 PM #6212
lol i just found it in pspnand_driver.h. thanks though
-
08-25-2007, 01:05 AM #6213QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- Middle Europe
- Beiträge
- 1.281
- Points
- 11.800
- Level
- 71
- Downloads
- 0
- Uploads
- 0
vodkkaa: my mate formated flash0 and then recovered, so it should work
[1 Year QJ Member]
[LUA Coder and C Learner]
[Ball Revamped Clone v0.1]
[Phil's Shooting Range v0.3]
[HideFile PRX v2]
[SSR PRX v1.1]
-
08-25-2007, 02:14 AM #6214QJ Gamer Silver
- Registriert seit
- Sep 2006
- Ort
- Finland
- Beiträge
- 752
- Points
- 7.385
- Level
- 57
- Downloads
- 0
- Uploads
- 0
vodkkaa is erasing the whole flash, it'll destroy idstorage, flash0/1/2/3 etc.
Zitat von myschoo
wheeee =:D
-
08-25-2007, 04:59 AM #6215Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
and pandora WONT recover it , so pointless to test , hold the psp for tests with idstorage , much more needed
-
08-25-2007, 06:57 AM #6216QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- Middle Europe
- Beiträge
- 1.281
- Points
- 11.800
- Level
- 71
- Downloads
- 0
- Uploads
- 0
so where is stored idstorage? if u format flash0 and then still recover
[1 Year QJ Member]
[LUA Coder and C Learner]
[Ball Revamped Clone v0.1]
[Phil's Shooting Range v0.3]
[HideFile PRX v2]
[SSR PRX v1.1]
-
08-25-2007, 08:18 AM #6217Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
on the nand , idstorage.prx is a librarie
-
08-25-2007, 08:31 AM #6218It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
:facepalm: idstorage.prx is a library in flash0 that manipulates the idstorage. It isn't the idstorage itself.
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
08-25-2007, 09:06 AM #6219I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
If thats so, where is idstorage actually stored, I'm guessing its not hardcoded into the hardware, else it wouldn't be damagable, right? And what are the exact ill effects of removing it?
Zitat von Archaemic
I've never really understood that much about idstorage, I guess now is the time to learn :)
-Aura
-
08-25-2007, 09:09 AM #6220Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
Thats just the same I said
Zitat von Archaemic
he said format flash0 => doesnt do anything to flash0
so i said it's on the nand , idstorage.prx (I guess that is the thing why he thought it was on flash0) is a library....
-
08-25-2007, 09:25 AM #6221It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
NAND is a kind of flash memory, by the way, and at that, the kind that the PSP uses. Saying it's on the NAND and on the flash memory mean the same thing. It's just not one of the flashx folders.
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
08-25-2007, 09:26 AM #6222Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
flash0 is a partation on the nand (or how you say it in englisch)
-
08-25-2007, 09:33 AM #6223It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Partition. And yes, that's exactly what flash0 is.
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
08-25-2007, 01:52 PM #6224I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
So, where exactly is idstorage? I'm assuming by what was said that its in a partition of the nand, but we know its not going to be in flash0-3... I'm confused...
And another question, how do I check the content of a directory, and display everything in it, sort of like iRShell or PSP Filer... I've taken a look at various peices of source code, but just got overwhelmed (I'm not good at reading big peices of source code from other people). I've noticed that there appears to be nothing in the pspiomanager.h file that can help.
-Aura
-
08-25-2007, 01:57 PM #6225It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Um, sceIoDopen, sceIoDread and sceIoDclose.
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
08-25-2007, 02:01 PM #6226I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Thats it? *Smashes head on table*
Zitat von Archaemic
Do you have as simple an answer to the idstorage question?
-Aura
-
08-25-2007, 02:01 PM #6227QJ Gamer Blue
- Registriert seit
- Jul 2007
- Beiträge
- 296
- Points
- 3.795
- Level
- 38
- Downloads
- 0
- Uploads
- 0
Umm, hold on. I have a sample some where...
-= Double Post =-
This is from something I was making, called dsxPlugin.
I didn't finish it because I didn't think anyone would use it, but still, it shows how it works. Or, at least, how I would do it.Code:typedef struct { char filename[256]; int id; } dsxFile; typedef struct { int numFiles; dsxFile* files; } dsxFilebrowser; dsxFilebrowser _dsxFilebrowser; char _dsxPluginBrowserPath[256] = "ms0:"; int dsxPluginBrowserSet(const char* path) { strncpy(_dsxPluginBrowserPath, path, 256); printf("New browser path:\n\t%s\n", _dsxPluginBrowserPath); return 1; } int dsxPluginBrowserBuild() { /** * Define our dirent. * dirent holds the current * file info. As we need our * dirent to act as a point, * memset it before use. */ SceIoDirent dirent; memset(&dirent, 0, sizeof(SceIoDirent)); SceUID dirId = sceIoDopen(_dsxPluginBrowserPath); if(dirId < 0) { //* Error check printf("Error: Unable to open directory \"%s\". SONY ERROR CODE: %X\n", _dsxPluginBrowserPath, dirId); dsxPluginBrowserSet("ms0:"); dsxPluginBrowserBuild(); } /** * Get file count. * sceIoDread return > 0 when * there are still files to * be read in the said directory. */ int fileCount = 0; while(sceIoDread(dirId, &dirent) > 0) { fileCount++; } /** * Close and reopen the file. * There is no rewind function * in the sceIo* lib, so we * do it the manual way. */ sceIoDclose(dirId); dirId = sceIoDopen(_dsxPluginBrowserPath); if(dirId < 0) { //* Error check printf("Error: Unable to open directory \"%s\". SONY ERROR CODE: %X\n", _dsxPluginBrowserPath, dirId); dsxPluginBrowserSet("ms0:"); dsxPluginBrowserBuild(); } /** * Free any files that * are left. */ if(_dsxFilebrowser.files) { free(_dsxFilebrowser.files); _dsxFilebrowser.files = NULL; } /** * Malloc enough data to * hold enough files for the * current directory. */ _dsxFilebrowser.files = (dsxFile*) malloc(sizeof(dsxFile) * fileCount); int i, err; for(i = 0; i < fileCount; i++) { err = sceIoDread(dirId, &dirent); if(err < 0) { printf("Unable to read file.\n"); return 0; } /** * Get filename and file id. */ strncpy(_dsxFilebrowser.files[i].filename, dirent.d_name, 256); _dsxFilebrowser.files[i].id = i; } _dsxFilebrowser.numFiles = fileCount; sceIoDclose(dirId); return 1; } int dsxPluginBrowserDump(const char* path) { FILE* pFile = fopen(path, "a"); if(!pFile) { printf("Error: Unable to open file, \"%s\"\n", path); return 0; } int i; for(i = 0; i < _dsxFilebrowser.numFiles; i++) { fprintf(pFile, "File ID: %d\n\t%s\n\n", _dsxFilebrowser.files[i].id, _dsxFilebrowser.files[i].filename); } fclose(pFile); return 1; }Geändert von _dysfunctional (08-25-2007 um 02:06 PM Uhr) Grund: Automerged Doublepost
-
08-25-2007, 02:08 PM #6228I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
Thanks, that should come in handy.
-Aura
Ok, I've got it all working well, except how to go down the directories, as in going from ms0:/PSP/GAME to ms0:/PSP, when using the .. option. Is there some sort of easy way of doing this, or do I have to do this manually?
Also, whats the . signify? I always thought that ./ was the same directory?Geändert von Auraomega (08-25-2007 um 05:08 PM Uhr)
-
08-26-2007, 03:52 AM #6229Heroes never die

- Registriert seit
- Aug 2006
- Ort
- ...........
- Beiträge
- 1.323
- Points
- 8.645
- Level
- 62
- Downloads
- 0
- Uploads
- 0
. is the root
and just write some function to let the user press 0 to go a folder up
-
08-26-2007, 04:35 AM #6230It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
hallo is wrong again. . is the same folder. It's just there because it's part of various standards.
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
08-26-2007, 05:26 AM #6231QJ Gamer Green
- Registriert seit
- Sep 2006
- Ort
- Cape Town, South Africa
- Beiträge
- 714
- Points
- 5.795
- Level
- 49
- Downloads
- 0
- Uploads
- 0
"." and "./" mean the same thing, unless there's a subtle difference that I'm unaware of.
-
08-26-2007, 07:19 AM #6232Banned for LIFE
- Registriert seit
- Oct 2006
- Ort
- East London, England
- Beiträge
- 2
- Points
- 18.744
- Level
- 86
- Downloads
- 0
- Uploads
- 0
Really quick question here.
When would you use int main(int argc, char* argv[]) instead of just int main() ?
-
08-26-2007, 07:20 AM #6233It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
If you want to accept command line arguments. On the PSP, that really only happens if it's an iR Shell plugin.
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
08-26-2007, 09:27 AM #6234QJ Gamer Blue
- Registriert seit
- Jul 2007
- Beiträge
- 296
- Points
- 3.795
- Level
- 38
- Downloads
- 0
- Uploads
- 0
Please, stop answering questions. :/
Zitat von hallo007
. and ./ mean the same thing. The difference is that . is a directory, so you can't append a file to it.
Would represent a folder named '.someotherfolder'..someotherfolder/
Would represent a folder named 'someotherfolder' in the current directory../someotherfolder/
-
08-26-2007, 10:05 AM #6235QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- USA SC/NC
- Beiträge
- 699
- Points
- 5.712
- Level
- 48
- Downloads
- 0
- Uploads
- 0
I've never felt the need for it, nor was I ever interested in using it, but can't you use
Zitat von Archaemic
I remember I saw it a while back but never got around to using it.Code:pspSdkLoadStartModuleWithArgs(const char *filename, int mpid, int argc, char * const argv[]);
[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]
-
08-26-2007, 10:06 AM #6236QJ Gamer Blue
- Registriert seit
- Jul 2007
- Beiträge
- 296
- Points
- 3.795
- Level
- 38
- Downloads
- 0
- Uploads
- 0
Yes, and the argc and argv are passed to the main function, telling the plugin what to do.
-
08-26-2007, 11:13 AM #6237I'm back!

- Registriert seit
- Feb 2007
- Ort
- England
- Beiträge
- 902
- Points
- 8.236
- Level
- 61
- Downloads
- 0
- Uploads
- 0
How do I go down a directory? I've tried making a manual way, but I keep crashing or ending up in the root oddly.
Also, how do I check file extentions? So as to load a .PBP when its selected.
Thanks
-Aura
-
08-26-2007, 11:16 AM #6238It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
strrchr will be your friend in both cases.
pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ
-
08-26-2007, 12:16 PM #6239QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- USA SC/NC
- Beiträge
- 699
- Points
- 5.712
- Level
- 48
- Downloads
- 0
- Uploads
- 0
Well, there's a few approaches to doing that. You could:
Zitat von Auraomega
Thats one way to do it. Also, you would need to create a menu to select the items. Shouldn't take much space for the entire code.Code:void load_file(char* file) { int x = 0; char temp[5]; int namelen = strlen(file); file += (namelen-4); if(strcmp(file,".pbp")==0) { file -= (namelen-4); /*Load eboot*/; } }[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]
-
08-26-2007, 12:29 PM #6240It's good to be free...

- Registriert seit
- Feb 2007
- Beiträge
- 2.440
- Points
- 10.420
- Level
- 67
- Downloads
- 0
- Uploads
- 0
Why modify file?
Code:void load_file(const char *file) { int namelen = strlen(file) if(strcasecmp(file+namelen-4,".pbp")==0) { /*Load eboot*/; } }pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ


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