SDL Port already in progress
Posted: Tue May 18, 2004 2:31 am
evilo sent me a private email alerting me to this thread. Obviously I have to monitor the forums more closely! [Sorry for the length - got carried away.]
FWIW, I'm a senior instructor/curriculum designer for both J2EE and Game Development at NextGen Education (www.nextgened.com) and a system architect/project manager for DragonTale Productions (www.dragontale.com) in Detroit. (We make more than cars here... :-)
We're currently in the middle of a Game Development track which focuses on using PS2DEV for console development. The students started off learning game mechanics and fundamentals (like C/C++, objects, threads, events) using SDL in x86/Linux. They were also beginning their portfolio of relatively simple games in this stage. The next stage was porting it to the PS2. They had the option to either rewrite the low-level access in PS2DEV, or to port SDL to PS2DEV. We looked at the PS2LINUX port, and knew that it wasn't going to be straightforward from that perspective.
The universal consensus was to port SDL. It turned out to be more straightforward than we thought - although there was nothing in the PS2LINUX code we could use. We're about a month and a half into the project, and we hope to have some of the core available for porting in the next week or so.
We had many of the same discussions you've had here, which led to some of the design choices. I've personally had a heavy hand in this because it could take new students a year to accomplish it otherwise. I've been working with and watching PS2DEV grow up for two years now, and SDL for several more, and my architectural experience weighed in a lot as well. Here are some of the results:
There is no simple way to port SDL. Because there are multiple processors, there are multiple paths to porting.
Although we're focusing on portability, reconfigurability, and optional options (SDL is great for this - take what you need, leave the rest behind), we really only have time to get one path working well. We will probably also end up with an "everything on EE" path first, though, although we consider that far from ideal.
Our main focus right now is to get a lot of the low-level (threads, events, pad/joystick control, audio, cdrom) to work as an IRX on the IOP, and free up as much of the EE/VU as possible for regular gameplay.
SDLnet will also run on the IOP (keeps it closer to the TCP/IP and Ethernet stacks, freeing up more EE)
SDLttf and SDLgfx will probably run on the EE at first. These will eventually be flexible depending on usage - I'd ultimately prefer them on the IOP.
I'd also like to leave some CPU horsepower room open on the IOP for networked GSM conversations, speech synthesis and possibly recognition, but that's much farther down the road. We're looking at the possibility of using gameCoda (www.gamecoda.com) (a commercial library) later on as well.
Communication between EE and IOP will be done seemlessly through RPC so the effects of splitting the functionality on different processors won't be seen. We're not at this point yet, but we're getting there.
SDLopenGL is really up in the air at the moment. We chose to do 2D graphics before PS2 then 3D afterwards in the class, so we haven't had the need for it yet. We'll be tackling that in one of the upcoming segments.
We'll post the source as soon as we reasonably can. I'd like to see it eventually become a part of PS2SDK as an optional slightly-higher-than-bare-metal library to ease entry into PS2DEV coding. There are definitely times when coding to the bare-metal is necessary, but I only want to have to do that when it's really important - not for every little thing! And besides, portability is a good thing - especially if you can minimize performance loss. We think we've done/will do this in our split-processor port.
Calvin Vette
calvin-dragontale_com
calvin-nextgened_com
FWIW, I'm a senior instructor/curriculum designer for both J2EE and Game Development at NextGen Education (www.nextgened.com) and a system architect/project manager for DragonTale Productions (www.dragontale.com) in Detroit. (We make more than cars here... :-)
We're currently in the middle of a Game Development track which focuses on using PS2DEV for console development. The students started off learning game mechanics and fundamentals (like C/C++, objects, threads, events) using SDL in x86/Linux. They were also beginning their portfolio of relatively simple games in this stage. The next stage was porting it to the PS2. They had the option to either rewrite the low-level access in PS2DEV, or to port SDL to PS2DEV. We looked at the PS2LINUX port, and knew that it wasn't going to be straightforward from that perspective.
The universal consensus was to port SDL. It turned out to be more straightforward than we thought - although there was nothing in the PS2LINUX code we could use. We're about a month and a half into the project, and we hope to have some of the core available for porting in the next week or so.
We had many of the same discussions you've had here, which led to some of the design choices. I've personally had a heavy hand in this because it could take new students a year to accomplish it otherwise. I've been working with and watching PS2DEV grow up for two years now, and SDL for several more, and my architectural experience weighed in a lot as well. Here are some of the results:
There is no simple way to port SDL. Because there are multiple processors, there are multiple paths to porting.
Although we're focusing on portability, reconfigurability, and optional options (SDL is great for this - take what you need, leave the rest behind), we really only have time to get one path working well. We will probably also end up with an "everything on EE" path first, though, although we consider that far from ideal.
Our main focus right now is to get a lot of the low-level (threads, events, pad/joystick control, audio, cdrom) to work as an IRX on the IOP, and free up as much of the EE/VU as possible for regular gameplay.
SDLnet will also run on the IOP (keeps it closer to the TCP/IP and Ethernet stacks, freeing up more EE)
SDLttf and SDLgfx will probably run on the EE at first. These will eventually be flexible depending on usage - I'd ultimately prefer them on the IOP.
I'd also like to leave some CPU horsepower room open on the IOP for networked GSM conversations, speech synthesis and possibly recognition, but that's much farther down the road. We're looking at the possibility of using gameCoda (www.gamecoda.com) (a commercial library) later on as well.
Communication between EE and IOP will be done seemlessly through RPC so the effects of splitting the functionality on different processors won't be seen. We're not at this point yet, but we're getting there.
SDLopenGL is really up in the air at the moment. We chose to do 2D graphics before PS2 then 3D afterwards in the class, so we haven't had the need for it yet. We'll be tackling that in one of the upcoming segments.
We'll post the source as soon as we reasonably can. I'd like to see it eventually become a part of PS2SDK as an optional slightly-higher-than-bare-metal library to ease entry into PS2DEV coding. There are definitely times when coding to the bare-metal is necessary, but I only want to have to do that when it's really important - not for every little thing! And besides, portability is a good thing - especially if you can minimize performance loss. We think we've done/will do this in our split-processor port.
Calvin Vette
calvin-dragontale_com
calvin-nextgened_com