# openorbis/openorbis-ps4-toolchain architecture

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

- Interactive diagram: https://gitdiagram.com/openorbis/openorbis-ps4-toolchain
- Repository: https://github.com/openorbis/openorbis-ps4-toolchain

## Overview

OpenOrbis is a PS4 homebrew development toolchain: developers use its platform headers and library stubs while compiling and linking applications, then use format utilities and external publishing tools to prepare artifacts. The tree shown is a partial view, so the graph emphasizes documented capabilities and sampled modules rather than implying the compiler, linker, or packaging tools are implemented here. The README documents the overall workflow; sampled source confirms the example stub’s embedded assets and selected utility behavior.

Main entry points: [`src/modules/right/right/lib.c`](https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/src/modules/right/right/lib.c) (Game Right stub), [`include/orbis`](https://github.com/openorbis/openorbis-ps4-toolchain/tree/master/include/orbis) (PS4 API headers), [`include/stb/stb.h`](https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/include/stb/stb.h) (STB utilities), [`include/stb/stb_image.h`](https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/include/stb/stb_image.h) (Image loading)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dev["Developer Interface"]
  node_platform_headers["PS4 API headers"]
  node_graphics_headers["Graphics headers<br/>[egl.h]"]
  node_freetype_headers["FreeType headers<br/>[freetype.h]"]
  node_stb["STB utilities<br/>[stb.h]"]
  node_stb_image["Image loading<br/>[stb_image.h]"]
end

subgraph group_runtime["Runtime Support"]
  node_crt["C runtime startup<br/>[crtlib.c]"]
  node_libc_stub["libc stub<br/>[lib.c]"]
  node_fios_stub["Fios2 stub<br/>[lib.c]"]
  node_right_stub["Game Right stub<br/>[lib.c]"]
  node_right_strings["Stub string asset<br/>[string_data.h]"]
  node_right_logo["Stub logo asset<br/>[logo_data.h]"]
end

subgraph group_utilities["Utilities"]
  node_elf_scripts["ELF inspection scripts<br/>[dynamic_entries.py]"]
  node_fself_script["SELF utility<br/>[make_fself.py]"]
  node_unicode_tool["Unicode table tool<br/>[unicode.c]"]
  node_font_tool["Font asset tool<br/>[easy_font_maker.c]"]
end

subgraph group_examples["Examples"]
  node_self_template["SELF project template<br/>[main.cpp]"]
  node_sprx_template["SPRX project template<br/>[lib.cpp]"]
end

node_developer(("Homebrew developer"))
node_clang_lld["Clang and LLD"]
node_publish_tools["Publishing tools"]
node_ps4_app["PS4 homebrew artifact"]

node_developer -->|"uses APIs"| node_platform_headers
node_developer -->|"uses APIs"| node_graphics_headers
node_developer -->|"uses APIs"| node_freetype_headers
node_developer -.->|"uses utilities"| node_stb
node_developer -->|"starts project"| node_self_template
node_developer -->|"starts project"| node_sprx_template
node_developer -->|"compiles and links"| node_clang_lld
node_platform_headers -->|"supports compilation"| node_clang_lld
node_crt -.->|"supports runtime"| node_ps4_app
node_libc_stub -.->|"provides stub"| node_ps4_app
node_fios_stub -.->|"provides stub"| node_ps4_app
node_right_stub -->|"returns string"| node_right_strings
node_right_stub -->|"returns image"| node_right_logo
node_clang_lld -->|"builds artifact"| node_ps4_app
node_elf_scripts -->|"reports ELF data"| node_developer
node_fself_script -->|"generates SELF"| node_developer
node_ps4_app -->|"packages with"| node_publish_tools
node_stb_image -->|"loads image"| node_font_tool
node_stb -->|"supports generation"| node_unicode_tool

click node_platform_headers "https://github.com/openorbis/openorbis-ps4-toolchain/tree/master/include/orbis"
click node_graphics_headers "https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/include/EGL/egl.h"
click node_freetype_headers "https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/include/freetype/freetype.h"
click node_stb "https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/include/stb/stb.h"
click node_stb_image "https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/include/stb/stb_image.h"
click node_crt "https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/src/crt/crtlib.c"
click node_libc_stub "https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/src/modules/libc/libc/lib.c"
click node_fios_stub "https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/src/modules/libSceFios2/libSceFios2/lib.c"
click node_right_stub "https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/src/modules/right/right/lib.c"
click node_right_strings "https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/src/modules/right/right/string_data.h"
click node_right_logo "https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/src/modules/right/right/logo_data.h"
click node_elf_scripts "https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/scripts/dynamic_entries.py"
click node_fself_script "https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/scripts/make_fself.py"
click node_unicode_tool "https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/include/stb/tools/unicode.c"
click node_font_tool "https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/include/stb/tools/easy_font_maker.c"
click node_self_template "https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/src/templates/PS4%20SELF%20Project/PS4%20SELF%20Project/main.cpp"
click node_sprx_template "https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/src/templates/PS4%20SPRX%20Project/PS4%20SPRX%20Project/lib.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_platform_headers,node_graphics_headers,node_freetype_headers,node_stb,node_stb_image toneBlue
class node_crt,node_libc_stub,node_fios_stub,node_right_stub,node_right_strings,node_right_logo toneAmber
class node_elf_scripts,node_fself_script,node_unicode_tool,node_font_tool toneMint
class node_self_template,node_sprx_template toneRose
class node_developer,node_clang_lld,node_publish_tools,node_ps4_app toneIndigo
```

## Components

### Developer Interface

- [PS4 API headers](https://github.com/openorbis/openorbis-ps4-toolchain/tree/master/include/orbis): `include/orbis`
- [Graphics headers](https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/include/EGL/egl.h): `include/EGL/egl.h`
- [FreeType headers](https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/include/freetype/freetype.h): `include/freetype/freetype.h`
- [STB utilities](https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/include/stb/stb.h): `include/stb/stb.h`
- [Image loading](https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/include/stb/stb_image.h): `include/stb/stb_image.h`

### Runtime Support

- [C runtime startup](https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/src/crt/crtlib.c): `src/crt/crtlib.c`
- [libc stub](https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/src/modules/libc/libc/lib.c): `src/modules/libc/libc/lib.c`
- [Fios2 stub](https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/src/modules/libSceFios2/libSceFios2/lib.c): `src/modules/libSceFios2/libSceFios2/lib.c`
- [Game Right stub](https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/src/modules/right/right/lib.c): `src/modules/right/right/lib.c`
- [Stub string asset](https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/src/modules/right/right/string_data.h): `src/modules/right/right/string_data.h`
- [Stub logo asset](https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/src/modules/right/right/logo_data.h): `src/modules/right/right/logo_data.h`

### Utilities

- [ELF inspection scripts](https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/scripts/dynamic_entries.py): `scripts/dynamic_entries.py`
- [SELF utility](https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/scripts/make_fself.py): `scripts/make_fself.py`
- [Unicode table tool](https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/include/stb/tools/unicode.c): `include/stb/tools/unicode.c`
- [Font asset tool](https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/include/stb/tools/easy_font_maker.c): `include/stb/tools/easy_font_maker.c`

### Examples

- [SELF project template](https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/src/templates/PS4%20SELF%20Project/PS4%20SELF%20Project/main.cpp): `src/templates/PS4 SELF Project/PS4 SELF Project/main.cpp`
- [SPRX project template](https://github.com/openorbis/openorbis-ps4-toolchain/blob/master/src/templates/PS4%20SPRX%20Project/PS4%20SPRX%20Project/lib.cpp): `src/templates/PS4 SPRX Project/PS4 SPRX Project/lib.cpp`

### Other components

- **Homebrew developer**
- **Clang and LLD**
- **Publishing tools**
- **PS4 homebrew artifact**

## Connections

- Homebrew developer → PS4 API headers: uses APIs (evidence: `README.md`)
- Homebrew developer → Graphics headers: uses APIs (evidence: `README.md`)
- Homebrew developer → FreeType headers: uses APIs (evidence: `README.md`)
- Homebrew developer → STB utilities: uses utilities
- Homebrew developer → SELF project template: starts project (evidence: `README.md`)
- Homebrew developer → SPRX project template: starts project (evidence: `README.md`)
- Homebrew developer → Clang and LLD: compiles and links (evidence: `README.md`)
- PS4 API headers → Clang and LLD: supports compilation (evidence: `README.md`)
- C runtime startup → PS4 homebrew artifact: supports runtime
- libc stub → PS4 homebrew artifact: provides stub
- Fios2 stub → PS4 homebrew artifact: provides stub
- Game Right stub → Stub string asset: returns string (evidence: `src/modules/right/right/lib.c`)
- Game Right stub → Stub logo asset: returns image (evidence: `src/modules/right/right/lib.c`)
- Clang and LLD → PS4 homebrew artifact: builds artifact (evidence: `README.md`)
- ELF inspection scripts → Homebrew developer: reports ELF data (evidence: `README.md`)
- SELF utility → Homebrew developer: generates SELF (evidence: `README.md`)
- PS4 homebrew artifact → Publishing tools: packages with (evidence: `README.md`)
- Image loading → Font asset tool: loads image (evidence: `include/stb/tools/easy_font_maker.c`)
- STB utilities → Unicode table tool: supports generation (evidence: `include/stb/tools/unicode.c`)
