Cleaning up some line ending issues.
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* 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_PRIVATE_H_
|
||||
#define XENIA_GPU_PRIVATE_H_
|
||||
|
||||
#include <gflags/gflags.h>
|
||||
|
||||
DECLARE_string(gpu);
|
||||
|
||||
DECLARE_bool(trace_ring_buffer);
|
||||
DECLARE_string(dump_shaders);
|
||||
|
||||
DECLARE_bool(vsync);
|
||||
|
||||
#endif // XENIA_GPU_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_PRIVATE_H_
|
||||
#define XENIA_GPU_PRIVATE_H_
|
||||
|
||||
#include <gflags/gflags.h>
|
||||
|
||||
DECLARE_string(gpu);
|
||||
|
||||
DECLARE_bool(trace_ring_buffer);
|
||||
DECLARE_string(dump_shaders);
|
||||
|
||||
DECLARE_bool(vsync);
|
||||
|
||||
#endif // XENIA_GPU_PRIVATE_H_
|
||||
|
||||
@@ -1,63 +1,63 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* 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/graphics_system.h"
|
||||
|
||||
#include "poly/poly.h"
|
||||
#include "xenia/emulator.h"
|
||||
#include "xenia/cpu/processor.h"
|
||||
#include "xenia/gpu/gpu-private.h"
|
||||
|
||||
namespace xe {
|
||||
namespace gpu {
|
||||
|
||||
GraphicsSystem::GraphicsSystem(Emulator* emulator)
|
||||
: emulator_(emulator),
|
||||
memory_(emulator->memory()),
|
||||
interrupt_callback_(0),
|
||||
interrupt_callback_data_(0) {}
|
||||
|
||||
GraphicsSystem::~GraphicsSystem() {}
|
||||
|
||||
X_STATUS GraphicsSystem::Setup() {
|
||||
processor_ = emulator_->processor();
|
||||
|
||||
return X_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
void GraphicsSystem::Shutdown() {}
|
||||
|
||||
void GraphicsSystem::SetInterruptCallback(uint32_t callback,
|
||||
uint32_t user_data) {
|
||||
interrupt_callback_ = callback;
|
||||
interrupt_callback_data_ = user_data;
|
||||
XELOGGPU("SetInterruptCallback(%.4X, %.4X)", callback, user_data);
|
||||
}
|
||||
|
||||
void GraphicsSystem::DispatchInterruptCallback(uint32_t source, uint32_t cpu) {
|
||||
if (!interrupt_callback_) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Pick a CPU, if needed. We're going to guess 2. Because.
|
||||
if (cpu == 0xFFFFFFFF) {
|
||||
cpu = 2;
|
||||
}
|
||||
|
||||
XELOGGPU("Dispatching GPU interrupt at %.8X w/ mode %d on cpu %d",
|
||||
interrupt_callback_, source, cpu);
|
||||
|
||||
// NOTE: we may be executing in some random thread.
|
||||
uint64_t args[] = {source, interrupt_callback_data_};
|
||||
processor_->ExecuteInterrupt(cpu, interrupt_callback_, args,
|
||||
poly::countof(args));
|
||||
}
|
||||
|
||||
} // namespace gpu
|
||||
} // namespace xe
|
||||
/**
|
||||
******************************************************************************
|
||||
* 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/graphics_system.h"
|
||||
|
||||
#include "poly/poly.h"
|
||||
#include "xenia/emulator.h"
|
||||
#include "xenia/cpu/processor.h"
|
||||
#include "xenia/gpu/gpu-private.h"
|
||||
|
||||
namespace xe {
|
||||
namespace gpu {
|
||||
|
||||
GraphicsSystem::GraphicsSystem(Emulator* emulator)
|
||||
: emulator_(emulator),
|
||||
memory_(emulator->memory()),
|
||||
interrupt_callback_(0),
|
||||
interrupt_callback_data_(0) {}
|
||||
|
||||
GraphicsSystem::~GraphicsSystem() {}
|
||||
|
||||
X_STATUS GraphicsSystem::Setup() {
|
||||
processor_ = emulator_->processor();
|
||||
|
||||
return X_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
void GraphicsSystem::Shutdown() {}
|
||||
|
||||
void GraphicsSystem::SetInterruptCallback(uint32_t callback,
|
||||
uint32_t user_data) {
|
||||
interrupt_callback_ = callback;
|
||||
interrupt_callback_data_ = user_data;
|
||||
XELOGGPU("SetInterruptCallback(%.4X, %.4X)", callback, user_data);
|
||||
}
|
||||
|
||||
void GraphicsSystem::DispatchInterruptCallback(uint32_t source, uint32_t cpu) {
|
||||
if (!interrupt_callback_) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Pick a CPU, if needed. We're going to guess 2. Because.
|
||||
if (cpu == 0xFFFFFFFF) {
|
||||
cpu = 2;
|
||||
}
|
||||
|
||||
XELOGGPU("Dispatching GPU interrupt at %.8X w/ mode %d on cpu %d",
|
||||
interrupt_callback_, source, cpu);
|
||||
|
||||
// NOTE: we may be executing in some random thread.
|
||||
uint64_t args[] = {source, interrupt_callback_data_};
|
||||
processor_->ExecuteInterrupt(cpu, interrupt_callback_, args,
|
||||
poly::countof(args));
|
||||
}
|
||||
|
||||
} // namespace gpu
|
||||
} // namespace xe
|
||||
|
||||
@@ -1,54 +1,54 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* 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_GRAPHICS_SYSTEM_H_
|
||||
#define XENIA_GPU_GRAPHICS_SYSTEM_H_
|
||||
|
||||
#include <atomic>
|
||||
#include <thread>
|
||||
|
||||
#include "xenia/common.h"
|
||||
#include "xenia/emulator.h"
|
||||
#include "xenia/xbox.h"
|
||||
|
||||
namespace xe {
|
||||
namespace gpu {
|
||||
|
||||
class GraphicsSystem {
|
||||
public:
|
||||
virtual ~GraphicsSystem();
|
||||
|
||||
Emulator* emulator() const { return emulator_; }
|
||||
Memory* memory() const { return memory_; }
|
||||
cpu::Processor* processor() const { return processor_; }
|
||||
|
||||
virtual X_STATUS Setup();
|
||||
virtual void Shutdown();
|
||||
|
||||
void SetInterruptCallback(uint32_t callback, uint32_t user_data);
|
||||
virtual void InitializeRingBuffer(uint32_t ptr, uint32_t page_count) = 0;
|
||||
virtual void EnableReadPointerWriteBack(uint32_t ptr, uint32_t block_size) = 0;
|
||||
|
||||
void DispatchInterruptCallback(uint32_t source, uint32_t cpu);
|
||||
|
||||
protected:
|
||||
GraphicsSystem(Emulator* emulator);
|
||||
|
||||
Emulator* emulator_;
|
||||
Memory* memory_;
|
||||
cpu::Processor* processor_;
|
||||
|
||||
uint32_t interrupt_callback_;
|
||||
uint32_t interrupt_callback_data_;
|
||||
};
|
||||
|
||||
} // namespace gpu
|
||||
} // namespace xe
|
||||
|
||||
#endif // XENIA_GPU_GRAPHICS_SYSTEM_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_GRAPHICS_SYSTEM_H_
|
||||
#define XENIA_GPU_GRAPHICS_SYSTEM_H_
|
||||
|
||||
#include <atomic>
|
||||
#include <thread>
|
||||
|
||||
#include "xenia/common.h"
|
||||
#include "xenia/emulator.h"
|
||||
#include "xenia/xbox.h"
|
||||
|
||||
namespace xe {
|
||||
namespace gpu {
|
||||
|
||||
class GraphicsSystem {
|
||||
public:
|
||||
virtual ~GraphicsSystem();
|
||||
|
||||
Emulator* emulator() const { return emulator_; }
|
||||
Memory* memory() const { return memory_; }
|
||||
cpu::Processor* processor() const { return processor_; }
|
||||
|
||||
virtual X_STATUS Setup();
|
||||
virtual void Shutdown();
|
||||
|
||||
void SetInterruptCallback(uint32_t callback, uint32_t user_data);
|
||||
virtual void InitializeRingBuffer(uint32_t ptr, uint32_t page_count) = 0;
|
||||
virtual void EnableReadPointerWriteBack(uint32_t ptr, uint32_t block_size) = 0;
|
||||
|
||||
void DispatchInterruptCallback(uint32_t source, uint32_t cpu);
|
||||
|
||||
protected:
|
||||
GraphicsSystem(Emulator* emulator);
|
||||
|
||||
Emulator* emulator_;
|
||||
Memory* memory_;
|
||||
cpu::Processor* processor_;
|
||||
|
||||
uint32_t interrupt_callback_;
|
||||
uint32_t interrupt_callback_data_;
|
||||
};
|
||||
|
||||
} // namespace gpu
|
||||
} // namespace xe
|
||||
|
||||
#endif // XENIA_GPU_GRAPHICS_SYSTEM_H_
|
||||
|
||||
Reference in New Issue
Block a user