Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ permissions:
actions: write

jobs:
native-tests:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: ilammy/msvc-dev-cmd@v1
- name: Standalone loader tests
shell: cmd
run: tests\run_native_tests.cmd

make:
runs-on: windows-latest
outputs:
Expand All @@ -34,7 +43,7 @@ jobs:
path: |
.\src\extern\zydis\msvc\bin\ReleaseX64
.\src\extern\zydis\msvc\bin\ReleaseX86
key: zydis-${{ runner.os }}-${{ steps.zydishash.outputs.hash }}
key: zydis-${{ runner.os }}-v143-${{ steps.zydishash.outputs.hash }}

- name: Install Python dependencies
uses: py-actions/py-dependency-install@v4
Expand Down Expand Up @@ -107,7 +116,7 @@ jobs:
path: .\dist\

preview:
needs: make
needs: [make, native-tests]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: windows-latest
permissions:
Expand Down Expand Up @@ -148,7 +157,7 @@ jobs:
updateOnlyUnreleased: true

release:
needs: make
needs: [make, native-tests]
if: github.event_name == 'workflow_dispatch'
runs-on: windows-latest
permissions:
Expand Down
30 changes: 28 additions & 2 deletions MGSM2Fix.ini
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ SkipNotice = true
StartGame = false

[Patches]


; MGS1 only: Reverts the Master Collection texture swap for Johnny's underpants.
RemoveUnderpants = true
; MGS1 only: Restores the mosaic blur effect on Johnny from original western releases.
Expand All @@ -51,6 +53,16 @@ RestoreGhosts = true
; MGS1 only: Reverts the Master Collection texture swaps for medicine items.
RestoreMedicine = true



; MGS1 only: The collection rewrites the game's whole 16-bit configuration word
; every frame to impose its button-type setting, from a copy it read a moment
; earlier. Anything the game wrote to that word in between - the language,
; caption, sound, vibration, radar and first-person-view settings all live
; there - is lost. This re-reads the word at write time and applies only the
; bits the collection changed, so the game's own settings survive.
PreserveConfiguration = true

; MGS1 only: Disables the HD font system in high resolution modes.
DisableFont = false

Expand All @@ -62,11 +74,25 @@ DisableRAM = false
DisableCDROM = false

[Game]




; MGS1 only: Enables the in-game developer menu (stage select).
; When enabled, the menu starts up in place of the title screen.
; Selecting 'title' on the menu will load the title screen as normal.
StageSelect = false

; MGS1 only (Integral): Selects English text in the game's own option screen.
; Integral starts with Japanese text selected; this holds the game's language
; setting to English while the title screens are up, so a new game begins in
; English. You can still switch it in the game's option screen afterwards -
; that choice is followed. If anything other than the option screen clears the
; setting (starting 1P MODE has been seen to do this), English is restored and
; the event is logged. Has no effect on any other version.
EnglishText = true




[Update Notifications]
; If set to true, MGSM2Fix will notify you when launching the game if a new MGSM2Fix update is available for download.
CheckForUpdates = true
Expand Down
11 changes: 6 additions & 5 deletions MGSM2Fix.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
<ClInclude Include="src\extern\json\include\nlohmann\json.hpp" />
<ClInclude Include="src\extern\json\include\nlohmann\json_fwd.hpp" />
<ClInclude Include="src\m2fix\ketchup.h" />
<ClInclude Include="src\m2fix\ram_patch.h" />
<ClInclude Include="src\m2\epi.h" />
<ClInclude Include="src\m2fix\m2fixbase.h" />
<ClInclude Include="src\m2fix\m2game.h" />
Expand Down Expand Up @@ -389,7 +390,7 @@
<Command>python "$(ProjectDir)M2Install.py" "$(TargetPath)" $(LibrariesArchitecture)</Command>
</PostBuildEvent>
<PreBuildEvent>
<Command>call "$(ProjectDir)build_zydis.cmd" $(Platform)</Command>
<Command>call "$(ProjectDir)build_zydis.cmd" $(Platform) $(PlatformToolset)</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
Expand Down Expand Up @@ -427,7 +428,7 @@
<Command>python "$(ProjectDir)M2Install.py" "$(TargetPath)" $(LibrariesArchitecture)</Command>
</PostBuildEvent>
<PreBuildEvent>
<Command>call "$(ProjectDir)build_zydis.cmd" $(Platform)</Command>
<Command>call "$(ProjectDir)build_zydis.cmd" $(Platform) $(PlatformToolset)</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
Expand Down Expand Up @@ -457,7 +458,7 @@
<Command>python "$(ProjectDir)M2Install.py" "$(TargetPath)" $(LibrariesArchitecture)</Command>
</PostBuildEvent>
<PreBuildEvent>
<Command>call "$(ProjectDir)build_zydis.cmd" $(Platform)</Command>
<Command>call "$(ProjectDir)build_zydis.cmd" $(Platform) $(PlatformToolset)</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand Down Expand Up @@ -495,10 +496,10 @@
<Command>python "$(ProjectDir)M2Install.py" "$(TargetPath)" $(LibrariesArchitecture)</Command>
</PostBuildEvent>
<PreBuildEvent>
<Command>call "$(ProjectDir)build_zydis.cmd" $(Platform)</Command>
<Command>call "$(ProjectDir)build_zydis.cmd" $(Platform) $(PlatformToolset)</Command>
</PreBuildEvent>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>
5 changes: 4 additions & 1 deletion MGSM2Fix.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,9 @@
<ClInclude Include="src\m2fix\ketchup.h">
<Filter>M2Fix</Filter>
</ClInclude>
<ClInclude Include="src\m2fix\ram_patch.h">
<Filter>M2Fix</Filter>
</ClInclude>
<ClInclude Include="src\m2fix\m2fix.h">
<Filter>M2Fix</Filter>
</ClInclude>
Expand Down Expand Up @@ -811,4 +814,4 @@
<Filter>Modules</Filter>
</FxCompile>
</ItemGroup>
</Project>
</Project>
19 changes: 15 additions & 4 deletions build_zydis.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,18 @@ set "PLAT=%~1"
if "%PLAT%"=="" set "PLAT=%Platform%"
if "%PLAT%"=="" set "PLAT=x64"

REM --- Toolset (arg 2): build Zydis with the same toolset as the main project.
REM Zydis.vcxproj hardcodes v143; a machine with only a newer Visual Studio
REM cannot build it as written, and the main project already knows which
REM toolset it is using.
set "TOOLSET=%~2"
if "%TOOLSET%"=="" set "TOOLSET=v143"
set "TOOLSET_ARG="
if not "%TOOLSET%"=="" set "TOOLSET_ARG=/p:PlatformToolset=%TOOLSET%"

REM --- Locate Zydis project file ---
set "ZY_PROJECT=%~dp0src\extern\zydis\msvc\zydis\Zydis.vcxproj"
if not exist %ZY_PROJECT% (
if not exist "%ZY_PROJECT%" (
echo ERROR: Zydis project file not found at %ZY_PROJECT%
exit /b 1
)
Expand Down Expand Up @@ -41,24 +50,26 @@ if /i "%PLAT%"=="x64" (
)

REM --- Decide if rebuild is needed ---
REM Toolset changes invalidate both this stamp and MSBuild's incremental output.
set "BUILD_KEY=%ZY_HASH%-%TOOLSET%"
set "NEED_BUILD=0"
if not exist "%ZY_LIB%" set "NEED_BUILD=1"
if not exist "%HASH_FILE%" set "NEED_BUILD=1"

if exist "%HASH_FILE%" (
set /p OLD_HASH=<"%HASH_FILE%"
if not "!OLD_HASH!"=="%ZY_HASH%" set "NEED_BUILD=1"
if not "!OLD_HASH!"=="%BUILD_KEY%" set "NEED_BUILD=1"
)

REM --- Build if needed ---
if "%NEED_BUILD%"=="1" (
echo [Zydis] Building Release MT %PLAT%
msbuild %ZY_PROJECT% %MSBUILD_ARGS%
msbuild "%ZY_PROJECT%" %MSBUILD_ARGS% %TOOLSET_ARG% /t:Rebuild
if errorlevel 1 (
echo ERROR: Zydis Release MT %PLAT% build failed
exit /b 1
)
>"%HASH_FILE%" echo %ZY_HASH%
>"%HASH_FILE%" echo %BUILD_KEY%
) else (
echo [Zydis] Release MT %PLAT% up to date, skipping
)
Expand Down
Loading
Loading