Skip to content

Commit 1df9f3c

Browse files
committed
add a guide for TR2
1 parent c1e9128 commit 1df9f3c

File tree

4 files changed

+117
-0
lines changed

4 files changed

+117
-0
lines changed

fixes/6/convert.sh

100644100755
File mode changed.

fixes/TR2/README

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
Guide: Setting Up Tomb Raider 2 on Wine with TR2Main & OGG Audio Support
2+
1. Install TR2Main (Enhanced Engine for Tomb Raider 2)
3+
4+
Open a terminal and navigate to the game directory:
5+
6+
cd /path/to/your/tomb-raider-2/
7+
8+
Extract the TR2Main files into the game directory:
9+
10+
unzip /path/to/TR2Main_v0.9.0.zip
11+
12+
This will replace the original Tomb2.exe with the improved TR2Main version.
13+
14+
2. Replace winmm.dll for OGG Audio Support
15+
16+
Tomb Raider 2 originally used CD audio for music. To enable OGG playback in Wine, you need to replace winmm.dll with ogg-winmm:
17+
18+
Download ogg-winmm from GitHub:
19+
https://github.com/ayuanx/ogg-winmm
20+
Extract the winmm.dll from the archive.
21+
Copy winmm.dll into the game directory, replacing the existing one:
22+
23+
cp /path/to/ogg-winmm/winmm.dll /path/to/your/tomb-raider-2/
24+
25+
3. Convert or Extract Audio Files
26+
27+
You need to ensure that the game has OGG format music in the music/ directory.
28+
Option 1: Convert Existing MP3s
29+
30+
If you already have the MP3 soundtrack, convert them:
31+
32+
Navigate to the music/ folder:
33+
34+
cd /path/to/your/tomb-raider-2/music/
35+
36+
Run the conversion script:
37+
38+
./convert.sh
39+
40+
Option 2: Extract Audio from the Game Files
41+
42+
If you don't have the MP3 soundtrack, extract it from the game’s original audio/ files:
43+
44+
Navigate to the audio/ directory:
45+
46+
cd /path/to/your/tomb-raider-2/audio/
47+
48+
Run the extraction script:
49+
50+
./extract_audio.sh
51+
52+
Ensure that the music/ folder now contains the OGG files.
53+
Remove or move the audio/ directory:
54+
55+
rm -r /path/to/your/tomb-raider-2/audio/
56+
57+
4. Fixing Video Playback Issues
58+
59+
If cutscenes don't play, you may need to use DXVK (DirectX to Vulkan translation layer).
60+
61+
Install DXVK:
62+
63+
WINEPREFIX=/path/to/your/wineprefix winetricks dxvk
64+
65+
Ensure Wine is using DXVK by setting d3d9.dll to native in winecfg:
66+
Run winecfg
67+
Go to the Libraries tab
68+
Add d3d9 and set it to "Native"
69+
70+
5. Run the Game
71+
72+
Once everything is set up, start the game:
73+
74+
WINEPREFIX=/path/to/your/wineprefix WINEDLLOVERRIDES="winmm=n,b" wine tomb2.exe -setup
75+
Then run:
76+
WINEPREFIX=/path/to/your/wineprefix WINEDLLOVERRIDES="winmm=n,b" wine tomb2.exe

fixes/TR2/convert.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/bash
2+
for file in *.mp3; do ffmpeg -i "$file" -c:a libvorbis -q:a 4 "Track$(printf '%02d' "${file%.*}").ogg"; done
3+
rm -f ./*.mp3

fixes/TR2/extract_audio.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#!/bin/bash
2+
3+
# Input files
4+
DAT_FILE="cdaudio.dat"
5+
MP3_FILE="cdaudio.mp3"
6+
7+
# Check if required files exist
8+
if [[ ! -f "$DAT_FILE" || ! -f "$MP3_FILE" ]]; then
9+
echo "Error: Missing $DAT_FILE or $MP3_FILE"
10+
exit 1
11+
fi
12+
13+
# Function to convert sectors to HH:MM:SS.MS format
14+
sector_to_time() {
15+
awk -v ms="$1" 'BEGIN {
16+
seconds = ms / 1000;
17+
hours = int(seconds / 3600);
18+
minutes = int((seconds % 3600) / 60);
19+
whole_seconds = int(seconds) % 60;
20+
milliseconds = ms % 1000;
21+
printf "%02d:%02d:%02d.%03d\n", hours, minutes, whole_seconds, milliseconds;
22+
}'
23+
}
24+
25+
# Read the DAT file and extract track info
26+
while read -r track start end name; do
27+
name="${name%%$'\r'}" # Strip trailing \r from name
28+
echo "DEBUG: track='$track', start='$start', end='$end' name='$name'"
29+
start_time=$(sector_to_time "$start")
30+
end_time=$(sector_to_time "$end")
31+
track_num=$(printf "%02d" "$((10#$track))")
32+
output_file="Track${track_num}.ogg"
33+
echo "Extracting: $output_file (from $start_time to $end_time)"
34+
ffmpeg -nostdin -i "$MP3_FILE" -ss "$start_time" -to "$end_time" -c:a libvorbis -q:a 5 "$output_file"
35+
done < "$DAT_FILE"
36+
37+
echo "Extraction complete!"
38+

0 commit comments

Comments
 (0)