M-HT / SR

A project to statically recompile following games to create Windows or Linux (x86 or arm) versions of the games - Albion, X-Com: UFO Defense (UFO: Enemy Unknown), X-Com: Terror from the Deep, Warcraft: Orcs & Humans, Septerra Core: Legacy of the Creator, Battle Isle 3: Shadow of the Emperor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Septerra Core fail to build Pi4 again

Exarkuniv opened this issue · comments

i now have gotten around to make a script to do all the hard work for me.

i have gotten most everything working fine, but now im getting a error that i did not get before when i needed your help

i run ./komp.sh from the SR/llasm folder and i get this

llasm.d:3367:29: error: cannot implicitly convert expression (fd.size()) of type ulong to uint
             values.length = fd.size;
                             ^

not sure whats going on.
i went back and traced my steps from the other posts and i used before and i dont see that im missing anything up to that point.
again i would love any help

so i ran this from one of the other helps you gave me

cp llasm/*.sci ./
./SRW.exe Septerra104.exe Septerra.llasm
rm *.sci

and it all looks good till the end and i get

2021-10-19 20:28:50.534: Initial disassembly...
2021-10-19 20:28:50.867: Applying fixup...
2021-10-19 20:28:50.942: Full disassembly...
2021-10-19 20:28:51.923: Writing output...
Error: -1

im going to look into getting a different copy of Septerra104.exe

commented

Probably something changed in a newer version of a compiler.

Try changing the line to values.length = to!uint(fd.size);

yes thats all that is was for that part.

i have a new error after that, but i need to make sure my path is correct before i bug you

now i have a error when it comes to the running

PATH=/home/pi/RetroPie-Setup/tmp/build/srcore/llvmorg/clang+llvm-8.0.1-armv7a-linux-gnueabihf/bin:$PATH:../../../llasm scons

so first i checked to make sure i had version 8.0.1 install. and its there

 PATH=home/pi/clang+llvm-8.0.1-armv7a-linux-gnueabihf/bin:$PATH opt --version
LLVM (http://llvm.org/):
  LLVM version 8.0.1
  Optimized build.
  Default target: armv7l-unknown-linux-gnueabihf
  Host CPU: cortex-a72

so here is the error its throwing me

scons: done reading SConscript files.
scons: Building targets ...
llasm llasm/CLIB-asm.llasm -O | opt -O3 | llc -O=3 -filetype=obj > llasm/CLIB-asm.o
sh: 1: llasm: not found
llasm llasm/Game-DataFiles-asm.llasm -O | opt -O3 | llc -O=3 -filetype=obj > llasm/Game-DataFiles-asm.o
sh: 1: llasm: not found
llasm llasm/Game-Registry-asm.llasm -O | opt -O3 | llc -O=3 -filetype=obj > llasm/Game-Registry-asm.o
sh: 1: llasm: not found
llasm llasm/Game-SoundEngine-asm.llasm -O | opt -O3 | llc -O=3 -filetype=obj > llasm/Game-SoundEngine-asm.o
sh: 1: llasm: not found
llasm llasm/MSS-asm.llasm -O | opt -O3 | llc -O=3 -filetype=obj > llasm/MSS-asm.o
sh: 1: llasm: not found
llasm llasm/QTML-asm.llasm -O | opt -O3 | llc -O=3 -filetype=obj > llasm/QTML-asm.o
sh: 1: llasm: not found
llasm llasm/Septerra.llasm -O | opt -O3 | llc -O=3 -filetype=obj > llasm/Septerra.o
sh: 1: llasm: not found
llasm llasm/WinApi-ddraw-asm.llasm -O | opt -O3 | llc -O=3 -filetype=obj > llasm/WinApi-ddraw-asm.o
sh: 1: llasm: not found
llasm llasm/WinApi-dsound-asm.llasm -O | opt -O3 | llc -O=3 -filetype=obj > llasm/WinApi-dsound-asm.o
sh: 1: llasm: not found
llasm llasm/WinApi-gdi32-asm.llasm -O | opt -O3 | llc -O=3 -filetype=obj > llasm/WinApi-gdi32-asm.o
sh: 1: llasm: not found
llasm llasm/WinApi-kernel32-asm.llasm -O | opt -O3 | llc -O=3 -filetype=obj > llasm/WinApi-kernel32-asm.o
sh: 1: llasm: not found
llasm llasm/WinApi-user32-asm.llasm -O | opt -O3 | llc -O=3 -filetype=obj > llasm/WinApi-user32-asm.o
sh: 1: llasm: not found
llasm llasm/WinApi-winmm-asm.llasm -O | opt -O3 | llc -O=3 -filetype=obj > llasm/WinApi-winmm-asm.o
sh: 1: llasm: not found
gcc -o SR-Septerra -Wl,-z,noexecstack -no-pie -s CLIB.o Game-Config.o Game-DataFiles.o Game-Main.o Game-Registry.o Game-SoundEngine.o MSS.o QTML.o WinApi-ddraw.o WinApi-dsound.o WinApi-gdi32.o WinApi-kernel32.o WinApi-user32.o WinApi-winmm.o WinApi.o X86_FS_mem.o llasm/CLIB-asm-llasm.o llasm/asm-cpu.o llasm/asm-llasm.o llasm/llasm_divide.o llasm/llasm_float.o llasm/llasm_fs_mem.o llasm/llasm_movs.o llasm/llasm_pushx.o llasm/llasm_scas.o llasm/llasm_stos.o llasm/printf_x86.o llasm/CLIB-asm.o llasm/Game-DataFiles-asm.o llasm/Game-Registry-asm.o llasm/Game-SoundEngine-asm.o llasm/MSS-asm.o llasm/QTML-asm.o llasm/Septerra.o llasm/WinApi-ddraw-asm.o llasm/WinApi-dsound-asm.o llasm/WinApi-gdi32-asm.o llasm/WinApi-kernel32-asm.o llasm/WinApi-user32-asm.o llasm/WinApi-winmm-asm.o -lSDL2 -lpthread -lm -lmpg123 -lquicktime
/usr/bin/ld: Game-Main.o: in function `main':
Game-Main.c:(.text.startup+0x1b8): undefined reference to `bShowEnemyStatus'
/usr/bin/ld: Game-Main.c:(.text.startup+0x1d4): undefined reference to `bShowEnemyLOS'
/usr/bin/ld: Game-Main.c:(.text.startup+0x1d8): undefined reference to `bHideText'
/usr/bin/ld: Game-Main.c:(.text.startup+0x1e8): undefined reference to `security_cookie_'
/usr/bin/ld: Game-SoundEngine.o: in function `SE_timer_CB':
Game-SoundEngine.c:(.text+0xec): undefined reference to `hWritePipe'
/usr/bin/ld: WinApi-ddraw.o: in function `DirectDrawCreate_c':
WinApi-ddraw.c:(.text+0x84): undefined reference to `IDirectDrawVtbl_asm2c'
/usr/bin/ld: WinApi-ddraw.o: in function `IDirectDraw_CreateSurface_c':
WinApi-ddraw.c:(.text+0x514): undefined reference to `IDirectDrawSurfaceVtbl_asm2c'
/usr/bin/ld: WinApi-dsound.o: in function `DirectSoundCreate_c':
WinApi-dsound.c:(.text+0x1e6c): undefined reference to `IDirectSoundVtbl_asm2c'
/usr/bin/ld: WinApi-dsound.o: in function `IDirectSound_CreateSoundBuffer_c':
WinApi-dsound.c:(.text+0x2384): undefined reference to `IDirectSoundBufferVtbl_asm2c'
/usr/bin/ld: llasm/asm-llasm.o: in function `GetRecordName_asm':
asm-llasm.c:(.text+0x20): undefined reference to `c_GetRecordName_'
/usr/bin/ld: llasm/asm-llasm.o: in function `MessageProc_asm':
asm-llasm.c:(.text+0x94): undefined reference to `c_MessageProc_c2asm'
/usr/bin/ld: llasm/asm-llasm.o: in function `WinMain_asm':
asm-llasm.c:(.text+0x108): undefined reference to `c_WinMain_'
/usr/bin/ld: llasm/asm-llasm.o: in function `RunWndProc_asm':
asm-llasm.c:(.text+0x18c): undefined reference to `c_RunWndProc_c2asm'
/usr/bin/ld: llasm/asm-llasm.o: in function `run_thread_asm':
asm-llasm.c:(.text+0x1d4): undefined reference to `c_run_thread_c2asm'
collect2: error: ld returned 1 exit status
scons: *** [SR-Septerra] Error 1
scons: building terminated because of errors.

i think my Septerra Core exe is not 1.04

commented

The line sh: 1: llasm: not found means, that llasm (created by compiling llasm.d) is not in PATH.

hmmm.

i did all of this

In directory SR/SRW-games/Septerra Core/SRW run command ./build-llasm.sh

From directory SR/SRW-games/Septerra Core/SRW copy files Septerra.llasm, seg*.llinc to directory SR/games/Septerra Core/SR-Septerra/llasm

and eveything thing is there.

the only thing is when i run

cp llasm/*.sci ./
./SRW.exe Septerra104.exe Septerra.llasm
rm *.sci

i do get a error at the end

2021-10-19 20:28:50.942: Full disassembly...
2021-10-19 20:28:51.923: Writing output...
Error: -1

not sure if that as anything to do with it

because i run

PATH=/home/pi/RetroPie-Setup/tmp/build/srcore/llvmorg/clang+llvm-8.0.1-armv7a-linux-gnueabihf/bin:$PATH:../../../llasm scons

im in the /SR/games/Septerra Core/SR-Septerra folder

commented

Error: -1 means the program can't open a file for writing. Do you have permissions for writing/creating files in the directory ?

By the way, if you just want to run the game on the Pi, you don't have to compile it. You can download a compiled version for arm in the Releases - I put it there a few months ago.

lol, good to know

i think at this point im on a mission to figure out why i cant get it to compile. since i did before
so i will mess with it for a bit more but i just give up

ok do i figure out why i was getting the sh: 1: llasm: not found error. i was not the owner
once i did that i was able to get

scons: done reading SConscript files.
scons: Building targets ...
llasm llasm/CLIB-asm.llasm -O | opt -O3 | llc -O=3 -filetype=obj > llasm/CLIB-asm.o
llasm llasm/Game-DataFiles-asm.llasm -O | opt -O3 | llc -O=3 -filetype=obj > llasm/Game-DataFiles-asm.o

just to show you a little

but at the end it still errors out

Game-Main.c:(.text.startup+0x1b8): undefined reference to `bShowEnemyStatus'
/usr/bin/ld: Game-Main.c:(.text.startup+0x1c0): undefined reference to `bShowFPS'
/usr/bin/ld: Game-Main.c:(.text.startup+0x1d4): undefined reference to `bShowEnemyLOS'
/usr/bin/ld: Game-Main.c:(.text.startup+0x1d8): undefined reference to `bHideText'
/usr/bin/ld: Game-Main.c:(.text.startup+0x1e8): undefined reference to `security_cookie_'
/usr/bin/ld: Game-SoundEngine.o: in function `SE_timer_CB':
Game-SoundEngine.c:(.text+0xec): undefined reference to `hWritePipe'
/usr/bin/ld: llasm/asm-llasm.o: in function `GetRecordName_asm':
asm-llasm.c:(.text+0x20): undefined reference to `c_GetRecordName_'
/usr/bin/ld: llasm/asm-llasm.o: in function `WinMain_asm':
asm-llasm.c:(.text+0x108): undefined reference to `c_WinMain_'
/usr/bin/ld: llasm/CLIB-asm.o: in function `_check_security_cookie_asm2c':
<stdin>:(.text+0x5a4): undefined reference to `security_cookie_'
/usr/bin/ld: <stdin>:(.text+0x5ac): undefined reference to `security_cookie_'
collect2: error: ld returned 1 exit status
scons: *** [SR-Septerra] Error 1
scons: building terminated because of errors.

as for your arm version. is there a way that we can point to the game dir with out it having to be placed in it?
so the binary can sit somewhere else and the game files else where?

commented

The errors mean, that these steps weren't done correctly.

In directory SR/SRW-games/Septerra Core/SRW run command ./build-llasm.sh

From directory SR/SRW-games/Septerra Core/SRW copy files Septerra.llasm, seg*.llinc to directory SR/games/Septerra Core/SR-Septerra/llasm

as for your arm version. is there a way that we can point to the game dir with out it having to be placed in it?
so the binary can sit somewhere else and the game files else where?

No, currently there isn't a way to do it.

well i know that im copying all the files over that are made when i run build-llasm.sh

but i think something is up with what it builds.
for Septerra.llasm how big should it be. mine is only like 3kb

and even though i have your made binary in my Septerra Core game folder and i know that its version 1.04 but it still comes up saying it cant find the game folder

commented

I tried to compile it, and there is an error. I made a lot of changes in SRW since the last release of Septerra Core and I introduced some bug there. I'll have to take a look at it.

and even though i have your made binary in my Septerra Core game folder and i know that its version 1.04 but it still comes up > saying it cant find the game folder

If it writes Septerra Core game not found, then it can't find find the file septerra.mft

If it writes Septerra Core game not found, then it can't find find the file septerra.mft

that is funny since it is right there a few files away from it. and the files work on my PC and say v1.04 so i know thats not the issue
ill keep messing with it.

now i get your binary to work. i now have to go back and take a look and see what is different in this folder vs the one from last nite.

Update. so i found the problem. for some reason with how i have my setup since its RetroPie and with how they use emulstation.
if i try to launch it from emulstation it will say it cant find the game files. but it i exit emulstation and use command line it works fine.
UPDATE again
ok i got it all working now. i needed to make a shell script (its a little different then the one you made) and it starts and plays fine.
so your binary works just fine on RetroPie.

if you want once you take a look at SRW. i can give it a go and see if it works to compile it from scratch

commented

So I didn't introduce a bug since the last release of Septerra Core, I just uncovered a problem which was there for a long time.
Anyway it's fixed now.

i just tested my script where i build it from the start and it went through and launches the game perfect.

yes just useing the binary that you already made is faster so i will be going that way for everyone else.
i will use the other one since i spent alot of time work on it.

im happy what i was able to find a error for you. lol.

again thanks for all the help.

ill close the ticket now