# hk21x/007-agentunderfire-recomp architecture

> Architecture diagram of the GitHub repository hk21x/007-agentunderfire-recomp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hk21x/007-agentunderfire-recomp
- Repository: https://github.com/hk21x/007-agentunderfire-recomp

## Overview

This repository implements a native Windows PC port of 007: Agent Under Fire, using statically recompiled Xbox game code with PC-side hooks and features. The player’s broad workflow is to launch the game, enter on-foot or driving play, configure settings through the game menus or the F1 window, and play with PC input and presentation enhancements. The source tree exposes the on-foot, driving, shared-support, and executable-hook areas; README capabilities such as rendering and achievements are included, but their implementation paths are not present here. Edges are limited to visible imports or explicitly documented behavior.

Main entry points: [`src/common/auf.h`](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/common/auf.h) (Shared runtime state), [`src/common/pc_rows.cpp`](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/common/pc_rows.cpp) (Settings rows), [`src/bond/mouse.cpp`](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/bond/mouse.cpp) (On-foot mouse), [`src/driving/mouse.cpp`](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/driving/mouse.cpp) (Driving mouse)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Launch hooks"]
  node_default_hooks["Boot and intro hooks<br/>[hooks.cpp]"]
  node_usa_default_hooks["USA boot hooks<br/>[hooks.cpp]"]
end

subgraph group_foot["On-foot game"]
  node_onfoot_hooks["On-foot hooks<br/>[hooks.cpp]"]
  node_onfoot_cheats["On-foot cheats<br/>[cheats.cpp]"]
  node_onfoot_framerate["On-foot timing<br/>[framerate.cpp]"]
  node_onfoot_mouse["On-foot mouse<br/>[mouse.cpp]"]
  node_onfoot_pointer["On-foot menus<br/>[pointer.cpp]"]
  node_onfoot_view["On-foot view<br/>[view.cpp]"]
  node_settings_en["English settings<br/>[pc_settings.cpp]"]
  node_settings_fr["French settings<br/>[pc_settings.cpp]"]
  node_settings_de["German settings<br/>[pc_settings.cpp]"]
  node_settings_usa["USA settings<br/>[pc_settings.cpp]"]
  node_bond_addresses["On-foot address maps<br/>[addr.h]"]
end

subgraph group_driving["Driving game"]
  node_driving_hooks["Driving hooks<br/>[hooks.cpp]"]
  node_driving_mouse["Driving mouse<br/>[mouse.cpp]"]
  node_driving_pointer["Driving menus<br/>[pointer.cpp]"]
  node_driving_view["Driving view<br/>[view.cpp]"]
  node_driving_addresses["Driving address maps<br/>[addr.h]"]
end

subgraph group_shared["Shared PC features"]
  node_shared_contract["Shared runtime state<br/>[auf.h]"]
  node_settings_rows["Settings rows<br/>[pc_rows.cpp]"]
  node_input_strokes["Input strokes<br/>[strokes.cpp]"]
  node_button_prompts["Button prompts<br/>[buttons.cpp]"]
  node_menu_mouse["Menu mouse<br/>[menu_mouse.cpp]"]
  node_game_info["Game information<br/>[game_info.cpp]"]
  node_achievement_set["Achievement definitions"]
  node_settings_storage["Settings storage"]
end

node_player(("Player"))
node_renderer["Direct3D renderer"]
node_sound_input["Sound and input layer"]

node_player -.->|"launches"| node_default_hooks
node_player -.->|"launches"| node_usa_default_hooks
node_default_hooks -.->|"starts game"| node_onfoot_hooks
node_usa_default_hooks -.->|"starts game"| node_onfoot_hooks
node_onfoot_cheats -->|"uses state"| node_shared_contract
node_onfoot_mouse -->|"uses state"| node_shared_contract
node_settings_en -->|"uses settings API"| node_shared_contract
node_settings_fr -->|"uses settings API"| node_shared_contract
node_settings_de -->|"uses settings API"| node_shared_contract
node_settings_usa -->|"uses settings API"| node_shared_contract
node_driving_hooks -->|"uses state"| node_shared_contract
node_driving_mouse -->|"uses state"| node_shared_contract
node_driving_pointer -->|"uses state"| node_shared_contract
node_driving_view -->|"uses state"| node_shared_contract
node_onfoot_pointer -.->|"uses row API"| node_settings_rows
node_driving_pointer -.->|"uses row API"| node_settings_rows
node_button_prompts -->|"uses shared API"| node_shared_contract
node_input_strokes -->|"provides shapes"| node_button_prompts
node_menu_mouse -->|"uses shared API"| node_shared_contract
node_game_info -->|"uses shared API"| node_shared_contract
node_achievement_set -.->|"declared by API"| node_shared_contract
node_settings_rows -.->|"persists settings"| node_settings_storage
node_onfoot_view -.->|"presents view"| node_renderer
node_driving_view -.->|"presents view"| node_renderer
node_onfoot_mouse -.->|"receives input"| node_sound_input
node_driving_mouse -.->|"receives input"| node_sound_input

click node_default_hooks "https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/game/hooks.cpp"
click node_usa_default_hooks "https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/game_usa/hooks.cpp"
click node_onfoot_hooks "https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/bond/hooks.cpp"
click node_onfoot_cheats "https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/bond/cheats.cpp"
click node_onfoot_framerate "https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/bond/framerate.cpp"
click node_onfoot_mouse "https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/bond/mouse.cpp"
click node_onfoot_pointer "https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/bond/pointer.cpp"
click node_onfoot_view "https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/bond/view.cpp"
click node_settings_en "https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/bond/pc_settings.cpp"
click node_settings_fr "https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/bond_fre/pc_settings.cpp"
click node_settings_de "https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/bond_ger/pc_settings.cpp"
click node_settings_usa "https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/bond_usa/pc_settings.cpp"
click node_bond_addresses "https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/bond/addr.h"
click node_driving_hooks "https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/driving/hooks.cpp"
click node_driving_mouse "https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/driving/mouse.cpp"
click node_driving_pointer "https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/driving/pointer.cpp"
click node_driving_view "https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/driving/view.cpp"
click node_driving_addresses "https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/driving/addr.h"
click node_shared_contract "https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/common/auf.h"
click node_settings_rows "https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/common/pc_rows.cpp"
click node_input_strokes "https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/common/strokes.cpp"
click node_button_prompts "https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/common/buttons.cpp"
click node_menu_mouse "https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/common/menu_mouse.cpp"
click node_game_info "https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/common/game_info.cpp"
click node_achievement_set "https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/common/achievement_set.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_default_hooks,node_usa_default_hooks toneBlue
class node_onfoot_hooks,node_onfoot_cheats,node_onfoot_framerate,node_onfoot_mouse,node_onfoot_pointer,node_onfoot_view,node_settings_en,node_settings_fr,node_settings_de,node_settings_usa,node_bond_addresses toneAmber
class node_driving_hooks,node_driving_mouse,node_driving_pointer,node_driving_view,node_driving_addresses toneMint
class node_shared_contract,node_settings_rows,node_input_strokes,node_button_prompts,node_menu_mouse,node_game_info,node_achievement_set,node_settings_storage toneRose
class node_player,node_renderer,node_sound_input toneIndigo
```

## Components

### Launch hooks

- [Boot and intro hooks](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/game/hooks.cpp): `src/game/hooks.cpp`
- [USA boot hooks](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/game_usa/hooks.cpp): `src/game_usa/hooks.cpp`

### On-foot game

- [On-foot hooks](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/bond/hooks.cpp): `src/bond/hooks.cpp`
- [On-foot cheats](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/bond/cheats.cpp): `src/bond/cheats.cpp`
- [On-foot timing](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/bond/framerate.cpp): `src/bond/framerate.cpp`
- [On-foot mouse](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/bond/mouse.cpp): `src/bond/mouse.cpp`
- [On-foot menus](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/bond/pointer.cpp): `src/bond/pointer.cpp`
- [On-foot view](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/bond/view.cpp): `src/bond/view.cpp`
- [English settings](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/bond/pc_settings.cpp): `src/bond/pc_settings.cpp`
- [French settings](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/bond_fre/pc_settings.cpp): `src/bond_fre/pc_settings.cpp`
- [German settings](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/bond_ger/pc_settings.cpp): `src/bond_ger/pc_settings.cpp`
- [USA settings](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/bond_usa/pc_settings.cpp): `src/bond_usa/pc_settings.cpp`
- [On-foot address maps](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/bond/addr.h): `src/bond/addr.h`

### Driving game

- [Driving hooks](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/driving/hooks.cpp): `src/driving/hooks.cpp`
- [Driving mouse](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/driving/mouse.cpp): `src/driving/mouse.cpp`
- [Driving menus](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/driving/pointer.cpp): `src/driving/pointer.cpp`
- [Driving view](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/driving/view.cpp): `src/driving/view.cpp`
- [Driving address maps](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/driving/addr.h): `src/driving/addr.h`

### Shared PC features

- [Shared runtime state](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/common/auf.h): `src/common/auf.h`
- [Settings rows](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/common/pc_rows.cpp): `src/common/pc_rows.cpp`
- [Input strokes](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/common/strokes.cpp): `src/common/strokes.cpp`
- [Button prompts](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/common/buttons.cpp): `src/common/buttons.cpp`
- [Menu mouse](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/common/menu_mouse.cpp): `src/common/menu_mouse.cpp`
- [Game information](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/common/game_info.cpp): `src/common/game_info.cpp`
- [Achievement definitions](https://github.com/hk21x/007-agentunderfire-recomp/blob/main/src/common/achievement_set.cpp): `src/common/achievement_set.cpp`
- **Settings storage**

### Other components

- **Player**
- **Direct3D renderer**
- **Sound and input layer**

## Connections

- Player → Boot and intro hooks: launches
- Player → USA boot hooks: launches
- Boot and intro hooks → On-foot hooks: starts game
- USA boot hooks → On-foot hooks: starts game
- On-foot cheats → Shared runtime state: uses state (evidence: `src/bond/cheats.cpp`)
- On-foot mouse → Shared runtime state: uses state (evidence: `src/bond/mouse.cpp`)
- English settings → Shared runtime state: uses settings API (evidence: `src/bond/pc_settings.cpp`)
- French settings → Shared runtime state: uses settings API (evidence: `src/bond_fre/pc_settings.cpp`)
- German settings → Shared runtime state: uses settings API (evidence: `src/bond_ger/pc_settings.cpp`)
- USA settings → Shared runtime state: uses settings API (evidence: `src/bond_usa/pc_settings.cpp`)
- Driving hooks → Shared runtime state: uses state (evidence: `src/driving/hooks.cpp`)
- Driving mouse → Shared runtime state: uses state (evidence: `src/driving/mouse.cpp`)
- Driving menus → Shared runtime state: uses state (evidence: `src/driving/pointer.cpp`)
- Driving view → Shared runtime state: uses state (evidence: `src/driving/view.cpp`)
- On-foot menus → Settings rows: uses row API
- Driving menus → Settings rows: uses row API
- Button prompts → Shared runtime state: uses shared API (evidence: `src/common/buttons.cpp`)
- Input strokes → Button prompts: provides shapes (evidence: `src/common/buttons.cpp`)
- Menu mouse → Shared runtime state: uses shared API (evidence: `src/common/menu_mouse.cpp`)
- Game information → Shared runtime state: uses shared API (evidence: `src/common/game_info.cpp`)
- Achievement definitions → Shared runtime state: declared by API
- Settings rows → Settings storage: persists settings
- On-foot view → Direct3D renderer: presents view
- Driving view → Direct3D renderer: presents view
- On-foot mouse → Sound and input layer: receives input
- Driving mouse → Sound and input layer: receives input
