summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/citra_qt/bootmanager.cpp5
-rw-r--r--src/core/arm/disassembler/load_symbol_map.cpp2
-rw-r--r--src/core/hle/kernel/kernel.cpp43
-rw-r--r--src/core/hw/gpu.cpp12
-rw-r--r--src/video_core/pica.h2
-rw-r--r--src/video_core/renderer_opengl/renderer_opengl.cpp32
-rw-r--r--src/video_core/utils.cpp32
-rw-r--r--src/video_core/utils.h2
-rw-r--r--src/video_core/video_core.cpp7
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 @@
19#define COPYRIGHT "Copyright (C) 2013-2014 Citra Team" 19#define COPYRIGHT "Copyright (C) 2013-2014 Citra Team"
20 20
21EmuThread::EmuThread(GRenderWindow* render_window) : 21EmuThread::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/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() {
85} 85}
86 86
87Object* ObjectPool::CreateByIDType(int type) { 87Object* ObjectPool::CreateByIDType(int type) {
88 // Used for save states. This is ugly, but what other way is there? 88 ERROR_LOG(COMMON, "Unimplemented: %d.", type);
89 switch (type) { 89 return nullptr;
90 //case SCE_KERNEL_TMID_Alarm:
91 // return __KernelAlarmObject();
92 //case SCE_KERNEL_TMID_EventFlag:
93 // return __KernelEventFlagObject();
94 //case SCE_KERNEL_TMID_Mbox:
95 // return __KernelMbxObject();
96 //case SCE_KERNEL_TMID_Fpl:
97 // return __KernelMemoryFPLObject();
98 //case SCE_KERNEL_TMID_Vpl:
99 // return __KernelMemoryVPLObject();
100 //case PPSSPP_KERNEL_TMID_PMB:
101 // return __KernelMemoryPMBObject();
102 //case PPSSPP_KERNEL_TMID_Module:
103 // return __KernelModuleObject();
104 //case SCE_KERNEL_TMID_Mpipe:
105 // return __KernelMsgPipeObject();
106 //case SCE_KERNEL_TMID_Mutex:
107 // return __KernelMutexObject();
108 //case SCE_KERNEL_TMID_LwMutex:
109 // return __KernelLwMutexObject();
110 //case SCE_KERNEL_TMID_Semaphore:
111 // return __KernelSemaphoreObject();
112 //case SCE_KERNEL_TMID_Callback:
113 // return __KernelCallbackObject();
114 //case SCE_KERNEL_TMID_Thread:
115 // return __KernelThreadObject();
116 //case SCE_KERNEL_TMID_VTimer:
117 // return __KernelVTimerObject();
118 //case SCE_KERNEL_TMID_Tlspl:
119 // return __KernelTlsplObject();
120 //case PPSSPP_KERNEL_TMID_File:
121 // return __KernelFileNodeObject();
122 //case PPSSPP_KERNEL_TMID_DirList:
123 // return __KernelDirListingObject();
124
125 default:
126 ERROR_LOG(COMMON, "Unable to load state: could not find object type %d.", type);
127 return nullptr;
128 }
129} 90}
130 91
131/// Initialize the kernel 92/// 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) {
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
20static const GLfloat kTopScreenWidthNormalized = 2; 20static const GLfloat kTopScreenWidthNormalized = 2;
21static const GLfloat kTopScreenHeightNormalized = kTopScreenWidthNormalized * (static_cast<float>(VideoCore::kScreenTopHeight) / VideoCore::kScreenTopWidth); 21static const GLfloat kTopScreenHeightNormalized = kTopScreenWidthNormalized * (static_cast<float>(VideoCore::kScreenTopHeight) / VideoCore::kScreenTopWidth);
22static const GLfloat kBottomScreenWidthNormalized = kTopScreenWidthNormalized * (static_cast<float>(VideoCore::kScreenBottomWidth) / VideoCore::kScreenTopWidth); 22static const GLfloat kBottomScreenWidthNormalized = kTopScreenWidthNormalized * (static_cast<float>(VideoCore::kScreenBottomWidth) / VideoCore::kScreenTopWidth);
23static const GLfloat kBottomScreenHeightNormalized = kBottomScreenWidthNormalized * (static_cast<float>(VideoCore::kScreenBottomHeight) / VideoCore::kScreenBottomWidth); 23static const GLfloat kBottomScreenHeightNormalized = kBottomScreenWidthNormalized * (static_cast<float>(VideoCore::kScreenBottomHeight) / VideoCore::kScreenBottomWidth);
24 24
25static const GLfloat g_vbuffer_top[] = { 25static 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
35static const GLfloat g_vbuffer_bottom[] = { 35static 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
10namespace VideoCore { 10namespace 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 */
19void DumpTGA(std::string filename, int width, int height, u8* raw_data) { 20void 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 */
62void DumpTGA(std::string filename, int width, int height, u8* raw_data); 62void 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
21RendererBase* g_renderer = NULL; ///< Renderer plugin 21RendererBase* g_renderer = NULL; ///< Renderer plugin
22int g_current_frame = 0; 22int g_current_frame = 0;
23 23
24/// Start the video core
25void 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
32void Init(EmuWindow* emu_window) { 25void Init(EmuWindow* emu_window) {
33 g_emu_window = emu_window; 26 g_emu_window = emu_window;