Jump to content

Tutorial for creating widescreen fixes


Recommended Posts

So, I've noticed nobody talks about modding old games here, so I'll break the tradition. Many people know old games have many issues running on newer monitors with aspect ratios different from what they used to be designed for, like 4:3 and 5:4, including no support for any kind of widescreen or wider resolutions, or when they do, they have a fixed field of view or it gets reduced with a wider resolution. Many old engines have the option to set a widescreen resolution, but just don't expose it to the user through the in-game settings, so editing through the Registry or external .ini/.cfg/.xml or other similar kind of files might be needed.

Usually when it's not possible to edit settings through external files or through Registry, it's needed to edit the executables themselves or other files around it directly (usually it can be DLLs, but not only), by using softwares that can edit the code in those files in hexadecimal form, like the so-called hexadecimal editors, or hex editors for short, or even using memory scanners/debuggers like Cheat Engine.

Why widescreen fixes matter
Many beloved PC games from the 1990s and early 2000s were designed for 4:3 or 5:4 monitors. On modern widescreen displays (16:9, 21:9, even ultrawide), they either stretch, letterbox, or simply refuse to launch at anything beyond their legacy resolutions. By applying a few straightforward tweaks - editing config files or hex‑patching executables - you can unlock native widescreen support, restore proper field of view (FOV), and keep the originals looking their best.

1. Check for built‑in widescreen support

Before diving into hex editing, see if the game already supports custom resolutions:

1. In‑game settings: Browse graphics or display options.

2. Config file entries: Look for resolution, width or height in .ini, .cfg or .xml files in the game folder or the Documents folder (either user one or public one).

3. Registry keys: Search under HKEY_CURRENT_USER\SOFTWARE\<GameName> or HKEY_LOCAL_MACHINE\SOFTWARE\<GameName>, or even look for the publisher or developer names as well.

2. Editing external config files

When settings aren’t exposed in menus, try this first:

  1. Locate the file: Common names include settings.ini, user.cfg, or graphics.xml.

  2. Open in a text editor: Notepad++ or VS Code are ideal.

  3. Modify resolution lines:

    width = 1920
    height = 1080
  4. Save and test: Launch the game and verify. If it crashes or reverts, restore your backup and proceed to the next step.

Tip: Always make a copy of the original file before editing.

3. Hex‑patching the executable

If no external file can be changed, you must patch the game binary:

  1. Backup the EXE/DLL: Copy game.exe (or relevant DLLs) to a safe folder.

  2. Open in a hex editor: HxD (free) or 010 Editor (paid) work well.

  3. Search for known resolution values:

    • 640x480 = 80 02 00 00 & E0 01 00 00 (little‑endian)

    • 800x600 = 20 03 00 00 & 58 02 00 00

  4. Replace with your resolution: For 1920x1080 use 80 07 00 00 and 38 04 00 00.

  5. Save and test: Run the game; if it fails, revert to the backup.

Warning: Hex patching can permanently corrupt executables, so always work on copies.

4. Adjusting aspect ratio and field of view

Even when resolution changes, the FOV may stay locked:

  • Aspect ratio values: Some engines store a float (e.g. 1.3333 for 4:3). Look for 3F AA AA AB (IEEE‑754 for ~1.33) and replace with 3F 99 99 9A (~1.777 for 16:9). The value might be from the division of width by height or even the inverse, height / width.

  • FOV multipliers: Search for common degree values (60° = 3C 70 00 00, in radians or as a multiplier). Increase by the ratio of new AR to old. Usually, the field of view is defined in the main executable or a DLL, most times close to where the far and near clip planes are calculated, see here for some documentation about clipping planes.

  • DLL hooks: Enthusiast patches (e.g. Widescreen Fixer on GitHub) automate this by injecting a DLL at runtime.

5. Using memory scanners/debuggers & editing assembly

When config file or simple hex patches aren’t enough, you can dive deeper with memory scanners (e.g. Cheat Engine) and debuggers/disassemblers (e.g. x64dbg, IDA Pro). This lets you locate values in RAM at runtime, inject code, or permanently patch the game’s machine code.

5.1 Memory Scanning with Cheat Engine

  1. Launch & attach

    • Start the game and open Cheat Engine.

    • Click the computer icon and select the game’s process.

  2. Finding values in RAM

    • Exact Scan: If the game’s running at 800x600, scan for the integer 600 (4‑byte).

    • Filtered Scan: After changing resolution in‑game to 1024x768, scan again for 768 - this narrows down candidate addresses.

    • Pointer Scan: Once you’ve isolated the runtime address, use “Pointer scan for this address” to locate the static pointer chain. This lets you reapply your patch each launch without rescanning.

  3. Freezing or modifying values

    • Double‑click the found address to add it to your table.

    • Change its value to 1080 (for 1920x1080) or check “Active” to freeze it.

Tip: Values can be stored as floats (e.g. FOV multiplier) or doubles—try scanning “Unknown initial value” and change the in‑game setting to filter.

5.2 Patching assembly in memory

Instead of just editing data, you can hook the code that reads or writes to it:

  1. Find the instruction

    • Right‑click your found address in CE → “Find out what accesses this address.”

    • CE will break into the debugger showing the instruction(s) (for example, mov [eax+0x10], ecx).

  2. Code injection

    • Use “Auto Assemble” in CE to inject a small script that overrides the value or skips a clamp routine.

    • Example of a CE script to bypass a clamp at address 0x00401000:

      [ENABLE]
      aobscanmodule(CLAMP, GameX.exe, 89 91 10 00 00 00)
      alloc(newmem,2048,GameX.exe+401000)
      
      label(returnhere)
      
      newmem:
      mov [ecx+0x10], dword ptr [esi] // set custom width
      jmp returnhere
      
      GameX.exe+401000:
      jmp newmem
      
      returnhere:
      [DISABLE]
      CLAMP:
      db 89 91 10 00 00 00
      dealloc(newmem)
    • Saving this script in CE lets you enable it each play session.

5.3 Permanent assembly patching in EXEs/DLLs

To avoid running scripts every time, you can patch the binary or DLL directly:

  1. Disassemble the module

    • Load game.exe (or the relevant DLL) into IDA Free, Ghidra, or x64dbg.

    • Identify the routine that handles resolution, aspect‑ratio clamping, or FOV calculation.

  2. Understand the Machine Code

    • Little‑Endian: Multi‑byte immediates appear reversed in hexadecimal.

    • Instruction Length: You cannot overwrite an instruction with a longer one without shifting downstream code; you may need to fill with NOPs (0x90) or use a jump instruction to a codecave that the game doesn't make use of.

  3. Apply the Patch

    • Example: original bytes at 0x00401000:

      0F 8C 1A 02 00 00 jl 0x40121C ; clamp if width < min
    • To skip the clamp, change 0F 8C (JL - jump if larger) to 90 90 (NOP NOP), NOP means no operation, so the CPU won't execute anything and will continue execution after those:

      90 90 1A 02 00 00
    • Save the patched binary or DLL and test.

Warnings:

  • Backups are mandatory. Keep copies of every original module.

  • Checksums & signatures: Some games verify executable integrity, patching may trigger anti‑tamper or anti‑cheat and cause crashes or bans.

  • Packers/compressors: If an EXE is packed (UPX, Themida), unpack it first or your patch may never be reached at runtime.

5.4 Best practices & cautions

  • Always work on copies. Never patch a live install.

  • Document your changes. Keep a changelog of offsets, original bytes, and replacements.

  • Watch for side effects. Skipping a clamp may break UI layout or cause rendering issues.

  • Legal considerations. Patching code for personal use is generally tolerated, but distribution of modified executables can violate EULAs.

  • Community resources. Search forums (e.g. XeNTaX, PCGamingWiki) to see if others have already mapped the same functions.

EDITING FILES

So to start editing files, a hex editor like it was mentioned above is needed. Usually HxD is a good choice, it's not too hard to learn and has all that's needed for a hex editor.

1. First open the file you want to edit on it either by dragging the file onto the HxD window, or press Ctrl+O and open it from there.

2. Then, when the file is opened, it's time to search for values. First press Ctrl+F, this window will appear, if wanting to find a hexadecimal number, change the datatype to "Hex-values", for integer numbers it's "Integer number" and for floating point numbers like those shown in the "Aspect Ratio" section, change it to "Floating point number".

image.png.e5b755e5bf780d08014d0dbb48fc9538.png

image.png.b8162acd643b78de630d7069e2ec785f.png

image.png.3a461e28e4aaa44d60943629de5615a2.png

image.png.9f636dfc1d259bde57a14cc7b0644e3c.png

3. Let's take this example for Lego Racers 2. The game only supports the following resolutions by default: 640x480, 800x600 and 1024x768.

image.thumb.png.ec86f624be44664cf1e523f263de3984.png

1363842399_LEGORacers22024-06-0321-39-02-360.thumb.png.58cf98ed4ba7b295ccdbfeabe8d6f358.png

1264421491_LEGORacers22024-06-0321-39-05-240.thumb.png.a540d668c49bf478bed1fa16965af3bf.png

5. To find the right resolution, it's needed to find both width and height values that are close enough to eachother in a file. For that, this program made by myself can be used to determine that: https://github.com/alphayellow1/AlphaYellowWidescreenFixes/releases/tag/utilities

6. Put the downloaded executable in the same folder where the game exe is, run it, put the executable name, write one of the resolutions the game supports, set the byte search range to 15 and type Enter.

image.thumb.png.ac0b1b73c6c6ccc6534392085216ce78.png

image.thumb.png.e26cfbd3614c8c9abda544641e9097d4.png

image.thumb.png.67e7ce78c084a6c113416c52860ebf9a.png

image.thumb.png.e512508b9d23cee829fb91fd840785ac.png

7. Since the 800x600 resolution has the least amount of close enough pairs in the executable (just 1), we'll go with it.

8. Go back to HxD, press Ctrl+G and search for the address that was found for the width: 0002A912 (just for info, each pair of numbers or letters represents 1 byte, so the highlighted value below is 2 bytes long).

9. image.thumb.png.44bd8be12b4ff14efc87664947117ad4.png

9. Highlight it, then go to the right side of the window in the "Data inspector" tab, and go to the row where it says Int16.

image.thumb.png.5c796bab8251c10a6d87290b25559480.png

10. Change it to the desired width, and type Enter.

11. Do the same for the height, highlight the value in the right address you found in the program above and change the value in the Int16 row at the right side. Save the file.

12. Now inside the game, we can see the new resolution that was changed earlier above now appears in the graphics settings, but if it doesn't appear, just set it to the one you changed before (so change it to 800x600 and the resolution in-game will change to the one you set in the file).

 414992054_LEGORacers22024-06-0402-12-46-594.thumb.png.c634ba8ab607bf17d0fb75e3ba6caedd.png

13. Now during gameplay we can check the proportions look correct but the camera view looks cropped in relation to 4:3, which means the field of view is reduced with wider resolutions, this scaling behavior is called Vert-, because the vertical field of view is reduced to accomodate the new aspect ratio. This means we have to increase it.

image.thumb.png.be1cae2b78e6642dea3fe47e773585cd.png

image.thumb.png.b955ed16d4837b6dddaeba55e2d4dc53.png

14. For the field of view, it was found the game stores FOV values as degrees, and after some experimentation, it's found the value is 90º. Note that in some games, they might store FOV for different areas of the game in more than one place, it might be either the same value as normal gameplay one, or might be a different FOV value altogether, like using one FOV for menus and another FOV for gameplay, or even different FOVs for each mission. For first-person games, they might store a  FOV value for the camera and another one different altogether for the weaponmodel. Also cutscenes might have its own FOV assigned to it (either a universal FOV value for cutscenes, or even different FOV values inside the same cutscene, or each type of cutscene having its own FOV), so beware.

15. In HxD, press Ctrl+F, change the tab to "Floating point number" and type 90, change "Search direction" to "All", and click in "Search all". 

image.png.e375438527d50fb8d1a1b744f54c9d3b.png

16. All the found 90 values are listed below:

image.thumb.png.34df20e0a9198c796ffb74b22e01241d.png

15. To edit each value, double click on one of the results below, and then go to the right side, and change the value in the "Single (float32)" row. You can try editing each value to a much higher one like 130, noting in which address the value is before changing it (see the second screenshot below this one), then saving the file, starting the game and going into gameplay, and seeing if the FOV became much higher, then if not, closing the game and coming back to HxD, changing the value back to 90 in the address you noted before, and going to the next value and doing the same process again until the camera FOV changes in-game.

image.thumb.png.7bb9b0747f493497db6c110fd42eb13a.png

image.thumb.png.6e54798e7b6116034c617ada450b0b70.png

16. It won't take long to find out it's the second value responsible for the camera FOV ingame, highlight it and change the value according to WSGF's FOV calculator: https://www.wsgf.org/fovcalc.php . Leave it as it is, and change the "number of monitors across" to 1, and change the resolution to the desired one above (in my case it's 1920x1080).

image.thumb.png.420ecff4e76ac23817871cc6aed60f2b.png

17. Copy the value after where it says "New hFOV =", only copy the number in bold. Also note that if the standard FOV isn't 90º but another number, you can change the number that is after "Old hFOV:" to that one to get the correct FOV for your aspect ratio.

18. After copying the number in step 17, go back to HxD and paste it in the "Single (float32)" row of the second address that was found in the first screenshot of step 15.

19. Now going back in-game, we can see the resolution and field of view were successfully changed and the game is fixed!

image.thumb.png.b955ed16d4837b6dddaeba55e2d4dc53.png

961370585_LEGORacers22024-06-0402-39-06-049.thumb.png.0366f5d0b4b7bff5bba64a1fd4fd5c71.png

ADVANCED EDITING THROUGH MEMORY HACKING

If changing resolution or FOV values in files doesn't change anything in-game, then memory scanning/debugging softwares like Cheat Engine and code disassemblers like OllyDbg and x32dbg are needed. I'll expand on this section later.

Link to comment
Share on other sites

  • Aemony featured and pinned this topic

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Found PCGamingWiki useful? Please consider making a Donation or visiting our Patreon.
  • Who's Online   1 Member, 0 Anonymous, 285 Guests (See full list)

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Forum Statistics

    1.8k
    Total Topics
    9.3k
    Total Posts
×
×
  • Create New...