CounterStrikeXB

CounterStrikeXB is a native Windows x64 port of Counter-Strike for Xbox, featuring a Direct3D 11 renderer and optional hi-res textures.

README

CounterStrikeXB

A static recompilation of the original Xbox Counter-Strike (2003) into a native Windows x64 program, built on the xboxrecomp toolkit. The game's own code is translated to C and runs natively, with the Xbox's kernel, GPU, audio, USB and network hardware modelled around it, and a Direct3D 11 renderer drawing it at up to 5x the original resolution (4K).

No game data is included. You need your own legally dumped copy of the disc (Counter-Strike (USA)).

Features

  • The whole game: training, single player with bots, every map, at 60 FPS (72 on 144 Hz and FreeSync/G-Sync monitors).
  • Direct3D 11 renderer: render scale from 1x (480p) to 5x (4K), MSAA up to 8x, anisotropic filtering up to 16x, VSync, a frame-rate cap of 30, 60 or 72, fullscreen. True widescreen in your screen's shape (16:9, 16:10, up to 21:9) with the HUD kept in shape, or 4:3. Picks the fast GPU on laptops with two.
  • Optional hi-res texture pack: 5,362 recreated 4x textures (BC7), loaded in the background as they appear.
  • System link: LAN play between PCs, and online with friends over a VPN, no Xbox needed: Tailscale is found by itself, any other VPN works with a peer list. Optionally with xemu too, using the System Link key from your own console's BIOS.
  • Xbox Live through Insignia with your own console's identity: sign in, play online, and recover your Insignia account straight into the game.
  • Title update 257 (the version Xbox Live expects), made from your own disc: no download needed.
  • Office and Inferno, the two downloadable maps, unlocked from the disc.
  • Settings that apply as you play: F1 in the game (keyboard, mouse or pad), config.exe, or RecompLauncher, drawn in the look of the game's manual.
  • Controller, keyboard and mouse: Xbox pads through XInput; PlayStation 4/5, Switch Pro and other pads through SDL3, with rumble, found by themselves; the PC game's keys by default, every one remappable in the game; mouse aim.
  • Logs and problem reports that RecompLauncher and config.exe can attach to a report.

Install

  • Setup: run CounterStrike-Setup-<version>.exe from the latest release (Windows 10/11, 64-bit, no administrator rights needed). It asks for your disc image (.iso/.xiso) or a folder holding default.xbe, checks it is the USA release, and copies the 1.6 GB of game files into <install folder>\game_files. It can also install the hi-res texture pack, downloading it if the parts are not beside it. Running a newer Setup over an install only replaces the program files; the same version offers Repair. Silent install: CounterStrike-Setup-<version>.exe /VERYSILENT /SOURCE=<image or folder> /DIR=<folder>.
  • RecompLauncher: add the release's CounterStrike-v<version>-Windows-x64.zip. The launcher asks for the disc, checks it against Redump, prepares it and starts the game. Its Big Picture mode always starts the game fullscreen.

Your settings, key map, saves, Xbox Live identity and logs are in %LOCALAPPDATA%\CounterStrikeXB. A new install starts fullscreen; an upgrade or repair keeps your settings.

Hi-res texture pack

Tick the texture task in Setup, or install it later with CounterStrike-HiRes-Textures-<version>-Setup.exe from the textures release. Either one uses the texture-NN.bin parts placed beside it or downloads the missing ones (resumable, each checked by size and SHA-256), and puts the pack in texture_pack in the game folder (6.26 GB). After a successful install it offers to delete the downloaded parts (the default); keep them if you want to repair or reinstall without downloading again (/KEEPTEXTUREBIN=1 for a silent install). Run the add-on again with /REPAIRTEXTURES=1 to restore damaged files. F1 > Hi-res textures turns it off and on as you play.

Playing

The keys are the PC game's where the Xbox game has the same action:

KeyAction
W A S DMove and strafe
SpaceJump
CtrlCrouch
Shift (hold) / BWalk / Buy menu (one Xbox button: hold it to walk, tap it for the buy menu)
Left click / Right clickFire / Alternate fire (with mouse aim on)
R, EReload / use
Q, mouse wheelCycle weapons
4Cycle grenades
GDrop weapon
Enter, MIn-game menu (team)
TabScores
Z, X, C, V (or the arrows)Radio: Follow me, Hold position, Report in, Taking fire
I J K LLook (without mouse aim)

Flashlight, night vision and chat have no key: the Xbox game has no such action. Change any key in the F1 menu's Controls tab or in config.exe: click a key (or Enter), then press the new key, mouse button or wheel. Each action takes up to three keys; a key does one thing, so giving it to another action moves it. Changes made in the F1 menu work at once. A key map made by an earlier version is kept; Reset to defaults brings in these keys.

Controllers need no setup. Xbox controllers are read through XInput; PlayStation 4 and 5, Switch Pro, 8BitDo and other controllers through SDL3 (SDL3.dll in the game folder), with their buttons in the Xbox places (Cross = A, Circle = B, Square = X, Triangle = Y, Options = START, Share/Create or the touchpad = BACK, L1/R1 = White/Black) and rumble. Each takes the first free controller port. If Steam Input or DS4Windows also turns your pad into an Xbox one, the game notices (its presses show up on that Xbox pad too) and uses it once, as the Xbox pad with your Steam or DS4Windows layout. Other controllers in the settings is Auto by default; Xbox only and All (no check) are there too ([input] other_controllers 1, 0, 2 in settings.ini), applied at the next start.

Mouse aim (off by default; F1 or config.exe): the mouse turns the view directly, as in the PC game, at Half-Life's default speed times the sensitivity you pick (0.5x to 3x), optionally inverted. In a match the mouse buttons and wheel are keys like any other. In the intros and menus, left click is START and right click is B. While mouse aim is on the pointer stays hidden in the middle of the picture; F9 frees it.

Widescreen (F1 or config.exe) takes the shape of the screen the game is on, 16:9, 16:10 or up to 21:9, and shows more of the world at the sides, keeping the vertical view. The HUD keeps its shape (the radar at the left edge, the bottom row with its 4:3 spacing), and the menus stay 4:3 in the middle. The window opens in that shape too.

Xbox Live stays controller only and 4:3, because it is shared with players on Xboxes and xemu: while mouse aim or widescreen is on, choosing Xbox Live does not open it. A notice says why and turns them off with one button (Off), after which Xbox Live opens as usual. Nothing reaches Insignia while mouse aim is on, and a match started from Xbox Live never reads the mouse and is always 4:3. Single player, training and System Link, including over a VPN, keep both.

Key
F1, or hold BACK and press START on the padSettings menu
Esc"Quit Counter-Strike?"
F11 or Alt+EnterFullscreen on/off

The menus work with the keyboard, the mouse (point and click; right click steps back; the wheel scrolls) and the controller (D-pad or left stick to move, A to confirm, B to close, the shoulder buttons to switch tabs). The settings menu also has Quit Counter-Strike, so the game can be closed from the pad. It is drawn over the game and changes these as you play, saving them as you go:

SettingChoices
Render scale1x (480p, the original, default), 2x (1080p), 3x (1440p), 4x (4K, lighter), 4.5x (4K), 5x (4K, sharpest); pick your screen, 4x and up need a fast graphics card
Fullscreenborderless, on the window's monitor (default on)
Stretch imagefill the window instead of keeping its shape
Widescreenoff (4:3, default) / on (your screen's shape; not on Xbox Live)
VSyncon / off
Frame rate cap30, 60 (default), 72 (on 144 Hz or FreeSync/G-Sync monitors)
Anti-aliasingoff, 2x, 4x, 8x MSAA
Anisotropic filteringoff, 2x to 16x
Hi-res textureson / off (when the pack is installed)
Mouse aim, Sensitivity, Invertsee above
Other controllersAuto (default), Xbox only, All

72 FPS is the game's own limit, as on the PC version of the time. It is offered only where it looks smooth: on a 144 Hz monitor (two refreshes per frame) or one with FreeSync/G-Sync Compatible; on other monitors 60 is the top, which is smooth on 60, 120 and 240 Hz. A native G-Sync monitor that does not report adaptive sync gets 72 at 144 Hz. Where the cap divides the monitor's refresh rate (30 on 60 Hz, 60 on 120 Hz, 72 on 144 Hz) the display paces it, one frame every few refreshes, so every frame is shown for the same time.

Xbox Live matches always run at 30 FPS, as on the console. The game sends one movement command per frame, and Insignia's hosts (consoles and xemu) correct the movement of a faster client, which makes the view stutter whenever you move. Menus, single player and System Link keep your cap.

config.exe has the same options and the same Controls tab, and changes made there or in RecompLauncher while the game runs apply within a second (keys and other controllers at the next start). Everything is stored in %LOCALAPPDATA%\CounterStrikeXB\settings.ini and keymap.ini.

System link

System Link works between PCs on the same network: the games find each other by themselves. Over the internet it runs through a VPN (below), and it can also play with xemu (System Link with xemu).

Online without an Xbox: System Link over a VPN

You can play online with friends with no original Xbox, no EEPROM and no Insignia account: System Link runs over a VPN as if everyone were on one home network. There is no matchmaking or server list, so agree on a time and who hosts on Discord (or however your group talks).

  1. Everyone installs Tailscale (free). One person creates the network and sends the others an invite; everyone joins it.
  2. With Tailscale connected, start the game and choose System Link. One player creates the match; the others see it and join.

While Tailscale is connected the game asks it for the other PCs by itself, so there is nothing to type. Without Tailscale it only searches the local network.

Another VPN works too. For partners the game does not find by itself, list their VPN addresses in settings.ini:

[network]
peers=100.64.0.2,100.64.0.3
System Link with xemu

Out of the box, System Link plays with other PCs running this game. xemu, like a real Xbox, encrypts System Link with a key the BIOS makes for each game, so to play with it, the game needs that key from your own BIOS:

  1. In Insignia Setup, with your console's EEPROM in step 1, click System Link key... in step 4 and choose your console's BIOS image and MCPX boot ROM. It saves only lankey.bin, the game's System Link key: your hard-drive key and account stay as they are, so if you already set up Insignia there is nothing to redo. (Filling in step 2 with From BIOS + MCPX and saving makes the key too.) The BIOS is not kept, and no key is built into the game.

  2. Turn it on: Insignia Setup asks right after saving the key, or set it in settings.ini:

    [network]
    real_xbox=1
    

    From a command line, insignia_setup.exe --bios BIOS.bin --mcpx MCPX.bin --real-xbox 1 does both, using the EEPROM you saved before.

With real_xbox=1 the game plays System Link with xemu, and no longer with copies of this game that leave it off (the default). Everyone in one game needs the same setting. A real Xbox has the same key but talks raw Ethernet, which the game does not send yet, so consoles cannot join it.

xemu has to be set to send its network to the game. In xemu, open Machine > Settings > Network, turn Enable off, set Attached to to UDP Tunnel, set Bind Address to 0.0.0.0:9368 and Remote Address to this PC's address with port 30740 (127.0.0.1:30740 when xemu runs on the same PC), then turn Enable on again. Then tell the game where xemu listens:

[network]
real_xbox=1
xemu=127.0.0.1:9368

(use the xemu PC's address instead of 127.0.0.1 when it runs on another PC). Start the game before starting xemu's Counter-Strike: the game gives xemu's Xbox its address, which it asks for when it starts.

Xbox Live (Insignia)

Insignia revives the original Xbox Live. The game signs in as your own console, so you need:

  1. A console registered with Insignia (with Insignia's Setup Assistant, see their connection guide).
  2. That console's EEPROM (eeprom.bin, from your console or xemu).
  3. Its hard-drive key: typed in, read from hddinfo.txt, or decrypted from your console's own BIOS and MCPX boot ROM dumps.
  4. Your Xbox Live account: recovered from Insignia with your gamertag and the 16-digit number on your insignia.live Web Dashboard, or loaded from a dump of your console's drive (or your xemu drive).

Insignia Setup (insignia_setup.exe, in the game folder) takes all of these and checks each one. A typed hard-drive key is checked against the accounts on your drive when you give one (they are signed with it); it refuses a key that did not sign them, and says when a key could not be checked. Insignia Setup itself never goes online. Recover from Insignia briefly starts the game, which signs your console in, fetches the account and closes by itself. The recovery number is never logged or stored. Creating a brand-new account still needs the Xbox dashboard on a console.

Without an EEPROM and a hard-drive key the game never contacts Insignia: it blocks all internet traffic and plays system link only.

Its optional step 4, System Link key..., is separate from Xbox Live: it makes the key for System Link with xemu (see System Link with xemu) and changes nothing else.

Then choose Xbox Live in the game and pick your gamertag. Matches run at 30 FPS, like everyone else's on Insignia.

Problem reports and logs

Every run writes a log to %LOCALAPPDATA%\CounterStrikeXB\logs (the newest five are kept, your Windows user name blanked out, the console's network address shortened to its maker prefix). It records the build, the PC, the video settings and the frame-rate top picked for your monitor, an [FPS] line every minute of play (average FPS, 1% low, longest frame, frames over 50 and 100 ms), a [FREEZE] report if the picture stops for 10 seconds and a [CRASH] report if the game crashes.

  • In config.exe, Report a problem... opens the logs folder with the newest log selected and a new GitHub issue filled in with the game version and PC; describe the problem and drag the log onto it.
  • RecompLauncher's crash report attaches the newest log by itself.

Building from source

Requirements: Windows 10/11 x64, Visual Studio 2022 with the C/C++ desktop workload, Git, Python 3, and your own Counter-Strike (USA) XISO image (its expected SHA-256 values are in dependencies.json).

# 1. Clone the pinned toolkit into tools\xboxrecomp (v0.17.0 + this project's patches), and fetch SDL3 into .deps
powershell -ExecutionPolicy Bypass -File scripts\setup.ps1

# 2. Extract your disc image into game_files\
python scripts\extract_disc.py "Counter-Strike (USA) (En,Fr,Es,It,Ko).xiso.iso" game_files

# 3. Make game_files\default.xbe the title update's (the disc's is kept as default.disc.xbe)
python scripts\tu_patch.py apply --patch cs_tu.xbepatch

# 4. Translate default.xbe to C (src\recomp\gen)
python scripts\pipeline.py

# 5. Build
powershell -ExecutionPolicy Bypass -File scripts\build.ps1 -Configuration RelWithDebInfo

# Run (development settings, logs in runs\<label>\)
powershell -ExecutionPolicy Bypass -File scripts\run.ps1

cs_tu.xbepatch ships with every Setup; scripts\tu_patch.py make builds it from the update's default.xbe.

Installer: python scripts\build_installer.py --version 1.0.0 (Inno Setup 6.4+ and Pillow) builds the player configuration into build_release\ and writes installer\Output\CounterStrike-Setup-<version>.exe and the RecompLauncher ZIP, each with a .sha256, and keeps the release's symbols in out\symbols\<version> for python scripts\symbolize_log.py <log>.

Texture add-on: python scripts\build_texture_payload.py makes the texture-NN.bin parts and texture-payload.json; python scripts\build_texture_addon.py <payload.json> compiles its Setup with every part's URL, size and hash pinned; python scripts\test_texture_addon.py <Setup.exe> installs it into a scratch folder and checks every file. python scripts\index_texture_pack.py <asset-root> builds a pack's lookup index.

How it is put together

  • src/ - Counter-Strike's host code: entry point and settings, the Direct3D 11 renderer, the texture pack, the F1/Esc menus, relaunch handling, the downloadable maps, Xbox Live account recovery, logs.
  • config/ - config.exe, the settings and controls program.
  • insignia/ - insignia_setup.exe.
  • installer/ - the Setup scripts, the disc importer and the title update patcher.
  • scripts/ - setup, disc extraction, the translation pipeline, build, run and release scripts.
  • seeds/ - function seeds for the pipeline.
  • patches/xboxrecomp/ - this project's changes to the toolkit (renderer, audio, USB, the network card and its router, console identity, the emulated hard disk, and more), applied by scripts/setup.ps1 with a fixed identity so the pinned commit in dependencies.json is reproducible.

src/recomp/gen is pure pipeline output, generated from your disc, and is never edited by hand or committed.

License

CounterStrikeXB is under the PolyForm Strict License 1.0.0: you may read, study, build and play it for personal, noncommercial use, but not change it or share copies, changed or not. Get the game from this project's releases. The toolkit patches in patches/xboxrecomp/ stay under the toolkit's MIT License. SDL3.dll, shipped beside the game, is SDL's own build under its zlib License (SDL3-LICENSE.txt).

Why: the game signs in to Xbox Live through Insignia, a community-run service shared with players on real consoles. Keeping modified builds off it protects everyone there from cheating. Bug reports and suggestions are welcome as issues.

Legal

This repository contains original source code, scripts and documentation, plus an icon (resources/cs.ico, cs.png) made from the game's logo. It contains no Counter-Strike game code, assets or disc images, and nothing from the Xbox dashboard. Release builds contain code translated from the game; the game files come from the player's own disc. Xbox Live play goes through Insignia, an independent revival service. Counter-Strike is a trademark of Valve Corporation; PlayStation, DualShock and DualSense are trademarks of Sony Interactive Entertainment, and Nintendo Switch of Nintendo. This project is not affiliated with or endorsed by Valve, Microsoft, Sony, Nintendo, Insignia, xemu or Tailscale.