SR icon indicating copy to clipboard operation
SR copied to clipboard

Help with building a "release" zip

Open jpihl opened this issue 1 year ago • 4 comments

Hi, I’m interested in making some changes to Septerra Core. I’ve forked the repo, but I’m not sure how to build it to see my changes in the game.

Could you give me a quick rundown on how to build the project to test my changes? I've read the various readmes within the repo, but it seems I'm still missing some information to get to what's in the released zip files.

Also thanks for maintaining this cool project!

jpihl avatar Aug 16 '24 15:08 jpihl

Here are the required steps to create the Septerra Core executable (provided that you have all necessary programs and libraries):

  1. compile udis86-1.7.2 in SRW a) go to directory SR/SRW/udis86-1.7.2 b) run ./configure (or ./configure --with-python=python3 if you don't have python2) c) run make
  2. compile SRW a) go to directory SR/SRW b) run scons c) that should create the file SRW.exe, which you should copy to directory SR/SRW-games/Septerra Core/SRW
  3. decompile the original executable a) copy the original executable Septerra104.exe into directory SR/SRW-games/Septerra Core/SRW b) go to direcory SR/SRW-games/Septerra Core/SRW c) run ./build-x86.sh d) that should create files Septerra.asm, seg01.inc, seg02.inc, seg03.inc, seg04.inc, which you should copy into directory SR/games/Septerra Core/SR-Septerra/x86
  4. compile new Septerra Core executable a) go to directory SR/games/Septerra Core/SR-Septerra b) run scons c) that should create the file SR-Septerra, which is the new Septerra Core executable

M-HT avatar Aug 16 '24 17:08 M-HT

@M-HT do you have any guidance for building on macOS/arm64? I'm stumbling through these instructions and have things almost working, but not quite.

catskull avatar Feb 15 '25 21:02 catskull

@catskull When compiling for arm64, you need following changes in the instructions:

  • before running scons in 2b) make following change in file SR_defs.h: change line #define OUTPUT_TYPE OUT_X86 to #define OUTPUT_TYPE OUT_LLASM
  • in 3c) run ./build-llasm.sh instead of ./build-x86.sh
  • in 3d) copy files to SR/games/Septerra Core/SR-Septerra/llasm instead of SR/games/Septerra Core/SR-Septerra/x86
  • I have no experience with macOS, so you might need to adjust file SConstruct when running scons in 4b)

The bigest issue however is, that the original code is 32-bit and when recompiling it to 64-bit, it only works when the code (and all data it uses) is loaded at memory adresses 0-2GB (pointers must fit into signed 32-bit integer). On Linux this is achieved using SR64-loader which reserves all memory adresses above 2GB, then loads the program below 2GB and runs it. This way the program and all libraries can only use memory adresses below 2GB. I don't know if this can be done on macOS (it doesn't work on Windows) and if yes, then how. Unless you can figure this out, you won't be able to run the game in 64-bit macOS.

M-HT avatar Feb 16 '25 09:02 M-HT

Thank you for the reply! I was able to get it running in a linux VM pretty well so I'll probably go that route. This is a very cool project!

catskull avatar Feb 16 '25 21:02 catskull