forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Porting Homeworld from PC to PSP...help :)

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Jack_6428



Joined: 25 Jun 2009
Posts: 3

PostPosted: Thu Jun 25, 2009 9:33 am    Post subject: Porting Homeworld from PC to PSP...help :) Reply with quote

Hi guys, last week i got the idea to port this great RTS from PC to the PSP...

I think it could be possible...since the Homeworld source-code is said to be quite user friendly. Basically fans ported the game to Linux and MAC OS. I thought, why not port it to the PSP ? To have a great game on the go ? Since there is no real space game on the system.

About the game:
Code:
http://en.wikipedia.org/wiki/Homeworld


In terms of hardware, Homeworld system requierments are:
PII 233 or equivalent
RAM: 32 MB
Video Memory: 4 MB
Hard Drive Space: 150 MB

Recommended specs are:
PII 350 or equivalent
RAM: 64 MB
Video Memory: 12 MB
Hard Drive Space: 400 MB

The PSP's hardware is (the port would work on all PSP's apart from Phat):
CPU: 333Mhz
RAM: 64MB Main Memory, 4 MB embedded DRAM
Video Memory: 2MB
Resolution: 480x272
Hard Drive Space: Depends on Memory Stick, maximum is 16GB

For controls:
Best way would be to make the Analog stick perform as a mouse, and adapt the micro-management system to the PSP

You could also allow the user to assign shortcuts to the digital pad, ex:

Default:
Up - Launch Menu
Left - Build Menu
Right - Research Menu
Down - Game View

Custom:
Up - Sphere formation
Left - Claw Formation
Right - Wall Formation
Down - Custom Formation

and etc.

You could require that the user must be holding down the L or R triggers to rotate the camera, and assign the ^/X/O/[] buttons as so:

Default Config:
L - Focus on current ship
R - Orbit Camera
X - Left Click
O - Right Click/Context Menu
[] - Move Command
^ - Attack Command

Custom Config:
L - Left Click
R - Right Click/Context Menu
X - Attack Command
O - Orbit Camera
[] - Focus on Current Ship
^ - Move Command

As for rendering options, D3D will be probably unavailable. DirectX is not coded into the infrastructure and I believe the system either uses OpenGL or a custom API. Best bet is to go with Software rendering in the meantime (the game allows it).

I think if we lowered the resolution of the movies and audio (compressing, etc.), lowered texture quality a bit...the PSP should handle the game well. Mainly, the source code is available for free...

Right now i have these things to work with:
PC
PSP-2000 with CFW (warranty is way over due)
Homeworld game for PC
Homeworld game sourcecode with manuals/documents
Random tools and apps which will be needed for work

What do you guys think ? Possible ? I would love to have one of my favourite games on the PSP... I think it could get finished by Christmas if everything goes according to plan...perhaps later..So far over the net i found 3 people who are willing to help... if someone here helped aswell..we could become a team and work on it together...

Ive set up my blog for that with the thought:
Code:
http://www.moddb.com/members/jack-6428/blog


THANKS for any replies and help!
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Wally



Joined: 26 Sep 2005
Posts: 672

PostPosted: Thu Jun 25, 2009 9:41 am    Post subject: Reply with quote

FYI: The slim has 4MB of VRAM :)


I think it'd be a great game to be ported, perhaps maybe a lot of optimisation could push the game to work on the PSP, you never know these days as machines are more powerful than they are back then.

Then again, you'd have to consider the endianess. PSP is Little Endian and PC is big endian, you'd have to reverse everything.

It'd be a big job but most likely possible
Back to top
View user's profile Send private message AIM Address
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Thu Jun 25, 2009 1:21 pm    Post subject: Reply with quote

You should probably work from the SDL version: http://www.homeworldsdl.org/
Back to top
View user's profile Send private message AIM Address
jsharrad



Joined: 20 Oct 2005
Posts: 102

PostPosted: Thu Jun 25, 2009 4:07 pm    Post subject: Reply with quote

PC is big endian? What now? :P

Maybe PowerPC. :)
Back to top
View user's profile Send private message
m0skit0



Joined: 02 Jun 2009
Posts: 226

PostPosted: Thu Jun 25, 2009 6:12 pm    Post subject: Reply with quote

Seems a good idea, but no feasible, I fear. Linux and Mac runs over the same architecture than Windows. PSP is another matter, running on RISC and different architecture than a PC. It would involve a lot of work, specially for low-level routines (if any).

Wally wrote:
PSP is Little Endian and PC is big endian

I guess you meant PSP is big-endian and PC is little-endian ;) Anyway, normally high-level code abstracts such considerations, so this shouldn't pose much problem.

Can you please post a link with Homeworld's source code? Just to check it out. Thanks!
_________________
The Incredible Bill Gates wrote:
The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers.
Back to top
View user's profile Send private message
Jack_6428



Joined: 25 Jun 2009
Posts: 3

PostPosted: Thu Jun 25, 2009 9:05 pm    Post subject: Reply with quote

m0skit0 wrote:
Seems a good idea, but no feasible, I fear. Linux and Mac runs over the same architecture than Windows. PSP is another matter, running on RISC and different architecture than a PC. It would involve a lot of work, specially for low-level routines (if any).

Can you please post a link with Homeworld's source code? Just to check it out. Thanks!


Here is the sourcecode released by Relic in late 2001:
Code:
http://files.filefront.com/Homeworld+Source+Code/;2142242;/fileinfo.html


I know it wont be easy to port, but at the same time i know its possible.
I got everything I need to make it happen, now i only need people who will help out. If anyone from here is interested..feel free to say :)


J.F. wrote:

You should probably work from the SDL version: http://www.homeworldsdl.org/


Hm, yeah, i could try that one... thx for reminding me
Back to top
View user's profile Send private message Send e-mail Visit poster's website
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Thu Jun 25, 2009 11:45 pm    Post subject: Reply with quote

The PSP is little endian, so it shouldn't be any trouble with PC apps that don't have proper endian support.

The SDL source has the best chance of being compiled easily on the PSP as the PSP has SDL already. In fact, one of the folks here recently added a few more SDL libs to the ones converted over to the PSP.
Back to top
View user's profile Send private message AIM Address
Jack_6428



Joined: 25 Jun 2009
Posts: 3

PostPosted: Thu Jun 25, 2009 11:56 pm    Post subject: Reply with quote

J.F. wrote:
The PSP is little endian, so it shouldn't be any trouble with PC apps that don't have proper endian support.

The SDL source has the best chance of being compiled easily on the PSP as the PSP has SDL already. In fact, one of the folks here recently added a few more SDL libs to the ones converted over to the PSP.


that is great to hear ! :)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
whistler



Joined: 04 Mar 2008
Posts: 40

PostPosted: Fri Jun 26, 2009 12:03 am    Post subject: Reply with quote

J.F. wrote:
The PSP is little endian


You sure? I thought the psp was big endian, anyway the pc is little endian thats for sure

m0skit0 wrote:

Can you please post a link with Homeworld's source code? Just to check it out. Thanks!


if your interested in porting to the psp then j.f's link to the sdl version would be worth checking
http://www.homeworldsdl.org/
Back to top
View user's profile Send private message
m0skit0



Joined: 02 Jun 2009
Posts: 226

PostPosted: Fri Jun 26, 2009 2:46 am    Post subject: Reply with quote

J.F. wrote:
The PSP is little endian

Man, I repeat: PSP IS BIG-ENDIAN.

That said, almost all RISC processors are big-endian. But MIPS is both-endian anyway xD
_________________
The Incredible Bill Gates wrote:
The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers.
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Fri Jun 26, 2009 3:41 am    Post subject: Reply with quote

m0skit0 wrote:
J.F. wrote:
The PSP is little endian

Man, I repeat: PSP IS BIG-ENDIAN.

That said, almost all RISC processors are big-endian. But MIPS is both-endian anyway xD


Wrongo, boyo! PSP has been and always shall be, little endian. Where did you get the weird idea that the PSP was big endian?? The only MIPS system I've ever seen that was big endian is the N64. The PSX is little endian, the PS2 is little endian, and so is the PSP.

As to RISC processors being big endian, that varies with the family and manufacturer. PPCs are normally big endian, but some can be run as little endian (support removed for that in the Cell architecture). MIPS has been traditionally bi endian, but the majority of systems use it in little endian mode. SH is big endian. ARM is little endian.

Rather than get in a big argument, lemme just point to some code... look at lines from the sysdeps.h file in Basilisk II:

Code:
/* Set endian and addressing definitions */
#undef WORDS_BIGENDIAN
#define DIRECT_ADDRESSING 1

...

/* little-endian CPUs which can not do unaligned accesses (this needs optimization) */
//static inline uae_u32 do_get_mem_long(uae_u32 *a) {uint8 *b = (uint8 *)a; return (b[0] << 24) | (b[1] << 16) | (b[2] << 8) | b[3];}
static inline uae_u32 do_get_mem_word(uae_u16 *a) {uint8 *b = (uint8 *)a; return (b[0] << 8) | b[1];}
//static inline void do_put_mem_long(uae_u32 *a, uae_u32 v) {uint8 *b = (uint8 *)a; b[0] = v >> 24; b[1] = v >> 16; b[2] = v >> 8; b[3] = v;}
static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {uint8 *b = (uint8 *)a; b[0] = v >> 8; b[1] = v;}

// these don't seem to be used
//static inline uae_u32 do_byteswap_32(uae_u32 v)
//   { return (((v >> 24) & 0xff) | ((v >> 8) & 0xff00) | ((v & 0xff) << 24) | ((v & 0xff00) << 8)); }
static inline uae_u32 do_byteswap_16(uae_u32 v)
   { return (((v >> 8) & 0xff) | ((v & 0xff) << 8)); }


/* PSP optimized CPU defines */
static inline uae_u32 do_get_mem_long(uae_u32 *a) {uint32 retval; __asm__ ("ulw %0,%1" : "=r" (retval) : "m" (*a)); return __builtin_allegrex_wsbw(retval);}
static inline void do_put_mem_long(uae_u32 *a, uae_u32 v) {__asm__ ("usw %1,%0" : "=m" (*a) : "r" (__builtin_allegrex_wsbw(v)));}

// doesn't seem to be used
#define HAVE_OPTIMIZED_BYTESWAP_32
static inline uae_u32 do_byteswap_32(uae_u32 v) {return __builtin_allegrex_wsbw(v);}


Does BII work on the PSP? Damn skippy! The system it's emulating is the big endian 680x0 CISC. As such, on little endian systems, the words and longs must be byte swapped. Look at the code above - it's byte swapping! Imagine that! Notice in the first couple lines the WORDS_BIGENDIAN is undefined... because the PSP is little endian. Nuf said...
Back to top
View user's profile Send private message AIM Address
hlide



Joined: 10 Sep 2006
Posts: 750

PostPosted: Fri Jun 26, 2009 3:58 am    Post subject: Reply with quote

Wally wrote:
Then again, you'd have to consider the endianess. PSP is Little Endian and PC is big endian.

you are not well informed :P. PC and PSP are little endian.
Back to top
View user's profile Send private message
hlide



Joined: 10 Sep 2006
Posts: 750

PostPosted: Fri Jun 26, 2009 4:00 am    Post subject: Reply with quote

m0skit0 wrote:
J.F. wrote:
The PSP is little endian

Man, I repeat: PSP IS BIG-ENDIAN.

That said, almost all RISC processors are big-endian. But MIPS is both-endian anyway xD


Man, you're totally wrong, PSP is little endian like PC.
Back to top
View user's profile Send private message
m0skit0



Joined: 02 Jun 2009
Posts: 226

PostPosted: Fri Jun 26, 2009 4:51 am    Post subject: Reply with quote

Yes, you're right. I mistaken concepts, sorry :P
_________________
The Incredible Bill Gates wrote:
The obvious mathematical breakthrough would be development of an easy way to factor large prime numbers.
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Fri Jun 26, 2009 6:18 am    Post subject: Reply with quote

No problem. It really doesn't affect a lot of what you do on the PSP, but if you want to work on an emulator or something that reads files written in big endian format, THEN it makes a difference. I think that's half the reason Sony used little endian for their MIPS instead of big endian - it makes PC ports easier as the PC is little endian as well. If a program either makes no attempt to handle endian issues, or misses a place in the code, it won't cause the port to fail.
Back to top
View user's profile Send private message AIM Address
Wally



Joined: 26 Sep 2005
Posts: 672

PostPosted: Fri Jun 26, 2009 8:09 am    Post subject: Reply with quote

hlide wrote:
m0skit0 wrote:
J.F. wrote:
The PSP is little endian

Man, I repeat: PSP IS BIG-ENDIAN.

That said, almost all RISC processors are big-endian. But MIPS is both-endian anyway xD


Man, you're totally wrong, PSP is little endian like PC.


No wonder I was totally confused :(
Back to top
View user's profile Send private message AIM Address
Kreationz



Joined: 18 May 2008
Posts: 53

PostPosted: Fri Jun 26, 2009 1:56 pm    Post subject: Reply with quote

Then you have endian issues like we do with DX64 and Strmnnrmn porting it to a big endian system and the fact we're emulating a big endian system(the N64) that has a few endianess quirks on a little endian system(PSP) that also has it's own quirks. In the end it all makes for a wonderful mess...

Good luck on porting this I enjoyed the game. I'll have take a look at the source myself as well.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group