diff options
-rw-r--r-- | src/citra_qt/bootmanager.cpp | 5 | ||||
-rw-r--r-- | src/core/arm/disassembler/load_symbol_map.cpp | 2 | ||||
-rw-r--r-- | src/core/hle/kernel/kernel.cpp | 43 | ||||
-rw-r--r-- | src/core/hw/gpu.cpp | 12 | ||||
-rw-r--r-- | src/video_core/pica.h | 2 | ||||
-rw-r--r-- | src/video_core/renderer_opengl/renderer_opengl.cpp | 32 | ||||
-rw-r--r-- | src/video_core/utils.cpp | 32 | ||||
-rw-r--r-- | src/video_core/utils.h | 2 | ||||
-rw-r--r-- | src/video_core/video_core.cpp | 7 |
9 files changed, 41 insertions, 96 deletions
diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index 657e39bea..cf4d8b32b 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp @@ -19,9 +19,8 @@ #define COPYRIGHT "Copyright (C) 2013-2014 Citra Team" EmuThread::EmuThread(GRenderWindow* render_window) : - exec_cpu_step(false), cpu_running(false), - render_window(render_window), filename(""), - stop_run(false) + filename(""), exec_cpu_step(false), cpu_running(false), + stop_run(false), render_window(render_window) { } diff --git a/src/core/arm/disassembler/load_symbol_map.cpp b/src/core/arm/disassembler/load_symbol_map.cpp index f156c43ce..0f384ad3e 100644 --- a/src/core/arm/disassembler/load_symbol_map.cpp +++ b/src/core/arm/disassembler/load_symbol_map.cpp @@ -18,7 +18,7 @@ void LoadSymbolMap(std::string filename) { std::ifstream infile(filename); std::string address_str, function_name, line; - u32 size, address; + u32 size; while (std::getline(infile, line)) { std::istringstream iss(line); diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index e56f1879e..88cbc1af5 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -85,47 +85,8 @@ int ObjectPool::GetCount() { } Object* ObjectPool::CreateByIDType(int type) { - // Used for save states. This is ugly, but what other way is there? - switch (type) { - //case SCE_KERNEL_TMID_Alarm: - // return __KernelAlarmObject(); - //case SCE_KERNEL_TMID_EventFlag: - // return __KernelEventFlagObject(); - //case SCE_KERNEL_TMID_Mbox: - // return __KernelMbxObject(); - //case SCE_KERNEL_TMID_Fpl: - // return __KernelMemoryFPLObject(); - //case SCE_KERNEL_TMID_Vpl: - // return __KernelMemoryVPLObject(); - //case PPSSPP_KERNEL_TMID_PMB: - // return __KernelMemoryPMBObject(); - //case PPSSPP_KERNEL_TMID_Module: - // return __KernelModuleObject(); - //case SCE_KERNEL_TMID_Mpipe: - // return __KernelMsgPipeObject(); - //case SCE_KERNEL_TMID_Mutex: - // return __KernelMutexObject(); - //case SCE_KERNEL_TMID_LwMutex: - // return __KernelLwMutexObject(); - //case SCE_KERNEL_TMID_Semaphore: - // return __KernelSemaphoreObject(); - //case SCE_KERNEL_TMID_Callback: - // return __KernelCallbackObject(); - //case SCE_KERNEL_TMID_Thread: - // return __KernelThreadObject(); - //case SCE_KERNEL_TMID_VTimer: - // return __KernelVTimerObject(); - //case SCE_KERNEL_TMID_Tlspl: - // return __KernelTlsplObject(); - //case PPSSPP_KERNEL_TMID_File: - // return __KernelFileNodeObject(); - //case PPSSPP_KERNEL_TMID_DirList: - // return __KernelDirListingObject(); - - default: - ERROR_LOG(COMMON, "Unable to load state: could not find object type %d.", type); - return nullptr; - } + ERROR_LOG(COMMON, "Unimplemented: %d.", type); + return nullptr; } /// Initialize the kernel diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp index 2e0943776..7afb00d6c 100644 --- a/src/core/hw/gpu.cpp +++ b/src/core/hw/gpu.cpp @@ -49,7 +49,7 @@ inline void Write(u32 addr, const T data) { return; } - g_regs[index] = data; + g_regs[index] = static_cast<u32>(data); switch (index) { @@ -81,9 +81,9 @@ inline void Write(u32 addr, const T data) { u8* source_pointer = Memory::GetPointer(Memory::PhysicalToVirtualAddress(config.GetPhysicalInputAddress())); u8* dest_pointer = Memory::GetPointer(Memory::PhysicalToVirtualAddress(config.GetPhysicalOutputAddress())); - for (int y = 0; y < config.output_height; ++y) { + for (u32 y = 0; y < config.output_height; ++y) { // TODO: Why does the register seem to hold twice the framebuffer width? - for (int x = 0; x < config.output_width; ++x) { + for (u32 x = 0; x < config.output_width; ++x) { struct { int r, g, b, a; } source_color = { 0, 0, 0, 0 }; @@ -134,10 +134,10 @@ inline void Write(u32 addr, const T data) { } } - DEBUG_LOG(GPU, "DisplayTriggerTransfer: 0x%08x bytes from 0x%08x(%dx%d)-> 0x%08x(%dx%d), dst format %x", + DEBUG_LOG(GPU, "DisplayTriggerTransfer: 0x%08x bytes from 0x%08x(%ux%u)-> 0x%08x(%ux%u), dst format %x", config.output_height * config.output_width * 4, - config.GetPhysicalInputAddress(), (int)config.input_width, (int)config.input_height, - config.GetPhysicalOutputAddress(), (int)config.output_width, (int)config.output_height, + config.GetPhysicalInputAddress(), config.input_width, config.input_height, + config.GetPhysicalOutputAddress(), config.output_width, config.output_height, config.output_format.Value()); } break; diff --git a/src/video_core/pica.h b/src/video_core/pica.h index cfdc9b934..374cd83c1 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h @@ -516,12 +516,12 @@ struct Regs { // Used for debugging purposes, so performance is not an issue here static std::string GetCommandName(int index) { std::map<u32, std::string> map; - Regs regs; // TODO: MSVC does not support using offsetof() on non-static data members even though this // is technically allowed since C++11. Hence, this functionality is disabled until // MSVC properly supports it. #ifndef _MSC_VER + Regs regs; #define ADD_FIELD(name) \ do { \ map.insert({PICA_REG_INDEX(name), #name}); \ diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index ad3ce3ba1..bc1683cb5 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -18,28 +18,28 @@ static const GLfloat kViewportAspectRatio = // Fullscreen quad dimensions static const GLfloat kTopScreenWidthNormalized = 2; -static const GLfloat kTopScreenHeightNormalized = kTopScreenWidthNormalized * (static_cast<float>(VideoCore::kScreenTopHeight) / VideoCore::kScreenTopWidth); -static const GLfloat kBottomScreenWidthNormalized = kTopScreenWidthNormalized * (static_cast<float>(VideoCore::kScreenBottomWidth) / VideoCore::kScreenTopWidth); +static const GLfloat kTopScreenHeightNormalized = kTopScreenWidthNormalized * (static_cast<float>(VideoCore::kScreenTopHeight) / VideoCore::kScreenTopWidth); +static const GLfloat kBottomScreenWidthNormalized = kTopScreenWidthNormalized * (static_cast<float>(VideoCore::kScreenBottomWidth) / VideoCore::kScreenTopWidth); static const GLfloat kBottomScreenHeightNormalized = kBottomScreenWidthNormalized * (static_cast<float>(VideoCore::kScreenBottomHeight) / VideoCore::kScreenBottomWidth); static const GLfloat g_vbuffer_top[] = { - // x, y, z u, v - -1.0f, 0.0f, 0.0f, 0.0f, 1.0f, - 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, - 1.0f, kTopScreenHeightNormalized, 0.0f, 1.0f, 0.0f, - 1.0f, kTopScreenHeightNormalized, 0.0f, 1.0f, 0.0f, - -1.0f, kTopScreenHeightNormalized, 0.0f, 0.0f, 0.0f, - -1.0f, 0.0f, 0.0f, 0.0f, 1.0f + // x, y z u v + -1.0f, 0.0f, 0.0f, 0.0f, 1.0f, + 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, + 1.0f, kTopScreenHeightNormalized, 0.0f, 1.0f, 0.0f, + 1.0f, kTopScreenHeightNormalized, 0.0f, 1.0f, 0.0f, + -1.0f, kTopScreenHeightNormalized, 0.0f, 0.0f, 0.0f, + -1.0f, 0.0f, 0.0f, 0.0f, 1.0f }; static const GLfloat g_vbuffer_bottom[] = { - // x, y, z u, v - -(kBottomScreenWidthNormalized / 2), -kBottomScreenHeightNormalized, 0.0f, 0.0f, 1.0f, - (kBottomScreenWidthNormalized / 2), -kBottomScreenHeightNormalized, 0.0f, 1.0f, 1.0f, - (kBottomScreenWidthNormalized / 2), 0.0f, 0.0f, 1.0f, 0.0f, - (kBottomScreenWidthNormalized / 2), 0.0f, 0.0f, 1.0f, 0.0f, - -(kBottomScreenWidthNormalized / 2), 0.0f, 0.0f, 0.0f, 0.0f, - -(kBottomScreenWidthNormalized / 2), -kBottomScreenHeightNormalized, 0.0f, 0.0f, 1.0f + // x y z u v + -(kBottomScreenWidthNormalized / 2), -kBottomScreenHeightNormalized, 0.0f, 0.0f, 1.0f, + (kBottomScreenWidthNormalized / 2), -kBottomScreenHeightNormalized, 0.0f, 1.0f, 1.0f, + (kBottomScreenWidthNormalized / 2), 0.0f, 0.0f, 1.0f, 0.0f, + (kBottomScreenWidthNormalized / 2), 0.0f, 0.0f, 1.0f, 0.0f, + -(kBottomScreenWidthNormalized / 2), 0.0f, 0.0f, 0.0f, 0.0f, + -(kBottomScreenWidthNormalized / 2), -kBottomScreenHeightNormalized, 0.0f, 0.0f, 1.0f }; /// RendererOpenGL constructor diff --git a/src/video_core/utils.cpp b/src/video_core/utils.cpp index b94376ac1..c1848f923 100644 --- a/src/video_core/utils.cpp +++ b/src/video_core/utils.cpp @@ -8,6 +8,7 @@ #include "video_core/utils.h" namespace VideoCore { + /** * Dumps a texture to TGA * @param filename String filename to dump texture to @@ -16,29 +17,20 @@ namespace VideoCore { * @param raw_data Raw RGBA8 texture data to dump * @todo This should be moved to some general purpose/common code */ -void DumpTGA(std::string filename, int width, int height, u8* raw_data) { - TGAHeader hdr; - FILE* fout; - u8 r, g, b; - - memset(&hdr, 0, sizeof(hdr)); - hdr.datatypecode = 2; // uncompressed RGB - hdr.bitsperpixel = 24; // 24 bpp - hdr.width = width; - hdr.height = height; - - fout = fopen(filename.c_str(), "wb"); +void DumpTGA(std::string filename, short width, short height, u8* raw_data) { + TGAHeader hdr = {0, 0, 2, 0, 0, 0, 0, width, height, 24, 0}; + FILE* fout = fopen(filename.c_str(), "wb"); + fwrite(&hdr, sizeof(TGAHeader), 1, fout); - for (int i = 0; i < height; i++) { - for (int j = 0; j < width; j++) { - b = raw_data[(3 * (i * width)) + (3 * j) + 0]; - g = raw_data[(3 * (i * width)) + (3 * j) + 1]; - r = raw_data[(3 * (i * width)) + (3 * j) + 2]; - putc(b, fout); - putc(g, fout); - putc(r, fout); + + for (int y = 0; y < height; y++) { + for (int x = 0; x < width; x++) { + putc(raw_data[(3 * (y * width)) + (3 * x) + 0], fout); // b + putc(raw_data[(3 * (y * width)) + (3 * x) + 1], fout); // g + putc(raw_data[(3 * (y * width)) + (3 * x) + 2], fout); // r } } + fclose(fout); } } // namespace diff --git a/src/video_core/utils.h b/src/video_core/utils.h index 20d4ec9e0..9cb3d4d43 100644 --- a/src/video_core/utils.h +++ b/src/video_core/utils.h @@ -59,6 +59,6 @@ struct TGAHeader { * @param raw_data Raw RGBA8 texture data to dump * @todo This should be moved to some general purpose/common code */ -void DumpTGA(std::string filename, int width, int height, u8* raw_data); +void DumpTGA(std::string filename, short width, short height, u8* raw_data); } // namespace diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp index 9aaff4917..c779771c5 100644 --- a/src/video_core/video_core.cpp +++ b/src/video_core/video_core.cpp @@ -21,13 +21,6 @@ EmuWindow* g_emu_window = NULL; ///< Frontend emulator window RendererBase* g_renderer = NULL; ///< Renderer plugin int g_current_frame = 0; -/// Start the video core -void Start() { - if (g_emu_window == NULL) { - ERROR_LOG(VIDEO, "VideoCore::Start called without calling Init()!"); - } -} - /// Initialize the video core void Init(EmuWindow* emu_window) { g_emu_window = emu_window; |