HDD install patch for Relics (v2.0)

Started by sangfroid, July 05, 2021, 05:35:59 AM

Previous topic - Next topic

sangfroid

  • These set of patches change some executables of Relics from Bothtec, version X68000, to run directly from a Hard Drive.
  • It runs directly from the HD, no subst.x, no 2HDSIM.x, nothing needed. I think it should work with 1Mb systems, but I don't have a 1mb environment to try.
  • The game AUTOEXEC.BAT created a RAM-disk in C: and copied some files, the main executable RELICS.X expected files to be in the root of C:. Removed the code to change to C: to make it work from any location. Since it no longer runs form RAM-disk, it can be jerkier at some parts.
  • The intro DEMO.X, main executable RELICS.X and ending ENDING.X loaded data files in absolute addresses, this worked from floppy since the executables loaded in a known environment, but from hard drive the executables can be in a lot of different addresses and these data files could overwrote the executable or its caller, crashing it. This was normal in the 8-bit era, and the game was ported very early in the X68000 life cycle.
  • This was solved adding the offsets of these absolute addresses to the .X file relocation table, which makes them relative to the base address of the executable. This was automated with a Python script that found the offsets, adjusted their relative position, added them to the reloc table and reconstructed the executables.
  • The patches are meant for these versions of the files:
    •   Relics [Set 1].hdm MD5 sum a23293ea26b5ec3b870108987a0d460f
    •   Relics.hdm MD5 sum 05afdf4ae8a73b857dbf32912232bf48
    The executables in these images have the same MD5 sums.
    The changes can surely be adapted easily to other versions, but these are the ones I worked with.
    • The DEMO.X executable hooks the keyboard serial interface handler and restores it afterwards without reading the 1-byte buffer. RELICS.X reads this buffer and unblocks the keyboard right after, and since they loaded from a .BAT file it just works, but executing DEMO.X standalone hanged the keyboard when returning. This was fixed and clearly intentional, also the XM6 line emulators don't emulate the MFP USART correctly and don't hang there.
    • This was tested on original hardware, a X68000 XVI, I played the intro and the beggining of the game. If you can, please test it more to check everything works as it should.
    • Installation:
      • Patch the disk image with one of the above patches, I made .IPS and .BPS, there are many utilities supporting those.
      • Copy all the files from the disk to a directory in a HD drive
      • Optionally remove COMMAND.X. HUMAN.SYS, and CONFIG.SYS
      • Rename AUTOEXEC.BAT to !Start.bat or whatever you like, and remove the "copy" commands, these only load files in the RAM drive and are not needed after patching.
      • Enjoy!
    Versions:
    2.0 Patched the rest of the addresses and fixed the keyboard hanging out in DEMO.X
    1.0 First version, some absolute addresses were left out so it could hang in some cases.

Relics HDD patch v2.0.zip

SuperDeadite

Nice work once again.  Do you take requests?  It would be lovely if Dragon Knight 1 and 2 got this treatment. 

sangfroid

Quote from: SuperDeadite on July 05, 2021, 10:46:21 AMNice work once again.  Do you take requests?  It would be lovely if Dragon Knight 1 and 2 got this treatment. 

I can have a look, according to http://tkhr000.s601.xrea.com/x68softlist/x68soft.htm, Dragon Knight II can be installed "unofficialy", whatever that means.