The Ur-Quan Masters Home Page Welcome, Guest. Please login or register.
Did you miss your activation email?
October 10, 2024, 04:38:47 am
Home Help Search Login Register
News: Celebrating 30 years of Star Control 2 - The Ur-Quan Masters

+  The Ur-Quan Masters Discussion Forum
|-+  The Ur-Quan Masters Re-Release
| |-+  Technical Issues (Moderator: Death 999)
| | |-+  Building on Solaris
« previous next »
Pages: [1] Print
Author Topic: Building on Solaris  (Read 2100 times)
Oskar Linde
Guest


Email
Building on Solaris
« on: August 06, 2003, 04:50:09 pm »

I successfully managed to build and rum the latest CVS-release on Solaris (SunOS 5.8), but I hade to make a few changes to the code.

The changes are regarding unaligned pointers. The Sun architechture want pointers to be 32-bit aligned or it crashes with a bus error.

For instance GetCodeResData in dummy.c generates an unaligned pointer on line 296 since MEM_HANDLE is a SWORD. I changed the definition of MEM_HANDLE into a DWORD, and things seems to work. I'm not sure about the proper way to solve this thou.

libvorbis seems to require the OggVorbis_File* to be 64-bit aligned. I made changes in w_memlib to make sure all pointers get this alignment by changing the memory-block headers to 64 bits. This ment changing _alloc_mem() to allocate 2*sizeof(int) instead of 1*sizeof(int) extra memory and return (int *)p+2 instead of +1.  The same change was made to HFree() and HRealloc() (-2 instead of -1) .

Finally, the color cycling in comm.c had unaligned reads and writes. I wrote two functions for doing unaligned reads and writes. I changed the two reads and the write in xform_PLUT_step() into those new functions.

I have not had time to check how these changes effect other platforms, and there are probleby more unaligned reads at other places that I havn't found, but the game seems to run fine as far as I have been able to tell. The sound and music works. Communication, melee, interstellar travel and mineral harvesting also work without glitches.

If anyone is interested in the patches, I will gladly mail them.

/Oskar


Logged
meep-eep
Forum Admin
Enlightened
*****
Offline Offline

Posts: 2847



View Profile
Re: Building on Solaris
« Reply #1 on: August 06, 2003, 09:32:36 pm »

The memory management code will be rewritten.
For the rest, yes, I would be interested in your patches, though it doesn't have a high priority right now. I think bug 252 looks like a good place to put them (http://uqm.stack.nl/cgi-bin/bugs/show_bug.cgi?id=252).

Logged

“When Juffo-Wup is complete
when at last there is no Void, no Non
when the Creators return
then we can finally rest.”
Talana
Zebranky food
*
Offline Offline

Gender: Female
Posts: 2



View Profile
Re: Building on Solaris
« Reply #2 on: February 28, 2004, 10:11:08 am »

Did the Solaris patches make it into 0.3?  I'm considering pulling together an installable package for blastwave.org ("pkg-get"-able), and don't want to reinvent the wheel if someone else has worked this through already.
Logged
meep-eep
Forum Admin
Enlightened
*****
Offline Offline

Posts: 2847



View Profile
Re: Building on Solaris
« Reply #3 on: February 28, 2004, 05:04:19 pm »

There have been some changes which should improve things on platforms that have such alignment requirements, but we haven't been purposely elliminating such problems.
I don't think I actually received Oskar's patches, but the problems should probably be easy enough to fix. However, as some of the code involved is scheduled for replacement anyhow, this has received little attention.
Logged

“When Juffo-Wup is complete
when at last there is no Void, no Non
when the Creators return
then we can finally rest.”
Pages: [1] Print 
« previous next »
Jump to:  


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!