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

View File

@@ -1,31 +1,31 @@
/**
******************************************************************************
* 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_GPU_D3D11_D3D11_PRIVATE_H_
#define XENIA_GPU_D3D11_D3D11_PRIVATE_H_
#include <xenia/core.h>
#include <xenia/gpu/d3d11/d3d11.h>
namespace xe {
namespace gpu {
namespace d3d11 {
} // namespace d3d11
} // namespace gpu
} // namespace xe
#endif // XENIA_GPU_D3D11_D3D11_PRIVATE_H_
/**
******************************************************************************
* 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_GPU_D3D11_D3D11_GPU_PRIVATE_H_
#define XENIA_GPU_D3D11_D3D11_GPU_PRIVATE_H_
#include <xenia/core.h>
#include <xenia/gpu/d3d11/d3d11_gpu.h>
namespace xe {
namespace gpu {
namespace d3d11 {
} // namespace d3d11
} // namespace gpu
} // namespace xe
#endif // XENIA_GPU_D3D11_D3D11_GPU_PRIVATE_H_

View File

@@ -1,44 +1,44 @@
/**
******************************************************************************
* 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. *
******************************************************************************
*/
#include <xenia/gpu/d3d11/d3d11.h>
#include <xenia/gpu/d3d11/d3d11_graphics_system.h>
using namespace xe;
using namespace xe::gpu;
using namespace xe::gpu::d3d11;
namespace {
void InitializeIfNeeded();
void CleanupOnShutdown();
void InitializeIfNeeded() {
static bool has_initialized = false;
if (has_initialized) {
return;
}
has_initialized = true;
//
atexit(CleanupOnShutdown);
}
void CleanupOnShutdown() {
}
}
GraphicsSystem* xe::gpu::d3d11::Create(const CreationParams* params) {
InitializeIfNeeded();
return new D3D11GraphicsSystem(params);
}
/**
******************************************************************************
* 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. *
******************************************************************************
*/
#include <xenia/gpu/d3d11/d3d11_gpu.h>
#include <xenia/gpu/d3d11/d3d11_graphics_system.h>
using namespace xe;
using namespace xe::gpu;
using namespace xe::gpu::d3d11;
namespace {
void InitializeIfNeeded();
void CleanupOnShutdown();
void InitializeIfNeeded() {
static bool has_initialized = false;
if (has_initialized) {
return;
}
has_initialized = true;
//
atexit(CleanupOnShutdown);
}
void CleanupOnShutdown() {
}
}
GraphicsSystem* xe::gpu::d3d11::Create(Emulator* emulator) {
InitializeIfNeeded();
return new D3D11GraphicsSystem(emulator);
}

View File

@@ -1,33 +1,33 @@
/**
******************************************************************************
* 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_GPU_D3D11_D3D11_H_
#define XENIA_GPU_D3D11_D3D11_H_
#include <xenia/core.h>
namespace xe {
namespace gpu {
class CreationParams;
class GraphicsSystem;
namespace d3d11 {
GraphicsSystem* Create(const CreationParams* params);
} // namespace d3d11
} // namespace gpu
} // namespace xe
#endif // XENIA_GPU_D3D11_D3D11_H_
/**
******************************************************************************
* 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_GPU_D3D11_D3D11_GPU_H_
#define XENIA_GPU_D3D11_D3D11_GPU_H_
#include <xenia/core.h>
XEDECLARECLASS1(xe, Emulator);
XEDECLARECLASS2(xe, gpu, GraphicsSystem);
namespace xe {
namespace gpu {
namespace d3d11 {
GraphicsSystem* Create(Emulator* emulator);
} // namespace d3d11
} // namespace gpu
} // namespace xe
#endif // XENIA_GPU_D3D11_D3D11_GPU_H_

View File

@@ -13,7 +13,7 @@
#include <xenia/core.h>
#include <xenia/gpu/graphics_driver.h>
#include <xenia/gpu/d3d11/d3d11-private.h>
#include <xenia/gpu/d3d11/d3d11_gpu-private.h>
#include <xenia/gpu/xenos/xenos.h>
#include <d3d11.h>

View File

@@ -21,7 +21,8 @@ using namespace xe::gpu::d3d11;
namespace {
void __stdcall D3D11GraphicsSystemVsyncCallback(D3D11GraphicsSystem* gs, BOOLEAN) {
void __stdcall D3D11GraphicsSystemVsyncCallback(
D3D11GraphicsSystem* gs, BOOLEAN) {
gs->MarkVblank();
gs->DispatchInterruptCallback(0);
}
@@ -29,10 +30,10 @@ void __stdcall D3D11GraphicsSystemVsyncCallback(D3D11GraphicsSystem* gs, BOOLEAN
}
D3D11GraphicsSystem::D3D11GraphicsSystem(const CreationParams* params) :
D3D11GraphicsSystem::D3D11GraphicsSystem(Emulator* emulator) :
window_(0), dxgi_factory_(0), device_(0),
timer_queue_(NULL), vsync_timer_(NULL),
GraphicsSystem(params) {
GraphicsSystem(emulator) {
}
D3D11GraphicsSystem::~D3D11GraphicsSystem() {
@@ -78,7 +79,7 @@ void D3D11GraphicsSystem::Initialize() {
}
// Just go with the default for now.
adapter = 0;
D3D_DRIVER_TYPE driver_type =
adapter ? D3D_DRIVER_TYPE_UNKNOWN : D3D_DRIVER_TYPE_HARDWARE;

View File

@@ -13,7 +13,7 @@
#include <xenia/core.h>
#include <xenia/gpu/graphics_system.h>
#include <xenia/gpu/d3d11/d3d11-private.h>
#include <xenia/gpu/d3d11/d3d11_gpu-private.h>
#include <d3d11.h>
@@ -25,12 +25,12 @@ namespace d3d11 {
class D3D11Window;
GraphicsSystem* Create(const CreationParams* params);
GraphicsSystem* Create(Emulator* emulator);
class D3D11GraphicsSystem : public GraphicsSystem {
public:
D3D11GraphicsSystem(const CreationParams* params);
D3D11GraphicsSystem(Emulator* emulator);
virtual ~D3D11GraphicsSystem();
protected:

View File

@@ -1,9 +1,9 @@
# Copyright 2013 Ben Vanik. All Rights Reserved.
{
'sources': [
'd3d11-private.h',
'd3d11.cc',
'd3d11.h',
'd3d11_gpu-private.h',
'd3d11_gpu.cc',
'd3d11_gpu.h',
'd3d11_graphics_driver.cc',
'd3d11_graphics_driver.h',
'd3d11_graphics_system.cc',