From 10d318a5de95580e3d522631e3f8b0f2fa93dded Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Wed, 1 Jan 2025 13:09:18 -0700 Subject: [PATCH 1/2] Fix inlining in `Helicopter::FUN_100042a0` (#1307) --- LEGO1/lego/legoomni/src/actors/helicopter.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/LEGO1/lego/legoomni/src/actors/helicopter.cpp b/LEGO1/lego/legoomni/src/actors/helicopter.cpp index bdec74e4..c08e8520 100644 --- a/LEGO1/lego/legoomni/src/actors/helicopter.cpp +++ b/LEGO1/lego/legoomni/src/actors/helicopter.cpp @@ -482,8 +482,7 @@ void Helicopter::FUN_100042a0(const Matrix4& p_matrix) m_unk0x1f0 = Timer()->GetTime(); - m_unk0x1f4.BETA_1004a9f0(local48); - m_unk0x1f4.FUN_10004620(local90); + m_unk0x1f4.BETA_1004a9b0(local48, local90); m_unk0x1f4.FUN_10004520(); } From 3e5967f3f3514abfce297e94be6fbaf597efac8b Mon Sep 17 00:00:00 2001 From: Ramen2X Date: Thu, 2 Jan 2025 19:16:23 -0500 Subject: [PATCH 2/2] initial Docker support (#1308) --- README.md | 19 +++++++++++++++++++ docker/Dockerfile | 24 ++++++++++++++++++++++++ docker/entrypoint.sh | 19 +++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 docker/Dockerfile create mode 100644 docker/entrypoint.sh diff --git a/README.md b/README.md index d64395cb..c24dc4ef 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,25 @@ cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo If you have a CMake-compatible IDE, it should be pretty straightforward to use this repository, as long as you can use `VCVARS32.BAT` and set the generator to `NMake Makefiles`. +### Docker + +Alternatively, we support Docker as a method of compilation. This is ideal for users on Linux and macOS who do not wish to manually configure a Wine environment for compiling this project. + +Compilation should be as simple as configuring and running the following command: + +``` +docker run -d \ + -e CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=RelWithDebInfo" \ + -v :/isle:rw \ + -v :/build:rw \ + ghcr.io/isledecomp/isle:latest +``` + +`` should be replaced with the path to the source code directory (ie: the root of this repository). +`` should be replaced with the path to the build folder you'd like CMake to use during compilation. + +You can pass as many CMake flags as you'd like in the `CMAKE_FLAGS` environment variable, but the default configuration provided in the command is already ideal for building highly-accurate binaries. + ## Usage The simplest way to use the recompiled binaries is to swap the original executables (`ISLE.EXE`, `LEGO1.DLL`, and `CONFIG.EXE`) in LEGO Island's installation directory for the ones that you've built from this source code. By default, LEGO Island is installed to `C:\Program Files\LEGO Island` on 32-bit operating systems and `C:\Program Files (x86)\LEGO Island` on 64-bit operating systems. diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 00000000..8fbe4130 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,24 @@ +FROM debian:latest + +# Gather dependencies +RUN dpkg --add-architecture i386 +RUN apt-get update -y +RUN apt-get install git wine wine64 wine32 wget unzip -y + +# Silence debug warnings in wine (creates noise during compile) +RUN export WINEDEBUG=-all + +# Set up the wineprefix +RUN wine wineboot + +# Set up MSVC 4.20 and CMake for Windows +RUN git clone https://github.com/itsmattkc/MSVC420 ~/.wine/drive_c/msvc +RUN wget https://github.com/Kitware/CMake/releases/download/v3.26.6/cmake-3.26.6-windows-i386.zip +RUN unzip cmake-3.26.6-windows-i386.zip -d ~/.wine/drive_c +RUN mv ~/.wine/drive_c/cmake-3.26.6-windows-i386 ~/.wine/drive_c/cmake +RUN rm cmake-3.26.6-windows-i386.zip + +# Set up entrypoint script to perform the build +COPY entrypoint.sh entrypoint.sh +RUN chmod +x entrypoint.sh +ENTRYPOINT [ "./entrypoint.sh" ] diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh new file mode 100644 index 00000000..2bd88684 --- /dev/null +++ b/docker/entrypoint.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +# Populate the Windows path inside of the wineprefix +# TODO: This is in here because writing to the registry seems +# to fail when performed in the Dockerfile itself; investigate +wine reg ADD 'HKCU\Environment' /v PATH /d 'C:\msvc\bin;C:\msvc\bin\winnt;C:\cmake\bin;C:\windows\system32' /f +wine reg ADD 'HKCU\Environment' /v INCLUDE /d 'C:\msvc\include;C:\msvc\mfc\include' /f +wine reg ADD 'HKCU\Environment' /v LIB /d 'C:\msvc\lib;C:\msvc\mfc\lib' /f +wine reg ADD 'HKCU\Environment' /v TMP /d 'Z:\build' /f +wine reg ADD 'HKCU\Environment' /v TEMP /d 'Z:\build' /f + +# Configure build with CMake +wine cmake -B build isle -G "NMake Makefiles" $CMAKE_FLAGS + +# Start compiling LEGO Island +wine cmake --build build + +# Unlock directories +chmod -R 777 isle build