Skip to content

Phoenix Architecture

athairus edited this page Jan 29, 2017 · 4 revisions

DRAFT

Overview

Phoenix is divided into two main components: a frontend and backend. The frontend runs the QML-based UI and manages the game library. The backend draws the QML-based UI and itself contains custom QML components related to emulation: the emulation core, controller input, audio/video output, etc.

Frontend

Builds to an executable. It handles:

  • The QML engine and its underlying JS engine
  • The game scanner GameHasher
  • Everything SQL-related (the user library, settings, etc.)
  • Verifying and launching games
  • "Launching" the backend via PhoenixWindow (See main.qml)

Backend

Builds to either a plugin (shared library) or a static library, depending on project configuration. Its most important components are:

  • GameConsole: The object whose job is to instantiate and pass messages down the pipeline tree. It is only a Node subclass for convenience; it should not be treated as a Node.
  • LibretroCore: A Libretro core encapsulated in a QObject. Due to technical reasons, it itself cannot be a Node. As a result, it has two companion objects that allow it to interact with the pipeline tree: LibretroLoader and LibretroRunner.
  • PhoenixWindow: A QQuickWindow that, behind the scenes, creates a window and renderer to display the frontend's QML scene (it is the root object in the QML code). It also provides to the pipeline tree a dedicated OpenGL context for the core's use and a signal fired each VSync interval to drive emulation while VSync is on. Interfaces with the pipeline tree via PhoenixWindowNode.
  • SDLManager: A Node whose job is to manage controller input. The job of remapping input is partially shared by the SDL library and partially by another Node, Remapper, depending on the type of remapping being done.
  • VideoOutput/AudioOutput: Nodes whose job is to handle audio/video output. Video output from VideoOutput will be composited into the QML scene like any other QML Item, allowing us to seamlessly add whatever effects we want to the outputted video.