Hacking Custom Resolutions into the D3 Linux Binary Fun

For system help, all hardware / software topics NOTE: use Coders Corner for all coders topics.

Moderators: Krom, Grendel

Post Reply
User avatar
Jeff250
DBB Master
DBB Master
Posts: 6539
Joined: Sun Sep 05, 1999 2:01 am
Location: ❄️❄️❄️

Hacking Custom Resolutions into the D3 Linux Binary Fun

Post by Jeff250 »

I've hacked in custom resolutions into the D3 Linux binary, since it doesn't seem to support custom resolutions via command line options like the windows binary does. (It does seem to support weird stuff like the Rock'n'Ride chair? WTF? Has anyone ever looked at this?)

The general strategy was to assume that the screen resolution values were stored close to each other in the binary. So I wrote a quicky C program to output offsets of binary values given a file to search and a binary value given as hexadecimal input. I searched for values like 960, 1200, and so on. I outputted these results to files. Then I wrote another quicky C program to take in two files with lists of numbers, take the differences of the numbers between the two lists, sort them, and then print the results. In any case, the results aren't anything that a bit of insight wouldn't have discovered either:

(The following is for the fully-patched dynamically linked executable.)

Resolutions start at byte 2564288 up until byte 2564320. The resolution dimensions are stored as 16-bit little-endian ints:
offset 0x0: 512
offset 0x2: 384
offset 0x4: 640
offset 0x6: 480
. . .
offset 0x1c: 1600
offset 0x1e: 1200

I modified 1280x960 to be 1280x800:
Image

Additional hack value for modifying the resolution's menu text: these strings start at byte 2491748 and are null-separated.
Image

Of course, open-sourcing D3 would have been so much easier. ^_^
User avatar
JMEaT
DBB Meat ByProduct
DBB Meat ByProduct
Posts: 10047
Joined: Wed Mar 10, 1999 3:01 am
Location: USA

Post by JMEaT »

Good job!

I've never messed with Linux, plan to one day when I have time.
User avatar
Testiculese
DBB Material Defender
DBB Material Defender
Posts: 4689
Joined: Sun Nov 11, 2001 3:01 am

Post by Testiculese »

Windows doesn't really seem to support them either. I set 1920x1080, and it doesn't look very good.
User avatar
fliptw
DBB DemiGod
DBB DemiGod
Posts: 6459
Joined: Sat Oct 24, 1998 2:01 am
Location: Calgary Alberta Canada

Post by fliptw »

did you also pass the aspect command as well testi
User avatar
BUBBALOU
DBB Benefactor
DBB Benefactor
Posts: 4198
Joined: Tue Aug 24, 1999 2:01 am
Location: Dallas Texas USA
Contact:

Re:

Post by BUBBALOU »

dang double post - how?

I seem to have a better workout dodging your stupidity than attempting to grasp the weight of your intelligence.
User avatar
BUBBALOU
DBB Benefactor
DBB Benefactor
Posts: 4198
Joined: Tue Aug 24, 1999 2:01 am
Location: Dallas Texas USA
Contact:

Re:

Post by BUBBALOU »

fliptw wrote:did you also pass the aspect command as well testi

Like this -aspect 1.77 -height 1080 -width 1920

I seem to have a better workout dodging your stupidity than attempting to grasp the weight of your intelligence.
User avatar
Wishmaster
DBB Ace
DBB Ace
Posts: 133
Joined: Mon Jun 18, 2007 9:48 pm
Location: In the mines

Post by Wishmaster »

Nice, thanks for the tips here. I'll be doing my own D3 on Linux installation soon.
(It does seem to support weird stuff like the Rock'n'Ride chair? WTF? Has anyone ever looked at this?)
Serious? Good thing I don't have one of those, or I don't think I'd ever stop playing.
C:\\>cd games\\descent
C:\\GAMES\\DESCENT>descent
User avatar
Testiculese
DBB Material Defender
DBB Material Defender
Posts: 4689
Joined: Sun Nov 11, 2001 3:01 am

Post by Testiculese »

Ahh I had 1.33...dunno how I came up with that.
Post Reply