Massive refactoring of all code + audio skeleton.

This should make it easier to find files and (in the future) split things
up into separate libraries.
It also changes around emulator initialization to make it a little more
difficult to do things out of order and a little more sensible as to when
real init work happens.
Also adding a skeleton audio system/driver and reworking CPU register
access to be more extensible.
This commit is contained in:
Ben Vanik
2013-10-23 20:42:24 -07:00
parent c996a4bbaf
commit b7ffd46319
182 changed files with 3919 additions and 3286 deletions

77
src/xenia/emulator.h Normal file
View File

@@ -0,0 +1,77 @@
/**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2013 Ben Vanik. All rights reserved. *
* Released under the BSD license - see LICENSE in the root for more details. *
******************************************************************************
*/
#ifndef XENIA_EMULATOR_H_
#define XENIA_EMULATOR_H_
#include <xenia/common.h>
#include <xenia/core.h>
#include <xenia/xbox.h>
XEDECLARECLASS1(xe, ExportResolver);
XEDECLARECLASS2(xe, apu, AudioSystem);
XEDECLARECLASS2(xe, cpu, Backend);
XEDECLARECLASS2(xe, cpu, Processor);
XEDECLARECLASS2(xe, dbg, Debugger);
XEDECLARECLASS2(xe, gpu, GraphicsSystem);
XEDECLARECLASS3(xe, kernel, xam, XamModule);
XEDECLARECLASS3(xe, kernel, xboxkrnl, XboxkrnlModule);
XEDECLARECLASS4(xe, kernel, xboxkrnl, fs, FileSystem);
namespace xe {
class Emulator {
public:
Emulator(const xechar_t* command_line);
~Emulator();
const xechar_t* command_line() const { return command_line_; }
xe_memory_ref memory() const { return memory_; }
dbg::Debugger* debugger() const { return debugger_; }
cpu::Processor* processor() const { return processor_; }
apu::AudioSystem* audio_system() const { return audio_system_; }
gpu::GraphicsSystem* graphics_system() const { return graphics_system_; }
ExportResolver* export_resolver() const { return export_resolver_; }
kernel::xboxkrnl::fs::FileSystem* file_system() const { return file_system_; }
X_STATUS Setup();
// TODO(benvanik): raw binary.
X_STATUS LaunchXexFile(const xechar_t* path);
X_STATUS LaunchDiscImage(const xechar_t* path);
private:
xechar_t command_line_[XE_MAX_PATH];
xe_memory_ref memory_;
dbg::Debugger* debugger_;
cpu::Backend* cpu_backend_;
cpu::Processor* processor_;
apu::AudioSystem* audio_system_;
gpu::GraphicsSystem* graphics_system_;
ExportResolver* export_resolver_;
kernel::xboxkrnl::fs::FileSystem* file_system_;
kernel::xboxkrnl::XboxkrnlModule* xboxkrnl_;
kernel::xam::XamModule* xam_;
};
} // namespace xe
#endif // XENIA_EMULATOR_H_