Learning PS2 porting techniques

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
User avatar
ShdoHawk01
Posts: 5
Joined: Fri Aug 18, 2006 2:36 am
Location: Milford, CT USA

Learning PS2 porting techniques

Post by ShdoHawk01 »

I have read here in several posts "just look at the source code" to see how something or other is done; and especially with regards to porting emulators, I have seen time and again, "look at the source for pSMS or pGen to see how easy it is to port XYZ emulator"... SNES9x 1.5 and HuGo 2.1 or any other TG16 emu come to mind.

maybe a dumb question but what exactly am I looking for? How is looking at the source for those items and comparing it to the original source they were ported from supposed to teach me anything useful?

-Edit- What I guess I am asking is how do I recognize what is PS2-related and what is core related when I am looking thru all this code, and is there any documentation available besides the examples on the site/in the SDK files to explain the base-level PS2 api calls and procedures so I can write my own PS2-related bits to make something work? -/Edit-

I know it's a bit of a handholding thing, but can someone who is proficient explain how to glean the necessary information to do something useful here (at your own leisure of course, despite being a noob programmer I am not expecting instant gratification here) ? I have had a couple courses in C++ and have studied C on my own, but I don't feel I understand what I am looking at (or perhaps looking FOR is a better term) .

As a side question I have read lots of posts regarding porting or simply just building SDL for the PS2, but so far no real info or links seem to have been passed around. Can someone elaborate?

Thanks in advance, and I'm sorry if some of this is redundancy, I really did pore over the board...

-Shadowhawk

----
Edited 8-22-06 for clarity
No boom TODAY. Boom TOMORROW. There's ALWAYS a boom tomorrow. - Cmdr. Susan Ivanova, Babylon 5
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

The simple answer is - if you can't figure it out from the changes people made to various programs, you don't know enough to make similar changes to other programs.

This process can be broken into three parts: first, you need to understand the programs which have already been ported enough to recognize the parts which have been changed; second, you need to understand the program you wish to port enough to recognize the parts that need changing; finally, you need to understand the PS2 enough to figure out how to use the examples in already ported programs to fill the needs of the program you are porting.

These three steps have no simple answers. It is only through work on your part that you will figure out the answers to the three steps. In particular, this board is dedicated to helping those who already have this knowledge, not to helping acquire it in the first place.
User avatar
ShdoHawk01
Posts: 5
Joined: Fri Aug 18, 2006 2:36 am
Location: Milford, CT USA

Post by ShdoHawk01 »

J.F. wrote:The simple answer is - if you can't figure it out from the changes people made to various programs, you don't know enough to make similar changes to other programs.
Granted, and this was the assumption I was proceeding under. I was hoping I would get a response that would point me in the proper direction to learning more of what I need to know to do the things described in your "three steps," but even so, that definition in itself was something useful to me as to how to proceed, and I thank you.
J.F. wrote:In particular, this board is dedicated to helping those who already have this knowledge, not to helping acquire it in the first place.


It is attitudes like this that made the Dreamcast Dev community an unfriendly and stagnant place to be; I would have expected better here but I guess my standards are too high. I would prefer to hear something like this from at least a Moderator, if not an Administrator on this board, before I take it to heart, so you'll forgive me if I try to let this roll off my back like water on a duck. My understanding after reading many of the posts here was that this board is open to all skill levels, and dedicated to furthering PS2 homebrew development by anyone. I leave it to an "official" to correct me; until then, my questions remain open. Thank you for your help.

-Edit- For those who like me are seeking more and more detailed info, here's a link I found to a course on general MIPS Assembly which is good for us n00bs:
http://chortle.ccsu.edu/AssemblyTutoria ... tents.html
If I find more I will post it, I hope you all will do the same. -/Edit-

-Shadowhawk

-----
Edited 8/23/06 for info
No boom TODAY. Boom TOMORROW. There's ALWAYS a boom tomorrow. - Cmdr. Susan Ivanova, Babylon 5
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

There's no 'how to port programs' guide because it is a rather broad subject, but there's a few places you can start. Take a look at any SDL-based program that has been ported to a few platforms. When you port a program you're basically doing what SDL is doing - abstracting away the things that are different between platforms. The hardware.

A well written program will be designed with this in mind and will be easier to port as its hardware access will be located in very few, centralized locations. A poorly written program will take a lot of time as there's hardware specific code throughout.

I hope this has pointed you in the right direction.
In particular, this board is dedicated to helping those who already have this knowledge, not to helping acquire it in the first place.
This board is dedicated to the development of new homebrew code and tools. It isn't meant to be exclusive, rather it is meant to be a focus. Please don't take what J.F. said the wrong way - he was just trying to say that you may not find the best people to talk to about the finer points of porting software here, and those that are may be busy. We will give you pointers, though.
User avatar
ShdoHawk01
Posts: 5
Joined: Fri Aug 18, 2006 2:36 am
Location: Milford, CT USA

Post by ShdoHawk01 »

Thanks ooPo, I'll check into that and keep all that in mind, and thanks for the clarification as well. I do hope that I can accomplish something both fun and beneficial with my efforts. I have since found some more examples to search through that I mostly understand what's going on with, so I may have more specific questions soon.

it's all cool. :)

-Shadowhawk
No boom TODAY. Boom TOMORROW. There's ALWAYS a boom tomorrow. - Cmdr. Susan Ivanova, Babylon 5
Post Reply