Seite 208 von 340 ErsteErste ... 108 158 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 258 308 ... LetzteLetzte
Zeige Ergebnis 6.211 bis 6.240 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; Zitat von vodkkaa what is the function to erase the entire nand. no i am not making a bricker (pointless ...

  
  1. #6211
    QJ Gamer Green
    Points: 9.165, Level: 64
    Level completed: 39%, Points required for next Level: 185
    Overall activity: 0%

    Registriert seit
    Apr 2006
    Ort
    England ~¦¦¦|+|¦¦¦~
    Beiträge
    1.112
    Points
    9.165
    Level
    64
    My Mood
    Bored
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von vodkkaa
    what is the function to erase the entire nand. no i am not making a bricker (pointless becasue of pandoras battery) my brother cracked his lcd screen and the whole right side doesnt work. Instead of buying a new psp he is waiting for the psp slim. so i just want to try the pandora battery method myself by bricking his psp then recovering it. I also want to see if the psp can recover from a 100% corrupt or missing flash. if you feel its not a good idea to post the function on the forum, please pm me it
    Code:
    sceNandEraseAllBlock();
    ???

    pspnand_driver.h as a header... Youd need to make it a kernel app etc...


    ...Just Returned To The Scene...

  2. #6212
    QJ Gamer Green
    Points: 8.459, Level: 62
    Level completed: 3%, Points required for next Level: 291
    Overall activity: 32,0%

    Registriert seit
    Apr 2007
    Beiträge
    886
    Points
    8.459
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    lol i just found it in pspnand_driver.h. thanks though

  3. #6213
    QJ Gamer Green
    Points: 11.800, Level: 71
    Level completed: 38%, Points required for next Level: 250
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Middle Europe
    Beiträge
    1.281
    Points
    11.800
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    vodkkaa: my mate formated flash0 and then recovered, so it should work

  4. #6214
    QJ Gamer Silver
    Points: 7.385, Level: 57
    Level completed: 18%, Points required for next Level: 165
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Finland
    Beiträge
    752
    Points
    7.385
    Level
    57
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von myschoo
    vodkkaa: my mate formated flash0 and then recovered, so it should work
    vodkkaa is erasing the whole flash, it'll destroy idstorage, flash0/1/2/3 etc.
    wheeee =:D

  5. #6215
    Heroes never die
    Points: 8.645, Level: 62
    Level completed: 65%, Points required for next Level: 105
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    ...........
    Beiträge
    1.323
    Points
    8.645
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    and pandora WONT recover it , so pointless to test , hold the psp for tests with idstorage , much more needed

  6. #6216
    QJ Gamer Green
    Points: 11.800, Level: 71
    Level completed: 38%, Points required for next Level: 250
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    Middle Europe
    Beiträge
    1.281
    Points
    11.800
    Level
    71
    Downloads
    0
    Uploads
    0

    Standard

    so where is stored idstorage? if u format flash0 and then still recover

  7. #6217
    Heroes never die
    Points: 8.645, Level: 62
    Level completed: 65%, Points required for next Level: 105
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    ...........
    Beiträge
    1.323
    Points
    8.645
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    on the nand , idstorage.prx is a librarie

  8. #6218
    It's good to be free...
    Points: 10.420, Level: 67
    Level completed: 93%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    2.440
    Points
    10.420
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    :facepalm: idstorage.prx is a library in flash0 that manipulates the idstorage. It isn't the idstorage itself.
    pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ

  9. #6219
    I'm back!
    Points: 8.236, Level: 61
    Level completed: 29%, Points required for next Level: 214
    Overall activity: 99,0%

    Registriert seit
    Feb 2007
    Ort
    England
    Beiträge
    902
    Points
    8.236
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Archaemic
    :facepalm: idstorage.prx is a library in flash0 that manipulates the idstorage. It isn't the idstorage itself.
    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?

    I've never really understood that much about idstorage, I guess now is the time to learn :)

    -Aura
    Last.fm | Deviant Art | First working OS picture

    Zitat Zitat von nickxab Beitrag anzeigen
    I will beat myself. :p

  10. #6220
    Heroes never die
    Points: 8.645, Level: 62
    Level completed: 65%, Points required for next Level: 105
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    ...........
    Beiträge
    1.323
    Points
    8.645
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Archaemic
    :facepalm: idstorage.prx is a library in flash0 that manipulates the idstorage. It isn't the idstorage itself.
    Thats just the same I said

    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....

  11. #6221
    It's good to be free...
    Points: 10.420, Level: 67
    Level completed: 93%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    2.440
    Points
    10.420
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    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 əʞɒʇ

  12. #6222
    Heroes never die
    Points: 8.645, Level: 62
    Level completed: 65%, Points required for next Level: 105
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    ...........
    Beiträge
    1.323
    Points
    8.645
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    flash0 is a partation on the nand (or how you say it in englisch)

  13. #6223
    It's good to be free...
    Points: 10.420, Level: 67
    Level completed: 93%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    2.440
    Points
    10.420
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Partition. And yes, that's exactly what flash0 is.
    pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ

  14. #6224
    I'm back!
    Points: 8.236, Level: 61
    Level completed: 29%, Points required for next Level: 214
    Overall activity: 99,0%

    Registriert seit
    Feb 2007
    Ort
    England
    Beiträge
    902
    Points
    8.236
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    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
    Last.fm | Deviant Art | First working OS picture

    Zitat Zitat von nickxab Beitrag anzeigen
    I will beat myself. :p

  15. #6225
    It's good to be free...
    Points: 10.420, Level: 67
    Level completed: 93%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    2.440
    Points
    10.420
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Um, sceIoDopen, sceIoDread and sceIoDclose.
    pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ

  16. #6226
    I'm back!
    Points: 8.236, Level: 61
    Level completed: 29%, Points required for next Level: 214
    Overall activity: 99,0%

    Registriert seit
    Feb 2007
    Ort
    England
    Beiträge
    902
    Points
    8.236
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Archaemic
    Um, sceIoDopen, sceIoDread and sceIoDclose.
    Thats it? *Smashes head on table*

    Do you have as simple an answer to the idstorage question?

    -Aura
    Last.fm | Deviant Art | First working OS picture

    Zitat Zitat von nickxab Beitrag anzeigen
    I will beat myself. :p

  17. #6227
    QJ Gamer Blue
    Points: 3.795, Level: 38
    Level completed: 97%, Points required for next Level: 5
    Overall activity: 27,0%

    Registriert seit
    Jul 2007
    Beiträge
    296
    Points
    3.795
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    Umm, hold on. I have a sample some where...
    -= Double Post =-
    This is from something I was making, called dsxPlugin.

    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;
    }
    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.
    Geändert von _dysfunctional (08-25-2007 um 02:06 PM Uhr) Grund: Automerged Doublepost

  18. #6228
    I'm back!
    Points: 8.236, Level: 61
    Level completed: 29%, Points required for next Level: 214
    Overall activity: 99,0%

    Registriert seit
    Feb 2007
    Ort
    England
    Beiträge
    902
    Points
    8.236
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    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)
    Last.fm | Deviant Art | First working OS picture

    Zitat Zitat von nickxab Beitrag anzeigen
    I will beat myself. :p

  19. #6229
    Heroes never die
    Points: 8.645, Level: 62
    Level completed: 65%, Points required for next Level: 105
    Overall activity: 0%

    Registriert seit
    Aug 2006
    Ort
    ...........
    Beiträge
    1.323
    Points
    8.645
    Level
    62
    Downloads
    0
    Uploads
    0

    Standard

    . is the root

    and just write some function to let the user press 0 to go a folder up

  20. #6230
    It's good to be free...
    Points: 10.420, Level: 67
    Level completed: 93%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    2.440
    Points
    10.420
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    hallo is wrong again. . is the same folder. It's just there because it's part of various standards.
    pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ

  21. #6231
    QJ Gamer Green
    Points: 5.795, Level: 49
    Level completed: 23%, Points required for next Level: 155
    Overall activity: 0%

    Registriert seit
    Sep 2006
    Ort
    Cape Town, South Africa
    Beiträge
    714
    Points
    5.795
    Level
    49
    Downloads
    0
    Uploads
    0

    Standard

    "." and "./" mean the same thing, unless there's a subtle difference that I'm unaware of.

  22. #6232
    Banned for LIFE
    Points: 18.744, Level: 86
    Level completed: 79%, Points required for next Level: 106
    Overall activity: 0%

    Registriert seit
    Oct 2006
    Ort
    East London, England
    Beiträge
    2
    Points
    18.744
    Level
    86
    Downloads
    0
    Uploads
    0

    Standard

    Really quick question here.

    When would you use int main(int argc, char* argv[]) instead of just int main() ?

  23. #6233
    It's good to be free...
    Points: 10.420, Level: 67
    Level completed: 93%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    2.440
    Points
    10.420
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    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 əʞɒʇ

  24. #6234
    QJ Gamer Blue
    Points: 3.795, Level: 38
    Level completed: 97%, Points required for next Level: 5
    Overall activity: 27,0%

    Registriert seit
    Jul 2007
    Beiträge
    296
    Points
    3.795
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von hallo007
    . is the root

    and just write some function to let the user press 0 to go a folder up
    Please, stop answering questions. :/

    . and ./ mean the same thing. The difference is that . is a directory, so you can't append a file to it.

    .someotherfolder/
    Would represent a folder named '.someotherfolder'.

    ./someotherfolder/
    Would represent a folder named 'someotherfolder' in the current directory.

  25. #6235
    QJ Gamer Green
    Points: 5.712, Level: 48
    Level completed: 81%, Points required for next Level: 38
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    USA SC/NC
    Beiträge
    699
    Points
    5.712
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Archaemic
    If you want to accept command line arguments. On the PSP, that really only happens if it's an iR Shell plugin.
    I've never felt the need for it, nor was I ever interested in using it, but can't you use
    Code:
    pspSdkLoadStartModuleWithArgs(const char *filename, int mpid, int argc, char * const argv[]);
    I remember I saw it a while back but never got around to using it.
    [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]

  26. #6236
    QJ Gamer Blue
    Points: 3.795, Level: 38
    Level completed: 97%, Points required for next Level: 5
    Overall activity: 27,0%

    Registriert seit
    Jul 2007
    Beiträge
    296
    Points
    3.795
    Level
    38
    Downloads
    0
    Uploads
    0

    Standard

    Yes, and the argc and argv are passed to the main function, telling the plugin what to do.

  27. #6237
    I'm back!
    Points: 8.236, Level: 61
    Level completed: 29%, Points required for next Level: 214
    Overall activity: 99,0%

    Registriert seit
    Feb 2007
    Ort
    England
    Beiträge
    902
    Points
    8.236
    Level
    61
    Downloads
    0
    Uploads
    0

    Standard

    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
    Last.fm | Deviant Art | First working OS picture

    Zitat Zitat von nickxab Beitrag anzeigen
    I will beat myself. :p

  28. #6238
    It's good to be free...
    Points: 10.420, Level: 67
    Level completed: 93%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    2.440
    Points
    10.420
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    strrchr will be your friend in both cases.
    pəʇuɒɹɓ ɹoɟ ɓuɪɥʇou əʞɒʇ

  29. #6239
    QJ Gamer Green
    Points: 5.712, Level: 48
    Level completed: 81%, Points required for next Level: 38
    Overall activity: 0%

    Registriert seit
    Jul 2006
    Ort
    USA SC/NC
    Beiträge
    699
    Points
    5.712
    Level
    48
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Auraomega

    Also, how do I check file extentions? So as to load a .PBP when its selected.

    Thanks
    -Aura
    Well, there's a few approaches to doing that. You could:
    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*/;
        }
    }
    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]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]

  30. #6240
    It's good to be free...
    Points: 10.420, Level: 67
    Level completed: 93%, Points required for next Level: 30
    Overall activity: 0%

    Registriert seit
    Feb 2007
    Beiträge
    2.440
    Points
    10.420
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    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 əʞɒʇ


 

Tags for this Thread

Forumregeln

  • Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
  • Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
  • Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
  • Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.
  •  





Alle Zeitangaben in WEZ -8. Es ist jetzt 09:14 PM Uhr.

Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © , Caputo Media, LLC. All Rights Reserved. Cluster .