Seite 5 von 340 ErsteErste 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 55 105 ... LetzteLetzte
Zeige Ergebnis 121 bis 150 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; Add -lpspumd to your LIBS....

  
  1. #121
    QJ Gamer Blue
    Points: 4.803, Level: 44
    Level completed: 27%, Points required for next Level: 147
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    33
    Points
    4.803
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Add -lpspumd to your LIBS.



  2. #122
    Developer
    Points: 10.075, Level: 67
    Level completed: 7%, Points required for next Level: 375
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Ort
    Sweden
    Beiträge
    941
    Points
    10.075
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Ok, thanks alot!

    But when you fix a problem there is always a new one...
    Now the program launches the UMD even if I don't push 'X'... So exactly when I execute the program it starts the UMD. Why doesn't the 'wait-for-me pressing-the-button' work??

    Code:
              while(1) {
              sceCtrlReadBufferPositive(&pad, 1);
              if(pad.Buttons & PSP_CTRL_CROSS) {
              break;
              } 
    
    	i = sceUmdCheckMedium(0);		
    	if (i == 0) { printf("- Insert UMD\n"); }
    	while (i == 0) {
    		i = sceUmdCheckMedium(0);
    	}
    		i = sceUmdActivate(1, "disc0:");
    	printf("- Mounted UMD\n");
    	i = sceUmdWaitDriveStat(UMD_WAITFORINIT);
    	fd = sceIoOpen("disc0:/UMD_DATA.BIN", PSP_O_RDONLY, 0777);
    	if(fd >= 0)
    	{
    		char game_id[11];
    		sceIoRead(fd, game_id, 10);
    		sceIoClose(fd);
    		game_id[10] = 0;
    		printf("- Found game %s\n", game_id);
    	}
    	sceKernelLoadExec("disc0:/PSP_GAME/SYSDIR/BOOT.BIN",0);

  3. #123
    QJ Gamer Blue
    Points: 4.803, Level: 44
    Level completed: 27%, Points required for next Level: 147
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    33
    Points
    4.803
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von SodR
    Ok, thanks alot!

    But when you fix a problem there is always a new one...
    Now the program launches the UMD even if I don't push 'X'... So exactly when I execute the program it starts the UMD. Why doesn't the 'wait-for-me pressing-the-button' work??

    Code:
              while(1) {
              sceCtrlReadBufferPositive(&pad, 1);
              if(pad.Buttons & PSP_CTRL_CROSS) {
              break;
              } 
    
    	i = sceUmdCheckMedium(0);		
    	if (i == 0) { printf("- Insert UMD\n"); }
    	while (i == 0) {
    		i = sceUmdCheckMedium(0);
    	}
    		i = sceUmdActivate(1, "disc0:");
    	printf("- Mounted UMD\n");
    	i = sceUmdWaitDriveStat(UMD_WAITFORINIT);
    	fd = sceIoOpen("disc0:/UMD_DATA.BIN", PSP_O_RDONLY, 0777);
    	if(fd >= 0)
    	{
    		char game_id[11];
    		sceIoRead(fd, game_id, 10);
    		sceIoClose(fd);
    		game_id[10] = 0;
    		printf("- Found game %s\n", game_id);
    	}
    	sceKernelLoadExec("disc0:/PSP_GAME/SYSDIR/BOOT.BIN",0);
    It looks like you forgot an ending bracket to terminate the while loop. It should look like this:
    Code:
    while(1) 
    {
       sceCtrlReadBufferPositive(&pad, 1);
       if(pad.Buttons & PSP_CTRL_CROSS) 
       {
          break;
       } 
    }
    Yeah, I write code a bit differently from most here. It's how they taught me in school. Anyway, you could also do this:

    Code:
    while(1) 
    {
       sceCtrlReadBufferPositive(&pad, 1);
       if(pad.Buttons & PSP_CTRL_CROSS) 
          break;
    }
    because if there's just one statement after an if statement, you don't need brackets. If you make anymore though, you must add them.

  4. #124
    Developer
    Points: 10.075, Level: 67
    Level completed: 7%, Points required for next Level: 375
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Ort
    Sweden
    Beiträge
    941
    Points
    10.075
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    I tryed tto make a simple meny but it wont work...

    Code:
     	    	while (1) {
    		sceCtrlReadBufferPositive(&pad, 1);
    	
    		if (menu == 1) {
    	    printTextScreen(10, 10, "something <--", RGB(0, 0, 0));
    	    printTextScreen(10, 20, "something", RGB(0, 0, 0));
    	    printTextScreen(10, 30, "something", RGB(0, 0, 0));
    	    printTextScreen(10, 40, "something", RGB(0, 0, 0));
              flipScreen();
    		}
    
    		if (menu == 2) {
    	    printTextScreen(10, 10, "something", RGB(0, 0, 0));
    	    printTextScreen(10, 20, "something <--", RGB(0, 0, 0));
    	    printTextScreen(10, 30, "something", RGB(0, 0, 0));
    	    printTextScreen(10, 40, "something", RGB(0, 0, 0));
              flipScreen();
    		}
    
    		if (menu == 3) {
    	    printTextScreen(10, 10, "something", RGB(0, 0, 0));
    	    printTextScreen(10, 20, "something", RGB(0, 0, 0));
    	    printTextScreen(10, 30, "something <--", RGB(0, 0, 0));
    	    printTextScreen(10, 40, "something", RGB(0, 0, 0));
              flipScreen();
    		}
    
    		if (menu == 4) {
    	    printTextScreen(10, 10, "something", RGB(0, 0, 0));
    	    printTextScreen(10, 20, "something", RGB(0, 0, 0));
    	    printTextScreen(10, 30, "something", RGB(0, 0, 0));
    	    printTextScreen(10, 40, "something <--", RGB(0, 0, 0));
              flipScreen();
    		}
    		
    		if (pad.Buttons & PSP_CTRL_UP) {
    			if (menu > 1) {
    				menu--;
    			        for(i=0; i<10; i++) {
    		                	sceDisplayWaitVblankStart();
    				}
              		}
    		}
    
    		if (pad.Buttons & PSP_CTRL_DOWN) {
    			if (menu < 9) {
    				menu++;
    			        for(i=0; i<10; i++) {
    		                	sceDisplayWaitVblankStart();
    				}
    			}
    		}
    Geändert von SodR (03-12-2006 um 07:09 AM Uhr)

  5. #125
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    What are you getting when complying? Also, might want to remove all the flipScreen()'s, you only need one, and when doing just text printing with printTextScreen, just put it at the end of the while loop / main infinite loop. O and dont make the colors

    RGB(0, 0, 0);

    That makes them black aka, wont see them 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


  6. #126
    Developer
    Points: 10.075, Level: 67
    Level completed: 7%, Points required for next Level: 375
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Ort
    Sweden
    Beiträge
    941
    Points
    10.075
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von SG57
    What are you getting when complying? Also, might want to remove all the flipScreen()'s, you only need one, and when doing just text printing with printTextScreen, just put it at the end of the while loop / main infinite loop. O and dont make the colors

    RGB(0, 0, 0);

    That makes them black aka, wont see them lol
    I don't get any errors when I comply but the meny dosn't work when I try to use it =S. I am using a white background so I want the text to be black =P. Maybe someone got a good exaple of a simple menu??

  7. #127
    QJ Gamer Blue
    Points: 4.803, Level: 44
    Level completed: 27%, Points required for next Level: 147
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    33
    Points
    4.803
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von SodR
    I don't get any errors when I comply but the meny dosn't work when I try to use it =S. I am using a white background so I want the text to be black =P. Maybe someone got a good exaple of a simple menu??
    I've actually designed a fairly functional menu class. If you're coding in C++, it might be handy. Beware: there's a load of documentation to go with it, and you'll probably need to read it to understand how to use it.

  8. #128
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    Here is something i just threw together:
    Code:
    void GameMenu() // ------------------------------Menu Function
    {    
        char bufferStart[200];
        char bufferOption[200];
        char bufferCredit[200];
        char bufferExit[200];
        
        char bufferBG[200];                     // {  Complete Backround Loading
        Image* bg;
        sprintf(bufferBG, "bg.png");
        bg = loadImage(bufferBG);               // }  Complete Backround loading 
        
        sprintf(bufferStart,"  S T A R T");
        sprintf(bufferOption, "O P T I O N S");
        sprintf(bufferCredit, "C R E D I T S");
        sprintf(bufferExit, "   E X I T");
    
        int startx = 200, starty = 136;
        int optionx = 200, optiony = 156;
        int creditx = 200, credity = 176;
        int exitx = 200, exity = 196;
        int menucount = 0;
        int i;
        
        Color highlighted = RGB(255, 255, 255);   // When selected
        Color dimmed = RGB(55, 55, 55);     // NOT selected
        Color shadow = RGB(55, 55, 55);         // When/Not selected
        SceCtrlData pad;
        while(1) {
                 blitAlphaImageToScreen(0, 0, 480, 272, bg, 0, 0);
                 //  ---  Seperator for Cleaner code...
                 printTextScreen(startx, starty, bufferStart, shadow);       // {print the shadow of option
                 printTextScreen(optionx, optiony, bufferOption, shadow);
                 printTextScreen(creditx, credity, bufferCredit, shadow);
                 printTextScreen(exitx, exity, bufferExit, shadow);          // } print the shadow of option
                 //  ---  Seperator for Cleaner code...
                 printTextScreen(startx, starty, bufferStart, dimmed);       // [ print the dimmed version of option
                 printTextScreen(optionx, optiony, bufferOption, dimmed);
                 printTextScreen(creditx, credity, bufferCredit, dimmed);
                 printTextScreen(exitx, exity, bufferExit, dimmed);          // ] print the dimmed version of option
                 sceCtrlReadBufferPositive(&pad, 1);  // initialize 'pad' to work with controller
                 if(UPPressed) {
                               menucount--;            // '--' Because menu is going downwards
                               for(i=0; i<10; i++) {
                                        sceDisplayWaitVblankStart(); // Wait 1 second until initiation
                               }
                 } 
                 if(DOWNPressed) {
                                 menucount++;
                                 for(i=0; i<10;i++) {
                                          sceDisplayWaitVblankStart();
                                 }
                 }
                 if(menucount < 0) menucount = 0;
                 if(menucount > 3) menucount = 3;
                 if(menucount == 0) {      
                              printTextScreen(startx, starty, bufferStart, highlighted);
                              if(XPressed) {
                                           GameMode = true;
                              }
                 }
                 if(menucount == 1) {
                              printTextScreen(optionx, optiony, bufferOption, highlighted);             
                 }
                 if(menucount == 2) {
                              printTextScreen(creditx, credity, bufferCredit, highlighted);
                 }
                 if(menucount == 3) {
                              printTextScreen(exitx, exity, bufferExit, highlighted);
                              if(XPressed) {
                                           pspDebugScreenClear();
                                           clearScreen(RGB(100, 100, 100));
                                           printTextScreen(100, 133, "H a v e   A   N i c e   D a y ! ! !", highlighted);
                                           sceKernelDelayThread(1000000*2); // wait 2 seconds before quiting
                                           sceKernelExitGame();
                              }
                 } else if(GameMode==true) {
                        Game();
                 }
                 flipScreen();
        } //while
    } // --------------------------------------------END GAMEMENU
    You do not need all the buffers, it just makes my code look cleaner, so feel free to do what ever. O and the XPressed and UPPressed and things like that are defined at the top as macros.

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


  9. #129
    Developer
    Points: 10.075, Level: 67
    Level completed: 7%, Points required for next Level: 375
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Ort
    Sweden
    Beiträge
    941
    Points
    10.075
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Thanks alot SG57 but this line gives me some problem when I try to comply:

    Code:
    GameMode = true;
    The compiler says that both 'GameMode' and 'true' is undeclared.

    btw. I changed Xpressed to pad.Buttons & PSP_CTRL_CROSS in the code. Because I assume that you have defined them that way, right?

  10. #130
    QJ Gamer Blue
    Points: 4.803, Level: 44
    Level completed: 27%, Points required for next Level: 147
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    33
    Points
    4.803
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Alright, I hate to do this, because the problem seems so trivial, and knowing my luck I'm gonna find the answer to it myself as soon as I post this. However, I've been banging my head against this for awhile, and it's confounding me.

    I have a class written called Paddle. I know this class is functional, as I've used it before and it executed perfectly. However, it's come to pass somehow that my other files in the project will no longer recognize the Paddle class. Everytime I try to create an instance of it, it thinks I'm trying to declare a variable with no type. Classes that used instances of this class that were working perfectly find beforehand are now no longer functional due to this.

    More specifically, I keep getting this error:
    ISO C++ forbids declaration of 'Paddle' with no type

    This occurs every time I try to create a new Paddle object.

    Here's the declaration of my Paddle class (contained in a seperate file named Paddle.h):
    Code:
    class Paddle
    {
    private:
    	int nX,
    		nY,
    		nXSize,
    		nYSize;
    
    	bool	bImageLoaded;
    
    	Image* imgPaddle;
    
    public:
    	Paddle(void);
    	Paddle(int, int, int, int, char*);
    	bool LoadImage(char*, int, int);
    	bool ImageSuccess(void);
    	int GetX(void);
    	int GetY(void);
    	int GetXSize(void);
    	int GetYSize(void);
    	void Display(void);
    	void LoadXY(int, int);
    	void MoveX(int);
    };
    All this code checks out. If I compile just Paddle.o, it works out fine, no errors nor warnings.

    Here's one of the classes that's trying to use it:
    Code:
    class Puck
    {
    private:
    	int	nX,
    		nY,
    		nXSize,
    		nYSize,
    		nXVelocity,
    		nYVelocity,
    		nStartingX,
    		nStartingY,
    		nStartingXVelocity,
    		nStartingYVelocity,
    		nNumBlocks;
    
    	bool	bImageLoaded;
    
    	Image*	imgPuck;
    	Paddle* pPaddle;
    	Block*	bBlocks;
    
    public:
    	Puck(void);
    	Puck(int, int, int, int, int, int, int, Paddle*, Block*, char*);
    	bool LoadImage(char*, int, int);
    	bool ImageSuccess(void);
    	void SetVelocity(int, int);
    	void Reset(void);
    	int Refresh(void);
    };
    It's stored in Puck.h, and has the following includes:
    Code:
    #include "psptools.h"
    #include "Block.h"
    #include "Paddle.h"
    Finally, here's my makefile:
    Code:
    TARGET = Breakout
    OBJS = main.o graphics.o framebuffer.o psptools.o Block.o Puck.o pause.o level.o Paddle.o 
    
    CFLAGS = -O2 -G0 -Wall
    CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
    ASFLAGS = $(CFLAGS)
    
    LIBDIR =
    LIBS = -lpspgu -lpsppower -lpng -lz -lm -lstdc++
    LDFLAGS =
    
    EXTRA_TARGETS = EBOOT.PBP
    PSP_EBOOT_TITLE = Breakout PSP
    
    PSPSDK=$(shell psp-config --pspsdk-path)
    include $(PSPSDK)/lib/build.mak
    Geändert von Andorien (03-12-2006 um 02:52 PM Uhr)

  11. #131
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    Zitat Zitat von SodR
    Thanks alot SG57 but this line gives me some problem when I try to comply:

    Code:
    GameMode = true;
    The compiler says that both 'GameMode' and 'true' is undeclared.

    btw. I changed Xpressed to pad.Buttons & PSP_CTRL_CROSS in the code. Because I assume that you have defined them that way, right?
    1. I told you i had a macro defining what XPressed and sch meant in the same post with the code
    2. GameMode is just a flag I used to determine if my game was in the menu or in the game or credits or exiting, etc.
    3. I defined true and false:
    #define true 1
    #define false 0
    So I could use them with teh GameMode flag and for better senseof whats is going on, not just a bunch of numbers and bools.

    Plus, Im not complaining or nothing, but debugging is a very useful 'skill' as someone had posted above. The complying errors you posted were very easy and understandable so maybe you could have looked at the code and realized "Wait a minute, I dont knoiw what 'true' means, and its not defined, theres the problem, along with GameMode". But I was once that way so I can not complain or else ill be a hipicrit :icon_smil
    Geändert von SG57 (03-12-2006 um 03:38 PM Uhr)

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


  12. #132
    QJ Gamer Blue
    Points: 4.803, Level: 44
    Level completed: 27%, Points required for next Level: 147
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    33
    Points
    4.803
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Andorien
    Alright, I hate to do this, because the problem seems so trivial, and knowing my luck I'm gonna find the answer to it myself as soon as I post this. However, I've been banging my head against this for awhile, and it's confounding me.

    I have a class written called Paddle. I know this class is functional, as I've used it before and it executed perfectly. However, it's come to pass somehow that my other files in the project will no longer recognize the Paddle class. Everytime I try to create an instance of it, it thinks I'm trying to declare a variable with no type. Classes that used instances of this class that were working perfectly find beforehand are now no longer functional due to this.

    More specifically, I keep getting this error:
    ISO C++ forbids declaration of 'Paddle' with no type

    This occurs every time I try to create a new Paddle object.

    Here's the declaration of my Paddle class (contained in a seperate file named Paddle.h):
    Code:
    class Paddle
    {
    private:
    	int nX,
    		nY,
    		nXSize,
    		nYSize;
    
    	bool	bImageLoaded;
    
    	Image* imgPaddle;
    
    public:
    	Paddle(void);
    	Paddle(int, int, int, int, char*);
    	bool LoadImage(char*, int, int);
    	bool ImageSuccess(void);
    	int GetX(void);
    	int GetY(void);
    	int GetXSize(void);
    	int GetYSize(void);
    	void Display(void);
    	void LoadXY(int, int);
    	void MoveX(int);
    };
    All this code checks out. If I compile just Paddle.o, it works out fine, no errors nor warnings.

    Here's one of the classes that's trying to use it:
    Code:
    class Puck
    {
    private:
    	int	nX,
    		nY,
    		nXSize,
    		nYSize,
    		nXVelocity,
    		nYVelocity,
    		nStartingX,
    		nStartingY,
    		nStartingXVelocity,
    		nStartingYVelocity,
    		nNumBlocks;
    
    	bool	bImageLoaded;
    
    	Image*	imgPuck;
    	Paddle* pPaddle;
    	Block*	bBlocks;
    
    public:
    	Puck(void);
    	Puck(int, int, int, int, int, int, int, Paddle*, Block*, char*);
    	bool LoadImage(char*, int, int);
    	bool ImageSuccess(void);
    	void SetVelocity(int, int);
    	void Reset(void);
    	int Refresh(void);
    };
    It's stored in Puck.h, and has the following includes:
    Code:
    #include "psptools.h"
    #include "Block.h"
    #include "Paddle.h"
    Finally, here's my makefile:
    Code:
    TARGET = Breakout
    OBJS = main.o graphics.o framebuffer.o psptools.o Block.o Puck.o pause.o level.o Paddle.o 
    
    CFLAGS = -O2 -G0 -Wall
    CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
    ASFLAGS = $(CFLAGS)
    
    LIBDIR =
    LIBS = -lpspgu -lpsppower -lpng -lz -lm -lstdc++
    LDFLAGS =
    
    EXTRA_TARGETS = EBOOT.PBP
    PSP_EBOOT_TITLE = Breakout PSP
    
    PSPSDK=$(shell psp-config --pspsdk-path)
    include $(PSPSDK)/lib/build.mak
    Bottom paged. Would rather this not get lost in the earlier pages.

  13. #133
    Developer
    Points: 10.075, Level: 67
    Level completed: 7%, Points required for next Level: 375
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Ort
    Sweden
    Beiträge
    941
    Points
    10.075
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    I managed to fix the menu problem above, so nevermind about that one.

    I want my program to execute MPH's Game Loader when I press X and I'm using this code:

    Code:
     sceKernelLoadExec("ms0:/PSP/GAME/MPHGAMELOADER/EBOOT.BIN", 0);
    But since I'm on 1.5 it will give me the "The Game could not be started (80010002)" error. If I remember right thats the error you get when trying to launch a non-kxploited eboot, right? So what is the code to launch a eboot from a homebrew game on 1.5 then?

    I tryed with sceKernelLoadExec("ms0:/PSP/GAME/MPHGAMELOADER%/EBOOT.BIN", 0); but that didn't work either...

    -----------------------------------------------------


    I know how to dump a single file with this code but what should I do if I want to dump the entire kd folder or the whole flash0?

    Code:
    void DumpAta.prx(void)
    {
    	int i;
    	int fd;
    
    	
    	fd = sceIoOpen("flash0:/kd/ata.prx", PSP_O_RDONLY, 0777);
    	if(fd >= 0)
    	{
    		char path[256];
    
    		build_path(path, "ms0:/", kd, 0);
    		sceIoMkdir(path, 0777);
    
    		write_file("flash0:/kd/", path, "ata.prx");
    	}
    }
    btw. This is not the exact code I used but it should look something like this.
    Geändert von SodR (03-13-2006 um 03:48 PM Uhr)

  14. #134
    11th Squad Captain
    Points: 26.490, Level: 97
    Level completed: 14%, Points required for next Level: 860
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    You are here -----> 名前: アダム | 飲むコー&#1
    Beiträge
    2.562
    Points
    26.490
    Level
    97
    Downloads
    0
    Uploads
    0

    Standard

    what do i do with loadvsh.sh?
    I Wanna load my PRX File in the PSP's OS,
    and i got told that loadvsh.sh will do that for me.
    But at the moment i dont know how to load it?
    Should i open it up with a text editor and add
    the code from loadvsh.sh to my main.c file?
    FAVORITE GAME! - BEER & ANIME! - SO EXICTING!

    開発者, 携帯用プログラマー 日本サポータおよび恋人 本名のアダムの鍛冶屋
    Currently Working On: - Flashmod V2.50 - Flashmod V2.60
    Currently Drinking: Coffee! - 私はコーヒーを飲む
    Chao Garden: DEMO v0.6
    Chao Garden V0.5b Review!

  15. #135
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    Zitat Zitat von SodR
    I managed to fix the menu problem above, so nevermind about that one.

    I want my program to execute MPH's Game Loader when I press X and I'm using this code:

    Code:
     sceKernelLoadExec("ms0:/PSP/GAME/MPHGAMELOADER/EBOOT.BIN", 0);
    But since I'm on 1.5 it will give me the "The Game could not be started (80010002)" error. If I remember right thats the error you get when trying to launch a non-kxploited eboot, right? So what is the code to launch a eboot from a homebrew game on 1.5 then?

    I tryed with sceKernelLoadExec("ms0:/PSP/GAME/MPHGAMELOADER%/EBOOT.BIN", 0); but that didn't work either...

    -----------------------------------------------------


    I know how to dump a single file with this code but what should I do if I want to dump the entire kd folder or the whole flash0?

    Code:
    void DumpAta.prx(void)
    {
    	int i;
    	int fd;
    
    	
    	fd = sceIoOpen("flash0:/kd/ata.prx", PSP_O_RDONLY, 0777);
    	if(fd >= 0)
    	{
    		char path[256];
    
    		build_path(path, "ms0:/", kd, 0);
    		sceIoMkdir(path, 0777);
    
    		write_file("flash0:/kd/", path, "ata.prx");
    	}
    }
    btw. This is not the exact code I used but it should look something like this.
    The game can not be started becasue there isnt a Eboot.bin in the MPH game folder, its .PBP, and your probably thinking about a UMD how you have to load the eboot.bin.

    Just kinda guessing

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


  16. #136
    Developer
    Points: 10.075, Level: 67
    Level completed: 7%, Points required for next Level: 375
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Ort
    Sweden
    Beiträge
    941
    Points
    10.075
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von SG57
    The game can not be started becasue there isnt a Eboot.bin in the MPH game folder, its .PBP, and your probably thinking about a UMD how you have to load the eboot.bin.

    Just kinda guessing
    Yes that was my fault of course it should be eboot.pbp =P but it seems that you can only start eboots form the ms in kernel mode and only start umd's in user mode(!).

    Because when I'm in user mode I can't start eboot.pbp from the ms but i can start UMD's with sceKernelLoadExec("disc0:/PSP_GAME/SYSDIR/BOOT.BIN",0); . But when I go into kernel mode with this line
    Code:
     PSP_MODULE_INFO("MyApp", 0x1000, 1, 1);  // 0x1000 = Kernel mode
    PSP_MAIN_THREAD_ATTR(0); 			 // Kernel Mode
    I can only start eboots from the ms but when I try to start a UMD it just gives me the same error as I got when I tryed to start a eboot from the ms in user mode.

    I have no idea why I can't launch UMD's in kernel mode =S

  17. #137
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    Well, think about the GTA exploit for a sec.... if UMD = USER MODE ONLY and GTA does not use kernel, only user mode, that may just be because it is in user mode, so that kinda verifys that user mode = UMD, unless fanjita or someone has a bigger brain ;-)

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


  18. #138
    Developer
    Points: 10.075, Level: 67
    Level completed: 7%, Points required for next Level: 375
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Ort
    Sweden
    Beiträge
    941
    Points
    10.075
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    So there is not way to have a function like this "press X and start the UMD and press O to start MPH Game Loader" ??

  19. #139
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    Yes there is, do some multithreading. OSS like PSIX and such play UMD Games and run eboots.

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


  20. #140
    QJ Gamer Blue
    Points: 4.482, Level: 42
    Level completed: 66%, Points required for next Level: 68
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Beiträge
    84
    Points
    4.482
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    does any one know of any IR source codes, im sure IR is not simple but iv got an idea for sending out raw IR, i just gotta know how to do it. Ir capture "captures" raw IR, im looking to emit it.

  21. #141
    Points: 4.439, Level: 42
    Level completed: 45%, Points required for next Level: 111
    Overall activity: 0%

    Registriert seit
    Dec 2005
    Beiträge
    32
    Points
    4.439
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Anybody know how I could launch EBOOT.PBP -files from my program? I'm trying to do a program where I could launch all my emulators by pressing the buttons on PSP, lets say that X launches NES-emulator, O launches SNES emulator and so on. I know everything else of how to do that except the loading of EBOOT.PBP's. I've tried to load them like this:

    Code:
    // Sets The Program To Kernel Mode
    PSP_MODULE_INFO("EMULATOR_LAUNCHER", 0x1000, 1, 1);
    PSP_MAIN_THREAD_ATTR(0);
    
    .
    .
    .
    
    and in main I'm trying to launch the eboot like this:
    
    sceKernelLoadExec("ms0:/EMULATORS/SNES.PBP",0);
    The problem is that it doesn't work on my 1.5 PSP. All I have is a black screen, memstick light flashes couple of times, then it gets back to XMB. For some emus it doesn't give any error, but with some it gives "80020001". I know that there's programs with source codes which load .PBP's (ex. FileAssistant), but it's too hard for me to find the information that I need from the sources.

    So, does somebody know what's wrong and how I could succesfully load those .PBP -files?

  22. #142
    words are stones in my <3
    Points: 35.274, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Overall activity: 0%

    Registriert seit
    Jul 2005
    Ort
    Spokane
    Beiträge
    5.008
    Points
    35.274
    Level
    100
    My Mood
    Lonely
    Downloads
    1
    Uploads
    0

    Standard

    Look at the FileAssistant Source, tahts what they released it for ?-S

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


  23. #143
    QJ Gamer Blue
    Points: 4.260, Level: 41
    Level completed: 55%, Points required for next Level: 90
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Ort
    Colne, Lancashire, UK
    Beiträge
    53
    Points
    4.260
    Level
    41
    Downloads
    0
    Uploads
    0

    Question Substring in C?

    is there a routine in C that will allow me to copy a substring from a given string.

    for instance, say I want to extract the word 'World' from 'Hello World'?

    At the moment I'm using loops, which are a pain.. :)

    Thanks

    PS: I scanned the sdk docs, but nothing gave me any ideas, I'm sure there used to be a function though...

    EDIT: I've been using this.....

    Code:
            char source[20];
            char dest[20];
            int f;
    
            strcpy(source, "Hello World");
            printf("source = %s\n", source);
    
            for (f=0; f<=4; f++)
            {
                    dest[f] = source[f+6];
            }
            printf("dest = %s\n", dest);
    Geändert von polomint (03-17-2006 um 02:48 AM Uhr)

  24. #144
    Points: 4.439, Level: 42
    Level completed: 45%, Points required for next Level: 111
    Overall activity: 0%

    Registriert seit
    Dec 2005
    Beiträge
    32
    Points
    4.439
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von SG57
    Look at the FileAssistant Source, tahts what they released it for ?-S
    I would, but as you can see I'm just a beginner and FileAssistant source has so many files that I don't know where to start looking PSP-OSS and some other programs use Bootloader 1.0 to boot EBOOT.PBP's, but I haven't find anything of it.

  25. #145
    QJ Gamer Silver
    Points: 9.457, Level: 65
    Level completed: 36%, Points required for next Level: 193
    Overall activity: 0%

    Registriert seit
    Jun 2005
    Ort
    Canada
    Beiträge
    1.492
    Points
    9.457
    Level
    65
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Andorien
    Bottom paged. Would rather this not get lost in the earlier pages.

    I havn't worked with classes much, but I know I had a similar problem with structs.

    normally you can declare a struct like..

    struct mystruct

    {
    stuff

    };

    then declare it like...

    mystruct* mystructarray[10];


    but for some reason you have to declare structs as...

    struct mystruc* mystructarray[10];


    so maybe when you declare something of paddle class try

    class paddle* mypaddles;


    Only thing that I can think of
    PSN: Shatterdome

  26. #146
    QJ Gamer Blue
    Points: 4.803, Level: 44
    Level completed: 27%, Points required for next Level: 147
    Overall activity: 0%

    Registriert seit
    Mar 2006
    Beiträge
    33
    Points
    4.803
    Level
    44
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von Shatterdome
    I havn't worked with classes much, but I know I had a similar problem with structs.

    normally you can declare a struct like..

    struct mystruct

    {
    stuff

    };

    then declare it like...

    mystruct* mystructarray[10];


    but for some reason you have to declare structs as...

    struct mystruc* mystructarray[10];


    so maybe when you declare something of paddle class try

    class paddle* mypaddles;


    Only thing that I can think of
    What you say makes sense, however I don't have to do that with any of my other classes (which now includes puck, paddle, block, level, design, pause, Menu_Item<TARGET> and Menu<ITEM>). I've since just moved the paddle class into the same files as the puck class, and it seems to work fine.
    Geändert von Andorien (03-17-2006 um 09:38 PM Uhr)

  27. #147
    Developer
    Points: 10.075, Level: 67
    Level completed: 7%, Points required for next Level: 375
    Overall activity: 0%

    Registriert seit
    Sep 2005
    Ort
    Sweden
    Beiträge
    941
    Points
    10.075
    Level
    67
    Downloads
    0
    Uploads
    0

    Standard

    Yes, that bootloader would fix everything, too bad I can't find the sources.

    btw. Miikkiz, have you made sure there is actually an eboot that is at ms0:/EMULATORS/SNES.PBP?? Shouldn't it be like this: ms0:/PSP/GAME/"theemulatorsfoldernamehe re"/EBOOT.PBP, since the excutable is always called eboot.pbp it's kinda weird to link to snes.pbp...

  28. #148
    QJ Gamer Bronze
    Points: 5.650, Level: 48
    Level completed: 50%, Points required for next Level: 100
    Overall activity: 0%

    Registriert seit
    Feb 2006
    Beiträge
    338
    Points
    5.650
    Level
    48
    Downloads
    0
    Uploads
    0

    Post

    This is kinda like the source code to one(.PBP^booter), but as it says... it doesn't work on 1.0

    http://forums.ps2dev.org/viewtopic.p...00576e0177cb77

  29. #149
    Points: 4.439, Level: 42
    Level completed: 45%, Points required for next Level: 111
    Overall activity: 0%

    Registriert seit
    Dec 2005
    Beiträge
    32
    Points
    4.439
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von SodR
    Yes, that bootloader would fix everything, too bad I can't find the sources.

    btw. Miikkiz, have you made sure there is actually an eboot that is at ms0:/EMULATORS/SNES.PBP?? Shouldn't it be like this: ms0:/PSP/GAME/"theemulatorsfoldernamehe re"/EBOOT.PBP, since the excutable is always called eboot.pbp it's kinda weird to link to snes.pbp...
    There actually is EBOOT at ms0:/EMULATORS/SNES.PBP, I copied it from the folder of SNES-emu (without the %-mark), and renamed it to SNES.PBP, so that they wouldn't take the space of my Game->Memory Stick -menu, because I could launch them with my own program, so only one icon needed.



    Devun_06, thanks for posting that, I'll look for more in to it tomorrow, still it seems pretty confusing to me, a guy who just started to learn coding Im just wondering what do I need to edit in that code, where do I put the path to my EBOOT? I'll try something and post my results then.
    Geändert von MiiKKiZ (03-21-2006 um 12:51 PM Uhr)

  30. #150
    Points: 4.439, Level: 42
    Level completed: 45%, Points required for next Level: 111
    Overall activity: 0%

    Registriert seit
    Dec 2005
    Beiträge
    32
    Points
    4.439
    Level
    42
    Downloads
    0
    Uploads
    0

    Standard

    Zitat Zitat von MiiKKiZ
    Devun_06, thanks for posting that, I'll look for more in to it tomorrow, still it seems pretty confusing to me, a guy who just started to learn coding Im just wondering what do I need to edit in that code, where do I put the path to my EBOOT? I'll try something and post my results then.
    Damn, I'm going to lose my mind, I've tried to get it working today and yesterday, and I have actually no clue how to do that. Maybe I should start to read some C-programming book or something. Anyways, could somebody post a sample which would include that code, and it would load ms0:/Emulators/NES/EBOOT.PBP straight after the program is executed, so it would be as simple as possible and I could maybe understand it :)


    EDIT:
    I actually found the source of Bootloader from FileAssistant forums, it can be downloaded here: http://www.easy-monkey.co.uk/Downloads/BootLoader.rar

    "Check out CFrameWork::RunExecutable and CFrameWork::RunUMD functions in FA++ source code to see how to use the loaders."


    But, as I'm a dumb idiot, I don't know how to use this, either. So, if somebody could post an example of this, how to load ms0:/Emulators/NES/EBOOT.PBP after the program starts, I would be so happy :icon_wink
    Geändert von MiiKKiZ (03-26-2006 um 07:48 AM Uhr)


 
Seite 5 von 340 ErsteErste 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 55 105 ... LetzteLetzte

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:15 PM Uhr.

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