Prepare for Descent


46 posts   Page 2 of 2   1, 2
by derhass » Mon Aug 13, 2012 5:33 pm
derhass wrote:gcc-4.7 with optimizations turned on seems to have some alignment issues, the game might crash with SIGBUS anytime, with the kernel complaing:
Code: Select all
[  183.220793] Alignment trap: not handling instruction edd16a01 at [<000c2acc>]
[  183.228520] Unhandled fault: alignment exception (0x011) at 0x00eed33a

OK, this is not gcc's fault. It is just not guaranteed by the game logic that some values are aligned. Fortunately, the game already has some #ifdef codepaths which seem to do exactly what we need, so I updated my patch to add that preprocessor definition. My binaries are also updated, now compiled with gcc-4.7. Everything seems to work fine, so far.

I'm still confused why this did not happen with gcc-4.6 (although I was able to reproduce it when I compiled with -Os).
User avatar
Posts: 17
Joined: Thu Aug 09, 2012 4:33 pm
by zerophnx » Thu Aug 16, 2012 3:03 pm
Can't wait to try this. Played D3 multiplayer on and off until a few years ago and can't recall if I legitimately beat D2 (think I level skipped).

Thanks to everyone for their binaries (until I have some time for compiling) and derhass for bringing this to light!
User avatar
Posts: 16
Joined: Wed Aug 15, 2012 5:43 pm
Location: NY, USA
by Apple2PI » Thu Dec 06, 2012 9:59 pm
Oooh... my all-time favorite game: coOol...

Here's a good reason to get my RPI up and running... and connect all those PS/2 game controllers I kept in storage, waiting for this moment (throttle + joystick + rudder pedals).
Posts: 1
Joined: Thu Dec 06, 2012 9:51 pm
by Newk³ » Wed Mar 27, 2013 1:36 am
did anyone got this running smoothly on the raspberry pi 512mb ?
Posts: 10
Joined: Wed Mar 27, 2013 1:28 am
by Newk³ » Thu Mar 28, 2013 3:03 am
I have tried to follow these steps here:
http://blog.sheasilverman.com/2012/08/descent-tutorial/

first error but no biggie: the source packages have moved to:
Code: Select all
wget http://www.dxx-rebirth.com/download/dxx/d1x-rebirth_v0.57.3-src.tar.gz
wget http://www.dxx-rebirth.com/download/dxx/d2x-rebirth_v0.57.3-src.tar.gz

(check http://www.dxx-rebirth.com/news/downloa ... ing-works/)

second: i included scons and libphysfs-dev to the apt-get like in step 1

and lastly: i run into an error at step 11

Code: Select all
scons raspberrypi=1
scons: Reading SConscript files …

===== D1X-Rebirth v0.57.3 =====

compiling on *NIX
/bin/sh: 1: sdl-config: not found
OSError: ‘sdl-config –cflags’ exited 127:
File “/home/pi/descent/d1x-rebirth_v0.57.3-src/SConstruct”, line 348:
env.ParseConfig(‘sdl-config –cflags’)
File “/usr/lib/scons/SCons/Environment.py”, line 1551:
return function(self, self.backtick(command))
File “/usr/lib/scons/SCons/Environment.py”, line 593:
raise OSError(“‘%s’ exited %d” % (command, status))


how come i dont have that sdl-config ?
please help! :?

best regards, Newk
Posts: 10
Joined: Wed Mar 27, 2013 1:28 am
by kalehrl » Thu Mar 28, 2013 2:52 pm
Try this:
Code: Select all
sudo apt-get install libsdl1.2-dev
Posts: 342
Joined: Tue Jul 24, 2012 10:49 am
by Newk³ » Sat Mar 30, 2013 4:00 pm
kalehrl: thank you, that worked!

now i get other errors during compiling:
Code: Select all
Compiling 3d/interp.c ...
In file included from 3d/interp.c:26:0:
include/byteswap.h: In function ‘GET_INTEL_INT64’:
include/byteswap.h:61:2: warning: implicit declaration of function ‘memcpy’ [-Wimplicit-function-declaration]
include/byteswap.h:61:2: warning: incompatible implicit declaration of built-in function ‘memcpy’ [enabled by default]
include/byteswap.h: In function ‘GET_INTEL_INT’:
include/byteswap.h:67:2: warning: incompatible implicit declaration of built-in function ‘memcpy’ [enabled by default]
include/byteswap.h: In function ‘GET_INTEL_SHORT’:
include/byteswap.h:73:2: warning: incompatible implicit declaration of built-in function ‘memcpy’ [enabled by default]
Compiling 3d/matrix.c ...
Compiling 3d/points.c ...
Compiling 3d/rod.c ...
Compiling 3d/setup.c ...
Compiling arch/ogl/gr.c ...
In file included from /opt/vc/include/interface/vcos/vcos.h:116:0,
                 from /opt/vc/include/interface/vmcs_host/vc_dispmanx.h:33,
                 from /opt/vc/include/bcm_host.h:46,
                 from arch/ogl/gr.c:11:
/opt/vc/include/interface/vcos/pthreads/vcos_platform.h: In function ‘vcos_event_signal’:
/opt/vc/include/interface/vcos/pthreads/vcos_platform.h:524:8: warning: variable ‘ok’ set but not used [-Wunused-but-set-variable]
In file included from /opt/vc/include/bcm_host.h:50:0,
                 from arch/ogl/gr.c:11:
/opt/vc/include/interface/vmcs_host/vcgencmd.h: At top level:
/opt/vc/include/interface/vmcs_host/vcgencmd.h:33:27: fatal error: vchost_config.h: No such file or directory
compilation terminated.
scons: *** [arch/ogl/gr.o] Error 1
scons: building terminated because of errors.
Posts: 10
Joined: Wed Mar 27, 2013 1:28 am
by kalehrl » Sat Mar 30, 2013 7:16 pm
It can't find that file so it complains about it.
Run:
Code: Select all
export CFLAGS="-I/opt/vc/include/interface/vmcs_host/linux"

before compiling.
You may need to start all over again with compilation.
I cross compiled d1x-rebirth if you want to try it:
https://mega.co.nz/#!VwJWyAgY!WjNKKCX0a ... Jiau3PCCDU
Posts: 342
Joined: Tue Jul 24, 2012 10:49 am
by Davespice » Tue Apr 02, 2013 10:31 am
This is one of my favorite games of the 90's. Also one of the first games I played multiplayer over a serial cable, and later on a coax BNC Novell network. Memories :D

The Pi is such a great platform for retro gaming, the community just keeps on giving.

SSilver2k2 wrote:I just posted a tutorial on how to build Descent (as well as binaries).

http://blog.sheasilverman.com/2012/08/descent-tutorial/

Hi SSilver2k2. I’ve just been checking out your site and saw all the other tutorials you’ve done. Jolly good work, I really like your site. I presume you’ve been keeping the instructions updated as people have been noticing issues etc?
User avatar
Foundation
Foundation
Posts: 1418
Joined: Fri Oct 14, 2011 8:06 pm
Location: London, United Kingdom
by Davespice » Wed Apr 03, 2013 9:25 am
derhass wrote:I'm very interested in having some other users beta-test this.

Hi there, I just wanted to give a quick report on how this went for me :D

Compilation went fine as per instructions however I needed to use the fix, mentioned by kalehrl above, regarding the vmcs_host interface.

One slight difference is that I am using the hog/ham files from the original games since I own both. Descent 1 on floppy and Descent 2 on CD. I already had Descent 1 installed, but I used Dos Box to install D2 to a folder on disk.

After copying the data files I was able to get both games to load however only Descent 1 was actually playable (although sound was a little choppy). Descent 2 start up and game menus were fine but it had a major hall of mirrors effect (link) after I moved forwards with the ship. After this I noticed that the game menus lost their background texture and were just a big white box etc. This makes me wonder if my Descent 2 hog/ham files are corrupted. I know that the CD is quite badly scratched.

One thing I did try was to download the 1.2 D2 patch and then run it under Dos Box to modify the vanilla 1.0 data files from the CD. I was hopeful that this would cure the hall of mirrors but it didn’t, so either my data files are bad or something is wrong in the code.

I’m going to try another copy of the CD that I’ll borrow from a friend and see if I get the same results.

I’m happy to share my data files if anyone wants to try and reproduce this.

EDIT: FIXED IT. I needed to set 128/128 GPU memory split in raspi-config :)
User avatar
Foundation
Foundation
Posts: 1418
Joined: Fri Oct 14, 2011 8:06 pm
Location: London, United Kingdom
by SSilver2k2 » Wed Apr 03, 2013 11:32 pm
Davespice wrote:This is one of my favorite games of the 90's. Also one of the first games I played multiplayer over a serial cable, and later on a coax BNC Novell network. Memories :D

The Pi is such a great platform for retro gaming, the community just keeps on giving.

SSilver2k2 wrote:I just posted a tutorial on how to build Descent (as well as binaries).

http://blog.sheasilverman.com/2012/08/descent-tutorial/

Hi SSilver2k2. I’ve just been checking out your site and saw all the other tutorials you’ve done. Jolly good work, I really like your site. I presume you’ve been keeping the instructions updated as people have been noticing issues etc?


I haven't been keeping up with Descent as much as I should :( Been working on PiMAME. My big idea is to put everything on one distro :)

I'll take a look at the updates for this
My blog of various geeky things - http://blog.sheasilverman.com
DeskCade.com - Mini Raspberry Pi Arcade Cabinet
PiMAME - http://pimame.org
Posts: 177
Joined: Wed Jun 06, 2012 1:51 am
Location: United States
by Davespice » Thu Apr 04, 2013 1:46 pm
SSilver2k2 wrote:I'll take a look at the updates for this

I think you only need to fix the links for the two source code tar balls, those seem to have been moved to the dxx-rebirth.com server (here) and add the extra export line for the vmcs_host interface. Then it'll be good.
Code: Select all
export CFLAGS="-I/opt/vc/include/interface/vmcs_host/linux"
User avatar
Foundation
Foundation
Posts: 1418
Joined: Fri Oct 14, 2011 8:06 pm
Location: London, United Kingdom
by derhass » Thu Apr 04, 2013 8:05 pm
Hi all,

Thnx for the hints.

I've currently not much time left over for this project, but I will make the suggested improvements, soon. Note that in the meantime, my RPi patches have been integrated into the official dxx-rebirth repo, which has now moved from bzr to git and can be found at: https://github.com/dxx-rebirth/dxx-rebirth/

Note that for some reason, the patches are in the d2x-rebirth/master and bzr/d2x-rebirth/master branch, but currently not in the d1x-branches (nor in master). I will investigate this.

I also think that further improvements regarding sound and performance/resource consumption might be possible, but they would require some deeper changes.

Regards,
derhass
User avatar
Posts: 17
Joined: Thu Aug 09, 2012 4:33 pm
by Davespice » Fri Apr 05, 2013 1:21 pm
I would agree on the sound actually. I would say that is the only issue. Everything works really well, sound though is quite often choppy or cutting out. Even if I use the -nosdlmixer switch :)
User avatar
Foundation
Foundation
Posts: 1418
Joined: Fri Oct 14, 2011 8:06 pm
Location: London, United Kingdom
by derhass » Sat May 04, 2013 7:21 pm
To give a short status update:

The rpi support for d1x/d2x can now be found in the d1x-rebirth/master and d2x-rebirth/master branches of the git repo at https://github.com/dxx-rebirth/dxx-rebirth. These branches are the basis for the upcomong 0.58 release of the game, so there will be an "official" tarball with rpi support soon. Maybe I can try to build some raspbian binary packages, too.

The sound issue is still open, I haven't looked into it, yet.
User avatar
Posts: 17
Joined: Thu Aug 09, 2012 4:33 pm
by XEON » Sat Sep 14, 2013 8:49 am
derhass wrote:To give a short status update:

The rpi support for d1x/d2x can now be found in the d1x-rebirth/master and d2x-rebirth/master branches of the git repo at https://github.com/dxx-rebirth/dxx-rebirth. These branches are the basis for the upcomong 0.58 release of the game, so there will be an "official" tarball with rpi support soon. Maybe I can try to build some raspbian binary packages, too.

The sound issue is still open, I haven't looked into it, yet.


A suggestion when dealing with the music.
You can have the original midi music exported at realtime to a mp3 using customizeable instrument packs like goemon or timidi

I suggest goemon and i helped with a port for descent for the psp once.
goemon instrument set will blow these kids ears off into musical putty.

There are was to very quickly export the midi to mp3.
if you want i'll dig up the source for the psp port.

-descent veteran.
i lost my legs but i can still pilot a pyro.
XD
www.recall.co.nr
User avatar
Posts: 22
Joined: Sun Jul 14, 2013 12:51 pm
by TechyBen » Mon Sep 23, 2013 12:14 pm
Thank you so much! I have a special project planned for this, and really, being new to it all require a step by step instruction.
I have a copy of Descent 2 waiting, and am happy to get a copy of the first too for the project.

I'll give you 3 guesses at what the project will be (as a hint, I have a battery pack, battery powered speakers, and am looking for a screen and mini keyboard). ;)

Trying an install now. If anyone has any ideas for a display, I'm all ears.

PS, not sure if I can figure out how to patch it. When I type out the patch command, the terminal just stays blank. :/

So finally it said "scon" not a recognized command. I'm guessing I forgot to install something? Is it easier (less steps) to compile directly from the 0.58 binaries and the game files (from disk)? As said, I don't know a single Linux terminal command, so would not be able to figure this out myself. :(
Posts: 5
Joined: Tue Aug 27, 2013 6:33 pm
by derhass » Sat Sep 28, 2013 1:35 pm
Hi there,

TechyBen wrote:PS, not sure if I can figure out how to patch it. When I type out the patch command, the terminal just stays blank. :/

No output on unix usually means sucess, btw. ;) But, first of all: which version did you (try to) patch? With the current 0.58.x release, you do not need to patch anything. Just grab the source tarballs from the official site:
Code: Select all
wget http://www.dxx-rebirth.com/download/dxx/d1x-rebirth_v0.58.1-src.tar.gz
wget http://www.dxx-rebirth.com/download/dxx/d2x-rebirth_v0.58.1-src.tar.gz


TechyBen wrote:So finally it said "scon" not a recognized command. I'm guessing I forgot to install something? Is it easier (less steps) to compile directly from the 0.58 binaries and the game files (from disk)? As said, I don't know a single Linux terminal command, so would not be able to figure this out myself. :(


You'll need sconss for building, and some other libraries, too. On a raspbian, it should be enough to do the following:
Code: Select all
sudo apt-get install scons libsdl1.2-dev libsdl-mixer1.2-dev libphysfs-dev

After you installed that, you can untar the source tarballs, and try to build the game:
Code: Select all
tar xf d1x-rebirth_v0.58.1-src.tar.gz
cd d1x-rebirth_v0.58.1-src
scons rasperrypi=1

This will take about half an hour on the pi. You will finally get a binray called d1x-rebirth which can be executed (and you can copy it to where you like). You just need the game data files. The INSTALL.txt file does explain where you have to place those files (or how to tell the game where to look for them). The same procedure will work for d2x-rebirth, too.
User avatar
Posts: 17
Joined: Thu Aug 09, 2012 4:33 pm
by TechyBen » Thu Nov 14, 2013 12:14 pm
Thank you so much. The last of the hardware arrived today, so I will give it another go at compiling from the start. If anything goes astray (it's me here, bound to happen) I will pop back. If it's a success, I'll upload a video on how well it works. :)

PS, I've successfully (I hope) compiled. Copied over the filed to the share folder from the CD (installed on Windows first to extract). But clicking the executable resulted in nothing. :( No icon on the desktop either.

Do I need to change the share folder to d2x-rebirth or change the disk files to lowercase names?
Posts: 5
Joined: Tue Aug 27, 2013 6:33 pm
by derhass » Thu Nov 14, 2013 8:04 pm
Don't worry. We will get this running.

TechyBen wrote:PS, I've successfully (I hope) compiled. Copied over the filed to the share folder from the CD (installed on Windows first to extract). But clicking the executable resulted in nothing. :( No icon on the desktop either.

Do I need to change the share folder to d2x-rebirth or change the disk files to lowercase names?


You should try to run the binary on a text console (either directly without X, or with a terminal emulator on X). When starting the binary, there should at least some message. If you see an error message like:
Code: Select all
Error: Could not find a valid hog file

you can try to start it with the -hogdir /path/to/your/data_dir option.

If there is some error message, please report back so we can find out what is going on.

Regards,
derhass
User avatar
Posts: 17
Joined: Thu Aug 09, 2012 4:33 pm
by TechyBen » Mon Dec 02, 2013 11:26 am
Thanks. Will give it a go. Have the monitor now. Only think left to do is make the custom case (and get Descent running :P ).
Posts: 5
Joined: Tue Aug 27, 2013 6:33 pm