QJ.NET | Videos | Forums | iPhone | MMORPG | Nintendo DS | Wii | PlayStation 3 | PSP | Xbox 360 | PC | Downloads | Contact Us
Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact

QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides

Go Back   QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides > Developers Corner > PSP Development, Hacks, and Homebrew > PSP Development Forum
The above video goes away if you are a member and logged in, so log in now!

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

Reply
 
LinkBack Thread Tools
Old 03-11-2006, 03:01 PM   #121
 
Join Date: Mar 2006
Posts: 33
Trader Feedback: 0
Default

Add -lpspumd to your LIBS.
Andorien is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-11-2006, 03:35 PM   #122

Developer
 
SodR's Avatar
 
Join Date: Sep 2005
Location: Sweden
Posts: 941
Trader Feedback: 0
Default

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);
SodR is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-11-2006, 03:41 PM   #123
 
Join Date: Mar 2006
Posts: 33
Trader Feedback: 0
Default

Quote:
Originally Posted by 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.
Andorien is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-12-2006, 05:40 AM   #124

Developer
 
SodR's Avatar
 
Join Date: Sep 2005
Location: Sweden
Posts: 941
Trader Feedback: 0
Default

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();
				}
			}
		}

Last edited by SodR; 03-12-2006 at 07:09 AM..
SodR is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-12-2006, 08:59 AM   #125

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

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
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-12-2006, 11:28 AM   #126

Developer
 
SodR's Avatar
 
Join Date: Sep 2005
Location: Sweden
Posts: 941
Trader Feedback: 0
Default

Quote:
Originally Posted by 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??
SodR is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-12-2006, 12:49 PM   #127
 
Join Date: Mar 2006
Posts: 33
Trader Feedback: 0
Default

Quote:
Originally Posted by 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.
Andorien is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-12-2006, 01:09 PM   #128

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

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.
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-12-2006, 01:55 PM   #129

Developer
 
SodR's Avatar
 
Join Date: Sep 2005
Location: Sweden
Posts: 941
Trader Feedback: 0
Default

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?
SodR is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-12-2006, 02:49 PM   #130
 
Join Date: Mar 2006
Posts: 33
Trader Feedback: 0
Default

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

Last edited by Andorien; 03-12-2006 at 02:52 PM..
Andorien is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-12-2006, 03:34 PM   #131

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

Quote:
Originally Posted by 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
__________________

Last edited by SG57; 03-12-2006 at 03:38 PM..
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-12-2006, 06:05 PM   #132
 
Join Date: Mar 2006
Posts: 33
Trader Feedback: 0
Default

Quote:
Originally Posted by 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.
Andorien is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-13-2006, 02:22 PM   #133

Developer
 
SodR's Avatar
 
Join Date: Sep 2005
Location: Sweden
Posts: 941
Trader Feedback: 0
Default

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.

Last edited by SodR; 03-13-2006 at 03:48 PM..
SodR is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-14-2006, 06:29 AM   #134
11th Squad Captain
 
c5cha7's Avatar
 
Join Date: Jun 2005
Location: You are here -----> 名前: アダム | 飲むコー&#1
Posts: 2,562
Trader Feedback: 0
Default

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!
c5cha7 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-14-2006, 07:42 AM   #135

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

Quote:
Originally Posted by 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
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-14-2006, 08:04 AM   #136

Developer
 
SodR's Avatar
 
Join Date: Sep 2005
Location: Sweden
Posts: 941
Trader Feedback: 0
Default

Quote:
Originally Posted by 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
SodR is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-14-2006, 08:40 PM   #137

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

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 ;-)
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-15-2006, 03:02 AM   #138

Developer
 
SodR's Avatar
 
Join Date: Sep 2005
Location: Sweden
Posts: 941
Trader Feedback: 0
Default

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" ??
SodR is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-15-2006, 07:19 AM   #139

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

Yes there is, do some multithreading. OSS like PSIX and such play UMD Games and run eboots.
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-15-2006, 02:31 PM   #140
 
Snowbhord's Avatar
 
Join Date: Feb 2006
Posts: 84
Trader Feedback: 0
Default

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.
Snowbhord is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-16-2006, 08:16 AM   #141
 
Join Date: Dec 2005
Posts: 32
Trader Feedback: 0
Default

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?
MiiKKiZ is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-16-2006, 04:35 PM   #142

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

Look at the FileAssistant Source, tahts what they released it for ?-S
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-17-2006, 02:35 AM   #143
 
Join Date: Mar 2006
Location: Colne, Lancashire, UK
Posts: 53
Trader Feedback: 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);

Last edited by polomint; 03-17-2006 at 02:48 AM..
polomint is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-17-2006, 06:12 AM   #144
 
Join Date: Dec 2005
Posts: 32
Trader Feedback: 0
Default

Quote:
Originally Posted by 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.
MiiKKiZ is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-17-2006, 09:05 PM   #145
 

 
Join Date: Jun 2005
Location: Canada
Posts: 1,486
Trader Feedback: 0
Default

Quote:
Originally Posted by 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
Shatterdome is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-17-2006, 09:34 PM   #146
 
Join Date: Mar 2006
Posts: 33
Trader Feedback: 0
Default

Quote:
Originally Posted by 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.

Last edited by Andorien; 03-17-2006 at 09:38 PM..
Andorien is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-19-2006, 11:41 AM   #147

Developer
 
SodR's Avatar
 
Join Date: Sep 2005
Location: Sweden
Posts: 941
Trader Feedback: 0
Default

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...
SodR is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-21-2006, 07:38 AM   #148
 
Devun_06's Avatar
 
Join Date: Feb 2006
Posts: 338
Trader Feedback: 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
Devun_06 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-21-2006, 12:48 PM   #149
 
Join Date: Dec 2005
Posts: 32
Trader Feedback: 0
Default

Quote:
Originally Posted by 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.

Last edited by MiiKKiZ; 03-21-2006 at 12:51 PM..
MiiKKiZ is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-26-2006, 07:31 AM   #150
 
Join Date: Dec 2005
Posts: 32
Trader Feedback: 0
Default

Quote:
Originally Posted by 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

Last edited by MiiKKiZ; 03-26-2006 at 07:48 AM..
MiiKKiZ is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
c or c , c++ , c/c++ , code , coding , c_language , programming , psp , psp programming , thread

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -8. The time now is 09:06 AM.



Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © 2009, QJ.NET. All Rights Reserved.
Contact Us