# retrobone/eacricketwidescreenfix architecture

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

- Interactive diagram: https://gitdiagram.com/retrobone/eacricketwidescreenfix
- Repository: https://github.com/retrobone/eacricketwidescreenfix

## Overview

EA Cricket Widescreen Fix is a runtime DLL patch for Cricket 07 that adapts the game to the selected or detected display resolution. On process attach, the DLL initializes logging and runs its patch initializer, which reads resolution settings, calculates widescreen layout values, then scans and modifies game code for resolution, HUD, interface, and gameplay-overlay fixes. The excerpt shows several patch branches, but omits intervening code, so the graph keeps the initializer as their owner and does not infer unshown calls or sequencing between patch domains.

Main entry points: [`source/Cricket07/dllmain.cpp`](https://github.com/retrobone/eacricketwidescreenfix/blob/main/source/Cricket07/dllmain.cpp) (Patch initializer), [`data/scripts/Cricket07WidescreenFix.ini`](https://github.com/retrobone/eacricketwidescreenfix/blob/main/data/scripts/Cricket07WidescreenFix.ini) (Resolution settings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Runtime setup"]
  node_entry["DLL attach<br/>[dllmain.cpp]"]
  node_init["Patch initializer<br/>[dllmain.cpp]"]
end

subgraph group_display["Display adaptation"]
  node_settings["Resolution settings"]
  node_resolution["Resolution detection<br/>[dllmain.cpp]"]
  node_layout["Aspect calculations<br/>[dllmain.cpp]"]
end

subgraph group_patches["Game patches"]
  node_resolutionpatch["Resolution patches<br/>[dllmain.cpp]"]
  node_hud["HUD hook<br/>[dllmain.cpp]"]
  node_ui["UI positioning hook<br/>[dllmain.cpp]"]
  node_mouse["Mouse limits<br/>[dllmain.cpp]"]
  node_pip["Picture-in-picture<br/>[dllmain.cpp]"]
  node_throwmeter["Throw meter<br/>[dllmain.cpp]"]
  node_video["Video scaling<br/>[dllmain.cpp]"]
  node_overlays["Overlay resolutions<br/>[dllmain.cpp]"]
end

node_game(("Cricket 07 process"))

node_game -->|"loads DLL"| node_entry
node_entry -->|"starts on attach"| node_init
node_init -->|"reads settings"| node_settings
node_init -->|"detects dimensions"| node_resolution
node_resolution -->|"provides dimensions"| node_layout
node_init -->|"patches resolution"| node_resolutionpatch
node_init -->|"installs hook"| node_hud
node_init -->|"installs hook"| node_ui
node_init -->|"patches limits"| node_mouse
node_init -->|"patches positions"| node_pip
node_init -->|"patches position"| node_throwmeter
node_init -->|"patches scaling"| node_video
node_init -->|"patches dimensions"| node_overlays

click node_entry "https://github.com/retrobone/eacricketwidescreenfix/blob/main/source/Cricket07/dllmain.cpp"
click node_init "https://github.com/retrobone/eacricketwidescreenfix/blob/main/source/Cricket07/dllmain.cpp"
click node_settings "https://github.com/retrobone/eacricketwidescreenfix/blob/main/data/scripts/Cricket07WidescreenFix.ini"
click node_resolution "https://github.com/retrobone/eacricketwidescreenfix/blob/main/source/Cricket07/dllmain.cpp"
click node_layout "https://github.com/retrobone/eacricketwidescreenfix/blob/main/source/Cricket07/dllmain.cpp"
click node_resolutionpatch "https://github.com/retrobone/eacricketwidescreenfix/blob/main/source/Cricket07/dllmain.cpp"
click node_hud "https://github.com/retrobone/eacricketwidescreenfix/blob/main/source/Cricket07/dllmain.cpp"
click node_ui "https://github.com/retrobone/eacricketwidescreenfix/blob/main/source/Cricket07/dllmain.cpp"
click node_mouse "https://github.com/retrobone/eacricketwidescreenfix/blob/main/source/Cricket07/dllmain.cpp"
click node_pip "https://github.com/retrobone/eacricketwidescreenfix/blob/main/source/Cricket07/dllmain.cpp"
click node_throwmeter "https://github.com/retrobone/eacricketwidescreenfix/blob/main/source/Cricket07/dllmain.cpp"
click node_video "https://github.com/retrobone/eacricketwidescreenfix/blob/main/source/Cricket07/dllmain.cpp"
click node_overlays "https://github.com/retrobone/eacricketwidescreenfix/blob/main/source/Cricket07/dllmain.cpp"

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_entry,node_init toneBlue
class node_settings,node_resolution,node_layout toneAmber
class node_resolutionpatch,node_hud,node_ui,node_mouse,node_pip,node_throwmeter,node_video,node_overlays toneMint
class node_game toneIndigo
```

## Components

### Runtime setup

- [DLL attach](https://github.com/retrobone/eacricketwidescreenfix/blob/main/source/Cricket07/dllmain.cpp): `source/Cricket07/dllmain.cpp`
- [Patch initializer](https://github.com/retrobone/eacricketwidescreenfix/blob/main/source/Cricket07/dllmain.cpp): `source/Cricket07/dllmain.cpp`

### Display adaptation

- [Resolution settings](https://github.com/retrobone/eacricketwidescreenfix/blob/main/data/scripts/Cricket07WidescreenFix.ini): `data/scripts/Cricket07WidescreenFix.ini`
- [Resolution detection](https://github.com/retrobone/eacricketwidescreenfix/blob/main/source/Cricket07/dllmain.cpp): `source/Cricket07/dllmain.cpp`
- [Aspect calculations](https://github.com/retrobone/eacricketwidescreenfix/blob/main/source/Cricket07/dllmain.cpp): `source/Cricket07/dllmain.cpp`

### Game patches

- [Resolution patches](https://github.com/retrobone/eacricketwidescreenfix/blob/main/source/Cricket07/dllmain.cpp): `source/Cricket07/dllmain.cpp`
- [HUD hook](https://github.com/retrobone/eacricketwidescreenfix/blob/main/source/Cricket07/dllmain.cpp): `source/Cricket07/dllmain.cpp`
- [UI positioning hook](https://github.com/retrobone/eacricketwidescreenfix/blob/main/source/Cricket07/dllmain.cpp): `source/Cricket07/dllmain.cpp`
- [Mouse limits](https://github.com/retrobone/eacricketwidescreenfix/blob/main/source/Cricket07/dllmain.cpp): `source/Cricket07/dllmain.cpp`
- [Picture-in-picture](https://github.com/retrobone/eacricketwidescreenfix/blob/main/source/Cricket07/dllmain.cpp): `source/Cricket07/dllmain.cpp`
- [Throw meter](https://github.com/retrobone/eacricketwidescreenfix/blob/main/source/Cricket07/dllmain.cpp): `source/Cricket07/dllmain.cpp`
- [Video scaling](https://github.com/retrobone/eacricketwidescreenfix/blob/main/source/Cricket07/dllmain.cpp): `source/Cricket07/dllmain.cpp`
- [Overlay resolutions](https://github.com/retrobone/eacricketwidescreenfix/blob/main/source/Cricket07/dllmain.cpp): `source/Cricket07/dllmain.cpp`

### Other components

- **Cricket 07 process**

## Connections

- Cricket 07 process → DLL attach: loads DLL (evidence: `source/Cricket07/dllmain.cpp`)
- DLL attach → Patch initializer: starts on attach (evidence: `source/Cricket07/dllmain.cpp`)
- Patch initializer → Resolution settings: reads settings (evidence: `source/Cricket07/dllmain.cpp`)
- Patch initializer → Resolution detection: detects dimensions (evidence: `source/Cricket07/dllmain.cpp`)
- Resolution detection → Aspect calculations: provides dimensions (evidence: `source/Cricket07/dllmain.cpp`)
- Patch initializer → Resolution patches: patches resolution (evidence: `source/Cricket07/dllmain.cpp`)
- Patch initializer → HUD hook: installs hook (evidence: `source/Cricket07/dllmain.cpp`)
- Patch initializer → UI positioning hook: installs hook (evidence: `source/Cricket07/dllmain.cpp`)
- Patch initializer → Mouse limits: patches limits (evidence: `source/Cricket07/dllmain.cpp`)
- Patch initializer → Picture-in-picture: patches positions (evidence: `source/Cricket07/dllmain.cpp`)
- Patch initializer → Throw meter: patches position (evidence: `source/Cricket07/dllmain.cpp`)
- Patch initializer → Video scaling: patches scaling (evidence: `source/Cricket07/dllmain.cpp`)
- Patch initializer → Overlay resolutions: patches dimensions (evidence: `source/Cricket07/dllmain.cpp`)
