PreyHFR 1.0.6
===============

PreyHFR is an unofficial 32-bit ASI high-frame-rate fix for the Windows Steam
release of Prey (2006) version 1.4. It lets the game present at modern refresh
rates while keeping gameplay at its original speed.

No original game files are replaced or modified.


WHAT'S NEW IN 1.0.6
-------------------

- Replaces whole-file game SHA-256 activation gates with fail-closed structural
  compatibility validation scoped to the enabled features.
- Accepts a different file identity only when the expected x86 PE layout,
  retail imports/exports, hook ABIs, deprotected engine timing/control flow,
  and referenced data relationships all validate.
- Expands the timing-path signature and verifies the RunGameTic user-command
  call/return relationship before mouse interpolation activates.
- Treats required scheduler-clock and DirectInput hooks as transactional:
  partial installation is rolled back and the plugin remains inert.
- Retains the 1.0.5 renderer effects clock and all prior interpolation,
  async-clock, display, input, and rollback behavior.


QUICK INSTALL - BUNDLE WITH LOADER
----------------------------------

1. Close Prey if it is running.

2. Check the folder containing prey.exe for an existing dinput.dll. Do not
   overwrite one: it may belong to another mod or ASI loader.

3. If no dinput.dll exists, extract every file from the "with-loader" ZIP into
   that folder. It includes the Win32 dinput.dll build of Ultimate ASI Loader
   v9.7.4, its required Prey early-load dinput.ini, and its MIT license.

4. Launch Prey normally through Steam or prey.exe. There is no separate
   PreyHFR launcher.

A typical Steam location is:

    C:\Program Files (x86)\Steam\steamapps\common\Prey


PLUGIN-ONLY INSTALL
-------------------

Use the plugin-only ZIP if the game already has a compatible 32-bit ASI loader.
Copy PreyHFR.asi and PreyHFR.ini beside prey.exe, or into another ASI directory
supported by that loader while keeping both files together.

Ultimate ASI Loader supports ASIs in the game root, scripts, plugins, or update
directories. PreyHFR is loader-agnostic and uses no Ultimate-ASI-Loader-specific
API. If an existing proxy, ReShade, or mod already owns dinput.dll, follow that
project's chaining instructions instead of replacing it.


DEFAULT SETTINGS
----------------

The included PreyHFR.ini automatically:

- detects the primary monitor's current refresh rate;
- uses the primary monitor's desktop resolution;
- starts the game in borderless mode;
- enables camera, weapon, world, animation, effects, and mouse interpolation;
- advances only renderer particle/material time between native tics; and
- keeps the original 62.5 Hz simulation rate so gameplay does not speed up.


CHANGING SETTINGS
-----------------

Open PreyHFR.ini in Notepad. The ASI reads it on each launch. Invalid or unknown
entries leave the patch inactive and are explained in PreyHFR.log.

To use a fixed frame-rate cap instead of the monitor's current refresh rate:

    presentation_fps = 144

To restore automatic refresh-rate detection:

    presentation_fps = desktop

To let V-Sync or another limiter control the frame rate:

    presentation_fps = 0

Avoid using two active frame limiters at the same time.

To use the game's configured display state:

    borderless = false
    mode = game
    resolution = game

To request an explicit exclusive resolution:

    borderless = false
    mode = exclusive
    resolution = 1920x1080

The display.vsync setting accepts game, on, or off and defaults to game.
Variable-refresh engagement is controlled by the display driver; G-SYNC does
not require V-Sync while the presentation rate remains below the refresh
ceiling. Borderless always uses the primary desktop resolution and cannot be
combined with exclusive mode.

The interpolation.effects setting controls presentation-rate renderer particle
and material time. It does not advance gameplay FX, scripts, or simulation.

The compatibility.buffered_two_tic_interpolation setting defaults to false.
Enabling it keeps one completed native simulation tic buffered to tolerate
irregular producer delivery, at the cost of one native tic of positional
presentation latency. The normal lower-latency interpolation path is preferred
now that PreyHFR stabilizes the game's asynchronous tic clock directly.


SUPPORTED GAME VERSION
----------------------

The fully tested Windows Steam 1.4 baseline has these SHA-256 hashes:

prey.exe:
CEA6D424FBB8E2FFBF307A5BEE509B45C2D35242F70BE31387224DB2A0EADD69

base\gamex86.dll:
74D436D376BA144762A28C940D0243135B4F9DB8FDD7EE597B9CB5E4277B43C6

These hashes identify the validation baseline; they are not an activation
allowlist. The plugin instead requires the expected x86 PE32 layout, retail
imports and GetGameAPI export, configured hook locations/prologues, one unique
deprotected engine timing path, and its verified references to writable engine
globals. Runtime object/vtable hooks validate their expected relationships when
the objects appear. A different file identity is accepted only when all paths
needed by the enabled features remain structurally compatible. Missing or
ambiguous prerequisites leave the plugin inert and roll back owned changes.

Layout-compatible variants have not automatically completed the full gameplay
test matrix merely by passing this safety/ABI gate. Layout-changing releases
remain unsupported.


KNOWN LIMITS
------------

- Singleplayer was validated through the historical launcher at 120, 144, 165,
  240, and 360 FPS, including a complete playthrough at 360 FPS. The equivalent
  complete retail matrix must be repeated through the ASI loader.
- Multiplayer, demos, timedemos, overlays, ReShade, other injectors, and
  multi-plugin combinations have not been validated.
- Saving at checkpoints may still cause a one-off frame-time hitch. The
  presentation clock automatically rebases if that hitch leaves it stale.
- Borderless mode uses the primary display at its desktop resolution.


TROUBLESHOOTING
---------------

- Keep PreyHFR.asi and PreyHFR.ini together in a location scanned by the ASI
  loader.
- Check PreyHFR.log beside the ASI after a launch problem.
- If the log is not created, the external ASI loader did not discover the
  plugin; check loader placement and architecture first.
- If another program controls frame pacing, set presentation_fps = 0.
- F10 manually resets only the presentation/interpolation timeline if motion
  remains uneven after a hitch. The key is configurable or disableable in the
  INI and does not alter simulation or save state.

For source code, updates, and issue reports, visit:

https://github.com/slopkhayzo/Prey-2006-FPSFix


UNINSTALLING
------------

Close the game and run uninstall-preyhfr.cmd. It removes only files owned by
PreyHFR. It intentionally does not remove dinput.dll: the external loader is
shared infrastructure and another installed ASI may depend on it. Remove that
loader separately only after checking its other users.


LICENSE
-------

PreyHFR is distributed under the MIT License. See PreyHFR-LICENSE.txt.

The loader-inclusive bundle also contains Ultimate-ASI-Loader-LICENSE.txt,
Ultimate-ASI-Loader-NOTICE.txt, and a checksum record for the pinned binary.
Ultimate ASI Loader is third-party software by ThirteenAG and is not part of
PreyHFR.

Prey is a trademark of its respective owners. This unofficial project is not
affiliated with or endorsed by Bethesda Softworks, ZeniMax Media, Human Head
Studios, or 3D Realms.


Misc
----

For more game fixes, see https://slop-blog.enkhayzomachines.net/fixes
