Adding some comments.

This commit is contained in:
Ben Vanik
2015-12-02 17:37:48 -08:00
parent 66cab7b76e
commit 249b952de9
6 changed files with 178 additions and 14 deletions

View File

@@ -43,33 +43,57 @@ class Window;
namespace xe {
// The main type that runs the whole emulator.
// This is responsible for initializing and managing all the various subsystems.
class Emulator {
public:
explicit Emulator(const std::wstring& command_line);
~Emulator();
// Full command line used when launching the process.
const std::wstring& command_line() const { return command_line_; }
// Window used for displaying graphical output.
ui::Window* display_window() const { return display_window_; }
// Guest memory system modelling the RAM (both virtual and physical) of the
// system.
Memory* memory() const { return memory_.get(); }
// Active debugger, which may or may not be attached.
debug::Debugger* debugger() const { return debugger_.get(); }
// Virtualized processor that can execute PPC code.
cpu::Processor* processor() const { return processor_.get(); }
// Audio hardware emulation for decoding and playback.
apu::AudioSystem* audio_system() const { return audio_system_.get(); }
// GPU emulation for command list processing.
gpu::GraphicsSystem* graphics_system() const {
return graphics_system_.get();
}
// Human-interface Device (HID) adapters for controllers.
hid::InputSystem* input_system() const { return input_system_.get(); }
// Kernel function export table used to resolve exports when JITing code.
cpu::ExportResolver* export_resolver() const {
return export_resolver_.get();
}
// File systems mapped to disc images, folders, etc for games and save data.
vfs::VirtualFileSystem* file_system() const { return file_system_.get(); }
// The 'kernel', tracking all kernel objects and other state.
// This is effectively the guest operating system.
kernel::KernelState* kernel_state() const { return kernel_state_.get(); }
// Initializes the emulator and configures all components.
// The given window is used for display and the provided functions are used
// to create subsystems as required.
// Once this function returns a game can be launched using one of the Launch
// functions.
X_STATUS Setup(
ui::Window* display_window,
std::function<std::unique_ptr<apu::AudioSystem>(cpu::Processor*)>
@@ -79,9 +103,19 @@ class Emulator {
std::function<std::vector<std::unique_ptr<hid::InputDriver>>(ui::Window*)>
input_driver_factory);
// Launches a game from the given file path.
// This will attempt to infer the type of the given file (such as an iso, etc)
// using heuristics.
X_STATUS LaunchPath(std::wstring path);
// Launches a game from a .xex file by mounting the containing folder as if it
// was an extracted STFS container.
X_STATUS LaunchXexFile(std::wstring path);
// Launches a game from a disc image file (.iso, etc).
X_STATUS LaunchDiscImage(std::wstring path);
// Launches a game from an STFS container file.
X_STATUS LaunchStfsContainer(std::wstring path);
private: