# ihaideez/wineps4 architecture

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

- Interactive diagram: https://gitdiagram.com/ihaideez/wineps4
- Repository: https://github.com/ihaideez/wineps4

## Overview

WinePS4 runs Windows programs natively on a jailbroken PS4 using Wine, with a custom desktop and PS4-specific Wine integration. The user starts the app, chooses a program from the desktop, and Wine launches it; the desktop also presents program windows, input, files, audio, and diagnostics. The graph preserves documented networking and Vulkan/DXVK capabilities. Some subsystems are represented by their exact enclosing directories because their implementation was not sampled; relationships without direct evidence are omitted.

Main entry points: [`shell/desktop.cpp`](https://github.com/ihaideez/wineps4/blob/main/shell/desktop.cpp) (Desktop shell), [`port/ps4_main.c`](https://github.com/ihaideez/wineps4/blob/main/port/ps4_main.c) (App entry), [`app`](https://github.com/ihaideez/wineps4/tree/main/app) (Wine runtime), [`port/ps4_spawn_desk.c`](https://github.com/ihaideez/wineps4/blob/main/port/ps4_spawn_desk.c) (Process spawning)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Wine runtime"]
  node_app_entry["App entry<br/>[ps4_main.c]"]
  node_wine_runtime["Wine runtime"]
end

subgraph group_desktop["Desktop experience"]
  node_desktop_shell["Desktop shell<br/>[desktop.cpp]"]
  node_file_manager["Files and editors<br/>[fileops.cpp]"]
  node_input_controls["Input controls<br/>[input.cpp]"]
  node_canvas["Canvas rendering<br/>[ps4_canvas.cpp]"]
  node_window_bridge["Window bridge<br/>[winwindows.cpp]"]
end

subgraph group_platform["PS4 integration"]
  node_process_spawn["Process spawning<br/>[ps4_spawn_desk.c]"]
  node_compat_layer["PS4 compatibility<br/>[ps4_wine_compat.h]"]
  node_networking["Networking<br/>[ps4_net.c]"]
  node_audio_mixer["Audio mixer<br/>[ps4_audio_desk.c]"]
  node_diagnostics["Logs and diagnostics<br/>[ps4_main.c]"]
end

subgraph group_drivers["Wine drivers"]
  node_display_driver["Display driver<br/>[display.c]"]
  node_audio_driver["Audio driver<br/>[audio.c]"]
  node_graphics["DXVK and Vulkan<br/>[vulkan.c]"]
end

node_user(("PS4 user"))

node_user -->|"starts app"| node_app_entry
node_app_entry -->|"runs desktop"| node_desktop_shell
node_app_entry -->|"starts loader"| node_wine_runtime
node_desktop_shell -->|"requests launches"| node_process_spawn
node_wine_runtime -->|"requests processes"| node_process_spawn
node_wine_runtime -->|"uses compatibility"| node_compat_layer
node_desktop_shell -->|"uses file operations"| node_file_manager
node_desktop_shell -->|"handles input"| node_input_controls
node_desktop_shell -->|"draws interface"| node_canvas
node_desktop_shell -->|"shows program windows"| node_window_bridge
node_display_driver -->|"sends window data"| node_desktop_shell
node_audio_driver -->|"sends audio"| node_audio_mixer
node_user -->|"uses network"| node_networking
node_user -->|"runs Direct3D games"| node_graphics
node_user -->|"views diagnostics"| node_diagnostics

click node_app_entry "https://github.com/ihaideez/wineps4/blob/main/port/ps4_main.c"
click node_wine_runtime "https://github.com/ihaideez/wineps4/tree/main/app"
click node_process_spawn "https://github.com/ihaideez/wineps4/blob/main/port/ps4_spawn_desk.c"
click node_compat_layer "https://github.com/ihaideez/wineps4/blob/main/port/include/ps4_wine_compat.h"
click node_networking "https://github.com/ihaideez/wineps4/blob/main/port/ps4_net.c"
click node_desktop_shell "https://github.com/ihaideez/wineps4/blob/main/shell/desktop.cpp"
click node_file_manager "https://github.com/ihaideez/wineps4/blob/main/shell/fileops.cpp"
click node_input_controls "https://github.com/ihaideez/wineps4/blob/main/shell/input.cpp"
click node_canvas "https://github.com/ihaideez/wineps4/blob/main/shell/ps4_canvas.cpp"
click node_window_bridge "https://github.com/ihaideez/wineps4/blob/main/shell/winwindows.cpp"
click node_display_driver "https://github.com/ihaideez/wineps4/blob/main/wine-overlay/dlls/wineps4.drv/display.c"
click node_audio_driver "https://github.com/ihaideez/wineps4/blob/main/wine-overlay/dlls/wineps4.drv/audio.c"
click node_audio_mixer "https://github.com/ihaideez/wineps4/blob/main/port/ps4_audio_desk.c"
click node_graphics "https://github.com/ihaideez/wineps4/blob/main/wine-overlay/dlls/wineps4.drv/vulkan.c"
click node_diagnostics "https://github.com/ihaideez/wineps4/blob/main/port/ps4_main.c"

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_app_entry,node_wine_runtime,node_user toneBlue
class node_desktop_shell,node_file_manager,node_input_controls,node_canvas,node_window_bridge toneAmber
class node_process_spawn,node_compat_layer,node_networking,node_audio_mixer,node_diagnostics toneMint
class node_display_driver,node_audio_driver,node_graphics toneRose
```

## Components

### Wine runtime

- [App entry](https://github.com/ihaideez/wineps4/blob/main/port/ps4_main.c): `port/ps4_main.c`
- [Wine runtime](https://github.com/ihaideez/wineps4/tree/main/app): `app`

### Desktop experience

- [Desktop shell](https://github.com/ihaideez/wineps4/blob/main/shell/desktop.cpp): `shell/desktop.cpp`
- [Files and editors](https://github.com/ihaideez/wineps4/blob/main/shell/fileops.cpp): `shell/fileops.cpp`
- [Input controls](https://github.com/ihaideez/wineps4/blob/main/shell/input.cpp): `shell/input.cpp`
- [Canvas rendering](https://github.com/ihaideez/wineps4/blob/main/shell/ps4_canvas.cpp): `shell/ps4_canvas.cpp`
- [Window bridge](https://github.com/ihaideez/wineps4/blob/main/shell/winwindows.cpp): `shell/winwindows.cpp`

### PS4 integration

- [Process spawning](https://github.com/ihaideez/wineps4/blob/main/port/ps4_spawn_desk.c): `port/ps4_spawn_desk.c`
- [PS4 compatibility](https://github.com/ihaideez/wineps4/blob/main/port/include/ps4_wine_compat.h): `port/include/ps4_wine_compat.h`
- [Networking](https://github.com/ihaideez/wineps4/blob/main/port/ps4_net.c): `port/ps4_net.c`
- [Audio mixer](https://github.com/ihaideez/wineps4/blob/main/port/ps4_audio_desk.c): `port/ps4_audio_desk.c`
- [Logs and diagnostics](https://github.com/ihaideez/wineps4/blob/main/port/ps4_main.c): `port/ps4_main.c`

### Wine drivers

- [Display driver](https://github.com/ihaideez/wineps4/blob/main/wine-overlay/dlls/wineps4.drv/display.c): `wine-overlay/dlls/wineps4.drv/display.c`
- [Audio driver](https://github.com/ihaideez/wineps4/blob/main/wine-overlay/dlls/wineps4.drv/audio.c): `wine-overlay/dlls/wineps4.drv/audio.c`
- [DXVK and Vulkan](https://github.com/ihaideez/wineps4/blob/main/wine-overlay/dlls/wineps4.drv/vulkan.c): `wine-overlay/dlls/wineps4.drv/vulkan.c`

### Other components

- **PS4 user**

## Connections

- PS4 user → App entry: starts app (evidence: `README.md`)
- App entry → Desktop shell: runs desktop (evidence: `port/ps4_main.c`)
- App entry → Wine runtime: starts loader (evidence: `port/ps4_main.c`)
- Desktop shell → Process spawning: requests launches (evidence: `shell/desktop.cpp`)
- Wine runtime → Process spawning: requests processes (evidence: `port/ps4_spawn_desk.c`)
- Wine runtime → PS4 compatibility: uses compatibility
- Desktop shell → Files and editors: uses file operations (evidence: `shell/desktop.cpp`)
- Desktop shell → Input controls: handles input (evidence: `shell/desktop.cpp`)
- Desktop shell → Canvas rendering: draws interface (evidence: `shell/desktop.cpp`)
- Desktop shell → Window bridge: shows program windows (evidence: `README.md`)
- Display driver → Desktop shell: sends window data
- Audio driver → Audio mixer: sends audio (evidence: `wine-overlay/dlls/wineps4.drv/audio.c`)
- PS4 user → Networking: uses network (evidence: `README.md`)
- PS4 user → DXVK and Vulkan: runs Direct3D games (evidence: `README.md`)
- PS4 user → Logs and diagnostics: views diagnostics (evidence: `README.md`)
