# hsgod/ps5-fpsunlocker-gta6 architecture

> Architecture diagram of the GitHub repository hsgod/ps5-fpsunlocker-gta6, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/hsgod/ps5-fpsunlocker-gta6
- Repository: https://github.com/hsgod/ps5-fpsunlocker-gta6

## Overview

This is a PS5 runtime payload that waits for supported GTA VI processes, verifies the game build in memory, and applies configurable FPS, delta-time, resolution, and optional ray-tracing changes. The principal workflow is payload launch → settings and process monitoring → process/build verification → memory patches and readback. The main source excerpt is partial; the README documents additional runtime capabilities. The memory writer is shown in detail, including its DMAP page-table path and older-firmware fallback.

Main entry points: [`src/gtavi-unlockfps.c`](https://github.com/hsgod/ps5-fpsunlocker-gta6/blob/main/src/gtavi-unlockfps.c) (Patch session), [`src/ptwalk.c`](https://github.com/hsgod/ps5-fpsunlocker-gta6/blob/main/src/ptwalk.c) (DMAP page writer), [`src/ptwalk.h`](https://github.com/hsgod/ps5-fpsunlocker-gta6/blob/main/src/ptwalk.h) (DMAP write interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime orchestration"]
  node_controller["Payload controller<br/>[gtavi-unlockfps.c]"]
  node_settings["Settings loader<br/>[gtavi-unlockfps.c]"]
  node_process_watch["Process watcher<br/>[gtavi-unlockfps.c]"]
  node_identity_check["Build verification<br/>[gtavi-unlockfps.c]"]
  node_status["Notifications and logs<br/>[gtavi-unlockfps.c]"]
end

subgraph group_patches["Game modifications"]
  node_patch_session["Patch session<br/>[gtavi-unlockfps.c]"]
  node_fps_time["FPS and delta time<br/>[gtavi-unlockfps.c]"]
  node_resolution["Render resolution<br/>[gtavi-unlockfps.c]"]
  node_rt_reflections["RT reflections toggle<br/>[gtavi-unlockfps.c]"]
end

subgraph group_memory["Memory access"]
  node_process_memory["Process memory access<br/>[gtavi-unlockfps.c]"]
  node_dmap_writer["DMAP page writer<br/>[ptwalk.c]"]
  node_ptwalk_api["DMAP write interface<br/>[ptwalk.h]"]
end

node_payload_manager(("Payload Manager"))
node_game_process["GTAVI process"]

node_payload_manager -->|"loads payload"| node_controller
node_controller -->|"loads settings"| node_settings
node_controller -->|"waits for game"| node_process_watch
node_process_watch -->|"detects process"| node_game_process
node_controller -->|"runs session"| node_patch_session
node_patch_session -->|"verifies build"| node_identity_check
node_patch_session -->|"applies patches"| node_fps_time
node_patch_session -->|"applies scale"| node_resolution
node_patch_session -.->|"optionally patches"| node_rt_reflections
node_patch_session -->|"reads and writes"| node_process_memory
node_process_memory -->|"calls writer"| node_ptwalk_api
node_ptwalk_api -->|"declares interface"| node_dmap_writer
node_process_memory -->|"accesses memory"| node_game_process
node_dmap_writer -->|"writes pages"| node_game_process
node_controller -->|"reports status"| node_status

click node_controller "https://github.com/hsgod/ps5-fpsunlocker-gta6/blob/main/src/gtavi-unlockfps.c"
click node_settings "https://github.com/hsgod/ps5-fpsunlocker-gta6/blob/main/src/gtavi-unlockfps.c"
click node_process_watch "https://github.com/hsgod/ps5-fpsunlocker-gta6/blob/main/src/gtavi-unlockfps.c"
click node_identity_check "https://github.com/hsgod/ps5-fpsunlocker-gta6/blob/main/src/gtavi-unlockfps.c"
click node_status "https://github.com/hsgod/ps5-fpsunlocker-gta6/blob/main/src/gtavi-unlockfps.c"
click node_patch_session "https://github.com/hsgod/ps5-fpsunlocker-gta6/blob/main/src/gtavi-unlockfps.c"
click node_fps_time "https://github.com/hsgod/ps5-fpsunlocker-gta6/blob/main/src/gtavi-unlockfps.c"
click node_resolution "https://github.com/hsgod/ps5-fpsunlocker-gta6/blob/main/src/gtavi-unlockfps.c"
click node_rt_reflections "https://github.com/hsgod/ps5-fpsunlocker-gta6/blob/main/src/gtavi-unlockfps.c"
click node_process_memory "https://github.com/hsgod/ps5-fpsunlocker-gta6/blob/main/src/gtavi-unlockfps.c"
click node_dmap_writer "https://github.com/hsgod/ps5-fpsunlocker-gta6/blob/main/src/ptwalk.c"
click node_ptwalk_api "https://github.com/hsgod/ps5-fpsunlocker-gta6/blob/main/src/ptwalk.h"

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_controller,node_settings,node_process_watch,node_identity_check,node_status toneBlue
class node_patch_session,node_fps_time,node_resolution,node_rt_reflections toneAmber
class node_process_memory,node_dmap_writer,node_ptwalk_api toneMint
class node_payload_manager,node_game_process toneIndigo
```

## Components

### Runtime orchestration

- [Payload controller](https://github.com/hsgod/ps5-fpsunlocker-gta6/blob/main/src/gtavi-unlockfps.c): `src/gtavi-unlockfps.c`
- [Settings loader](https://github.com/hsgod/ps5-fpsunlocker-gta6/blob/main/src/gtavi-unlockfps.c): `src/gtavi-unlockfps.c`
- [Process watcher](https://github.com/hsgod/ps5-fpsunlocker-gta6/blob/main/src/gtavi-unlockfps.c): `src/gtavi-unlockfps.c`
- [Build verification](https://github.com/hsgod/ps5-fpsunlocker-gta6/blob/main/src/gtavi-unlockfps.c): `src/gtavi-unlockfps.c`
- [Notifications and logs](https://github.com/hsgod/ps5-fpsunlocker-gta6/blob/main/src/gtavi-unlockfps.c): `src/gtavi-unlockfps.c`

### Game modifications

- [Patch session](https://github.com/hsgod/ps5-fpsunlocker-gta6/blob/main/src/gtavi-unlockfps.c): `src/gtavi-unlockfps.c`
- [FPS and delta time](https://github.com/hsgod/ps5-fpsunlocker-gta6/blob/main/src/gtavi-unlockfps.c): `src/gtavi-unlockfps.c`
- [Render resolution](https://github.com/hsgod/ps5-fpsunlocker-gta6/blob/main/src/gtavi-unlockfps.c): `src/gtavi-unlockfps.c`
- [RT reflections toggle](https://github.com/hsgod/ps5-fpsunlocker-gta6/blob/main/src/gtavi-unlockfps.c): `src/gtavi-unlockfps.c`

### Memory access

- [Process memory access](https://github.com/hsgod/ps5-fpsunlocker-gta6/blob/main/src/gtavi-unlockfps.c): `src/gtavi-unlockfps.c`
- [DMAP page writer](https://github.com/hsgod/ps5-fpsunlocker-gta6/blob/main/src/ptwalk.c): `src/ptwalk.c`
- [DMAP write interface](https://github.com/hsgod/ps5-fpsunlocker-gta6/blob/main/src/ptwalk.h): `src/ptwalk.h`

### Other components

- **Payload Manager**
- **GTAVI process**

## Connections

- Payload Manager → Payload controller: loads payload (evidence: `README.md`)
- Payload controller → Settings loader: loads settings (evidence: `src/gtavi-unlockfps.c`)
- Payload controller → Process watcher: waits for game (evidence: `README.md`)
- Process watcher → GTAVI process: detects process (evidence: `README.md`)
- Payload controller → Patch session: runs session (evidence: `src/gtavi-unlockfps.c`)
- Patch session → Build verification: verifies build (evidence: `README.md`)
- Patch session → FPS and delta time: applies patches (evidence: `README.md`)
- Patch session → Render resolution: applies scale (evidence: `README.md`)
- Patch session → RT reflections toggle: optionally patches (evidence: `README.md`)
- Patch session → Process memory access: reads and writes (evidence: `src/gtavi-unlockfps.c`)
- Process memory access → DMAP write interface: calls writer (evidence: `src/gtavi-unlockfps.c`)
- DMAP write interface → DMAP page writer: declares interface (evidence: `src/ptwalk.h`)
- Process memory access → GTAVI process: accesses memory (evidence: `README.md`)
- DMAP page writer → GTAVI process: writes pages (evidence: `README.md`)
- Payload controller → Notifications and logs: reports status (evidence: `src/gtavi-unlockfps.c`)
