-
-
Notifications
You must be signed in to change notification settings - Fork 413
Emulator code structure
This page describes the code inside src/emulator
directory tree.
It's worth noting that each library generally falls into one of two categories:
- A stateless collection of utility functions
- A stateful module corresponding to a subset of Vita functionality
Stateful modules tend to have a public interface divided into data structures (state.h
) and functions (functions.h
). OOP is generally discouraged at the moment but it's not clear whether the current approach is better or just different. Certainly C++-style OOP tends to inflate compile times because naive C++ OOP lacks adequate implementation-hiding mechanisms.
See recommended viewing.
GUI window and graphics rendering backend initiation and management.
Maintains audio-related state and mixes audio.
Multimedia decodification and video/audio player for games.
Used to display compatibility in the emulator.
YAML configuration file management and CLI argument parsing.
CPU emulation. Uses Unicorn and dynarmic internally but that's largely hidden from the rest of the emulator. While the emulator does create real threads to implement SCE threads, the cpu
library is unaware of threads. Each virtual CPU corresponds to a thread and, like threads, virtual CPUs share the same address space.
Defines controller state data structures.
PS Vita OS dialog handling. This folder contains the code necessary to handle the calls from the game to create native PS Vita OS dialogs.
Control state of display.
This is the interface between the emulator application and the HLE module exports. It groups together the other modules, and the resulting overall EmuEnvState
structure is passed as a parameter to every HLE export.
Host setup check for emulation features and optimizations.
GDB integration.
OpenGL utilities, to ease management of OpenGL objects.
UI elements management code. In fact, many functions handled by the GUI are implemented by this part.
Defines GXM module state data structures.
Host operating system abstraction layer.
Headers used for http are included here.
Header files for ime.
Input/Output such as file or TTY access.
Low-level process management tasks like threading.
Management lang and translation.
Memory management. This library handles both allocation and address space management, somewhat conflating the two. Does not currently follow the state/functions paradigm, but probably should.
Utilities required by HLE modules. Bridging deserves some special attention.
An interface library grouping all the HLE modules together into one library so emulator
can depend on them easily.
Within modules
, there is a large collection of HLE module exports. The structure is generated by gen-exports
.
PS Vita motion emulation.
Ground code for SceNet
.
Handles PS Vita ngs
audio API.
Utilities for dealing with NIDs. Contains a header of all NIDs and names, generated by gen-modules
. Should probably be merged with modules
.
Handles PS Vita Np
trophy API.
PS Vita software package handling.
Registory manager.
OpenGL and Vulkan implementations.
Real Time Clock. Time and clock implementation.
Update script for Vita3K.
Hand-written GLSL shaders to which the GXM HLE loads when the game tries to compile a shader. There's a GPU reverse engineering effort underway which could eventually remove the use for hand-written shaders.
Built in shaders for Vita3K such as FXAA and FSR.
Thread management.
PS Vita touchscreen emulation.
Generic utilities. This library has a terrible name and should probably be merged into an existing library or split up and each new library named better.
Vulkan utilities, to ease management of Vulkan objects.