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:
31
src/xenia/apu/nop/nop_apu-private.h
Normal file
31
src/xenia/apu/nop/nop_apu-private.h
Normal file
@@ -0,0 +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_APU_NOP_NOP_APU_PRIVATE_H_
|
||||
#define XENIA_APU_NOP_NOP_APU_PRIVATE_H_
|
||||
|
||||
#include <xenia/core.h>
|
||||
|
||||
#include <xenia/apu/nop/nop_apu.h>
|
||||
|
||||
|
||||
namespace xe {
|
||||
namespace apu {
|
||||
namespace nop {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace nop
|
||||
} // namespace apu
|
||||
} // namespace xe
|
||||
|
||||
|
||||
#endif // XENIA_APU_NOP_NOP_APU_PRIVATE_H_
|
||||
44
src/xenia/apu/nop/nop_apu.cc
Normal file
44
src/xenia/apu/nop/nop_apu.cc
Normal file
@@ -0,0 +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/apu/nop/nop_apu.h>
|
||||
|
||||
#include <xenia/apu/nop/nop_audio_system.h>
|
||||
|
||||
|
||||
using namespace xe;
|
||||
using namespace xe::apu;
|
||||
using namespace xe::apu::nop;
|
||||
|
||||
|
||||
namespace {
|
||||
void InitializeIfNeeded();
|
||||
void CleanupOnShutdown();
|
||||
|
||||
void InitializeIfNeeded() {
|
||||
static bool has_initialized = false;
|
||||
if (has_initialized) {
|
||||
return;
|
||||
}
|
||||
has_initialized = true;
|
||||
|
||||
//
|
||||
|
||||
atexit(CleanupOnShutdown);
|
||||
}
|
||||
|
||||
void CleanupOnShutdown() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
AudioSystem* xe::apu::nop::Create(Emulator* emulator) {
|
||||
InitializeIfNeeded();
|
||||
return new NopAudioSystem(emulator);
|
||||
}
|
||||
33
src/xenia/apu/nop/nop_apu.h
Normal file
33
src/xenia/apu/nop/nop_apu.h
Normal file
@@ -0,0 +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_NOP_NOP_H_
|
||||
#define XENIA_GPU_NOP_NOP_H_
|
||||
|
||||
#include <xenia/core.h>
|
||||
|
||||
|
||||
XEDECLARECLASS1(xe, Emulator);
|
||||
XEDECLARECLASS2(xe, apu, AudioSystem);
|
||||
|
||||
|
||||
namespace xe {
|
||||
namespace apu {
|
||||
namespace nop {
|
||||
|
||||
|
||||
AudioSystem* Create(Emulator* emulator);
|
||||
|
||||
|
||||
} // namespace nop
|
||||
} // namespace apu
|
||||
} // namespace xe
|
||||
|
||||
|
||||
#endif // XENIA_GPU_NOP_NOP_H_
|
||||
28
src/xenia/apu/nop/nop_audio_driver.cc
Normal file
28
src/xenia/apu/nop/nop_audio_driver.cc
Normal file
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* 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/apu/nop/nop_audio_driver.h>
|
||||
|
||||
#include <xenia/apu/apu-private.h>
|
||||
|
||||
|
||||
using namespace xe;
|
||||
using namespace xe::apu;
|
||||
using namespace xe::apu::nop;
|
||||
|
||||
|
||||
NopAudioDriver::NopAudioDriver(xe_memory_ref memory) :
|
||||
AudioDriver(memory) {
|
||||
}
|
||||
|
||||
NopAudioDriver::~NopAudioDriver() {
|
||||
}
|
||||
|
||||
void NopAudioDriver::Initialize() {
|
||||
}
|
||||
40
src/xenia/apu/nop/nop_audio_driver.h
Normal file
40
src/xenia/apu/nop/nop_audio_driver.h
Normal file
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* 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_APU_NOP_NOP_AUDIO_DRIVER_H_
|
||||
#define XENIA_APU_NOP_NOP_AUDIO_DRIVER_H_
|
||||
|
||||
#include <xenia/core.h>
|
||||
|
||||
#include <xenia/apu/audio_driver.h>
|
||||
#include <xenia/apu/nop/nop_apu-private.h>
|
||||
|
||||
|
||||
namespace xe {
|
||||
namespace apu {
|
||||
namespace nop {
|
||||
|
||||
|
||||
class NopAudioDriver : public AudioDriver {
|
||||
public:
|
||||
NopAudioDriver(xe_memory_ref memory);
|
||||
virtual ~NopAudioDriver();
|
||||
|
||||
virtual void Initialize();
|
||||
|
||||
protected:
|
||||
};
|
||||
|
||||
|
||||
} // namespace nop
|
||||
} // namespace apu
|
||||
} // namespace xe
|
||||
|
||||
|
||||
#endif // XENIA_APU_NOP_NOP_AUDIO_DRIVER_H_
|
||||
40
src/xenia/apu/nop/nop_audio_system.cc
Normal file
40
src/xenia/apu/nop/nop_audio_system.cc
Normal file
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* 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/apu/nop/nop_audio_system.h>
|
||||
|
||||
#include <xenia/apu/apu-private.h>
|
||||
#include <xenia/apu/nop/nop_audio_driver.h>
|
||||
|
||||
|
||||
using namespace xe;
|
||||
using namespace xe::apu;
|
||||
using namespace xe::apu::nop;
|
||||
|
||||
|
||||
NopAudioSystem::NopAudioSystem(Emulator* emulator) :
|
||||
AudioSystem(emulator) {
|
||||
}
|
||||
|
||||
NopAudioSystem::~NopAudioSystem() {
|
||||
}
|
||||
|
||||
void NopAudioSystem::Initialize() {
|
||||
AudioSystem::Initialize();
|
||||
|
||||
XEASSERTNULL(driver_);
|
||||
driver_ = new NopAudioDriver(memory_);
|
||||
}
|
||||
|
||||
void NopAudioSystem::Pump() {
|
||||
}
|
||||
|
||||
void NopAudioSystem::Shutdown() {
|
||||
AudioSystem::Shutdown();
|
||||
}
|
||||
43
src/xenia/apu/nop/nop_audio_system.h
Normal file
43
src/xenia/apu/nop/nop_audio_system.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* 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_APU_NOP_NOP_AUDIO_SYSTEM_H_
|
||||
#define XENIA_APU_NOP_NOP_AUDIO_SYSTEM_H_
|
||||
|
||||
#include <xenia/core.h>
|
||||
|
||||
#include <xenia/apu/audio_system.h>
|
||||
#include <xenia/apu/nop/nop_apu-private.h>
|
||||
|
||||
|
||||
namespace xe {
|
||||
namespace apu {
|
||||
namespace nop {
|
||||
|
||||
|
||||
class NopAudioSystem : public AudioSystem {
|
||||
public:
|
||||
NopAudioSystem(Emulator* emulator);
|
||||
virtual ~NopAudioSystem();
|
||||
|
||||
protected:
|
||||
virtual void Initialize();
|
||||
virtual void Pump();
|
||||
virtual void Shutdown();
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
|
||||
} // namespace nop
|
||||
} // namespace apu
|
||||
} // namespace xe
|
||||
|
||||
|
||||
#endif // XENIA_APU_NOP_NOP_AUDIO_SYSTEM_H_
|
||||
12
src/xenia/apu/nop/sources.gypi
Normal file
12
src/xenia/apu/nop/sources.gypi
Normal file
@@ -0,0 +1,12 @@
|
||||
# Copyright 2013 Ben Vanik. All Rights Reserved.
|
||||
{
|
||||
'sources': [
|
||||
'nop_apu-private.h',
|
||||
'nop_apu.cc',
|
||||
'nop_apu.h',
|
||||
'nop_audio_driver.cc',
|
||||
'nop_audio_driver.h',
|
||||
'nop_audio_system.cc',
|
||||
'nop_audio_system.h',
|
||||
],
|
||||
}
|
||||
Reference in New Issue
Block a user