How do you port to a console

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Re: How do you port to a console

Post by Falco Girgis »

Because in all honesty, the Dreamcast API that we use is nothing like OGL.
User avatar
M_D_K
Chaos Rift Demigod
Chaos Rift Demigod
Posts: 1087
Joined: Tue Oct 28, 2008 10:33 am
Favorite Gaming Platforms: PC
Programming Language of Choice: C/++
Location: UK

Re: How do you port to a console

Post 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;
Gyro Sheen wrote:you pour their inventory onto my life
IRC wrote: <sparda> The routine had a stack overflow, sorry.
<sparda> Apparently the stack was full of shit.
User avatar
eatcomics
ES Beta Backer
ES Beta Backer
Posts: 2528
Joined: Sat Mar 08, 2008 7:52 pm
Location: Illinois

Re: How do you port to a console

Post 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!!!
Image
CC Ricers
Chaos Rift Regular
Chaos Rift Regular
Posts: 120
Joined: Sat Jan 24, 2009 1:36 am
Location: Chicago, IL

Re: How do you port to a console

Post 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
Altus
Chaos Rift Newbie
Chaos Rift Newbie
Posts: 5
Joined: Mon Apr 27, 2009 3:35 am
Location: Seattle, WA

Re: How do you port to a console

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