Removing the last of XEDECLARECLASS.

This commit is contained in:
Ben Vanik 2014-08-20 22:50:10 -07:00
parent 06f5b8cbbf
commit 244e8a8745
15 changed files with 108 additions and 144 deletions

View File

@ -12,14 +12,13 @@
#include <xenia/apu/audio_system.h> #include <xenia/apu/audio_system.h>
namespace xe {
XEDECLARECLASS1(xe, Emulator); class Emulator;
} // namespace xe
namespace xe { namespace xe {
namespace apu { namespace apu {
AudioSystem* Create(Emulator* emulator); AudioSystem* Create(Emulator* emulator);
AudioSystem* CreateNop(Emulator* emulator); AudioSystem* CreateNop(Emulator* emulator);
@ -31,5 +30,4 @@ AudioSystem* CreateXAudio2(Emulator* emulator);
} // namespace apu } // namespace apu
} // namespace xe } // namespace xe
#endif // XENIA_APU_APU_H_ #endif // XENIA_APU_APU_H_

View File

@ -11,18 +11,12 @@
#define XENIA_APU_AUDIO_DRIVER_H_ #define XENIA_APU_AUDIO_DRIVER_H_
#include <xenia/core.h> #include <xenia/core.h>
#include <xenia/emulator.h>
#include <xenia/xbox.h> #include <xenia/xbox.h>
XEDECLARECLASS1(xe, Emulator);
XEDECLARECLASS2(xe, cpu, Processor);
XEDECLARECLASS2(xe, cpu, XenonThreadState);
namespace xe { namespace xe {
namespace apu { namespace apu {
class AudioDriver { class AudioDriver {
public: public:
AudioDriver(Emulator* emulator); AudioDriver(Emulator* emulator);
@ -36,9 +30,7 @@ protected:
cpu::Processor* processor_; cpu::Processor* processor_;
}; };
} // namespace apu } // namespace apu
} // namespace xe } // namespace xe
#endif // XENIA_APU_AUDIO_DRIVER_H_ #endif // XENIA_APU_AUDIO_DRIVER_H_

View File

@ -16,16 +16,13 @@
#include <thread> #include <thread>
#include <xenia/core.h> #include <xenia/core.h>
#include <xenia/emulator.h>
#include <xenia/xbox.h> #include <xenia/xbox.h>
XEDECLARECLASS1(xe, Emulator);
XEDECLARECLASS2(xe, cpu, Processor);
XEDECLARECLASS2(xe, cpu, XenonThreadState);
XEDECLARECLASS2(xe, apu, AudioDriver);
namespace xe { namespace xe {
namespace apu { namespace apu {
class AudioDriver;
class AudioSystem { class AudioSystem {
public: public:
@ -38,11 +35,13 @@ public:
virtual X_STATUS Setup(); virtual X_STATUS Setup();
virtual void Shutdown(); virtual void Shutdown();
X_STATUS RegisterClient(uint32_t callback, uint32_t callback_arg, size_t* out_index); X_STATUS RegisterClient(uint32_t callback, uint32_t callback_arg,
size_t* out_index);
void UnregisterClient(size_t index); void UnregisterClient(size_t index);
void SubmitFrame(size_t index, uint32_t samples_ptr); void SubmitFrame(size_t index, uint32_t samples_ptr);
virtual X_STATUS CreateDriver(size_t index, HANDLE wait_handle, AudioDriver** out_driver) = 0; virtual X_STATUS CreateDriver(size_t index, HANDLE wait_handle,
AudioDriver** out_driver) = 0;
virtual void DestroyDriver(AudioDriver* driver) = 0; virtual void DestroyDriver(AudioDriver* driver) = 0;
virtual uint64_t ReadRegister(uint64_t addr); virtual uint64_t ReadRegister(uint64_t addr);
@ -88,9 +87,7 @@ protected:
std::queue<size_t> unused_clients_; std::queue<size_t> unused_clients_;
}; };
} // namespace apu } // namespace apu
} // namespace xe } // namespace xe
#endif // XENIA_APU_AUDIO_SYSTEM_H_ #endif // XENIA_APU_AUDIO_SYSTEM_H_

View File

@ -12,22 +12,19 @@
#include <xenia/core.h> #include <xenia/core.h>
namespace xe {
XEDECLARECLASS1(xe, Emulator); class Emulator;
XEDECLARECLASS2(xe, apu, AudioSystem); } // namespace xe
namespace xe { namespace xe {
namespace apu { namespace apu {
class AudioSystem;
namespace nop { namespace nop {
AudioSystem* Create(Emulator* emulator); AudioSystem* Create(Emulator* emulator);
} // namespace nop } // namespace nop
} // namespace apu } // namespace apu
} // namespace xe } // namespace xe
#endif // XENIA_APU_NOP_NOP_APU_H_ #endif // XENIA_APU_NOP_NOP_APU_H_

View File

@ -14,21 +14,15 @@
#include <vector> #include <vector>
#include <xenia/core.h> #include <xenia/core.h>
#include <xenia/emulator.h>
XEDECLARECLASS2(alloy, runtime, Breakpoint);
XEDECLARECLASS1(xe, Emulator);
XEDECLARECLASS1(xe, ExportResolver);
XEDECLARECLASS1(xe, Memory);
XEDECLARECLASS2(xe, cpu, XenonMemory);
XEDECLARECLASS2(xe, cpu, XenonRuntime);
XEDECLARECLASS2(xe, cpu, XenonThreadState);
XEDECLARECLASS2(xe, cpu, XexModule);
namespace xe { namespace xe {
namespace cpu { namespace cpu {
class XenonMemory;
class XenonRuntime;
class XenonThreadState;
class XexModule;
enum class Irql : uint32_t { enum class Irql : uint32_t {
PASSIVE = 0, PASSIVE = 0,
@ -37,7 +31,6 @@ enum class Irql : uint32_t {
DPC = 3, DPC = 3,
}; };
class Processor { class Processor {
public: public:
Processor(Emulator* emulator); Processor(Emulator* emulator);
@ -49,17 +42,15 @@ public:
int Setup(); int Setup();
int Execute( int Execute(XenonThreadState* thread_state, uint64_t address);
XenonThreadState* thread_state, uint64_t address); uint64_t Execute(XenonThreadState* thread_state, uint64_t address,
uint64_t Execute( uint64_t args[], size_t arg_count);
XenonThreadState* thread_state, uint64_t address, uint64_t args[],
size_t arg_count);
Irql RaiseIrql(Irql new_value); Irql RaiseIrql(Irql new_value);
void LowerIrql(Irql old_value); void LowerIrql(Irql old_value);
uint64_t ExecuteInterrupt( uint64_t ExecuteInterrupt(uint32_t cpu, uint64_t address, uint64_t args[],
uint32_t cpu, uint64_t address, uint64_t args[], size_t arg_count); size_t arg_count);
private: private:
Emulator* emulator_; Emulator* emulator_;
@ -74,9 +65,7 @@ private:
uint64_t interrupt_thread_block_; uint64_t interrupt_thread_block_;
}; };
} // namespace cpu } // namespace cpu
} // namespace xe } // namespace xe
#endif // XENIA_CPU_PROCESSOR_H_ #endif // XENIA_CPU_PROCESSOR_H_

View File

@ -14,8 +14,7 @@
#include <xenia/core.h> #include <xenia/core.h>
#include <xenia/cpu/xenon_thread_state.h> #include <xenia/cpu/xenon_thread_state.h>
#include <xenia/export_resolver.h>
XEDECLARECLASS1(xe, ExportResolver);
namespace xe { namespace xe {
namespace cpu { namespace cpu {

View File

@ -12,14 +12,13 @@
#include <xenia/gpu/graphics_system.h> #include <xenia/gpu/graphics_system.h>
namespace xe {
XEDECLARECLASS1(xe, Emulator); class Emulator;
} // namespace xe
namespace xe { namespace xe {
namespace gpu { namespace gpu {
GraphicsSystem* Create(Emulator* emulator); GraphicsSystem* Create(Emulator* emulator);
GraphicsSystem* CreateNop(Emulator* emulator); GraphicsSystem* CreateNop(Emulator* emulator);
@ -28,9 +27,7 @@ GraphicsSystem* CreateNop(Emulator* emulator);
GraphicsSystem* CreateD3D11(Emulator* emulator); GraphicsSystem* CreateD3D11(Emulator* emulator);
#endif // WIN32 #endif // WIN32
} // namespace gpu } // namespace gpu
} // namespace xe } // namespace xe
#endif // XENIA_GPU_GPU_H_ #endif // XENIA_GPU_GPU_H_

View File

@ -14,20 +14,15 @@
#include <thread> #include <thread>
#include <xenia/core.h> #include <xenia/core.h>
#include <xenia/emulator.h>
#include <xenia/xbox.h> #include <xenia/xbox.h>
XEDECLARECLASS1(xe, Emulator);
XEDECLARECLASS2(xe, cpu, Processor);
namespace xe { namespace xe {
namespace gpu { namespace gpu {
class CommandProcessor; class CommandProcessor;
class GraphicsDriver; class GraphicsDriver;
class GraphicsSystem { class GraphicsSystem {
public: public:
virtual ~GraphicsSystem(); virtual ~GraphicsSystem();
@ -84,9 +79,7 @@ protected:
HANDLE thread_wait_; HANDLE thread_wait_;
}; };
} // namespace gpu } // namespace gpu
} // namespace xe } // namespace xe
#endif // XENIA_GPU_GRAPHICS_SYSTEM_H_ #endif // XENIA_GPU_GRAPHICS_SYSTEM_H_

View File

@ -12,22 +12,19 @@
#include <xenia/core.h> #include <xenia/core.h>
namespace xe {
XEDECLARECLASS1(xe, Emulator); class Emulator;
XEDECLARECLASS2(xe, gpu, GraphicsSystem); } // namespace xe
namespace xe { namespace xe {
namespace gpu { namespace gpu {
class GraphicsSystem;
namespace nop { namespace nop {
GraphicsSystem* Create(Emulator* emulator); GraphicsSystem* Create(Emulator* emulator);
} // namespace nop } // namespace nop
} // namespace gpu } // namespace gpu
} // namespace xe } // namespace xe
#endif // XENIA_GPU_NOP_NOP_GPU_H_ #endif // XENIA_GPU_NOP_NOP_GPU_H_

View File

@ -12,19 +12,16 @@
#include <xenia/hid/input_system.h> #include <xenia/hid/input_system.h>
namespace xe {
XEDECLARECLASS1(xe, Emulator); class Emulator;
} // namespace xe
namespace xe { namespace xe {
namespace hid { namespace hid {
InputSystem* Create(Emulator* emulator); InputSystem* Create(Emulator* emulator);
} // namespace hid } // namespace hid
} // namespace xe } // namespace xe
#endif // XENIA_HID_HID_H_ #endif // XENIA_HID_HID_H_

View File

@ -13,11 +13,9 @@
#include <vector> #include <vector>
#include <xenia/core.h> #include <xenia/core.h>
#include <xenia/emulator.h>
#include <xenia/xbox.h> #include <xenia/xbox.h>
XEDECLARECLASS1(xe, Emulator);
XEDECLARECLASS2(xe, cpu, Processor);
namespace xe { namespace xe {
namespace hid { namespace hid {

View File

@ -12,11 +12,10 @@
#include <xenia/core.h> #include <xenia/core.h>
XEDECLARECLASS2(xe, hid, InputDriver);
XEDECLARECLASS2(xe, hid, InputSystem);
namespace xe { namespace xe {
namespace hid { namespace hid {
class InputDriver;
class InputSystem;
namespace nop { namespace nop {
InputDriver* Create(InputSystem* input_system); InputDriver* Create(InputSystem* input_system);

View File

@ -10,11 +10,9 @@
#ifndef XENIA_KERNEL_XBOXKRNL_XKERNEL_MODULE_H_ #ifndef XENIA_KERNEL_XBOXKRNL_XKERNEL_MODULE_H_
#define XENIA_KERNEL_XBOXKRNL_XKERNEL_MODULE_H_ #define XENIA_KERNEL_XBOXKRNL_XKERNEL_MODULE_H_
#include <xenia/emulator.h>
#include <xenia/kernel/objects/xmodule.h> #include <xenia/kernel/objects/xmodule.h>
XEDECLARECLASS1(xe, Emulator);
XEDECLARECLASS1(xe, ExportResolver);
namespace xe { namespace xe {
namespace kernel { namespace kernel {

View File

@ -14,11 +14,10 @@
#include <mutex> #include <mutex>
#include <string> #include <string>
#include <xenia/cpu/xenon_thread_state.h>
#include <xenia/kernel/xobject.h> #include <xenia/kernel/xobject.h>
#include <xenia/xbox.h> #include <xenia/xbox.h>
XEDECLARECLASS2(xe, cpu, XenonThreadState);
namespace xe { namespace xe {
namespace kernel { namespace kernel {

View File

@ -10,20 +10,34 @@
#ifndef XENIA_TYPES_H_ #ifndef XENIA_TYPES_H_
#define XENIA_TYPES_H_ #define XENIA_TYPES_H_
#define XEDECLARECLASS1(ns1, name) \
namespace ns1 { class name; }
#define XEDECLARECLASS2(ns1, ns2, name) \
namespace ns1 { namespace ns2 { \
class name; \
} }
#define XEFAIL() goto XECLEANUP #define XEFAIL() goto XECLEANUP
#define XEEXPECT(expr) if (!(expr) ) { goto XECLEANUP; } #define XEEXPECT(expr) \
#define XEEXPECTTRUE(expr) if (!(expr) ) { goto XECLEANUP; } if (!(expr)) { \
#define XEEXPECTFALSE(expr) if ( (expr) ) { goto XECLEANUP; } goto XECLEANUP; \
#define XEEXPECTZERO(expr) if ( (expr) != 0 ) { goto XECLEANUP; } }
#define XEEXPECTNOTZERO(expr) if ( (expr) == 0 ) { goto XECLEANUP; } #define XEEXPECTTRUE(expr) \
#define XEEXPECTNULL(expr) if ( (expr) != NULL ) { goto XECLEANUP; } if (!(expr)) { \
#define XEEXPECTNOTNULL(expr) if ( (expr) == NULL ) { goto XECLEANUP; } goto XECLEANUP; \
}
#define XEEXPECTFALSE(expr) \
if ((expr)) { \
goto XECLEANUP; \
}
#define XEEXPECTZERO(expr) \
if ((expr) != 0) { \
goto XECLEANUP; \
}
#define XEEXPECTNOTZERO(expr) \
if ((expr) == 0) { \
goto XECLEANUP; \
}
#define XEEXPECTNULL(expr) \
if ((expr) != NULL) { \
goto XECLEANUP; \
}
#define XEEXPECTNOTNULL(expr) \
if ((expr) == NULL) { \
goto XECLEANUP; \
}
#endif // XENIA_TYPES_H_ #endif // XENIA_TYPES_H_