# drbermejor/mgs4ultra120 architecture

> Architecture diagram of the GitHub repository drbermejor/mgs4ultra120, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/drbermejor/mgs4ultra120
- Repository: https://github.com/drbermejor/mgs4ultra120

## Overview

MGS4 Ultra120 is a game-mod plugin and setup/configuration project for ultrawide rendering, native-camera FOV, controller profiles, reticle coordinates, and optional supersampling; it also ships a separate experimental native HUD plugin. The principal runtime flow is the game loading the ASI, which resolves supported executable locations and applies patches. The README documents an optional third-party FPS plugin and independent HUD settings. Some advertised features are represented by their documented subsystem because their implementation was not sampled; edges are limited to shown references or README statements.

Main entry points: [`src/mgs4_ultrawide.cpp`](https://github.com/drbermejor/mgs4ultra120/blob/main/src/mgs4_ultrawide.cpp) (Main ASI), [`src/native_hud/mgs4_native_centered_hud.cpp`](https://github.com/drbermejor/mgs4ultra120/blob/main/src/native_hud/mgs4_native_centered_hud.cpp) (Native HUD ASI), [`src/patch_resolver.h`](https://github.com/drbermejor/mgs4ultra120/blob/main/src/patch_resolver.h) (Patch resolver), [`src/game_profile.h`](https://github.com/drbermejor/mgs4ultra120/blob/main/src/game_profile.h) (Build profile)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_core["Runtime patch"]
  node_ultrawide["Main ASI<br/>[mgs4_ultrawide.cpp]"]
  node_profile["Build profile<br/>[game_profile.h]"]
  node_resolver["Patch resolver<br/>[patch_resolver.h]"]
  node_signatures["Signature scanning"]
  node_windows["Patch signatures<br/>[patch_windows.h]"]
  node_main_config["Main settings<br/>[mgs4_ultrawide.ini]"]
end

subgraph group_render["Rendering fixes"]
  node_camera_policy["Camera route policy"]
  node_projection["Projection math<br/>[projection_math.h]"]
  node_reticle["Reticle patch"]
  node_supersampling["Render scaling"]
end

subgraph group_hud["Native HUD"]
  node_native_hud["Native HUD ASI"]
  node_hud_math["HUD layout math<br/>[native_hud_math.h]"]
  node_hud_signatures["HUD route signatures"]
  node_hud_config["HUD settings"]
end

subgraph group_integration["External components"]
  node_fps_plugin["MGSFPSUnlock"]
  node_loader["Ultimate ASI Loader"]
end

node_player(("Player"))
node_game["MGS4 game"]

node_player -->|"plays"| node_game
node_game -->|"loads plugins"| node_loader
node_loader -->|"loads ASI"| node_ultrawide
node_loader -.->|"loads optional ASI"| node_native_hud
node_ultrawide -->|"checks build"| node_profile
node_ultrawide -->|"resolves patches"| node_resolver
node_resolver -->|"scans signatures"| node_signatures
node_resolver -->|"uses patterns"| node_windows
node_ultrawide -->|"routes camera"| node_camera_policy
node_ultrawide -->|"adjusts projection"| node_projection
node_ultrawide -->|"patches coordinates"| node_reticle
node_ultrawide -->|"computes render size"| node_supersampling
node_ultrawide -->|"reads settings"| node_main_config
node_native_hud -->|"uses layout math"| node_hud_math
node_native_hud -->|"checks UI routes"| node_hud_signatures
node_native_hud -->|"gates build"| node_profile
node_native_hud -->|"resolves hooks"| node_resolver
node_native_hud -->|"reads enable switch"| node_hud_config
node_player -.->|"may install separately"| node_fps_plugin

click node_ultrawide "https://github.com/drbermejor/mgs4ultra120/blob/main/src/mgs4_ultrawide.cpp"
click node_profile "https://github.com/drbermejor/mgs4ultra120/blob/main/src/game_profile.h"
click node_resolver "https://github.com/drbermejor/mgs4ultra120/blob/main/src/patch_resolver.h"
click node_signatures "https://github.com/drbermejor/mgs4ultra120/blob/main/src/signature_resolver.h"
click node_windows "https://github.com/drbermejor/mgs4ultra120/blob/main/src/patch_windows.h"
click node_camera_policy "https://github.com/drbermejor/mgs4ultra120/blob/main/src/camera_route_policy.h"
click node_projection "https://github.com/drbermejor/mgs4ultra120/blob/main/src/projection_math.h"
click node_reticle "https://github.com/drbermejor/mgs4ultra120/blob/main/src/reticle_truncation_patch.h"
click node_supersampling "https://github.com/drbermejor/mgs4ultra120/blob/main/src/supersampling_math.h"
click node_main_config "https://github.com/drbermejor/mgs4ultra120/blob/main/config/mgs4_ultrawide.ini"
click node_native_hud "https://github.com/drbermejor/mgs4ultra120/blob/main/src/native_hud/mgs4_native_centered_hud.cpp"
click node_hud_math "https://github.com/drbermejor/mgs4ultra120/blob/main/src/native_hud/native_hud_math.h"
click node_hud_signatures "https://github.com/drbermejor/mgs4ultra120/blob/main/src/native_hud/native_hud_signatures.h"
click node_hud_config "https://github.com/drbermejor/mgs4ultra120/blob/main/config/mgs4_native_centered_hud.ini"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_ultrawide,node_profile,node_resolver,node_signatures,node_windows,node_main_config toneBlue
class node_camera_policy,node_projection,node_reticle,node_supersampling toneAmber
class node_native_hud,node_hud_math,node_hud_signatures,node_hud_config toneMint
class node_fps_plugin,node_loader toneRose
class node_player,node_game toneIndigo
```

## Components

### Runtime patch

- [Main ASI](https://github.com/drbermejor/mgs4ultra120/blob/main/src/mgs4_ultrawide.cpp): `src/mgs4_ultrawide.cpp`
- [Build profile](https://github.com/drbermejor/mgs4ultra120/blob/main/src/game_profile.h): `src/game_profile.h`
- [Patch resolver](https://github.com/drbermejor/mgs4ultra120/blob/main/src/patch_resolver.h): `src/patch_resolver.h`
- [Signature scanning](https://github.com/drbermejor/mgs4ultra120/blob/main/src/signature_resolver.h): `src/signature_resolver.h`
- [Patch signatures](https://github.com/drbermejor/mgs4ultra120/blob/main/src/patch_windows.h): `src/patch_windows.h`
- [Main settings](https://github.com/drbermejor/mgs4ultra120/blob/main/config/mgs4_ultrawide.ini): `config/mgs4_ultrawide.ini`

### Rendering fixes

- [Camera route policy](https://github.com/drbermejor/mgs4ultra120/blob/main/src/camera_route_policy.h): `src/camera_route_policy.h`
- [Projection math](https://github.com/drbermejor/mgs4ultra120/blob/main/src/projection_math.h): `src/projection_math.h`
- [Reticle patch](https://github.com/drbermejor/mgs4ultra120/blob/main/src/reticle_truncation_patch.h): `src/reticle_truncation_patch.h`
- [Render scaling](https://github.com/drbermejor/mgs4ultra120/blob/main/src/supersampling_math.h): `src/supersampling_math.h`

### Native HUD

- [Native HUD ASI](https://github.com/drbermejor/mgs4ultra120/blob/main/src/native_hud/mgs4_native_centered_hud.cpp): `src/native_hud/mgs4_native_centered_hud.cpp`
- [HUD layout math](https://github.com/drbermejor/mgs4ultra120/blob/main/src/native_hud/native_hud_math.h): `src/native_hud/native_hud_math.h`
- [HUD route signatures](https://github.com/drbermejor/mgs4ultra120/blob/main/src/native_hud/native_hud_signatures.h): `src/native_hud/native_hud_signatures.h`
- [HUD settings](https://github.com/drbermejor/mgs4ultra120/blob/main/config/mgs4_native_centered_hud.ini): `config/mgs4_native_centered_hud.ini`

### External components

- **MGSFPSUnlock**
- **Ultimate ASI Loader**

### Other components

- **Player**
- **MGS4 game**

## Connections

- Player → MGS4 game: plays (evidence: `README.md`)
- MGS4 game → Ultimate ASI Loader: loads plugins (evidence: `README.md`)
- Ultimate ASI Loader → Main ASI: loads ASI (evidence: `README.md`)
- Ultimate ASI Loader → Native HUD ASI: loads optional ASI (evidence: `README.md`)
- Main ASI → Build profile: checks build (evidence: `src/mgs4_ultrawide.cpp`)
- Main ASI → Patch resolver: resolves patches (evidence: `src/mgs4_ultrawide.cpp`)
- Patch resolver → Signature scanning: scans signatures (evidence: `src/patch_resolver.h`)
- Patch resolver → Patch signatures: uses patterns (evidence: `src/patch_resolver.h`)
- Main ASI → Camera route policy: routes camera (evidence: `src/mgs4_ultrawide.cpp`)
- Main ASI → Projection math: adjusts projection (evidence: `src/mgs4_ultrawide.cpp`)
- Main ASI → Reticle patch: patches coordinates (evidence: `src/mgs4_ultrawide.cpp`)
- Main ASI → Render scaling: computes render size (evidence: `src/mgs4_ultrawide.cpp`)
- Main ASI → Main settings: reads settings (evidence: `README.md`)
- Native HUD ASI → HUD layout math: uses layout math (evidence: `src/native_hud/mgs4_native_centered_hud.cpp`)
- Native HUD ASI → HUD route signatures: checks UI routes (evidence: `src/native_hud/mgs4_native_centered_hud.cpp`)
- Native HUD ASI → Build profile: gates build (evidence: `src/native_hud/mgs4_native_centered_hud.cpp`)
- Native HUD ASI → Patch resolver: resolves hooks (evidence: `src/native_hud/mgs4_native_centered_hud.cpp`)
- Native HUD ASI → HUD settings: reads enable switch (evidence: `src/native_hud/mgs4_native_centered_hud.cpp`)
- Player → MGSFPSUnlock: may install separately (evidence: `README.md`)
