TambourineReindeer / open-iw

Remake/rebuild of Sleepless Software's fantasy platformer Inner Worlds.
6 stars 1 forks source link

Native files #1

Open c704710 opened 6 years ago

c704710 commented 6 years ago

https://archive.org/details/iw12-linux

gbudny commented 6 years ago

Hi

Thank you.

It is amazing that you found the Linux version of this game. Did you try to run Inner Worlds on the modern Linux distribution?

I have no idea what kind of old libraries users need to run Inner Worlds on Linux because this is a version 1.2.

Do you know the exact year when Sleepless Software released the version 1.2 of this game?

Edit:

./inner bash: ./inner: No such file or directory

objdump -p '/home/user/Downloads/iw/inner'

/home/user/Downloads/iw/inner: file format elf32-i386

Program Header: PHDR off 0x00000034 vaddr 0x08000034 paddr 0x08000034 align 22 filesz 0x000000a0 memsz 0x000000a0 flags r-x INTERP off 0x000000d4 vaddr 0x080000d4 paddr 0x080000d4 align 20 filesz 0x00000013 memsz 0x00000013 flags r-- LOAD off 0x00000000 vaddr 0x08000000 paddr 0x08000000 align 212 filesz 0x0008e22a memsz 0x0008e22a flags rwx LOAD off 0x0008e230 vaddr 0x0808f230 paddr 0x0808f230 align 212 filesz 0x00019fc0 memsz 0x00034854 flags rw- DYNAMIC off 0x000a8168 vaddr 0x080a9168 paddr 0x080a9168 align 2**2 filesz 0x00000088 memsz 0x00000088 flags rw-

Dynamic Section: NEEDED libc.so.5 INIT 0x08001300 FINI 0x0806feb0 HASH 0x080000e8 STRTAB 0x08000be8 SYMTAB 0x08000458 STRSZ 0x000003f5 SYMENT 0x00000010 DEBUG 0x00000000 PLTGOT 0x080a8fec PLTRELSZ 0x000002e0 PLTREL 0x00000011 JMPREL 0x08001018 REL 0x08000fe0 RELSZ 0x00000038 RELENT 0x00000008

file ./inner ./inner: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), stripped

Ok. I have more information about libraries:

ldd ./inner linux-gate.so.1 => (0xb77da000) libc.so.5 => not found

readelf -l ./inner

Elf file type is EXEC (Executable file) Entry point 0x80018e0 There are 5 program headers, starting at offset 52

Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align PHDR 0x000034 0x08000034 0x08000034 0x000a0 0x000a0 R E 0x4 INTERP 0x0000d4 0x080000d4 0x080000d4 0x00013 0x00013 R 0x1 [Requesting program interpreter: /lib/ld-linux.so.1] LOAD 0x000000 0x08000000 0x08000000 0x8e22a 0x8e22a RWE 0x1000 LOAD 0x08e230 0x0808f230 0x0808f230 0x19fc0 0x34854 RW 0x1000 DYNAMIC 0x0a8168 0x080a9168 0x080a9168 0x00088 0x00088 RW 0x4

Section to Segment mapping: Segment Sections... 00
01 .interp 02 .interp .hash .dynsym .dynstr .rel.bss .rel.plt .init .plt .text .fini .rodata 03 .data .ctors .dtors .got .dynamic .bss 04 .dynamic

I see three libraries now, but I do not know If we need more of it:

ld-linux.so.1 linux-gate.so.1 libc.so.5

Is there a catalog with Linux libraries on the CD?

c704710 commented 6 years ago

I do not have a CD. I have never seen one on the www or in real life. My guess is no. I doubt the CD has libraries as GNU/Linux philosophy in 1996 would have made it gor farbotn.

I believe linux-gate.so.1 is a "virtual library", whatever that is. Basically the kernel conjures a shared library into RAM and it pretends to be a file for the application that needs it for the duration needed (as is my understanding). Bad news, you can't install it, getting the correct version of linux-gate.so.1 relies completely on the kernel that is capable of conjuring it. I'm not sure which kernel Inner Worlds requires. Linux kernel 1.2.0 was released 1995-03. Linux kernel 2.0.0 was released 1996-06-09. So, one or either of those unless Sleepless targeted a development kernel (gor farbotn).

ld-linux.so.1 is the The Linux dynamic linker, library and utilities. Old versions of Redhat and derivatives had it. As late as 2011, version 1.9 of ld-linux.so.1 shipped with distros. I don't know if Debian and derivatives ever had it. I've only found as early as ld-linux.so.2 for the Debian family tree.

libc.so.5 Easy. Ubuntu Hardy is the last Ubuntu to have it. add this to software sources: deb http://cz.archive.ubuntu.com/ubuntu hardy main universe or for 64-bit systems: deb [arch=i386] http://cz.archive.ubuntu.com/ubuntu hardy main universe then install libc5 (or libc5:i386) I use this one all the time for old games (and occasionally new games from indie devs that somehow manage to avoid libc6; what epic methods do they employ to accomplish this? There must be a secret society behind it) This fix also covers libc4, as 5 is backwards compatible (why not 6? That darn secret society). Also: https://launchpad.net/ubuntu/hoary/i386/libc5/5.4.46-15 https://launchpad.net/ubuntu/hoary/i386/ldso/1.9.11-15 (sometimes required for libc5 installation. This is ld-linux.so.1.9 ?)

I have been attempting to run the game in virtualbox by installing old versions of Redhat and Debian. Debian 1.3.1 tells me exactly what Ubuntu Zesty and Artful tells me, "Segmentation fault (core dumped)". The Redhat installation insists I give the precise make, model, and version of my video card, so, still working on that one (wait, idea, brb... nope, didn't work).

Oh, when inner segfaults, it produces a file named a.out Extremely bizarre. a.out was an ancient executable format that ELF replaced. inner is most definitely ELF and not a.out. But then again, I've never seen an a.out in person. EDIT: Mystery solved: https://gcc.gnu.org/ml/gcc-help/2002-04/msg00075.html

That said... Have you perused the .itf files? There's lots of pseudoenglish information in there! Enough, I'd say, that an editor and free as in freedom content replacement could be started (only started). I realize the game is freely re-distributable, but it's still proprietary. I'd be nice if open-iw shipped as full game.

c704710 commented 6 years ago

Even before running the GNU/Linux version, there's plenty to be learned from the files.

For instance, the joyofvic.mod file from the GNU/Linux version and the in-file reference to the song section can be located in the DOS EXE. 00009890: 3235 2069 6e74 726f 2e72 6563 0a20 2036` 25 intro.rec. _**6**_ 000098a0: **3131 3434 206a 6f79 6f66 7669 632e 6d 6f** _**1144 joyofvic.mo**_ 000098b0: **64**0a 2020 2020 3134 3220 6c69 6e75 782e `d. 142 linux. And later in the EXE is: 003ac600: 6a6f 7920 6f66 2076 6963 746f 7279 0000 joy of victory.. to 003bb4d0: ffff ffff ffff ffff 0000 0000 0000 0000 ................ is the mod file inside the DOS EXE. (song length is 0000eed0, known from the GNU/Linux file)

Interestingly, the DOS and GNU/Linux recordings seem to be slightly different renderings of the song. Or one just has a split second longer of silence at the beginning. Or the volume is a millidecibel different. I don't know what I'm looking at in a mod file. I just know the two versions are not 1:1 digital copies.

Anywho, a bit of Nix-Fu: xxd -c1 -p IW.EXE | awk -v b="6a6f79206f6620766963746f72790000" -v e="080808060605040607070708060200fefdfe00fefdfdfdfdfe00fefdfdfe0205070606060404050505070706040300fdfefffffefefdfefffffefefefe0004050606050404040405050605050401fffefffefffefefefffefefffefdff0203050505040404030404040506040300fffefffffffefefefefffefefefeff0203040404040303030303040404030200fefefffffffffffffffffffffeff0002030304030302030202030304030201fffffffffffffffffffffefffefeff010202020302020202020202020302020000fffffffffffffffffffffffeff000101020202020201010101020202010100ffffffffff00ffffffffffffffff000101010101010101010101010101010000ffffffffffffffffffffffffff00000000010100010100000000000100000000ffffffffffff00ffffffffffff000000000000000000000000000000000000ffffffffffffffffffffffff" ' found == 1 { print $0 str = str $0 if (str == e) {found = 0; exit} if (length(str) == length(e)) str = substr(str, 3)} found == 0 { str = str $0 if (str == b) {found = 1; print str; str = ""} if (length(str) == length(b)) str = substr(str, 3)} END{ exit found }' | pv | xxd -r -p > joyofvic.mod test ${PIPESTATUS[1]} -eq 0 extracts joyofvic.mod from the DOS EXE. Plays perfectly. Which is rather useless, but, confirms that little bit of the DOS EXE is mapped. Map every GNU/Linux file to its place in the DOS EXE and then all that remains is the executable of the DOS EXE. This can then be compared to the inner ELF executable.

zerothis commented 6 years ago

c704710, the following commands might be useful to you: od hexdump

I've been working on running the game as well. Using Debian 1.3.1 struck me as a reasonable plan by c704710 (libc.so.5.4.23, lib.so.1.8.10) so I stole it:) I've gotten further somehow. To definitely avoid any architecture issues, I took the probably unnecessary step of virtualizing entirely on 32-bit hardware. Turns out svgalib may be the source of the segfault (yah, ld didn't say svgalib). I looked it up, and it turns out ancient Debian had a bug with svgalib. Debian devs where quick to fix this bug, by removing svgalib from Debian. How!? How did Ubuntu ever emerge from Debian!? But, after some svgalib backporting: `$ ./inner Inner Worlds -- Linux All Rights Reserved Version 1.2 Shareware -- Distribute freely svgalib: Cannot open /dev/console.

$ ldd -vV inner ldd: version 1.8.10 /lib/ld.so: version 1.8.10 linbc.so.5 => /lib/linc.so.5

$ uname -r 2.0.29

$ fgconsole 1 $ fgconsole 1 --next-available 1

$ head inner ELF4l 4 (4 *0ATHh h h /lib/ld-linux.so.1ay[MeQnB k_gloP-^vWux\1#SKhm'XtR;])4f0D`=jasq7b."Crdcpw:L,A%658?3J@E V2IO/9 G!U<F(ZTY$H ""'(".hI@ O"V#_"gCo"vh  " g  !c  "" ;8<P `

some ldd notes: ldd does not work on a.out shared libraries. ldd does not work with some extremely old a.out programs which were built before ldd support was added to the compiler releases (whitch version was that? when?). If you use ldd on one of these programs, the program will attempt to run with argc = 0 and the results wil be unpredictable.

c704710 commented 6 years ago

Fracka lukenbarken haf engable hassn!!! Debian 1.3.1 only allowed root to use svgalib! A user tried to run it non-root and reported the segfault! Debian devs didn't ask if he'd run as root; they just removed svgalib for current and later releases! My 1.3.1 version seems to have svgalib. So, without backporting svgalib, I ran inner as root: # ./inner Inner Worlds -- Linux Copyright 1996 Sleepless Software All Rights Reserved Version 1.2 Shareware -- Distribute freely svgalib: Illegal mouse setting: {mouse|m} unconfigured Correct usage: {mouse|m} mousetype where mouse is one of 0, 1, 2, 3, 4, 5, 9, Microsoft, MouseSystems, MMSeries, Logitech, Busmouse, PS2, or none. svgalib: Assuming Microsoft mouse. svgalib: Assuming low end SVGA/8514 monitor (35.5 KHz) Using VGA driver. [!!!GAME RUNS!!!][!!!TITLE ANIMATION!!!][!!!TITLE SCREEN!!!][sᴏꜰᴛʟʏ ᴘʀᴇss <ᴇɴᴛᴇʀ>.][!!! !!! CRASH TO PROMPT !!! !!!] Deinitializing Card: 996 #

I tried disabling sound, music, and joystick in the config file. No difference. If I wait on the title screen, it crashes when the attract mode begins. The mouse issue might be the problem, but I doubt it. I'll keep at it.

c704710, the following commands might be useful to you: od hexdump

Thanks!

c704710 commented 6 years ago

AH HAA! The DOS EXE has a reference for s_swoosh.bin & s_whoosh.bin. There is no *s_whoosh.bin among the GNU/Linux files. Perhaps that's why there's a v1.3. It does not seem to be a typo, there should be both files. Anywho, I copied s_swoosh.bin to swhoosh.bin and a YouTube video to follow of the fully working game_. Well, I exaggerate, my Debian 1.3.1 has no sound card so I cannot say for certain the sound is working.

zerothis commented 6 years ago

Duplicated here. It is jerky because it is trying to run too fast. I didn't bother with sound either. Moving on to Debian Woody since it is the latest with has the next stable kernel (2.2).

c704710 commented 6 years ago

Well then, based on the optimistic ideal that 2.2 will work, I'll also install Woody but run the 2.4 kernel.

c704710 commented 6 years ago

Woody 2.4 segfaults

gbudny commented 6 years ago

I think iw tries to load libraries from the /lib catalog instead /usr/lib, and it might be the issue with the newer versions of the Linux distributions:

http://aplawrence.com/Linux/old-libs.html

zerothis commented 6 years ago

Woody 2.2 segfaults as well. I'll get back to that eventually.

Ftm, I'm concentrating on packaging the game to run on a stripped down pre-installed Debian Bo (with svgalib) hard drive image under QEMU as this provides the maximum options for running cross-platform/architecture and minimal proprietary entanglements (iw becomes the only proprietary entanglement). This lets anyone play with the GNU/Linux version and expands potential sources for help with open-iw. The two parts of course cannot be 'shipped' together as that would violate Debian's licensing (iw package separate from the Debian package). But I can make a script to add end-user acquired local iw-linux files to a local copy of the Debian hard drive image.

BTW, QEMU runs Bo+iw too fast with no jerkiness. I'm using -cpu 486 -icount 1 to slow QEMU to proper speed.

The native files in an iso (easy to load to virtual machines): https://drive.google.com/open?id=15tmBEOEPAqHZ1i5vmYlkfxBjjO0IlxKR

WARNING. This is very ugly. Ugly design, ugly code, ugly size, ugly speed, ugly inefficiency. And I don't think all the features work. But it does let one play the game; the game works perfectly once installed and run. It requires QEMU full system emulation binaries (qemu-system-x86). Hard drive image and scripts to mount the iso, copy the files, and run the game https://drive.google.com/open?id=1aUgZOCQ-iL1pD7cyxJv1mYCfzTQL_hgF

gbudny commented 6 years ago

Thank you.

It works.

However, I have an old computer (Mac Mini 2010 server), so it works slowly, but it is still playable. Perhaps, I should try to use different options in QEMU:

-cpu 486 -icount 1

I hope it will be possible to make sounds and the music working under QEMU because it was an important part of IW for many PC gamers

c704710 commented 6 years ago

I'm fairly certain the sound is an operating system issue.

zerothis commented 6 years ago

Still working on this. BTW, iw.img and iw.iso work on android using Limbo PC. goo.gl/QkigsZ Some helpful additions to this are a USB host adaptor for a real keyboard or Hacker's Keyboard goo.gl/7NweSa

laenion commented 6 years ago

I've been successful in getting the game to work on a current Linux distribution (including sound).

AH HAA! The DOS EXE has a reference for s_swoosh.bin & s_whoosh.bin. There is no *_swhoosh.bin among the GNU/Linux files. Perhaps that's why there's a v1.3. It does not seem to be a typo, there should be both files. Anywho, I copied s_swoosh.bin to swhoosh.bin and a YouTube video to follow of the fully working game_. Well, I exaggerate, my Debian 1.3.1 has no sound card so I cannot say for certain the sound is working.

Thanks so much for this hint! I also got it working now using Slackware64-current with the proprietary NVIDIA drivers. Everything seems to be working so far, including sound and music.

A summary of a few common problems I encountered and how I solved them - I'd be glad to hear better solutions if available:

./inner: No such file or directory

In contrast to today's common glibc the game was compiled against libc5. This means that you need an interpreter for this type of binary, i.e. ld-linux.so.1 and libc.so.5. However those aren't included in any current distribution any more - libc5 was replaced by glibc around 1998, so you may find compatibility packages containing those files in your distribution's release in that timeframe (the Debian and Ubuntu packages can be found some posts above, for Slackware it is https://mirrors.slackware.com/slackware/slackware-7.1/slakware/a9/libc5.tgz - if you don't find one for your distribution those may also work for you).

svgalib: Cannot open /dev/console.

Check the permissions of the device file. Usually only root is allowed to write there, so either start Inner Worlds as root or change the permissions.

Not running in graphics-capable virtual console.

Change to a text terminal, e.g. via "Ctrl" + "Alt" + "1".

Segmentation fault during start

Disable Address Space Layout Randomization by prepending setarch i386 -R

The game just quits without any error message

cd into the installation directory before starting the game.

The framebuffer driver FBDEV does not work in the SVGAlib configuration (libvga.config)

Inner Worlds is statically linked against an old version of libvga without framebuffer device support. It seems we would have to stick with the VGA driver.

Open questions

ludiointegritas commented 4 years ago

Here is an alternate native GNU/Linux version (1.0?) https://drive.google.com/file/d/1oSCPMWmGFH28s22moKwe7_r-E6bzRNSo/view?usp=drivesdk s_whoosh.bin exists in this version. I haven't attempted to run this game. I also have a GNU/Linux version map editor. But, it is specifically non-redistributable. As far as I can determine, Sleepless has only allowed the game itself to be shared.

gbudny commented 1 year ago

@laenion @zerothis @c704710 @ludiointegritas

Hi

I was able to play it on the old computer (Pentium 4 or Athlon XP) with Suse 9.0. It requires to install ancient libraries like libc5 (Yast). In this case, I had to boot into a safe mode and log in as a root to run it.

I had gotten to a final boss, and I still tried to figure out how to beat him. I didn't notice any serious issues in the Linux version. However, finding a location where you can save the game make it more complicated.

I highly recommend playing it this way.

@laenion I don't know anything about Slackware, but GRUB n Suse allows you to use VGA parameters to set a different screen resolution in a safe mode.