Page 2 of 2

Re: How do you port to a console

Posted: Sun Apr 26, 2009 8:45 pm
by Falco Girgis
Because in all honesty, the Dreamcast API that we use is nothing like OGL.

Re: How do you port to a console

Posted: Sun Apr 26, 2009 9:06 pm
by M_D_K
You don't really need to mess with the kernel on a PSP do make games. Really the only times you do this is when you need to...lets say hook the home button, there are more things but nothing you really need to do.

Also the PSP's graphics stuff is GL based(on the openGL standard) so it works in a similar fashion to OpenGL. there is a library called PSPGL(if I remember correctly) that wraps the internal PSP graphics call stuff and you use OpenGL calls but its not complete. SDL is also ported to the PSP, but I wouldn't recommend using it since its a bit resource heavy.

And you do need to know hardware and how it all works. Cause chances are you're going to be using a load of textures and you'll need to know how to hotswap to and from VRAM.

One last thing the PSP 1.5 phat is your best choice when devving on a PSP. If it runs smooth on a phat you know it will run on pretty much any PSP except the 3000 its still in the early stages of being hacked.

EDIT:
You also need to know assembly to use the PSP vector processors(for the math) which can only be accessed with assembly(shit like this)

Code: Select all

	Vector ret;
	__asm__ __volatile__
	(
		".set       push\n"
		".set       noreorder\n"
	
		"lv.s       S100, 0 + %1\n"
		"lv.s       S101, 4 + %1\n"
		"lv.s       S102, 8 + %1\n"
		"vzero.s    S103\n"
		"ulv.q       C000,  0 + %2\n"
		"ulv.q       C010, 16 + %2\n"
		"ulv.q       C020, 32 + %2\n"
		"ulv.q       C030, 48 + %2\n"
		"vtfm4.q    C200, E000, C100\n"
		"sv.s       S200, 0 + %0\n"
		"sv.s       S201, 4 + %0\n"
		"sv.s       S202, 8 + %0\n"
	
		".set       pop \n"
		: "=m"(ret)
		: "m"(vector), "m"(matrix)
	);
	return ret;

Re: How do you port to a console

Posted: Tue Apr 28, 2009 8:13 pm
by eatcomics
M_D_K wrote:

Code: Select all

	Vector ret;
	__asm__ __volatile__
	(
		".set       push\n"
		".set       noreorder\n"
	
		"lv.s       S100, 0 + %1\n"
		"lv.s       S101, 4 + %1\n"
		"lv.s       S102, 8 + %1\n"
		"vzero.s    S103\n"
		"ulv.q       C000,  0 + %2\n"
		"ulv.q       C010, 16 + %2\n"
		"ulv.q       C020, 32 + %2\n"
		"ulv.q       C030, 48 + %2\n"
		"vtfm4.q    C200, E000, C100\n"
		"sv.s       S200, 0 + %0\n"
		"sv.s       S201, 4 + %0\n"
		"sv.s       S202, 8 + %0\n"
	
		".set       pop \n"
		: "=m"(ret)
		: "m"(vector), "m"(matrix)
	);
	return ret;
Yay!!! Low Level!!!

Re: How do you port to a console

Posted: Wed Apr 29, 2009 11:52 am
by CC Ricers
I never used PSPGL much, but when I looked at some of its underlying code, it was more of a wrapper for the native PSP GU functions, that were still very GL-looking in style anyways. PSPGL was clearly written for people who want the most portable GL code without rewriting many function definitions.

An average OpenGL user could probably figure out what the following code does:

Code: Select all

	sceGuPushMatrix();
	{
		ScePspFVector3 rot1 = { -90.0f, 0.0f, 0.0f };
		ScePspFVector3 rot2 = { 0.0f, 0.0f, -90.0f };
		sceGuRotateXYZ(&rot1);
		sceGuRotateXYZ(&rot2);
	}
	sceGuPopMatrix();
I've never used assembly, but for PSP it's not needed in most cases except for speed critical applications like emulators. As M_D_K said earlier, just keep the system's memory in check when loading information. I believe the PSP has 24mb of system ram that is readily available for use. Need to make a program that is larger than that and you would have to know file streaming

Re: How do you port to a console

Posted: Wed Apr 29, 2009 5:27 pm
by Altus
If you have the "Internet Channel" for wii (basically a simplified version of the Opera web browser) and you know how to use flash/actionscript 2.0 you could make simple games that work with wii with very little effort. I guess that's not technically a port, but it is a hell of a lot easier to do.