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/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 |
8 files changed, 39 insertions, 55 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 @@ | |||
| 19 | #define COPYRIGHT "Copyright (C) 2013-2014 Citra Team" | 19 | #define COPYRIGHT "Copyright (C) 2013-2014 Citra Team" |
| 20 | 20 | ||
| 21 | EmuThread::EmuThread(GRenderWindow* render_window) : | 21 | EmuThread::EmuThread(GRenderWindow* render_window) : |
| 22 | exec_cpu_step(false), cpu_running(false), | 22 | filename(""), exec_cpu_step(false), cpu_running(false), |
| 23 | render_window(render_window), filename(""), | 23 | stop_run(false), render_window(render_window) |
| 24 | stop_run(false) | ||
| 25 | { | 24 | { |
| 26 | } | 25 | } |
| 27 | 26 | ||
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) { | |||
| 18 | std::ifstream infile(filename); | 18 | std::ifstream infile(filename); |
| 19 | 19 | ||
| 20 | std::string address_str, function_name, line; | 20 | std::string address_str, function_name, line; |
| 21 | u32 size, address; | 21 | u32 size; |
| 22 | 22 | ||
| 23 | while (std::getline(infile, line)) { | 23 | while (std::getline(infile, line)) { |
| 24 | std::istringstream iss(line); | 24 | std::istringstream iss(line); |
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) { | |||
| 49 | return; | 49 | return; |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | g_regs[index] = data; | 52 | g_regs[index] = static_cast<u32>(data); |
| 53 | 53 | ||
| 54 | switch (index) { | 54 | switch (index) { |
| 55 | 55 | ||
| @@ -81,9 +81,9 @@ inline void Write(u32 addr, const T data) { | |||
| 81 | u8* source_pointer = Memory::GetPointer(Memory::PhysicalToVirtualAddress(config.GetPhysicalInputAddress())); | 81 | u8* source_pointer = Memory::GetPointer(Memory::PhysicalToVirtualAddress(config.GetPhysicalInputAddress())); |
| 82 | u8* dest_pointer = Memory::GetPointer(Memory::PhysicalToVirtualAddress(config.GetPhysicalOutputAddress())); | 82 | u8* dest_pointer = Memory::GetPointer(Memory::PhysicalToVirtualAddress(config.GetPhysicalOutputAddress())); |
| 83 | 83 | ||
| 84 | for (int y = 0; y < config.output_height; ++y) { | 84 | for (u32 y = 0; y < config.output_height; ++y) { |
| 85 | // TODO: Why does the register seem to hold twice the framebuffer width? | 85 | // TODO: Why does the register seem to hold twice the framebuffer width? |
| 86 | for (int x = 0; x < config.output_width; ++x) { | 86 | for (u32 x = 0; x < config.output_width; ++x) { |
| 87 | struct { | 87 | struct { |
| 88 | int r, g, b, a; | 88 | int r, g, b, a; |
| 89 | } source_color = { 0, 0, 0, 0 }; | 89 | } source_color = { 0, 0, 0, 0 }; |
| @@ -134,10 +134,10 @@ inline void Write(u32 addr, const T data) { | |||
| 134 | } | 134 | } |
| 135 | } | 135 | } |
| 136 | 136 | ||
| 137 | DEBUG_LOG(GPU, "DisplayTriggerTransfer: 0x%08x bytes from 0x%08x(%dx%d)-> 0x%08x(%dx%d), dst format %x", | 137 | DEBUG_LOG(GPU, "DisplayTriggerTransfer: 0x%08x bytes from 0x%08x(%ux%u)-> 0x%08x(%ux%u), dst format %x", |
| 138 | config.output_height * config.output_width * 4, | 138 | config.output_height * config.output_width * 4, |
| 139 | config.GetPhysicalInputAddress(), (int)config.input_width, (int)config.input_height, | 139 | config.GetPhysicalInputAddress(), config.input_width, config.input_height, |
| 140 | config.GetPhysicalOutputAddress(), (int)config.output_width, (int)config.output_height, | 140 | config.GetPhysicalOutputAddress(), config.output_width, config.output_height, |
| 141 | config.output_format.Value()); | 141 | config.output_format.Value()); |
| 142 | } | 142 | } |
| 143 | break; | 143 | 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 { | |||
| 516 | // Used for debugging purposes, so performance is not an issue here | 516 | // Used for debugging purposes, so performance is not an issue here |
| 517 | static std::string GetCommandName(int index) { | 517 | static std::string GetCommandName(int index) { |
| 518 | std::map<u32, std::string> map; | 518 | std::map<u32, std::string> map; |
| 519 | Regs regs; | ||
| 520 | 519 | ||
| 521 | // TODO: MSVC does not support using offsetof() on non-static data members even though this | 520 | // TODO: MSVC does not support using offsetof() on non-static data members even though this |
| 522 | // is technically allowed since C++11. Hence, this functionality is disabled until | 521 | // is technically allowed since C++11. Hence, this functionality is disabled until |
| 523 | // MSVC properly supports it. | 522 | // MSVC properly supports it. |
| 524 | #ifndef _MSC_VER | 523 | #ifndef _MSC_VER |
| 524 | Regs regs; | ||
| 525 | #define ADD_FIELD(name) \ | 525 | #define ADD_FIELD(name) \ |
| 526 | do { \ | 526 | do { \ |
| 527 | map.insert({PICA_REG_INDEX(name), #name}); \ | 527 | 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 = | |||
| 18 | 18 | ||
| 19 | // Fullscreen quad dimensions | 19 | // Fullscreen quad dimensions |
| 20 | static const GLfloat kTopScreenWidthNormalized = 2; | 20 | static const GLfloat kTopScreenWidthNormalized = 2; |
| 21 | static const GLfloat kTopScreenHeightNormalized = kTopScreenWidthNormalized * (static_cast<float>(VideoCore::kScreenTopHeight) / VideoCore::kScreenTopWidth); | 21 | static const GLfloat kTopScreenHeightNormalized = kTopScreenWidthNormalized * (static_cast<float>(VideoCore::kScreenTopHeight) / VideoCore::kScreenTopWidth); |
| 22 | static const GLfloat kBottomScreenWidthNormalized = kTopScreenWidthNormalized * (static_cast<float>(VideoCore::kScreenBottomWidth) / VideoCore::kScreenTopWidth); | 22 | static const GLfloat kBottomScreenWidthNormalized = kTopScreenWidthNormalized * (static_cast<float>(VideoCore::kScreenBottomWidth) / VideoCore::kScreenTopWidth); |
| 23 | static const GLfloat kBottomScreenHeightNormalized = kBottomScreenWidthNormalized * (static_cast<float>(VideoCore::kScreenBottomHeight) / VideoCore::kScreenBottomWidth); | 23 | static const GLfloat kBottomScreenHeightNormalized = kBottomScreenWidthNormalized * (static_cast<float>(VideoCore::kScreenBottomHeight) / VideoCore::kScreenBottomWidth); |
| 24 | 24 | ||
| 25 | static const GLfloat g_vbuffer_top[] = { | 25 | static const GLfloat g_vbuffer_top[] = { |
| 26 | // x, y, z u, v | 26 | // x, y z u v |
| 27 | -1.0f, 0.0f, 0.0f, 0.0f, 1.0f, | 27 | -1.0f, 0.0f, 0.0f, 0.0f, 1.0f, |
| 28 | 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, | 28 | 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, |
| 29 | 1.0f, kTopScreenHeightNormalized, 0.0f, 1.0f, 0.0f, | 29 | 1.0f, kTopScreenHeightNormalized, 0.0f, 1.0f, 0.0f, |
| 30 | 1.0f, kTopScreenHeightNormalized, 0.0f, 1.0f, 0.0f, | 30 | 1.0f, kTopScreenHeightNormalized, 0.0f, 1.0f, 0.0f, |
| 31 | -1.0f, kTopScreenHeightNormalized, 0.0f, 0.0f, 0.0f, | 31 | -1.0f, kTopScreenHeightNormalized, 0.0f, 0.0f, 0.0f, |
| 32 | -1.0f, 0.0f, 0.0f, 0.0f, 1.0f | 32 | -1.0f, 0.0f, 0.0f, 0.0f, 1.0f |
| 33 | }; | 33 | }; |
| 34 | 34 | ||
| 35 | static const GLfloat g_vbuffer_bottom[] = { | 35 | static const GLfloat g_vbuffer_bottom[] = { |
| 36 | // x, y, z u, v | 36 | // x y z u v |
| 37 | -(kBottomScreenWidthNormalized / 2), -kBottomScreenHeightNormalized, 0.0f, 0.0f, 1.0f, | 37 | -(kBottomScreenWidthNormalized / 2), -kBottomScreenHeightNormalized, 0.0f, 0.0f, 1.0f, |
| 38 | (kBottomScreenWidthNormalized / 2), -kBottomScreenHeightNormalized, 0.0f, 1.0f, 1.0f, | 38 | (kBottomScreenWidthNormalized / 2), -kBottomScreenHeightNormalized, 0.0f, 1.0f, 1.0f, |
| 39 | (kBottomScreenWidthNormalized / 2), 0.0f, 0.0f, 1.0f, 0.0f, | 39 | (kBottomScreenWidthNormalized / 2), 0.0f, 0.0f, 1.0f, 0.0f, |
| 40 | (kBottomScreenWidthNormalized / 2), 0.0f, 0.0f, 1.0f, 0.0f, | 40 | (kBottomScreenWidthNormalized / 2), 0.0f, 0.0f, 1.0f, 0.0f, |
| 41 | -(kBottomScreenWidthNormalized / 2), 0.0f, 0.0f, 0.0f, 0.0f, | 41 | -(kBottomScreenWidthNormalized / 2), 0.0f, 0.0f, 0.0f, 0.0f, |
| 42 | -(kBottomScreenWidthNormalized / 2), -kBottomScreenHeightNormalized, 0.0f, 0.0f, 1.0f | 42 | -(kBottomScreenWidthNormalized / 2), -kBottomScreenHeightNormalized, 0.0f, 0.0f, 1.0f |
| 43 | }; | 43 | }; |
| 44 | 44 | ||
| 45 | /// RendererOpenGL constructor | 45 | /// 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 @@ | |||
| 8 | #include "video_core/utils.h" | 8 | #include "video_core/utils.h" |
| 9 | 9 | ||
| 10 | namespace VideoCore { | 10 | namespace VideoCore { |
| 11 | |||
| 11 | /** | 12 | /** |
| 12 | * Dumps a texture to TGA | 13 | * Dumps a texture to TGA |
| 13 | * @param filename String filename to dump texture to | 14 | * @param filename String filename to dump texture to |
| @@ -16,29 +17,20 @@ namespace VideoCore { | |||
| 16 | * @param raw_data Raw RGBA8 texture data to dump | 17 | * @param raw_data Raw RGBA8 texture data to dump |
| 17 | * @todo This should be moved to some general purpose/common code | 18 | * @todo This should be moved to some general purpose/common code |
| 18 | */ | 19 | */ |
| 19 | void DumpTGA(std::string filename, int width, int height, u8* raw_data) { | 20 | void DumpTGA(std::string filename, short width, short height, u8* raw_data) { |
| 20 | TGAHeader hdr; | 21 | TGAHeader hdr = {0, 0, 2, 0, 0, 0, 0, width, height, 24, 0}; |
| 21 | FILE* fout; | 22 | FILE* fout = fopen(filename.c_str(), "wb"); |
| 22 | u8 r, g, b; | 23 | |
| 23 | |||
| 24 | memset(&hdr, 0, sizeof(hdr)); | ||
| 25 | hdr.datatypecode = 2; // uncompressed RGB | ||
| 26 | hdr.bitsperpixel = 24; // 24 bpp | ||
| 27 | hdr.width = width; | ||
| 28 | hdr.height = height; | ||
| 29 | |||
| 30 | fout = fopen(filename.c_str(), "wb"); | ||
| 31 | fwrite(&hdr, sizeof(TGAHeader), 1, fout); | 24 | fwrite(&hdr, sizeof(TGAHeader), 1, fout); |
| 32 | for (int i = 0; i < height; i++) { | 25 | |
| 33 | for (int j = 0; j < width; j++) { | 26 | for (int y = 0; y < height; y++) { |
| 34 | b = raw_data[(3 * (i * width)) + (3 * j) + 0]; | 27 | for (int x = 0; x < width; x++) { |
| 35 | g = raw_data[(3 * (i * width)) + (3 * j) + 1]; | 28 | putc(raw_data[(3 * (y * width)) + (3 * x) + 0], fout); // b |
| 36 | r = raw_data[(3 * (i * width)) + (3 * j) + 2]; | 29 | putc(raw_data[(3 * (y * width)) + (3 * x) + 1], fout); // g |
| 37 | putc(b, fout); | 30 | putc(raw_data[(3 * (y * width)) + (3 * x) + 2], fout); // r |
| 38 | putc(g, fout); | ||
| 39 | putc(r, fout); | ||
| 40 | } | 31 | } |
| 41 | } | 32 | } |
| 33 | |||
| 42 | fclose(fout); | 34 | fclose(fout); |
| 43 | } | 35 | } |
| 44 | } // namespace | 36 | } // 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 { | |||
| 59 | * @param raw_data Raw RGBA8 texture data to dump | 59 | * @param raw_data Raw RGBA8 texture data to dump |
| 60 | * @todo This should be moved to some general purpose/common code | 60 | * @todo This should be moved to some general purpose/common code |
| 61 | */ | 61 | */ |
| 62 | void DumpTGA(std::string filename, int width, int height, u8* raw_data); | 62 | void DumpTGA(std::string filename, short width, short height, u8* raw_data); |
| 63 | 63 | ||
| 64 | } // namespace | 64 | } // 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 | |||
| 21 | RendererBase* g_renderer = NULL; ///< Renderer plugin | 21 | RendererBase* g_renderer = NULL; ///< Renderer plugin |
| 22 | int g_current_frame = 0; | 22 | int g_current_frame = 0; |
| 23 | 23 | ||
| 24 | /// Start the video core | ||
| 25 | void Start() { | ||
| 26 | if (g_emu_window == NULL) { | ||
| 27 | ERROR_LOG(VIDEO, "VideoCore::Start called without calling Init()!"); | ||
| 28 | } | ||
| 29 | } | ||
| 30 | |||
| 31 | /// Initialize the video core | 24 | /// Initialize the video core |
| 32 | void Init(EmuWindow* emu_window) { | 25 | void Init(EmuWindow* emu_window) { |
| 33 | g_emu_window = emu_window; | 26 | g_emu_window = emu_window; |