Ridge Racer 7 QilinRecomp for Windows (64-bit)
===============================================

Ridge Racer 7 (Namco Bandai Games, PlayStation 3, 2006), recompiled to run natively: the game's own
program translated into C++ and compiled for your PC, drawn with Vulkan.
It is a work in progress: it reaches the races, but some drawing is still
wrong.

No game data is included, and no PS3 keys. You need your own copy of the
game: the USA disc, BLUS30001, version 01.02. Other regions and versions are other programs and aren't
supported.


Your game folder
----------------
You need three things, all from your own disc and console software:

1. The disc's files: the folder holding PS3_GAME (with PS3_DISC.SFB beside
   it), copied from your disc as it is.
2. The decrypted program. The disc's PS3_GAME\USRDIR\EBOOT.BIN is
   encrypted, and this project can't decrypt it. Do it once with the PS3
   emulator RPCS3 (https://rpcs3.net): in RPCS3 choose Utilities > Decrypt
   PS3 Binaries and pick that EBOOT.BIN. RPCS3 writes EBOOT.elf beside it;
   if it ends up anywhere else, move it into PS3_GAME\USRDIR, beside
   EBOOT.BIN.
3. The PS3's fonts, from its system software. In RPCS3 choose File >
   Install Firmware and pick the PS3 system software update (PS3UPDAT.PUP,
   from PlayStation's website). RPCS3 puts it in a folder named dev_flash
   beside rpcs3.exe. Copy that dev_flash folder into your game folder,
   beside PS3_GAME. (It is also found in a folder named RPCS3 beside your
   game folder, holding RPCS3 and its dev_flash.)

The launcher checks all three when you choose the folder, and says what is
missing and what to do.


Playing
-------
1. Unzip the download anywhere. Building the game needs about 2 GB free on
   that drive, and a few minutes the first time.
2. Open the folder and double-click "Play Ridge Racer 7.exe".
3. Click "Choose your game folder" and pick the folder above, or drag it
   onto the window.
4. Wait for the first build. The game's code is recompiled from your
   EBOOT.elf and compiled with the compiler in this download, as many files
   at once as your PC's memory allows (each takes up to about
   900 MB). Your game files never leave your PC.
5. Click Play. The window hides while the game runs. "Add a desktop
   shortcut" puts Play Ridge Racer 7 on your desktop.

After that, Play Ridge Racer 7.exe remembers your folder (even in a new download
folder), and Play starts the game straight away. After an update it builds
the game again first, recompiling only what changed. Leave the game folder
where it is: the game reads its files from it while you play.

The game's output is in work\run.log and work\run-errors.log, and the
build's in work\build.log. Send them when reporting a problem.

If Windows says "Windows protected your PC": More info, then Run anyway.
(The download isn't signed.) Or before unpacking, right-click the zip,
Properties, tick Unblock, OK.

Needs: Windows 10 or 11, 64-bit, a processor with SSSE3 (any from the last
fifteen years), 4 GB of memory or more, and a graphics driver with Vulkan
1.3 (any recent NVIDIA, AMD or Intel driver).


Controls
--------
A controller works as the PS3's. On the keyboard:

  Keys            Button          Keys              Button
  arrows          d-pad           Q, W              L1, R1
  Z               cross           1, 2              L2, R2
  X               circle          Return            Start
  A               square          Backspace         Select
  S               triangle        C, V              L3, R3
  I J K L         left stick      keypad 8 4 2 6    right stick

F1 or Esc (a controller: Back and Start together): the settings menu (the
game pauses), with the controls (set by pressing them), the picture and
the console's own settings. Alt+Enter or F11: full screen. F3: frame
times.

Settings (ridgeracer7.ini), saves (dev_hdd0) and the shader cache are kept
in %LOCALAPPDATA%\qilin\ridgeracer7, with the folder you chose and the build's
cache of compiled files (build-cache).


What's in here
--------------
Play Ridge Racer 7.exe  chooses your game folder, builds the game (once) and starts it
kit\qilin.exe       the recompiler: turns your EBOOT.elf into C++, and the
                    game's shaders into Vulkan's
kit\lib, include    the prebuilt rest of the game: its runtime, the renderer,
                    sound, films, the window and controls (SDL3), the menu
                    (Dear ImGui), fonts (FreeType), MPEG-2 and ATRAC3plus
                    (FFmpeg's libavcodec)
kit\toolchain       LLVM-MinGW, a C++ compiler for Windows (Clang)
kit\files.txt       every file this release holds (see below)
work\               made when building: the game (ridgeracer7.exe), built from your
                    copy, the recompiled code, the build's files and the logs
LICENSES\           the licences of everything included

Portions of this software are copyright (C) 2024 The FreeType Project
(https://freetype.org). All rights reserved. FFmpeg's libraries are under
the LGPL: LICENSES\FFmpeg says where their source is and how the game can
be linked with other builds of them.

Source, changes and issues: https://github.com/Qilin1066/RidgeRacer7--QilinRecomp


Updates and recovery
--------------------
"Check for updates" in Play Ridge Racer 7.exe asks GitHub for a newer release
(it sends nothing about you or your PC). If there is one, it downloads it,
unpacks it beside this folder and swaps in the new kit and launcher, then
starts again and builds the game for the new version. If anything fails on
the way, the old version is left as it was. You can also unzip a new
download anywhere, even over this folder: it finds your folder and the
cache by itself, and at its first start it removes files the new kit no
longer has (anything in kit\ or LICENSES\ that kit\files.txt doesn't name).
Your saves and settings are never in this folder, so nothing of yours is
touched.

The game is compiled for this PC's processor; moved to another PC, it is
built again. Compiled files come from the cache when nothing they're made
from has changed. A failed build leaves the working game as it was; the one
before a new build is kept as work\ridgeracer7.exe.previous until the new one has run
and closed normally. "Build again from scratch" compiles everything anew.
