Skip to content

Commit 781f544

Browse files
SciLorclaude
andcommitted
Release v0.2.0: car flip/turn, camera options, safer patching, release CI
Trainer - Add "Flip" and "Turn 180°" buttons for the car - Add camera settings "Height Distance factor" and "Zoom limit" - Drive over revive now flips cars that are on their roof - Patch only the instruction operands of a feature (PatchedFloat) instead of shared game float constants, avoiding side effects on HUD/AI/physics - Read/write the car pose via both RwMatrix buffers (fixes freeze/set position) Build and release - Add Asm/build.sh and bundle fasm 1.73.35 to rebuild the .bin files - Add release workflow: verify .bin files are up to date, build with MSBuild and create a draft GitHub release with the zip on v* tags Docs - Add trainer analysis doc and update the changelog for v0.2.0 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent ad30f3f commit 781f544

13 files changed

Lines changed: 391 additions & 73 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ['v*']
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
asm:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- run: Asm/build.sh
16+
- name: Fail if committed .bin files are stale
17+
run: git diff --exit-code -- Asm
18+
19+
build:
20+
needs: asm
21+
runs-on: windows-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: microsoft/setup-msbuild@v2
25+
# v4.5 targeting pack is not on the runner image; v4.8 runs the same on Windows 10+
26+
- run: msbuild "SciLors Mashed Trainer.csproj" /p:Configuration=Release /p:TargetFrameworkVersion=v4.8 /restore:false
27+
- name: Package
28+
shell: pwsh
29+
run: Compress-Archive -Path "bin/Release/*" -DestinationPath "MashedTrainer-${{ github.ref_name }}.zip"
30+
- uses: softprops/action-gh-release@v2
31+
with:
32+
draft: true
33+
name: ${{ github.ref_name }}
34+
generate_release_notes: true
35+
files: MashedTrainer-${{ github.ref_name }}.zip

‎Asm/build.sh‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
# Rebuilds the flat binaries (*.bin) from the *.asm files with the bundled flat assembler (fasm/, v1.73.35).
3+
set -e
4+
cd "$(dirname "$0")"
5+
for f in *.asm; do
6+
"${FASM:-./fasm/fasm}" "$f" "${f%.asm}.bin"
7+
done

‎Asm/fasm/fasm‎

105 KB
Binary file not shown.

‎Asm/fasm/fasm.exe‎

116 KB
Binary file not shown.

‎Asm/fasm/license.txt‎

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
flat assembler version 1.73
3+
Copyright (c) 1999-2026, Tomasz Grysztar.
4+
All rights reserved.
5+
6+
This program is free for commercial and non-commercial use as long as
7+
the following conditions are adhered to.
8+
9+
Copyright remains Tomasz Grysztar, and as such any Copyright notices
10+
in the code are not to be removed.
11+
12+
Redistribution and use in source and binary forms, with or without
13+
modification, are permitted provided that the following conditions are
14+
met:
15+
16+
1. Redistributions of source code must retain the above copyright notice,
17+
this list of conditions and the following disclaimer.
18+
2. Redistributions in binary form must reproduce the above copyright
19+
notice, this list of conditions and the following disclaimer in the
20+
documentation and/or other materials provided with the distribution.
21+
22+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
24+
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
25+
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
26+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33+
34+
The licence and distribution terms for any publically available
35+
version or derivative of this code cannot be changed. i.e. this code
36+
cannot simply be copied and put under another distribution licence
37+
(including the GNU Public Licence).

‎Controls/UcGameInfo.xaml‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
<Slider Value="{Binding Path=Game.MaximumDamage, ElementName=GameInfo, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" x:Name="sldMaxDamage" Margin="0,22,-2,0" VerticalAlignment="Top" Maximum="100" SmallChange="1" TickFrequency="5" TickPlacement="Both" ValueChanged="sldMaxDamage_ValueChanged"/>
124124
</Grid>
125125
</GroupBox>
126-
<GroupBox Header="Camera" x:Name="grpCamera" Grid.Column="0" Height="123" VerticalAlignment="Top" Margin="0,175,0,0">
126+
<GroupBox Header="Camera" x:Name="grpCamera" Grid.Column="0" Height="173" VerticalAlignment="Top" Margin="0,175,0,0">
127127
<Grid>
128128
<Grid.ColumnDefinitions>
129129
<ColumnDefinition Width="Auto" />
@@ -134,6 +134,8 @@
134134
<RowDefinition Height="Auto" />
135135
<RowDefinition Height="Auto" />
136136
<RowDefinition Height="Auto" />
137+
<RowDefinition Height="Auto" />
138+
<RowDefinition Height="Auto" />
137139
</Grid.RowDefinitions>
138140
<Label Content="Tilt multiplicator" Grid.Column="0" Grid.Row="0"/>
139141
<TextBox x:Name="txtCameraTiltMulti" Grid.Column="1" Grid.Row="0"
@@ -147,7 +149,15 @@
147149
<TextBox x:Name="txtCameraHeightDistanceAdd" Grid.Column="1" Grid.Row="2"
148150
Text="{Binding Game.CameraHeightDistanceAdd, ElementName=GameInfo, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
149151

150-
<Button x:Name="btnResetCamera" Content="Reset" Grid.Column="1" Grid.Row="3" Height="21" VerticalAlignment="Top" Click="btnResetCamera_Click"/>
152+
<Label Content="Height Distance factor" Grid.Column="0" Grid.Row="3"/>
153+
<TextBox x:Name="txtCameraHeightDistanceFactor" Grid.Column="1" Grid.Row="3"
154+
Text="{Binding Game.CameraHeightDistanceFactor, ElementName=GameInfo, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
155+
156+
<Label Content="Zoom limit" Grid.Column="0" Grid.Row="4"/>
157+
<TextBox x:Name="txtCameraZoomLimit" Grid.Column="1" Grid.Row="4"
158+
Text="{Binding Game.CameraZoomLimit, ElementName=GameInfo, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
159+
160+
<Button x:Name="btnResetCamera" Content="Reset" Grid.Column="1" Grid.Row="5" Height="21" VerticalAlignment="Top" Click="btnResetCamera_Click"/>
151161
</Grid>
152162
</GroupBox>
153163
</Grid>

‎Controls/UcGameInfo.xaml.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ private void btnResetCamera_Click(object sender, RoutedEventArgs e) {
5252
Game.CameraTiltMultiplicator = 50;
5353
Game.CameraHeightDistanceDivider = 5;
5454
Game.CameraHeightDistanceAdd = 1;
55+
Game.CameraHeightDistanceFactor = 0.8f;
56+
Game.CameraZoomLimit = 10;
5557
}
5658
}
5759
}

‎Controls/UcPlayerInfo.xaml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@
7575
<controls:UcWeaponSelector x:Name="uwsWeaponSelector" Grid.ColumnSpan="3" Grid.Row="1" WeaponClick="uwsWeaponSelector_WeaponClick" />
7676
</Grid>
7777
</GroupBox>
78+
<GroupBox Header="Car" Height="66" Margin="186,232,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="128">
79+
<Grid>
80+
<Button Content="Flip" x:Name="btnFlip" Margin="6,4,6,0" Height="22" VerticalAlignment="Top" Click="btnFlip_Click"/>
81+
<Button Content="Turn 180&#176;" x:Name="btnTurn" Margin="6,30,6,0" Height="22" VerticalAlignment="Top" Click="btnTurn_Click"/>
82+
</Grid>
83+
</GroupBox>
7884
<GroupBox Header="Damage" Height="233" Margin="186,-5,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Width="128">
7985
<Grid>
8086
<Label x:Name="lblDamageFront" Content="0%" Height="26" Margin="14,27,14,0" VerticalAlignment="Top" Width="152" HorizontalAlignment="Center" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" />

‎Controls/UcPlayerInfo.xaml.cs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,14 @@ private void sldDamageBack_ValueChanged(object sender, RoutedPropertyChangedEven
117117
lblDamageBack.Content = Math.Round(sldDamageBack.Value) + "%";
118118
}
119119

120+
private void btnFlip_Click(object sender, RoutedEventArgs e) {
121+
Player.Flip();
122+
}
123+
124+
private void btnTurn_Click(object sender, RoutedEventArgs e) {
125+
Player.Turn(180);
126+
}
127+
120128
private void btnDamageRepair_Click(object sender, RoutedEventArgs e) {
121129
Player.Repair();
122130
}

‎README.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,17 @@ http://www.scilor.com/donate.html
4040

4141
## ChangeLog:
4242

43+
### v0.2.0(2026-10-07)
44+
- New: "Flip" and "Turn 180°" buttons to right or turn the car
45+
- New: Camera settings "Height Distance factor" and "Zoom limit"
46+
- Drive over revive now flips cars that are on their roof
47+
- Maximum distance/damage and camera values now patch only the instructions of their feature instead of shared game constants (fixes side effects on HUD/AI/physics)
48+
- Fix freeze/set position by writing both car matrix buffers
49+
- Fix wrong address in ChangeWeapon.asm (0x467E6 -> 0x467E60)
50+
- Add reverse engineering docs (trainer and weapon ASM analysis)
51+
- Add `Asm/build.sh` to rebuild the `.bin` files from the `.asm` sources with fasm
52+
- Add GitHub Action that checks the `.bin` files are up to date, builds the trainer and drafts a release on `v*` tags
53+
4354
### v0.1.0(2017-11-20)
4455
- Initial Release
4556

0 commit comments

Comments
 (0)