Skip to content

About

Launch scripts for running classic Windows games from EmulationStation on a Raspberry Pi 5, using Box64 and Wine.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Box64-Wine-GameScripts

Launch scripts for running classic Windows games from EmulationStation on a Raspberry Pi 5, using Box64 and Wine. Each game has its own .sh script; the shared code they all use is in the .scripts folder.

No games or game files are included. You need your own copy of each game.

Use at your own risk. These scripts have only been tested on the setup listed below. Some games need patches or extra files that you have to find or make yourself (see each game's notes), and some need a no-CD patch.

Keys and registration details are never stored in the scripts. Games that need them read them from a small text file in the game's folder (listed in each game's notes below). These files are in .gitignore. Keep them private and don't upload them.

What's new: the overhaul (November 2026)

This release is an overhaul of all the Wine game scripts (nfs3.sh, which runs a native ARM64 build, is unchanged). Much of it was done for consistency: the scripts were written one game at a time, and each had grown its own way of doing the same jobs. Now they all work the same way:

  • The same layout and settings in every script: Display, Performance and Sound sections in the same order, with the same setting names, values and notes (HIDE_CURSOR, MOUSE_FENCE, VSYNC, the Box64 options, DEBUG, SOUND_MIXER and so on). Anything only one game needs comes after them.
  • More shared code: starting X for the game, checking its files, the registry basics, the starting zoom, following the game's window, cleaning up and --kill are now all in .scripts. Each game's script holds only what's special about that game.
  • A shared settings file, .scripts/settings.cfg: the Wine and Box64 paths, the TV's resolution and scaling, the HDMI port, the MIDI soundfont and the start-up message size, set once for all games. A game's script can still set any of them for itself.
  • Sharing Wine's files between games (optional): every prefix holds about 600 MB of Wine files, nearly all identical. With sharing on, the identical files become hard links to one master copy (~/wine-prefixes/.master), saving about 16 GB across the 29 games on my Pi. Anything a game changes or adds stays its own. Sharing is turned on or off in the wine module's menu in RetroPie-Setup (Box64-Wine-Install), which also has "Share now". A game can opt out with PREFIX_LINK=0 in its script.
  • The same sound mixer numbers in every game: SOUND_MIXER=0 is a game-only ALSA mixer (now used by every game with sound), 1 is straight to the HDMI sound, 2 is a private PulseAudio.
  • The same start-up and close-down in every game: everything is set up inside the game's own X session, and the start-up messages show each setup step and how long it took (only when there's real work to do, e.g. on a first run). A game started with no Wine prefix at all sets itself up from scratch, with no manual steps. Every game is then watched the same way until it closes, and if Wine hangs on after the game has closed, it's ended after a few seconds so you're taken back to EmulationStation.
  • The same log in every game: in the game's folder, named after the game (e.g. td6-launch.log), with one line at the top listing the settings used.
  • Test and diagnostic switches removed: settings that only existed for trying things out are now fixed at the values that work, and the start-up messages are always shown.
  • Small fixes found along the way, e.g. Test Drive 6's mouse pointer now starts in view on its launcher, Lemmings' drop-down menus no longer make the pointer jump, and Solitaire no longer needs a workaround for a start-up hang in an older Box64 build.

Upgrading from the earlier scripts: replace all the .sh scripts and the whole .scripts folder (including the new settings.cfg). On its first launch, a game may import its registry settings again once. Some files left in the game folders and prefixes by the earlier scripts (older log and settings file names) are no longer used; they're harmless and can be deleted.

What the scripts do

Each script starts its own X session from EmulationStation, runs the game in Wine through Box64, and closes everything when the game ends. Along the way they:

  • Fill the TV without changing its mode. The game runs at its own resolution, and the Pi's display hardware scales or zooms the picture up to the TV (no GPU work). Scripts that follow the game's window adjust automatically to whatever resolution is picked in the game, with black panels at the sides for 4:3.
  • Keep the mouse and keyboard on the game. There's no window manager, so the pointer is fenced onto the picture where needed, and a helper keeps the keyboard focus on the game.
  • Mix sound for the Pi's HDMI, which plays one stream at a time. Each game gets a private mixer just for itself, so sound effects, MIDI music and video soundtracks can play together, and no sound loses its start while the TV's HDMI audio wakes up. EmulationStation and the emulators keep using plain ALSA.
  • Play MIDI music through FluidSynth, started only while the game runs.
  • Set up a separate Wine prefix per game (~/wine-prefixes/<game>), and import registry settings only when they change. Optionally, the identical Wine files in all the prefixes are shared (see What's new).
  • Show start-up messages on screen while the game loads (including any setup steps, with their times), then a black screen until the game is ready, so resolution changes happen out of sight.
  • Write a log in the game's folder on each launch.

Each game's settings (resolution, scaling, sound mixer, Box64 options and so on) are at the top of its script, with notes. Settings about the Pi, the TV and the installed software, shared by all the games, are in .scripts/settings.cfg.

To close a stuck game over SSH, run its script with --kill, e.g.:

bash ~/RetroPie/roms/windows/nfsu.sh --kill

The .scripts folder

Shared code and settings, loaded by every game script. The files are named .inc / .py / .cfg and the folder is hidden, so EmulationStation doesn't list them as games.

File What it does
settings.cfg The settings shared by all the games: Wine and Box64 paths, the TV's resolution and scaling, HDMI port, soundfont, start-up message size
common.inc Loading settings.cfg, starting each game (X, file checks, setup, cleanup), Box64 and Wine settings, prefix setup and sharing, logging, --kill
display.inc Scaling and zooming the picture to the TV, the starting zoom, following the game's window, black panels, mouse fence, keyboard focus
sound.inc The private sound mixers (ALSA or PulseAudio), and MIDI music through FluidSynth
bootlog.inc / bootlog.py The start-up messages and black cover while the game loads
panels.py Black panels beside the picture, and the mouse fence
focus.py Keeps the keyboard focus on the game

The Python helpers talk to X directly and need nothing installed beyond python3.

The games

Script Game Game folder (in roms/windows)
3DPinball.sh 3D Pinball for Windows - Space Cadet (Windows XP) 3DPinball
aoe2.sh Age of Empires II: The Conquerors aoe2
AngryBirds.sh Angry Birds (PC) Angry Birds
cmr04.sh Colin McRae Rally 04 Colin McRae Rally 04
dxball.sh DX-Ball dxball
FS98.sh Microsoft Flight Simulator 98 Flight Simulator
hl.sh Half-Life (retail WON version, not Steam) half-life
Jazz2.sh Jazz Jackrabbit 2 (v1.23) Jazz2
lemmings.sh Lemmings (Windows) lemmings
mk4.sh Mortal Kombat 4 mk4
MotoGP2.sh MotoGP 2 MotoGP2
nfs2.sh Need for Speed II: SE nfs2
nfs3.sh Need for Speed III: Hot Pursuit nfs3
nfs4.sh Need for Speed: High Stakes / Road Challenge nfs4
nfs5.sh Need for Speed: Porsche 2000 / Porsche Unleashed nfs5
nfs6.sh Need for Speed: Hot Pursuit 2 nfs6
nfsu.sh Need for Speed: Underground nfsu
nfsu2.sh Need for Speed: Underground 2 nfsu2
outrun.sh OutRun 2006: Coast 2 Coast OutRun2006 Coast 2 Coast
Prairie Dog Hunt Pro.sh Prairie Dog Hunt Pro (Windows 3.x) Prairie Dog Hunt Pro
quake2.sh Quake II (v3.24, OpenGL) quake2
racer.sh Star Wars Episode I: Racer racer
SeriousSam.sh Serious Sam: The First Encounter (v1.05) Serious Sam
Solitaire.sh Solitaire (Windows XP) Solitaire
starwarsgbs.sh Star Wars Galactic Battlegrounds: Saga starwarsgbs
tanks.sh Pocket Tanks Deluxe tanks
Test Drive 6.sh Test Drive 6 Test Drive 6
Toca2.sh TOCA 2: Touring Cars Toca2
Worms Armageddon.sh Worms Armageddon (3.8) Worms Armageddon
x2.sh X2: The Threat X2 - The Threat

Fixes and patches for each game

The versions, patches and extras used for each game in my setup, so you can set up your copy the same way. Fixes marked (game-fixes) are in this repo's game-fixes folder, described in full below; everything else you need to get yourself and put in the game's folder.

No-CD patches: some games need a no-CD patch to run, because their disc copy protection doesn't work under Wine.

3D Pinball - Space Cadet

  • From Windows XP (SP3 PINBALL.EXE, version 5.1.2600.5512).
  • Plain GDI graphics, so the only work is zooming the window to fill the TV.
  • Music: Wine can't play the game's music the way it asks, so the script plays PINBALL.MID itself, on a loop, through FluidSynth. The game's own Music option is kept off.
  • Esc is blocked (it's the game's "boss key").

Age of Empires II: The Conquerors

  • Possibly The Conquerors 1.0e patch.
  • Wine's own DirectDraw; the picture is zoomed to full height with the mouse fenced so edge-scrolling works.
  • The in-game music is a CD audio track, which Wine only plays from a real CD drive, so there's none. The menu and civilisation themes still play.
  • Product IDs (optional): put the Product IDs from your own install in aoe2-pid.txt in the game folder: Age of Kings on line 1, The Conquerors on line 2 (e.g. 12345-123-1234567-12345, copied from the registry of a PC where the game is installed). Without it, all zeros are used. Age of Kings runs with that; The Conquerors hasn't been tested without its own ID.

Angry Birds

  • Sound fix (done by the script): the game has a start-up race that often leaves it silent under Box64. The script changes 23 bytes in AngryBirds.exe so the sound thread waits instead of quitting. The original is kept as AngryBirds.exe.orig.
  • Registration: if you have registered the game, put your registered settings.lua and bi_data.lua in a registration folder in the game folder; the script restores them into a fresh prefix.

Colin McRae Rally 04

  • LAV Filters (32-bit, LAVFilters-x.xx-x86.zip, contents in LAVFilters in the game folder): installed into the prefix once, so the intro and menu videos have their soundtracks. Set VIDEOS=0 to turn videos off.

DX-Ball

  • MIDI music through FluidSynth, mixed with the sound effects.

Flight Simulator 98

  • Microsoft's Patch Set 1 (fs98pat1.exe).
  • Intro video: needs Intel's Indeo 4.1 codec from Windows 95/98 (ir41_32.dll renamed to ir41_32.ax, plus ir41_qc.dll and ir41_qcx.dll) in a codecs folder. Without it you get an "MCI Error" and no intro, then the game starts.
  • Known issue: in 3D the ground can be black and the cockpit blank. This is a fault inside Wine; the script's notes list everything tried.

Half-Life

  • Retail WON version (not Steam). Runs in OpenGL; Direct3D is never used, because GoldSrc's Direct3D path hangs the display.
  • CD key (optional): put your CD key on the first line of hl-cdkey.txt in the game folder, with or without the dashes. It's imported into the registry once (and again if you change it), so a new Wine prefix doesn't ask for it. Without the file, the game asks for the key as normal.

Jazz Jackrabbit 2

  • Jazz Jackrabbit 2 v1.20 full version, with the official v1.23 patch.
  • Patched exe (game-fixes): jj2-patch makes Jazz2-pi.exe from Jazz2.exe, fixing picture damage and crashes on exit. The script runs Jazz2-pi.exe, so this is needed.
  • Optional: cnc-ddraw (ddraw.dll + ddraw.ini in the game folder) is used instead of Wine's DirectDraw if present. Not used in my setup.

Lemmings

  • MIDI music through FluidSynth, mixed with the sound effects.
  • A helper presses OK on the start-up "colour display" warning.

Mortal Kombat 4

  • GOG version, which includes the nGlide 2.10 Glide wrapper and a CD music replacement (Ogg files in MUSIC, played through _inmm.dll).
  • Renders through Glide (nGlide); Direct3D doesn't work (the game rejects Wine's Direct3D devices).

MotoGP 2

  • Runs slightly smaller than the TV and is zoomed up, because the game loads many minutes slower when its resolution exactly matches the Wine desktop.

Need for Speed II: SE

  • NFSIISE v1.4.0, an open-source wrapper for the original game (SDL2 + OpenGL), in place of the original nfs2se.exe, which deadlocks under Wine + Box64. Its settings are written by the script on every launch.
  • Game data: the original Special Edition CD's fedata and gamedata folders, renamed to lower case as NFSIISE requires.
  • Menu speed fix (game-fixes, optional): a rebuilt nfs2se.exe with a texture fix, so the Audio, Graphics and exit menus run at full speed instead of about 3 fps.

Need for Speed III: Hot Pursuit

  • No Wine or Box64: uses a native ARM64 build of the game from the nfs-recompiled static recompilation project (nfs3hp), which draws straight to the display with SDL3. Build it and copy nfs3hp into the game folder with the game's FEDATA, GAMEDATA and install.win.

Need for Speed: High Stakes / Road Challenge

  • NFS4 Modern Patch v0.1.0 (2016) by Evgeny Vrublevsky: reads its settings from nfs4.ini instead of the registry, plus many fixes.
  • nGlide 2.10 (Zeus Software), as an alternative renderer.
  • The renderer is chosen in the script, not in nfs4.ini: set GAME_RENDERER to dx7 (Direct3D 7, 32-bit colour, the default) or nglide (nGlide, 16-bit). The script writes it into nfs4.ini as ThrashDriver on every launch.

Need for Speed: Porsche 2000 / Porsche Unleashed

  • European Need for Speed: Porsche 2000.
  • Possibly the NFS: Porsche Unleashed Combined Patch v1.0.
  • nGlide 2.10 (Zeus Software): Glide.dll, Glide2x.dll and Glide3x.dll in the game folder, used by the game's Voodoo2 (Glide) renderer.

Need for Speed: Hot Pursuit 2

  • Official v2.42 patch.
  • HP2WSFix 2.9.1, thefirefox12537's fork of xan1242's widescreen fix (scripts\HP2WSFix.asi), loaded by the Ultimate ASI Loader as dinput.dll.
  • Known issue: changing the resolution in the game's options doesn't fully apply until the game is restarted (the script keeps the picture usable meanwhile). The new resolution is right from the next launch.

Need for Speed: Underground

  • European v1.0. No patches needed.

Need for Speed: Underground 2

  • Official v1.2 patch.
  • The CARS\CIVIC and CARS\RSX folders.
  • Patched exe (game-fixes): nfsu2-lockfix makes SPEED2_PATCHED.EXE from SPEED2.EXE (v1.2), fixing a menu crash. The script runs SPEED2_PATCHED.EXE, so this is needed.

OutRun 2006: Coast 2 Coast

  • Patched exe (game-fixes): outrun-lockfix makes OR2006C2C_PATCHED.EXE, fixing crashes and freezes while loading. The script runs OR2006C2C_PATCHED.EXE, so this is needed.
  • OutRun2006Tweaks v0.6.1 by emoose (dinput8.dll in the game folder), loaded automatically when present.
  • Perfect Music Mod by Danhanado (GameBanana): the full FLAC version, plus the 1.1 patch.
  • Antialiasing is always off: any level stops the game at start-up under Wine.

Prairie Dog Hunt Pro

  • A 16-bit Windows 3.x program, which Box64 can't run directly: runs through otvdm (winevdm) in an otvdm folder in the game folder.
  • Needs VBRUN300.DLL in the game folder.
  • Registration (optional): put your registration name on line 1 and your code on line 2 of pdh-registration.txt in the game folder. On first run the script writes them into pdhpro.ini (delete that file to have it made again). Without the file, the game starts unregistered.

Quake II

  • Quake II v3.24 (Knightmare's unofficial patch), OpenGL renderer (ref_gl.dll).
  • Ogg Vorbis music in baseq2\music.

Star Wars Episode I: Racer

  • The script makes a copy of the game's exe, SWEP1RCR_wine.EXE, that loads Wine's DirectDraw instead of PDRAW.DLL (a Windows-only fix that crashes under Wine).

Serious Sam: The First Encounter

  • Official v1.05 patch.
  • Patched Bin\Engine.dll (game-fixes): serioussam-enginefix changes one byte, fixing "Write attempted on read-only file stream!" at start-up. Needed; the launch script warns in its log if the original is still in place.

Solitaire

  • From Windows XP: sol.exe, with cards.dll from Windows XP's System32 next to it.

Star Wars Galactic Battlegrounds: Saga

  • All-In-One Patch (the script runs its Clone Campaigns exe, battlegrounds_cc.exe).
  • Widescreen Patcher v4.0 (wide_on.exe, by BoekaBart & Carborunda; it comes with the All-In-One Patch): replaces the 800x600 option with 1280x720.
  • Intro videos converted with ffmpeg: from the patch's H.264/MP3 to Cinepak video with IMA ADPCM audio, which Wine can decode without extra decoders.
  • Player profile fix (done by the script): the screen size stored in player.nf1 is reset to 1280x720 before and after each session.
  • The game's exe is in the Game subfolder of the game folder.

Pocket Tanks Deluxe

  • v1.00b (8 February 2002). No patches needed. The game always runs at 800x600, scaled to full height.

Test Drive 6

  • Music fix (from PCGamingWiki): the Windows Media Source Filter v1.8 and the DivX 3.11 audio codec, in a music-fix folder, plus drmclien.dll (from the Media Source Filter package) and strmdll.dll in the game folder. The script installs them once per prefix.

TOCA 2: Touring Cars

Worms Armageddon

  • Official 3.8 update.
  • Uses the update's own Tweaks registry files (OpenGL renderer, larger fonts, vsync off and others), chosen in the script.

X2: The Threat

  • Version 1.5.
  • LAV Filters (32-bit) in a LAVFilters folder: MP3 music and WMA speech.
  • Microsoft's 32-bit DirectShow DLLs: quartz.dll, amstream.dll, devenum.dll and qasf.dll from dxnt.cab in directx_feb2010_redist.exe, placed in a native-dshow folder in the game folder: videos and station chatter. The Windows 10/11 copies don't work in Wine.

The game-fixes folder

Fixes for games that crash, freeze or misbehave under Box64 and Wine. Most of them are small changes to the game's exe or a dll. They work on the copy you already have; no game files are included.

game-fixes/
├── Jazz Jackrabbit 2/   jj2-patch.py, jj2-patch.ps1
├── NFS Underground 2/   nfsu2-lockfix.py, nfsu2-lockfix.ps1
├── NFS2/                nfs2se_build.py, nfs2se-texture-fix.patch
├── OutRun 2006/         outrun-lockfix.py, outrun-lockfix.ps1
└── Serious Sam/         serioussam-enginefix.py, serioussam-enginefix.ps1

How the patches work

  • Two versions of each: the .py runs on the Pi (or any computer with Python 3); the .ps1 does exactly the same on Windows with PowerShell, nothing to install. Use whichever is easier.
  • Safe to run: each one checks that it has the exact game version it was made for, byte for byte, before changing anything. Anything else is refused and nothing is written. Running one again on an already-patched game does nothing.
  • The original is kept: the exe patches write a new exe next to the original, and the Serious Sam fix keeps a copy of the original dll.
  • Run once. You only need to run a patch again if you replace the game's files.

On the Pi: copy the .py into the game's folder, then run the command shown for that game over SSH.

On Windows: copy the .ps1 into the game's folder (for example through the Pi's Samba share), then right-click it → Run with PowerShell. The window stays open at the end so you can read the result. If Windows won't run it, right-click the file → Properties → tick Unblock, or run it from a PowerShell window with:

powershell -ExecutionPolicy Bypass -File .\name-of-patch.ps1

Jazz Jackrabbit 2 - jj2-patch

For Jazz Jackrabbit 2 v1.23. Makes Jazz2-pi.exe from Jazz2.exe (which is not changed). Four changes:

  1. FPU memory copy switched off. On Pentium-class CPUs the game copies memory 8 bytes at a time through the x87 maths unit, an old speed trick. Box64 does x87 maths with 64-bit doubles, which hold only 53 bits, so one byte in every 8 got damaged: thin lines and noise bands in the picture, and a crash on exit. The game now always uses its plain memory copy.
  2. and 3. Sound timer callbacks now take the sound lock before checking whether sound is running, not after.
  3. Sound shutdown now marks sound off and stops the timer before taking the lock and freeing the buffers.

Changes 2 to 4 fix a race between the sound timer and the game's shutdown which, slowed down by emulation, caused an Access Violation or a hang on exit. Every change only alters or reorders existing instructions.

python3 ~/RetroPie/roms/windows/Jazz2/jj2-patch.py

On Windows, put jj2-patch.ps1 in the Jazz2 folder and run it. Both versions also accept other file names: jj2-patch.py [source.exe [patched.exe]].

Need for Speed: Underground 2 - nfsu2-lockfix

For NFSU2 v1.2 (SPEED2.EXE, MD5 6445adbf4e8d64be51e96a69bba168a4). Makes SPEED2_PATCHED.EXE (the original is not changed).

The bug: the game guards some shared data with a home-made lock, an "in use" flag plus a pointer. Taking the lock was two steps (check the flag, then set it later), so two threads could both get in. When one finished, it cleared the pointer the other was still using, and the game crashed in the menus. On a real PC the gap is tiny; under Box64 it's much wider.

The fix:

  1. The lock routine claims the lock in one atomic step (LOCK CMPXCHG). If the lock is already taken, it reports "busy", which every caller already handles.
  2. The periodic update routine, which claims the lock itself, gets the same atomic claim.
  3. At all 24 places that release the lock, the pointer is now cleared before the flag, so nobody can take the lock and then have their pointer wiped.
cd ~/RetroPie/roms/windows/nfsu2
python3 nfsu2-lockfix.py SPEED2.EXE SPEED2_PATCHED.EXE

The .py needs both file names. The Windows .ps1 uses these names by default when run from the nfsu2 folder.

OutRun 2006: Coast 2 Coast - outrun-lockfix

Makes OR2006C2C_PATCHED.EXE from OR2006C2C.EXE (not changed). Fixes three races in the game's background file loader, which under Box64 crashed it (at 0x4245B4 / 0x4245C8) or froze it on a black screen at 0% CPU, at start-up or when loading:

  1. The loading queue. While moving a request from the "pending" list to the "active" list, the loader turned off the lists' locking for everyone, not just itself, so another thread adding a request at the same moment could break the list. The loader now leaves the locks alone and moves the request with two small non-locking copies of the list functions, placed in unused space at the end of the code.
  2. The "parts still loading" count. The main thread added to it and the loader subtracted from it, each in several steps, so a change could be lost and the count never reached 0, leaving the game waiting for ever. Both are now single atomic operations.
  3. Waiting for a file. The main thread could miss the loader's "finished" signal if the loader finished at just the wrong moment, and then wait for ever. The main thread now checks the count every millisecond instead.
cd "$HOME/RetroPie/roms/windows/OutRun2006 Coast 2 Coast"
python3 outrun-lockfix.py

Or give the exe's path: python3 outrun-lockfix.py /path/to/OR2006C2C.EXE. An older (version 1) OR2006C2C_PATCHED.EXE can be given as the input: only the missing fixes are added, and the old file is kept as OR2006C2C_PATCHED.EXE.v1.

Serious Sam: The First Encounter - serioussam-enginefix

For Serious Sam TFE v1.05. Without it the game stops at start-up with "Fatal Error: Write attempted on read-only file stream!".

The bug: the engine reads its files through memory that is filled in the first time it's touched. When that happens during a memory copy, Box64 reports it as a write even when the copy is reading, and the engine then refuses with the message above.

The fix: one byte in Bin\Engine.dll (offset 0x1D577, 75 → EB) skips that one check, so the memory is filled in as for any read. Nothing else uses the check. The original is saved as Bin\Engine.dll.orig (and never overwritten once there).

cd "$HOME/RetroPie/roms/windows/Serious Sam"
python3 serioussam-enginefix.py

To undo it and put the original back:

python3 serioussam-enginefix.py --undo

You can also give the game folder's path, or the dll's: python3 serioussam-enginefix.py "/path/to/Serious Sam". On Windows: .\serioussam-enginefix.ps1 [path], and -Undo to undo.

Need for Speed II: SE - nfs2se_build (optional)

A faster nfs2se.exe for NFSIISE v1.4.0.

The problem: in the Audio, Graphics and exit (Yes/No) menus, the game re-sends about 300 small textures every frame. NFSIISE overwrote textures the GPU was still drawing with, which makes the Pi's graphics driver wait each time (about 1.5 ms). Those menus ran at about 3 fps, with a jerky pointer and missed clicks.

The fix: each re-sent texture gets a fresh GL texture instead of overwriting the old one, and textures that haven't changed are skipped. The menus run at about 65 fps. The game itself is not affected.

nfs2se_build.py does the whole job on the Pi: it installs the build tools if missing (git, the 32-bit MinGW cross-compiler and yasm, using sudo apt-get), downloads NFSIISE v1.4.0 and the SDL2 development files, applies the fix (built into the script) and compiles nfs2se.exe. It needs an internet connection; the first run takes a few minutes.

python3 nfs2se_build.py              # build only -> ~/nfs2se-build/nfs2se.exe
python3 nfs2se_build.py --install    # build and copy into the nfs2 folder
python3 nfs2se_build.py --no-patch   # build plain v1.4.0, for comparison

--install keeps your existing nfs2se.exe as nfs2se-original.exe (only the first time, so a backup is never overwritten). Use --game-dir "/path/to/nfs2" if your game folder is somewhere else. Each run starts from a fresh copy of NFSIISE, so running it again is safe.

nfs2se-texture-fix.patch is the same fix as a source patch, for building NFSIISE yourself. Apply it from the top of the NFSIISE source folder:

git clone https://github.com/zaps166/NFSIISE.git
cd NFSIISE
git checkout v1.4.0
git submodule update --init --recursive
git apply -p0 /path/to/nfs2se-texture-fix.patch

Requirements

  • Raspberry Pi 5 with RetroPie on Raspberry Pi OS Bookworm Lite 64-bit.
  • The Pi set to output 1080p (1920x1080), not 4K. These scripts are designed to run at 1080p: they assume it (NATIVE_RES="1920x1080" in .scripts/settings.cfg), set the TV to that mode for each game, and scale the picture to fit it.
  • Box64, Wine and their dependencies, installed with the RetroPie-Setup modules from Box64-Wine-Install:
    • wine-deps, box64 and wine for every game. Use Wine 11.18 - later versions don't currently work (see that repo's README). Sharing Wine's files between the games is turned on in the wine module's menu.
    • fluidsynth for games with MIDI music (3D Pinball, DX-Ball, Lemmings).
    • pulseaudio only if you set a game's SOUND_MIXER=2.
  • A Windows system in EmulationStation (set up by the wine module).
  • python3, for the shared helpers and the .py patches (or use the .ps1 patches on Windows).

Tested on

Hardware Raspberry Pi 5 (16 GB), 1080p over HDMI
OS Raspberry Pi OS Bookworm Lite 64-bit (Debian 12.15)
RetroPie 4.8.12
Box64 v0.4.5 (e99ca51), with Dynarec
Wine 11.18 WoW64, vanilla (Kron4ek)
X server xorg-server 2:21.1.7-3+rpt3+deb12u13

Installing

  1. Copy the .sh scripts and the .scripts folder into ~/RetroPie/roms/windows/. The .scripts folder must sit next to the scripts.
  2. Install each game into its folder under ~/RetroPie/roms/windows/ (see the table above), with any fixes it needs.
  3. Run the patches from game-fixes for the games that need them: Jazz Jackrabbit 2, Need for Speed: Underground 2, OutRun 2006 and Serious Sam (and optionally NFS II SE). The game-fixes folder itself doesn't need to be on the Pi.
  4. Check .scripts/settings.cfg (the Wine and Box64 paths, NATIVE_RES="1920x1080", the HDMI port), then the settings at the top of each game's script.
  5. Optional: turn on sharing of Wine's files between the games in the wine module's menu (RetroPie-Setup), to save about 600 MB per game.
  6. Add the games to EmulationStation's gamelist.xml for the Windows system, or restart EmulationStation.

If you edit the scripts or settings.cfg on Windows, save them with Unix (LF) line endings. In Notepad++: Edit → EOL Conversion → Unix (LF). Scripts with Windows (CRLF) line endings fail on the Pi.

Credits

These scripts use, or work with, the following projects. None of them are included here.

Licence

The scripts and patches in this repo are released under the MIT Licence; see LICENSE. The NFS II SE texture fix is a change to NFSIISE, which is also MIT-licensed. The games and the third-party tools listed above are covered by their own licences.

About

Launch scripts for running classic Windows games from EmulationStation on a Raspberry Pi 5, using Box64 and Wine.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages