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
41 changes: 36 additions & 5 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse

jobs:
check:
name: check
check-gnu:
name: check-gnu
runs-on: ubuntu-latest
steps:
- name: Install Mingw-w64
Expand All @@ -36,18 +36,49 @@ jobs:
shell: bash
run: cargo fmt --all -- --check

- name: Run cargo check (gnu)
- name: Run cargo check
shell: bash
run: RUSTFLAGS="-D warnings" cargo check --workspace --target 'i686-pc-windows-gnu'

- name: Run cargo test
shell: bash
run: RUSTFLAGS="-D warnings" cargo test --workspace --target 'x86_64-unknown-linux-gnu'

- name: Run cargo build (release gnu)
- name: Run cargo build (release)
shell: bash
run: cargo build --verbose --release --package 'zipfixup' --package 'zippatch' --target 'i686-pc-windows-gnu'

- name: Run export checker (gnu)
- name: Run export checker
shell: bash
run: cargo run --package 'export-check' --target 'x86_64-unknown-linux-gnu' -- 'target/i686-pc-windows-gnu/release/zipfixup.dll'

check-msvc:
name: check-msvc
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Sync toolchain
shell: bash
run: rustup show

- name: Run cargo fmt
shell: bash
run: cargo fmt --all -- --check

- name: Run cargo check
shell: bash
run: RUSTFLAGS="-D warnings" cargo check --workspace --target 'i686-pc-windows-msvc'

- name: Run cargo test
shell: bash
run: RUSTFLAGS="-D warnings" cargo test --workspace --target 'i686-pc-windows-msvc'

- name: Run cargo build (release)
shell: bash
run: cargo build --verbose --release --package 'zipfixup' --package 'zippatch' --target 'i686-pc-windows-msvc'

- name: Run export checker
shell: bash
run: cargo run --package 'export-check' --target 'x86_64-pc-windows-msvc' -- 'target/i686-pc-windows-msvc/release/zipfixup.dll'
23 changes: 17 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,21 @@

## [Unreleased]

- Project: Update Rust version to 1.88.0 and codebase. This moves off nightly, since everything we need is now stabilised, and should help with maintenance.
- Patch: Rundll32 no longer seems to work... replaced it with `zippatch.exe`.
- Project: Use retour/detour for hooking functions.
- Project: Relicense under EUPL-1.2.
- Patch: Patcher now waits for enter.

- Fixup: Use retour/detour for hooking functions.
- Fixup: Include timestamps in debug output.
- Fixup: Implement checker to verify DLL exports/forwards are correct.
- Fixup: Specify exports via [Module-Definition (.Def)
file](https://learn.microsoft.com/en-us/cpp/build/reference/module-definition-dot-def-files).
- Fixup: Now builds using either `i686-pc-windows-gnu` or `i686-pc-windows-msvc`.

- Project: Update Rust version to 1.88.0 and edition to 2024. This moves off
nightly, since everything we need is now stabilised, and should help with
maintenance.
- Project: Relicense under EUPL-1.2.

## [0.1.1] - 2021-01-29

- PM: Have another go at adding PM support.
Expand All @@ -20,10 +29,12 @@
## [0.0.2] - 2021-01-19

- Patch: Fix install script.
- DLL: Display version number during install.
- Fixup: Display version number during install.

## [0.0.1] - 2021-01-18

- All: Fixed timing issues related GetTickCount having a resolution of 1ms but an accuracy of 16ms.
- All: Fixed timing issues related GetTickCount having a resolution of 1ms but
an accuracy of 16ms.
- All: Fixed timing issues related to high system uptime.
- MW: Bounds checking on target box lines (prevents crashes at higher resolutions).
- MW: Bounds checking on target box lines (prevents crashes at higher
resolutions).
33 changes: 25 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ZipperFixup

A redistributable DLL to fix bugs and limitations of certain games developed by Zipper Interactive™ to modern formats and back:
This project fixes bugs and limitations of certain games/game engines developed by Zipper Interactive™:

* the Recoil™ game (1999)
* the MechWarrior 3™ base game (1999)
Expand All @@ -10,15 +10,36 @@ Zipper Interactive™ was trademark or registered trademark of Sony Computer Ent

Obviously, this is an unofficial fan effort and not connected to the developers, publishers, or rightsholders. [Join us on MW3 Discord](https://discord.gg/Be53gMy), or the Recoil Discord!

## Building
## Installation

[Rust](https://www.rust-lang.org/tools/install) is required. Also required is [Mingw-w64](http://mingw-w64.org/), specifically the 32 bit version.
1. Download [the latest release Zip file](https://github.com/TerranMechworks/ZipperFixup/releases), for example `
ZipperFixup-0.1.2.zip`.
2. Extract the Zip file.
3. Follow instructions of `Readme.txt` in Zip file.

## License

Licensed under the European Union Public Licence (EUPL) 1.2 ([LICENSE](LICENSE) or https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12).

## Development

### Building

[Rust](https://www.rust-lang.org/tools/install) is required.

#### i686-pc-windows-msvc

This target can only be build on Windows. Please see installing [Rust on Windows](https://rust-lang.github.io/rustup/installation/windows.html), including the Visual Studio requirement.

#### i686-pc-windows-gnu

This target can be built on any platform, but requires [Mingw-w64](http://mingw-w64.org/) (specifically the 32 bit version).

* On Ubuntu: `apt install gcc-mingw-w64-i686`
* On macOS: `brew install mingw-w64`
* On Windows, use WSL.

## Release procedure
### Release procedure

1. Review `CHANGELOG.md`
1. Add release version number and release date to changelog; add a new `[Unreleased]` section
Expand All @@ -29,7 +50,3 @@ Obviously, this is an unofficial fan effort and not connected to the developers,
1. The build will automatically create a release as a draft
1. Add changelog items to the release notes via the GitHub web interface
1. Publish the release via the GitHub web interface

## License

Licensed under the European Union Public Licence (EUPL) 1.2 ([LICENSE](LICENSE) or https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12).
8 changes: 2 additions & 6 deletions crates/zipfixup/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
fn main() {
let env = std::env::var("CARGO_CFG_TARGET_ENV").unwrap();
println!("cargo::warning={env}");

let path = std::env::var("CARGO_MANIFEST_DIR").unwrap();
let mut path = std::path::PathBuf::from(path);
Expand All @@ -11,15 +12,10 @@ fn main() {

match env.as_str() {
"gnu" => {
println!("cargo::warning=GNU");
println!("cargo::rustc-link-arg-cdylib={path}");
}
"msvc" => {
println!("cargo::warning=MSVC");
"msvc" | _ => {
println!("cargo::rustc-link-arg-cdylib=/DEF:{path}");
}
_ => {
println!("cargo::warning=unknown env `{env}`");
}
}
}
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.88.0"
profile = "default"
targets = ["i686-pc-windows-gnu"]
targets = ["i686-pc-windows-gnu", "i686-pc-windows-msvc"]