RGen 1.1.0 by Jason Meehan - build native Windows versions of eight Sega
Genesis / Mega Drive games
Official website: www.R-Gen.net
================================================================================

DISCLAIMER
  You must own the original game cartridge for any ROM you use with RGen.
  RGen does not include any games or ROMs. Use only ROMs you have legally
  dumped from cartridges you own. RGen is not affiliated with, endorsed by or
  sponsored by SEGA.


RGen turns YOUR OWN copy of a supported Genesis ROM into a native Windows
program. The game is not emulated in a window. The builder translates the
game's 68000 code into a Windows program on your PC and links it with the
RGen runtime (graphics, sound, launcher, save states).

This zip contains NO games and NO ROMs. You must supply your own ROM file
for every game you build. Each game is built on your PC from your ROM.

Supported games (one exact ROM version each, see "ROM versions" below):
  1) Herzog Zwei
  2) Sonic the Hedgehog
  3) Streets of Rage
  4) Golden Axe
  5) Sonic the Hedgehog 2          (new in 1.1.0)
  6) Road Rash                     (new in 1.1.0)
  7) OutRunners                    (new in 1.1.0)
  8) Micro Machines                (new in 1.1.0)


REQUIREMENTS
------------
- Windows 10 or 11, 64-bit (x64).
- About 300 MB of free disk space: about 76 MB for RGen, about 20 MB per
  built game, plus about 100 MB of temporary files during a build.
- No administrator rights and no installation. RGen does not change any
  system settings and does not need antivirus exclusions.
- Your own ROM dump of each game you want to build (see below).
- Keyboard, or an XInput/SDL-compatible game controller (Xbox-style pads
  work out of the box).
- Put RGen in a folder whose path uses plain English letters only (for
  example C:\Games\RGen-1.1.0). Paths with accented, Cyrillic, Chinese and
  similar characters are not supported. Also avoid folders that are
  synced by OneDrive or protected by Controlled Folder Access.


HOW TO BUILD A GAME (STEP BY STEP)
----------------------------------
1. Unzip RGen-1.1.0.zip to a normal folder you own, for example
   C:\Games\. Use "Extract All" so that you get C:\Games\RGen-1.1.0\.
   Do not run RGen.exe from inside the zip window, and keep the folder
   structure as is (RGen.exe needs the "tools" folder beside it).

2. Double-click RGen.exe. A console window opens with the menu:

       1) Herzog Zwei
       2) Sonic the Hedgehog
       3) Streets of Rage
       4) Golden Axe
       5) Sonic the Hedgehog 2
       6) Road Rash
       7) OutRunners
       8) Micro Machines
       Q) Quit

   If Windows shows "Windows protected your PC" (SmartScreen), see
   Troubleshooting.

3. Type the number of the game and press Enter.

4. Point RGen at your ROM. Press Enter to get a normal "Open file"
   window and pick the file. Or type/paste the full path of the ROM and
   press Enter. The file window lists .bin, .md, .gen and .smd files (choose
   "All files" to see anything else). RGen recognises the ROM by its
   contents, not its extension: plain (raw) dumps, dumps with a 512-byte
   copier header, and interleaved SMD dumps (with or without the header)
   are all accepted. Byte-swapped dumps and over-dumps (the ROM repeated,
   or padded with 0x00/0xFF up to 1, 2, 4 or 8 MiB) are fixed automatically,
   and RGen prints what it found, for example
     "Detected: raw, byte-swapped, trimmed from 1024 KiB (mirrored copy)".
   Zipped ROMs are not accepted, so unzip them first.

5. RGen checks the ROM (size and CRC32). The wrong game, a different
   revision or a damaged/hacked file is rejected with a message that names
   the exact version that is needed. Nothing is built in that case.

6. The build starts. It translates the ROM, then compiles and links it.
   It takes about 1-5 minutes, depending on your PC. When it finishes you
   see "Done!" and the path of the game. A log of the last build is kept
   in  build\<game>-last-build.log .

7. Your game is in the Games folder next to RGen.exe:

       RGen-1.1.0\Games\HerzogZwei\HerzogZwei.exe
       RGen-1.1.0\Games\Sonic\Sonic.exe
       RGen-1.1.0\Games\StreetsOfRage\StreetsOfRage.exe
       RGen-1.1.0\Games\GoldenAxe\GoldenAxe.exe
       RGen-1.1.0\Games\Sonic2\Sonic2.exe
       RGen-1.1.0\Games\RoadRash\RoadRash.exe
       RGen-1.1.0\Games\OutRunners\OutRunners.exe
       RGen-1.1.0\Games\MicroMachines\MicroMachines.exe

   Double-click the .exe to play. You can make a desktop shortcut to it.
   Keep the DLLs, the "assets" folder and the .ini/.cfg files beside the
   .exe. You can move a whole game folder somewhere else.

8. The game reads your ROM every time it starts. If your ROM was a raw dump,
   the game uses the ROM file where it is (its path is stored in
   rom-<Game>.cfg), so do not move or delete that ROM. If you do, just build
   the game again. Headered, .smd, byte-swapped and over-dumped ROMs are
   converted once and stored in
   the game folder as <Game>-rom.bin.

Building again (for example after moving the ROM) is safe: your
settings.ini and save files in the game folder are kept. Save states only
work with the exact build that made them, so states from an earlier build
will not load (see "Save states").

Command line (optional):
    RGen.exe --game <id> --rom "<path to ROM>" [--no-pause]
    ids: herzog-zwei  sonic  streets-of-rage  golden-axe
         sonic2  road-rash  outrunners  micro-machines
    RGen.exe --help
The exit code is 0 on success, 2 for a rejected/unreadable ROM and 1 for
other errors.


ROM VERSIONS (exactly these; size after any header is removed; CRC32 of
the raw ROM data)
-------------------------------------------------------------------------
  Herzog Zwei          (USA/Europe)                      CRC32 A605B65B
  Sonic the Hedgehog   (USA/Europe) (REV00, original)    CRC32 F9394E97
  Streets of Rage      (World) (Rev A)  - also titled    CRC32 4052E845
                       "Bare Knuckle - Ikari no Tekken / Streets of Rage"
  Golden Axe           (World) (Rev A)                   CRC32 665D7DF9
  (the four games above are 524,288 bytes = 512 KiB)
  Sonic the Hedgehog 2 (World) (Rev A)      1 MiB          CRC32 7B905383
  Road Rash            (USA, Europe)        768 KiB        CRC32 DEA53D19
  OutRunners           (USA)                2 MiB          CRC32 EDE636B9
  Micro Machines       (Europe)             512 KiB        CRC32 50081A0B

SHA-1 of the supported dumps (No-Intro):
  Herzog Zwei     8F7262102C2B2334F0BC88EE6FD6B08797919176
  Sonic           6DDB7DE1E17E7F6CDB88927BD906352030DAA194
  Streets of Rage 731CDF182FE647E4977477BA4DD2E2B46B9B878A
  Golden Axe      2CE17105CA916FBBE3AC9AE3A2086E66B07996DD
  Sonic 2         8BCA5DCEF1AF3E00098666FD892DC1C2A76333F9
  OutRunners      5D00AD7D9DCCD9067C4BD716C2AB9C0A18930AE2
  Micro Machines  56A8844C376F2E79E92CF128681FA3FEF81C36D6

Known versions that are NOT supported (RGen names them when you pick one):
  Herzog Zwei (Japan)                                       CRC32 4CF676B3
  Sonic The Hedgehog (Japan, Europe, Korea) (En) (Rev A)    CRC32 AFE05EEE
  Sonic The Hedgehog (USA, Europe) (Sonic Classic Collection) CRC32 27E22795
  Sonic The Hedgehog (World) (Sonic Mega Collection)        CRC32 6382B2C5
  Sonic & Knuckles + Sonic The Hedgehog (J/E/K) (Rev A) (Lock-On) CRC32 B6C67EAC
  Sonic & Knuckles + Sonic The Hedgehog (USA, Europe) (Lock-On)  CRC32 E01F6ED5
  MD Sonic The Hedgehog (World) (Aftermarket) (Unl)         CRC32 23A11500
  Streets of Rage (World) (En,Ja) (Rev 0)                   CRC32 BFF227C6
  Golden Axe (World) (Rev 0)                                CRC32 E8182B90
  Golden Axe (USA) (Rev B) (Sega Smash Pack)                CRC32 31227079
  Sonic The Hedgehog 2 (another revision)                   CRC32 24AB4C3A
  Micro Machines (USA)                                      CRC32 364E68BB
These differ in code (revisions) or are not cartridge dumps. Each would need
its own recompiler configuration and testing, so RGen refuses them rather
than building something broken. Hacks, translations, MD+/MSU-MD patched
ROMs and damaged dumps are refused too.

Japanese owners: Streets of Rage / Bare Knuckle and Golden Axe were sold as
one "World" cartridge for every region, so a Japanese cartridge is the same
dump (Rev A is supported). Herzog Zwei and Sonic have separate Japanese
versions, which are not supported yet. For the four games added in 1.1.0,
only the versions listed above are supported.


PLAYING
-------
Launcher
  Each game opens the RGen launcher first. Use the mouse (or the arrow keys
  and Enter, or a controller) to change options and press PLAY. Your
  choices are saved to settings.ini in the game folder. The MODS panel holds
  the widescreen options (see below).
  The first time you press PLAY, the game shows a one-time personal-use
  notice. Click OK to continue.

Default controls (player 1)       Keyboard        Controller (Xbox layout)
  D-pad                           Arrow keys      D-pad / left stick
  A / B / C                       Z / X / C       B / A / X
  Start                           Enter           Start
  X / Y / Z (6-button games)      A / S / D       Y / LB / RB
  Mode                            Backspace       Back
Player 2 is off by default. In the launcher, set Player 2 to Keyboard or a
controller. Player 2's keyboard defaults are I J K L = D-pad, N M , = A B C,
Right Shift = Start. Use "Configure" in the launcher to change any binding,
and 3-Button/6-Button to choose the pad type.

Hotkeys while playing
  F11 or Alt+Enter     Fullscreen on/off
  Esc                  Game menu: Reset game / Save game / Load game / Exit
                       game. Save and Load ask for slot 1-3. Closing the menu
                       with X, Alt+F4 or Esc resumes the game.
  Shift+F1 ... F9      Quick save to slot 1-9
  F1 ... F9            Quick load from slot 1-9
  Tab (hold)           Fast forward (turbo). Controller: hold Back.
  Controller LB / RB   Quick save / quick load, slot 1 (while the game runs)
  (On a controller, LB/RB are also the Y/Z buttons; this only matters in
  6-button games, none of which are included.)

Game controls of the new games (Genesis pad; default keys above)
  Sonic the Hedgehog 2  Start = start/pause, A/B/C = jump. Spin dash: hold
                        Down while standing, tap jump to rev, release Down.
  Road Rash             Start = start/advance menus/pause, B = accelerate,
                        A and C = attack (punch/club), Left/Right = steer,
                        Down = brake.
  OutRunners            Start = start/pause; see the game's own menus for
                        accelerate/brake/gear (they can be changed there).
  Micro Machines        Start = start/pause; see the game's own menus for
                        the accelerate/brake buttons.

Save states
  Saves are written to the game folder (rgen_save_1..3.bin from the Esc
  menu, native_save_1..9.bin from the hotkeys). Save states work in all
  eight games. If saving or loading fails, the message says why (for
  example "Access is denied" or "no save in this slot"). Games started
  without a console window write their diagnostics to run-stderr.log in
  the game folder. A save state contains the
  whole machine and is tied to the exact game .exe that wrote it. After
  rebuilding a game (including a game built with an earlier RGen version),
  older states will not load (you get a message, and
  the running game is not affected). The games' own in-game saves and
  passwords work as on the console.

Fullscreen
  Fullscreen uses borderless fullscreen on normal desktops. On desktops that
  run below 50 Hz (for example some 4K TVs/monitors at 30 Hz) it switches to
  exclusive 1920x1080 at 60 Hz so that the games run smoothly. Opening the
  Esc menu in fullscreen briefly returns to a window and goes back after the
  menu closes.


WIDESCREEN MODS (optional, off by default)
------------------------------------------
These are drawn by RGen's renderer only. The game itself still runs
exactly as on a Genesis. Turning them on or off never changes gameplay or
save data. Turn them on in the launcher's MODS panel, or in settings.ini.

Herzog Zwei - "Herzog terrain widescreen"  (settings.ini: [video]
herzog_terrain_widescreen = 1)
  - 16:9 picture (400x224) during one-player gameplay, in 2-player Split
    Display and on the title screen.
  - Past the map edge, the margins show the game's own divider rail.
  - Limits: units can pop in/out at the outer margins, menus such as BUY,
    map select and password stay 4:3 with bars, and the title margins are
    mirrored from the picture's edge (there is no wider original artwork).

Sonic the Hedgehog - "Widescreen (experimental; objects may pop in)"
(settings.ini: [video] widescreen = 1)
  - 16:9 picture in levels (terrain and parallax background), on the SEGA
    logo screen and on the title screen.
  - Limits: rings, enemies and other objects appear only when they enter
    the original 320-pixel view, so they "pop in" at the inner edge of the
    margins. At the very left edge of a level, the left margin shows only
    background. Some background columns can be briefly stale in zones
    that stream their background. The special stage, level select, menus
    and "SONIC TEAM PRESENTS" stay 4:3 with bars.
  - Any screen the renderer does not recognise falls back to the normal 4:3
    picture instead of showing garbage.

Streets of Rage and Golden Axe - "Widescreen (16:9 stages)"
(settings.ini: [video] widescreen = 1)
  - 16:9 picture (400x224) in the stages. The margins show the game's own
    level art; enemies walking in from off-screen are visible in the
    margins. The Streets of Rage HUD keeps its 4:3 box.
  - Streets of Rage: the stage margins are drawn from the game's own level
    map in memory. Areas outside the level are dark backdrop, nothing is
    mirrored.
  - Limits: menus, character select and other screens stay 4:3 with bars
    (Golden Axe intro/title/menu are 256-pixel screens and stay
    pillarboxed). Only the first stages were tested in depth; a screen
    that is not recognised falls back to 4:3. In Golden Axe, right after a
    state load or at a stage start a margin can briefly show mirrored art.


Sonic the Hedgehog 2, Road Rash, OutRunners and Micro Machines -
"Widescreen (16:9 stages)"  (settings.ini: [video] widescreen = 1)
  - Sonic 2: levels (1 player) are 400x224. The margins show the level
    from the game's own layout in memory; objects and rings near the
    edges are drawn by the game itself (the game logic still only sees
    the original 320-pixel view, so gameplay is unchanged). Title, SEGA
    logo, menus, special stage and 2-player stay 4:3. Tested in depth in
    Emerald Hill; other zones may show stale background tiles in the
    margins. The idea of widening the game's own sprite and ring culling
    comes from the "Sonic 2 Community's Cut" widescreen hack (see
    THIRD-PARTY-NOTICES.txt); no code or data from it is used.
  - Road Rash: races are 400x224. Sky, mountains, road, grass, roadside
    objects and riders continue into the margins from the game's own
    data; the dashboard housing is continued beside the dashboard. Menus,
    BUSTED/results screens and the title stay 4:3. Some objects pop in at
    the margin edge; far off-road the grass dither can differ slightly.
  - OutRunners: races use the game's full-width road/scenery planes;
    roadside objects past the 4:3 edge show in the margins. Menus/title
    stay 4:3. On busy screens the game's own sprite multiplexing can make
    objects appear slightly earlier at the edges.
  - Micro Machines: races show the real track around the camera in the
    margins (decoded from the game's own track map), and cars are no
    longer cut off at the 4:3 edge. Menus/title stay 4:3. The HUD position
    dots stay at their 4:3 positions. Only the first track was tested in
    depth.
  - With widescreen off, all eight games show the original 4:3 picture.


TROUBLESHOOTING
---------------
"Windows protected your PC" (SmartScreen)
  RGen.exe and the games you build are not code-signed, so SmartScreen can
  warn the first time. Click "More info" and then "Run anyway". If the zip
  was downloaded, you can also right-click the zip > Properties > tick
  "Unblock" > OK BEFORE extracting it. Only do this for a copy you got from
  a source you trust. Check it against SHA256SUMS.txt (see below).

Microsoft Defender / antivirus
  The games are compiled on your own PC, so no antivirus vendor has seen
  your exact .exe before. Heuristic scanners sometimes flag new unsigned
  programs ("Wacatac", "Trojan:Win32/...!ml" and similar generic names).
  If Defender quarantines a file during or after a build:
  - Do NOT turn off Defender, and RGen never needs an exclusion.
  - Open Windows Security > Virus & threat protection > Protection history
    to see what was flagged. If you are confident it is a false positive,
    restore it there and report it to Microsoft at
    https://www.microsoft.com/wdsi/filesubmission ("Submit a file").
  - Run the build again after the file has been reviewed/restored.
  If the build stops with "cannot find" / "Permission denied" errors from
  gcc/as/ld, a scanner probably locked or removed a file in tools\ or
  build\. Re-extract the zip and try again.

"The tools folder is missing or incomplete"
  RGen.exe was started without its tools folder (for example from inside
  the zip). Extract the whole zip first.

"This file was rejected" / "Wrong ROM for ..."
  The file is not the supported version. The message shows the CRC32 of
  your file and the one that is needed. If your file is a different
  supported game, RGen tells you which menu entry to use. Unzip zipped ROMs
  first. Check that you have the exact revision listed under ROM versions.

The game says it cannot find / open the ROM
  The ROM was moved or deleted after the build (raw ROMs are used in place).
  Put it back, or build the game again from its new location.

Build failed
  Look at build\<game>-last-build.log (the build folder is kept when a build
  fails). Common causes: very little free disk space, a non-English/special
  character in the folder path, a synced or protected folder (OneDrive,
  Controlled Folder Access), or antivirus interference. Move RGen to
  something like C:\Games\RGen-1.1.0 and try again.

No sound / crackling / music too slow or too fast
  - Check that the right output device is the Windows default device before
    starting the game. The game uses the default device.
  - Close programs that hold the audio device in exclusive mode.
  - Crackling usually means the PC cannot keep up. Close heavy background
    programs, play in fullscreen, and keep "Fast forward" (Tab) released.
  - The game adjusts its audio rate slightly to stay in sync. Short gaps
    can occur after a long hitch (for example a window drag).

4K displays, TVs and displays below 60 Hz
  - Windowed mode on a display slower than 50 Hz (for example 4K at 30 Hz)
    still runs at full speed, but motion looks less smooth. Use fullscreen
    (F11). On such displays fullscreen switches the screen to 1920x1080 at
    60 Hz.
  - If fullscreen stutters or runs at half speed, set  exclusive_vsync = 0
    in rgen-video.ini in the game folder.
  - Picture too small/large in a window: resize the window or change the
    "Window scale" in the launcher. Scaling keeps the original aspect ratio.

Controller not detected
  Connect it before starting the game. Xbox-style (XInput) controllers work
  out of the box. Other pads work when SDL2 knows them.

Logs
  Each game writes rgen-video.log next to its .exe, and the builder writes
  build\<game>-last-build.log. Include those when you report a problem.


VERIFYING THE DOWNLOAD
----------------------
SHA256SUMS.txt lists the SHA-256 of every file in this package. In
PowerShell:   Get-FileHash .\RGen.exe -Algorithm SHA256


WHAT IS IN THIS PACKAGE
-----------------------
RGen.exe                 The builder (menu + checks + build steps).
tools\rgen-recompiler.exe  The 68000-to-C recompiler (runs only on your ROM).
tools\games\             Per-game recompiler settings (no game data).
tools\runtime\           The RGen runtime as compiled object files and DLLs,
                         and launcher fonts/icons. No source code.
tools\mingw64\           A trimmed MinGW-w64 GCC 14.2.0 compiler (WinLibs
                         build) that compiles and links the game on your PC.
LICENSES\                License texts for RGen and every third-party part.
THIRD-PARTY-NOTICES.txt  Credits and license summary.
README.txt               This file.
CHANGES.txt              What changed in each version.
SHA256SUMS.txt           Checksums.

During a build, RGen writes the translated game code and a few small
interface headers to build\<game>\. That folder is deleted when the
build succeeds. It is a translation of your ROM: do not share it, and do
not share the finished game folders either. They contain code translated
from your ROM (and possibly a copy of it).


LEGAL
-----
- Use only ROMs that you dumped from cartridges you legally own, or that
  you otherwise have the legal right to use. RGen does not include, download
  or help you obtain any ROM.
- Do not distribute the games you build, the build folder, or ROM files.
- Official website: www.R-Gen.net
- RGen is an independent project. It is not affiliated with, endorsed by
  or sponsored by SEGA. Herzog Zwei is a trademark of its owner (originally
  Technosoft). SEGA, Genesis, Mega Drive, Sonic the Hedgehog, Streets of
  Rage, Golden Axe and Sonic the Hedgehog 2 are trademarks of SEGA
  Corporation. Road Rash is a trademark of Electronic Arts. OutRunners and
  OutRun are trademarks of SEGA. Micro Machines is a trademark of its owner
  (Codemasters / Hasbro). All trademarks
  belong to their respective owners.
- RGen itself is licensed under the PolyForm Noncommercial License 1.0.0
  (LICENSES\RGen-PolyForm-Noncommercial-1.0.0.txt): free for personal and
  other noncommercial use. Do not sell RGen or games built with it.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.


CREDITS / THIRD-PARTY SOFTWARE
------------------------------
RGen runtime and recompiler (m68k-recomp-core), Copyright (c) 2026 Matthew
Stan - PolyForm Noncommercial 1.0.0. Launcher UI (recomp-ui) by Matthew
Stanley - MIT.
Also included, under their own licenses (full texts in LICENSES\, summary in
THIRD-PARTY-NOTICES.txt):
  SDL2 (zlib), ymfm by Aaron Giles (BSD-3-Clause), Dear ImGui (MIT),
  superzazu z80 (MIT), clowncommon (ISC), minicoro (MIT-0/public domain),
  tomlc99 (MIT), stb (MIT/public domain), tinyfiledialogs (zlib),
  Lato and Noto Sans Symbols 2 fonts (SIL OFL 1.1), Noto Color Emoji flag
  images (SIL OFL 1.1), OpenMoji (CC BY-SA 4.0),
  MinGW-w64 runtime and winpthreads (ZPL/MIT-style), GCC 14.2.0 and GNU
  Binutils 2.43.1 (GPLv3, runtime library exception for libgcc), GMP, MPFR,
  MPC, libiconv, libintl (LGPL), ISL (MIT), zlib, zstd (BSD) - packaged by
  WinLibs (winlibs.com, Brecht Sanders).

Compiler source code: the bundled compiler includes GPL/LGPL software. Its
complete corresponding source code is distributed alongside this release as
RGen-1.0.0-compiler-sources.zip (unchanged for 1.1.0). A written offer for it is in
THIRD-PARTY-NOTICES.txt.
