Skip to content

Commit

Permalink
Merge pull request #18 from klei1984/menu-integration
Browse files Browse the repository at this point in the history
Menu integration
  • Loading branch information
klei1984 committed Dec 21, 2022
2 parents 92032b9 + 921e57f commit d9bc866
Show file tree
Hide file tree
Showing 367 changed files with 79,546 additions and 426,621 deletions.
4 changes: 2 additions & 2 deletions .cproject
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<folderInfo id="cdt.managedbuild.toolchain.gnu.base.762831889.328966871" name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.base.1863652403" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.base">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.GNU_ELF" id="cdt.managedbuild.target.gnu.platform.base.144488128" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
<builder buildPath="${workspace_loc:/max/build}/" command="make" id="cdt.managedbuild.target.gnu.builder.base.1811020671" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/>
<builder buildPath="${workspace_loc:/max/build}/" command="make" id="cdt.managedbuild.target.gnu.builder.base.1811020671" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="unlimited" superClass="cdt.managedbuild.target.gnu.builder.base"/>
<tool id="cdt.managedbuild.tool.gnu.archiver.base.167087971" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.1549570889" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.compiler.option.include.paths.689578666" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
Expand Down Expand Up @@ -107,4 +107,4 @@
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
</cproject>
</cproject>
10 changes: 10 additions & 0 deletions .gdbinit
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
set disassembly-flavor intel
skip -file smartpointer.hpp
skip -file smartobjectarray.hpp
skip -file smartstring.cpp
skip -file smartstring.hpp
skip -file sortedarray.hpp
skip -file sortedenum.hpp
skip -file smartarray.hpp
skip -file smartlist.hpp
skip -file point.hpp
194 changes: 98 additions & 96 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,100 +1,102 @@
name: Build Workflow
on:
push:
branches:
- master
paths-ignore:
- '**.md'
- '**.yml'
- '**/doc'

pull_request:
types:
- opened
- synchronize
- reopened
paths-ignore:
- '**.md'
- '**.yml'
- '**/doc'
push:
branches:
- master
paths-ignore:
- '**.md'
- '**.yml'
- '**/doc'

pull_request:
types:
- opened
- synchronize
- reopened
paths-ignore:
- '**.md'
- '**.yml'
- '**/doc'

jobs:
Linux-i386:
runs-on: ubuntu-18.04

env:
BUILD_DIR: build
BUILD_TYPE: Debug

steps:
- name: Setup Dependencies
run: |
sudo dpkg --add-architecture i386
sudo apt-get update -y -qq
sudo apt-get install -y -qq build-essential gcc-multilib g++-multilib libsdl2-dev:i386 libsdl2-mixer-dev:i386 libsdl2-image-dev:i386 libsdl2-ttf-dev:i386 libsdl2-net-dev:i386
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: '3.x'

- name: Checkout
uses: actions/checkout@v2

- name: Build
run: |-
mkdir $BUILD_DIR
cd $BUILD_DIR
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=/usr/local -DSDL2_DIR=/usr/lib/i386-linux-gnu/cmake/SDL2 ..
cmake --build .
- name: Package
run: |
cd $BUILD_DIR
cpack
mkdir Artifacts
cp *.deb Artifacts/
- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: build artifacts
path: ${{env.BUILD_DIR}}/Artifacts

Windows-i386:
runs-on: windows-2019
env:
BUILD_DIR: build
BUILD_TYPE: Debug

defaults:
run:
shell: msys2 {0}

steps:
- name: Install MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW32

- name: Setup Dependencies
run: |
pacman -S --noconfirm git mingw-w64-i686-toolchain mingw32/mingw-w64-i686-SDL2 mingw32/mingw-w64-i686-SDL2_mixer mingw32/mingw-w64-i686-SDL2_image mingw32/mingw-w64-i686-SDL2_ttf mingw32/mingw-w64-i686-SDL2_net mingw32/mingw-w64-i686-cmake make
- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: '3.x'

- name: Checkout
uses: actions/checkout@v2

- name: Build & Package
run: |
cmake/mingw32-i686-build.sh
- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: build artifacts
path: ${{env.BUILD_DIR}}/Artifacts
Linux-i386:
runs-on: ubuntu-18.04

env:
BUILD_DIR: build
BUILD_TYPE: Debug

steps:
- name: Setup Dependencies
run: |
sudo dpkg --add-architecture i386
sudo apt-get update -y -qq
sudo apt-get install -y -qq build-essential gcc-multilib g++-multilib libsdl2-dev:i386 libsdl2-mixer-dev:i386 libsdl2-net-dev:i386 ninja-build:i386
- name: Checkout
uses: actions/checkout@v3

- name: Build
run: |-
mkdir $BUILD_DIR
cd $BUILD_DIR
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX=/usr/local ..
cmake --build . --parallel
- name: Package
run: |
cd $BUILD_DIR
cpack
mkdir Artifacts
cp *.deb Artifacts/
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: build artifacts
path: ${{env.BUILD_DIR}}/Artifacts

Windows-i386:
runs-on: windows-2019
env:
BUILD_DIR: build
BUILD_TYPE: Debug

defaults:
run:
shell: msys2 {0}

steps:
- name: Install MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW32

- name: Setup Dependencies
run: |
pacman -S --noconfirm git mingw-w64-i686-toolchain mingw32/mingw-w64-i686-SDL2 mingw32/mingw-w64-i686-SDL2_mixer mingw32/mingw-w64-i686-SDL2_net mingw32/mingw-w64-i686-cmake mingw-w64-x86_64-ninja make
- name: Checkout
uses: actions/checkout@v3

- name: Build
run: |-
export PATH=$PATH:/mingw32/bin
mkdir $BUILD_DIR
cd $BUILD_DIR
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_INSTALL_PREFIX="C:/Program Files (x86)/max" ..
cmake --build . --parallel
- name: Package
run: |
cd $BUILD_DIR
cpack
mkdir Artifacts
cp *-win32.exe Artifacts/
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: build artifacts
path: ${{env.BUILD_DIR}}/Artifacts
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:

jobs:
Release:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:
- name: Create Release
Expand Down
6 changes: 3 additions & 3 deletions .settings/language.settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser" keep-relative-paths="false" name="CDT GCC Build Output Parser" parameter="(g?cc)|([gc]\+\+)|(clang)" prefer-non-shared="true"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-609156879544744771" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-860160132756939789" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
</extension>
</configuration>
</project>
</project>
36 changes: 8 additions & 28 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,13 @@ endif()

message(STATUS "Set build version to v${GAME_VERSION}")

enable_language(C ASM)
enable_language(C CXX)

set(GAME_INCLUDES "")
set(GAME_SOURCES "")
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/src/")

find_package(PythonInterp)

set(CODEGEN_TOOL "${CMAKE_CURRENT_SOURCE_DIR}/util/codegen.py")
set(CODEGEN_CONFIG_FILE "${CMAKE_CURRENT_SOURCE_DIR}/conf/codegen.json")

if (MINGW)
set(CODEGEN_OPTIONS "--underscore")
add_definitions(-DSDL_MAIN_HANDLED)
add_compile_options(-mno-ms-bitfields)
add_link_options(-mconsole)
Expand All @@ -76,24 +70,6 @@ if (UNIX)
set(ENV{PKG_CONFIG_PATH} "/usr/lib/i386-linux-gnu/pkgconfig")
endif (UNIX)

set(GAME_SOURCES
${GAME_SOURCES}
${CMAKE_CURRENT_BINARY_DIR}/${GAME_BINARY}.S
)

set_source_files_properties(
${CMAKE_CURRENT_BINARY_DIR}/${GAME_BINARY}.S
PROPERTIES
OBJECT_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${GAME_BINARY}.h;${CMAKE_CURRENT_SOURCE_DIR}/src/user.h"
)

add_custom_command(
COMMAND ${PYTHON_EXECUTABLE} ${CODEGEN_TOOL} ${CODEGEN_OPTIONS} --input=${CMAKE_CURRENT_SOURCE_DIR}/res/${GAME_BINARY}.in --output=${CMAKE_CURRENT_BINARY_DIR} ${CODEGEN_CONFIG_FILE}
DEPENDS ${CODEGEN_TOOL} ${CODEGEN_CONFIG_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/res/${GAME_BINARY}.in
OUTPUT ${GAME_BINARY}.S ${GAME_BINARY}.h wrappers.h
COMMENT "Generating ${GAME_BINARY}.S ${GAME_BINARY}.h wrappers.h."
)

INCLUDE(FindPkgConfig)

PKG_SEARCH_MODULE(SDL2 REQUIRED sdl2 )
Expand Down Expand Up @@ -125,7 +101,10 @@ include_directories(
)

add_executable(${GAME_BINARY} ${GAME_SOURCES})
set_target_properties(${GAME_BINARY} PROPERTIES COMPILE_FLAGS "-m32 -O0 -fno-eliminate-unused-debug-types -no-pie -DGAME_VERSION=\"\\\"v${GAME_VERSION}\\\"\"" LINK_FLAGS "-m32 -O0 -no-pie")
set_target_properties(${GAME_BINARY} PROPERTIES
CXX_STANDARD "17"
COMPILE_FLAGS "-Wtype-limits -Wparentheses -Wuninitialized -Wmaybe-uninitialized -Wformat -fno-eliminate-unused-debug-types -m32 -DGAME_VERSION=\"\\\"v${GAME_VERSION}\\\"\""
LINK_FLAGS "-m32")
target_link_libraries(${GAME_BINARY} SDL2::SDL2 SDL2::NET SDL2::MIXER m)

set(CPACK_PACKAGE_VERSION_MAJOR ${GAME_VERSION_MAJOR})
Expand All @@ -137,7 +116,7 @@ set(CPACK_PACKAGE_NAME "max-port")
set(CPACK_PACKAGE_CONTACT "M.A.X. Port Team")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "M.A.X. Port v${GAME_VERSION}")
set(CPACK_PACKAGE_DESCRIPTION "M.A.X. Port is an SDL library based runtime executable for the 1996 DOS game M.A.X.: Mechanized Assault & Exploration developed and published by Interplay Productions.")
set(CPACK_PACKAGE_DESCRIPTION "M.A.X. Port is an SDL library based runtime executable for the 1996 MS-DOS game M.A.X.: Mechanized Assault & Exploration developed and published by Interplay Productions.")

install(FILES "LICENSE" DESTINATION .)

Expand All @@ -147,7 +126,7 @@ if(UNIX)
set(CPACK_DEBIAN_PACKAGE_SECTION "games")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://klei1984.github.io/max/")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i386")

install(TARGETS ${GAME_BINARY}
CONFIGURATIONS ${CMAKE_BUILD_TYPE}
RUNTIME DESTINATION .
Expand All @@ -156,6 +135,7 @@ endif()

if(MINGW)
set(CPACK_GENERATOR "NSIS")
set(CPACK_STRIP_FILES "TRUE")
set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".")
set(CPACK_NSIS_MUI_FINISHPAGE_RUN "${GAME_BINARY}")
set(CPACK_NSIS_DISPLAY_NAME "M.A.X. Port")
Expand Down
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
# M.A.X. Port
# M.A.X. Port

![Build Workflow](https://github.com/klei1984/max/workflows/Build%20Workflow/badge.svg)

M.A.X. Port is an [SDL library](https://wiki.libsdl.org/) based runtime executable for the 1996 DOS game M.A.X.: Mechanized Assault & Exploration developed and published by Interplay Productions.

Official home page: [https://klei1984.github.io/max/](https://klei1984.github.io/max/)
Official home page: [https://klei1984.github.io/max/](https://klei1984.github.io/max/)

The goal of the project is to fix the game breaking [defects](https://klei1984.github.io/max/defects/) present in the original game executable and to create a runtime that natively runs on modern operating systems.

M.A.X. Port requires the original game data. The port only provides a modernized executable.

M.A.X. COPYRIGHT (C) 1996 INTERPLAY PRODUCTIONS. ALL RIGHTS RESERVED.
INTERPLAY PRODUCTIONS IS THE EXCLUSIVE LICENSEE AND DISTRIBUTOR.

M.A.X. - MECHANIZED ASSAULT & EXPLORATION IS A REGISTERED U.S. TRADEMARK OF INTERPLAY ENTERTAINMENT CORP.

### How to play M.A.X. Port

1. Install the original M.A.X. game onto your computer.
- If you still have the original M.A.X. CD-ROM you have to use a DOS emulator to install the game as only an MS-DOS compatible installer is found on the CD. Make sure to select **full** installation within the installer if you do not wish to keep the CD in your CD-ROM drive all the time. The game needs to be patched to v1.04 after installation.
- If you still have the original M.A.X. CD-ROM you have to use a DOS emulator to install the game as only an MS-DOS compatible installer is found on the CD. Make sure to select **full** installation within the installer if you do not wish to keep the CD in your CD-ROM drive all the time. The game needs to be patched to v1.04 after installation.
- If you have the gog.com release of the game it is already patched to v1.04.
- If you have the steam release of the game it is already patched to v1.04.

Expand Down

0 comments on commit d9bc866

Please sign in to comment.