summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/common/key_map.h14
-rw-r--r--src/core/file_sys/archive_backend.cpp8
-rw-r--r--src/core/file_sys/archive_backend.h8
-rw-r--r--src/core/loader/elf.cpp6
-rw-r--r--src/video_core/pica.cpp522
-rw-r--r--src/video_core/shader/shader_interpreter.cpp3
-rw-r--r--src/video_core/shader/shader_jit_x64.cpp4
7 files changed, 488 insertions, 77 deletions
diff --git a/src/common/key_map.h b/src/common/key_map.h
index 0ecec714f..68f7e2f99 100644
--- a/src/common/key_map.h
+++ b/src/common/key_map.h
@@ -4,6 +4,7 @@
#pragma once
+#include <tuple>
#include "core/hle/service/hid/hid.h"
namespace KeyMap {
@@ -15,15 +16,14 @@ struct HostDeviceKey {
int key_code;
int device_id; ///< Uniquely identifies a host device
- bool operator < (const HostDeviceKey &other) const {
- if (device_id == other.device_id) {
- return key_code < other.key_code;
- }
- return device_id < other.device_id;
+ bool operator<(const HostDeviceKey &other) const {
+ return std::tie(key_code, device_id) <
+ std::tie(other.key_code, other.device_id);
}
- bool operator == (const HostDeviceKey &other) const {
- return device_id == other.device_id && key_code == other.key_code;
+ bool operator==(const HostDeviceKey &other) const {
+ return std::tie(key_code, device_id) ==
+ std::tie(other.key_code, other.device_id);
}
};
diff --git a/src/core/file_sys/archive_backend.cpp b/src/core/file_sys/archive_backend.cpp
index 3f81447df..97adf0e12 100644
--- a/src/core/file_sys/archive_backend.cpp
+++ b/src/core/file_sys/archive_backend.cpp
@@ -43,7 +43,7 @@ Path::Path(LowPathType type, u32 size, u32 pointer) : type(type) {
}
}
-const std::string Path::DebugStr() const {
+std::string Path::DebugStr() const {
switch (GetType()) {
case Invalid:
default:
@@ -66,7 +66,7 @@ const std::string Path::DebugStr() const {
}
}
-const std::string Path::AsString() const {
+std::string Path::AsString() const {
switch (GetType()) {
case Char:
return string;
@@ -83,7 +83,7 @@ const std::string Path::AsString() const {
}
}
-const std::u16string Path::AsU16Str() const {
+std::u16string Path::AsU16Str() const {
switch (GetType()) {
case Char:
return Common::UTF8ToUTF16(string);
@@ -99,7 +99,7 @@ const std::u16string Path::AsU16Str() const {
}
}
-const std::vector<u8> Path::AsBinary() const {
+std::vector<u8> Path::AsBinary() const {
switch (GetType()) {
case Binary:
return binary;
diff --git a/src/core/file_sys/archive_backend.h b/src/core/file_sys/archive_backend.h
index e7a59a1ed..601e95d8c 100644
--- a/src/core/file_sys/archive_backend.h
+++ b/src/core/file_sys/archive_backend.h
@@ -49,11 +49,11 @@ public:
* Gets the string representation of the path for debugging
* @return String representation of the path for debugging
*/
- const std::string DebugStr() const;
+ std::string DebugStr() const;
- const std::string AsString() const;
- const std::u16string AsU16Str() const;
- const std::vector<u8> AsBinary() const;
+ std::string AsString() const;
+ std::u16string AsU16Str() const;
+ std::vector<u8> AsBinary() const;
private:
LowPathType type;
diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp
index 5d7264f12..69df94324 100644
--- a/src/core/loader/elf.cpp
+++ b/src/core/loader/elf.cpp
@@ -250,7 +250,7 @@ const char *ElfReader::GetSectionName(int section) const {
return nullptr;
int name_offset = sections[section].sh_name;
- const char* ptr = (char*)GetSectionDataPtr(header->e_shstrndx);
+ const char* ptr = reinterpret_cast<const char*>(GetSectionDataPtr(header->e_shstrndx));
if (ptr)
return ptr + name_offset;
@@ -347,10 +347,10 @@ bool ElfReader::LoadSymbols() {
SectionID sec = GetSectionByName(".symtab");
if (sec != -1) {
int stringSection = sections[sec].sh_link;
- const char *stringBase = (const char *)GetSectionDataPtr(stringSection);
+ const char *stringBase = reinterpret_cast<const char*>(GetSectionDataPtr(stringSection));
//We have a symbol table!
- Elf32_Sym* symtab = (Elf32_Sym *)(GetSectionDataPtr(sec));
+ const Elf32_Sym* symtab = reinterpret_cast<const Elf32_Sym*>(GetSectionDataPtr(sec));
unsigned int numSymbols = sections[sec].sh_size / sizeof(Elf32_Sym);
for (unsigned sym = 0; sym < numSymbols; sym++) {
int size = symtab[sym].st_size;
diff --git a/src/video_core/pica.cpp b/src/video_core/pica.cpp
index 8c528989e..d7b31384a 100644
--- a/src/video_core/pica.cpp
+++ b/src/video_core/pica.cpp
@@ -12,66 +12,474 @@ namespace Pica {
State g_state;
+static const std::pair<u16, const char*> register_names[] = {
+ { 0x010, "GPUREG_FINALIZE" },
+
+ { 0x040, "GPUREG_FACECULLING_CONFIG" },
+ { 0x041, "GPUREG_VIEWPORT_WIDTH" },
+ { 0x042, "GPUREG_VIEWPORT_INVW" },
+ { 0x043, "GPUREG_VIEWPORT_HEIGHT" },
+ { 0x044, "GPUREG_VIEWPORT_INVH" },
+
+ { 0x047, "GPUREG_FRAGOP_CLIP" },
+ { 0x048, "GPUREG_FRAGOP_CLIP_DATA0" },
+ { 0x049, "GPUREG_FRAGOP_CLIP_DATA1" },
+ { 0x04A, "GPUREG_FRAGOP_CLIP_DATA2" },
+ { 0x04B, "GPUREG_FRAGOP_CLIP_DATA3" },
+
+ { 0x04D, "GPUREG_DEPTHMAP_SCALE" },
+ { 0x04E, "GPUREG_DEPTHMAP_OFFSET" },
+ { 0x04F, "GPUREG_SH_OUTMAP_TOTAL" },
+ { 0x050, "GPUREG_SH_OUTMAP_O0" },
+ { 0x051, "GPUREG_SH_OUTMAP_O1" },
+ { 0x052, "GPUREG_SH_OUTMAP_O2" },
+ { 0x053, "GPUREG_SH_OUTMAP_O3" },
+ { 0x054, "GPUREG_SH_OUTMAP_O4" },
+ { 0x055, "GPUREG_SH_OUTMAP_O5" },
+ { 0x056, "GPUREG_SH_OUTMAP_O6" },
+
+ { 0x061, "GPUREG_EARLYDEPTH_FUNC" },
+ { 0x062, "GPUREG_EARLYDEPTH_TEST1" },
+ { 0x063, "GPUREG_EARLYDEPTH_CLEAR" },
+ { 0x064, "GPUREG_SH_OUTATTR_MODE" },
+ { 0x065, "GPUREG_SCISSORTEST_MODE" },
+ { 0x066, "GPUREG_SCISSORTEST_POS" },
+ { 0x067, "GPUREG_SCISSORTEST_DIM" },
+ { 0x068, "GPUREG_VIEWPORT_XY" },
+
+ { 0x06A, "GPUREG_EARLYDEPTH_DATA" },
+
+ { 0x06D, "GPUREG_DEPTHMAP_ENABLE" },
+ { 0x06E, "GPUREG_RENDERBUF_DIM" },
+ { 0x06F, "GPUREG_SH_OUTATTR_CLOCK" },
+
+ { 0x080, "GPUREG_TEXUNIT_CONFIG" },
+ { 0x081, "GPUREG_TEXUNIT0_BORDER_COLOR" },
+ { 0x082, "GPUREG_TEXUNIT0_DIM" },
+ { 0x083, "GPUREG_TEXUNIT0_PARAM" },
+ { 0x084, "GPUREG_TEXUNIT0_LOD" },
+ { 0x085, "GPUREG_TEXUNIT0_ADDR1" },
+ { 0x086, "GPUREG_TEXUNIT0_ADDR2" },
+ { 0x087, "GPUREG_TEXUNIT0_ADDR3" },
+ { 0x088, "GPUREG_TEXUNIT0_ADDR4" },
+ { 0x089, "GPUREG_TEXUNIT0_ADDR5" },
+ { 0x08A, "GPUREG_TEXUNIT0_ADDR6" },
+ { 0x08B, "GPUREG_TEXUNIT0_SHADOW" },
+
+ { 0x08E, "GPUREG_TEXUNIT0_TYPE" },
+ { 0x08F, "GPUREG_LIGHTING_ENABLE0" },
+
+ { 0x091, "GPUREG_TEXUNIT1_BORDER_COLOR" },
+ { 0x092, "GPUREG_TEXUNIT1_DIM" },
+ { 0x093, "GPUREG_TEXUNIT1_PARAM" },
+ { 0x094, "GPUREG_TEXUNIT1_LOD" },
+ { 0x095, "GPUREG_TEXUNIT1_ADDR" },
+ { 0x096, "GPUREG_TEXUNIT1_TYPE" },
+
+ { 0x099, "GPUREG_TEXUNIT2_BORDER_COLOR" },
+ { 0x09A, "GPUREG_TEXUNIT2_DIM" },
+ { 0x09B, "GPUREG_TEXUNIT2_PARAM" },
+ { 0x09C, "GPUREG_TEXUNIT2_LOD" },
+ { 0x09D, "GPUREG_TEXUNIT2_ADDR" },
+ { 0x09E, "GPUREG_TEXUNIT2_TYPE" },
+
+ { 0x0A8, "GPUREG_TEXUNIT3_PROCTEX0" },
+ { 0x0A9, "GPUREG_TEXUNIT3_PROCTEX1" },
+ { 0x0AA, "GPUREG_TEXUNIT3_PROCTEX2" },
+ { 0x0AB, "GPUREG_TEXUNIT3_PROCTEX3" },
+ { 0x0AC, "GPUREG_TEXUNIT3_PROCTEX4" },
+ { 0x0AD, "GPUREG_TEXUNIT3_PROCTEX5" },
+
+ { 0x0AF, "GPUREG_PROCTEX_LUT" },
+ { 0x0B0, "GPUREG_PROCTEX_LUT_DATA0" },
+ { 0x0B1, "GPUREG_PROCTEX_LUT_DATA1" },
+ { 0x0B2, "GPUREG_PROCTEX_LUT_DATA2" },
+ { 0x0B3, "GPUREG_PROCTEX_LUT_DATA3" },
+ { 0x0B4, "GPUREG_PROCTEX_LUT_DATA4" },
+ { 0x0B5, "GPUREG_PROCTEX_LUT_DATA5" },
+ { 0x0B6, "GPUREG_PROCTEX_LUT_DATA6" },
+ { 0x0B7, "GPUREG_PROCTEX_LUT_DATA7" },
+
+ { 0x0C0, "GPUREG_TEXENV0_SOURCE" },
+ { 0x0C1, "GPUREG_TEXENV0_OPERAND" },
+ { 0x0C2, "GPUREG_TEXENV0_COMBINER" },
+ { 0x0C3, "GPUREG_TEXENV0_COLOR" },
+ { 0x0C4, "GPUREG_TEXENV0_SCALE" },
+
+ { 0x0C8, "GPUREG_TEXENV1_SOURCE" },
+ { 0x0C9, "GPUREG_TEXENV1_OPERAND" },
+ { 0x0CA, "GPUREG_TEXENV1_COMBINER" },
+ { 0x0CB, "GPUREG_TEXENV1_COLOR" },
+ { 0x0CC, "GPUREG_TEXENV1_SCALE" },
+
+ { 0x0D0, "GPUREG_TEXENV2_SOURCE" },
+ { 0x0D1, "GPUREG_TEXENV2_OPERAND" },
+ { 0x0D2, "GPUREG_TEXENV2_COMBINER" },
+ { 0x0D3, "GPUREG_TEXENV2_COLOR" },
+ { 0x0D4, "GPUREG_TEXENV2_SCALE" },
+
+ { 0x0D8, "GPUREG_TEXENV3_SOURCE" },
+ { 0x0D9, "GPUREG_TEXENV3_OPERAND" },
+ { 0x0DA, "GPUREG_TEXENV3_COMBINER" },
+ { 0x0DB, "GPUREG_TEXENV3_COLOR" },
+ { 0x0DC, "GPUREG_TEXENV3_SCALE" },
+
+ { 0x0E0, "GPUREG_TEXENV_UPDATE_BUFFER" },
+ { 0x0E1, "GPUREG_FOG_COLOR" },
+
+ { 0x0E4, "GPUREG_GAS_ATTENUATION" },
+ { 0x0E5, "GPUREG_GAS_ACCMAX" },
+ { 0x0E6, "GPUREG_FOG_LUT_INDEX" },
+
+ { 0x0E8, "GPUREG_FOG_LUT_DATA0" },
+ { 0x0E9, "GPUREG_FOG_LUT_DATA1" },
+ { 0x0EA, "GPUREG_FOG_LUT_DATA2" },
+ { 0x0EB, "GPUREG_FOG_LUT_DATA3" },
+ { 0x0EC, "GPUREG_FOG_LUT_DATA4" },
+ { 0x0ED, "GPUREG_FOG_LUT_DATA5" },
+ { 0x0EE, "GPUREG_FOG_LUT_DATA6" },
+ { 0x0EF, "GPUREG_FOG_LUT_DATA7" },
+ { 0x0F0, "GPUREG_TEXENV4_SOURCE" },
+ { 0x0F1, "GPUREG_TEXENV4_OPERAND" },
+ { 0x0F2, "GPUREG_TEXENV4_COMBINER" },
+ { 0x0F3, "GPUREG_TEXENV4_COLOR" },
+ { 0x0F4, "GPUREG_TEXENV4_SCALE" },
+
+ { 0x0F8, "GPUREG_TEXENV5_SOURCE" },
+ { 0x0F9, "GPUREG_TEXENV5_OPERAND" },
+ { 0x0FA, "GPUREG_TEXENV5_COMBINER" },
+ { 0x0FB, "GPUREG_TEXENV5_COLOR" },
+ { 0x0FC, "GPUREG_TEXENV5_SCALE" },
+ { 0x0FD, "GPUREG_TEXENV_BUFFER_COLOR" },
+
+ { 0x100, "GPUREG_COLOR_OPERATION" },
+ { 0x101, "GPUREG_BLEND_FUNC" },
+ { 0x102, "GPUREG_LOGIC_OP" },
+ { 0x103, "GPUREG_BLEND_COLOR" },
+ { 0x104, "GPUREG_FRAGOP_ALPHA_TEST" },
+ { 0x105, "GPUREG_STENCIL_TEST" },
+ { 0x106, "GPUREG_STENCIL_OP" },
+ { 0x107, "GPUREG_DEPTH_COLOR_MASK" },
+
+ { 0x110, "GPUREG_FRAMEBUFFER_INVALIDATE" },
+ { 0x111, "GPUREG_FRAMEBUFFER_FLUSH" },
+ { 0x112, "GPUREG_COLORBUFFER_READ" },
+ { 0x113, "GPUREG_COLORBUFFER_WRITE" },
+ { 0x114, "GPUREG_DEPTHBUFFER_READ" },
+ { 0x115, "GPUREG_DEPTHBUFFER_WRITE" },
+ { 0x116, "GPUREG_DEPTHBUFFER_FORMAT" },
+ { 0x117, "GPUREG_COLORBUFFER_FORMAT" },
+ { 0x118, "GPUREG_EARLYDEPTH_TEST2" },
+
+ { 0x11B, "GPUREG_FRAMEBUFFER_BLOCK32" },
+ { 0x11C, "GPUREG_DEPTHBUFFER_LOC" },
+ { 0x11D, "GPUREG_COLORBUFFER_LOC" },
+ { 0x11E, "GPUREG_FRAMEBUFFER_DIM" },
+
+ { 0x120, "GPUREG_GAS_LIGHT_XY" },
+ { 0x121, "GPUREG_GAS_LIGHT_Z" },
+ { 0x122, "GPUREG_GAS_LIGHT_Z_COLOR" },
+ { 0x123, "GPUREG_GAS_LUT_INDEX" },
+ { 0x124, "GPUREG_GAS_LUT_DATA" },
+
+ { 0x126, "GPUREG_GAS_DELTAZ_DEPTH" },
+
+ { 0x130, "GPUREG_FRAGOP_SHADOW" },
+
+ { 0x140, "GPUREG_LIGHT0_SPECULAR0" },
+ { 0x141, "GPUREG_LIGHT0_SPECULAR1" },
+ { 0x142, "GPUREG_LIGHT0_DIFFUSE" },
+ { 0x143, "GPUREG_LIGHT0_AMBIENT" },
+ { 0x144, "GPUREG_LIGHT0_XY" },
+ { 0x145, "GPUREG_LIGHT0_Z" },
+ { 0x146, "GPUREG_LIGHT0_SPOTDIR_XY" },
+ { 0x147, "GPUREG_LIGHT0_SPOTDIR_Z" },
+
+ { 0x149, "GPUREG_LIGHT0_CONFIG" },
+ { 0x14A, "GPUREG_LIGHT0_ATTENUATION_BIAS" },
+ { 0x14B, "GPUREG_LIGHT0_ATTENUATION_SCALE" },
+
+ { 0x150, "GPUREG_LIGHT1_SPECULAR0" },
+ { 0x151, "GPUREG_LIGHT1_SPECULAR1" },
+ { 0x152, "GPUREG_LIGHT1_DIFFUSE" },
+ { 0x153, "GPUREG_LIGHT1_AMBIENT" },
+ { 0x154, "GPUREG_LIGHT1_XY" },
+ { 0x155, "GPUREG_LIGHT1_Z" },
+ { 0x156, "GPUREG_LIGHT1_SPOTDIR_XY" },
+ { 0x157, "GPUREG_LIGHT1_SPOTDIR_Z" },
+
+ { 0x159, "GPUREG_LIGHT1_CONFIG" },
+ { 0x15A, "GPUREG_LIGHT1_ATTENUATION_BIAS" },
+ { 0x15B, "GPUREG_LIGHT1_ATTENUATION_SCALE" },
+
+ { 0x160, "GPUREG_LIGHT2_SPECULAR0" },
+ { 0x161, "GPUREG_LIGHT2_SPECULAR1" },
+ { 0x162, "GPUREG_LIGHT2_DIFFUSE" },
+ { 0x163, "GPUREG_LIGHT2_AMBIENT" },
+ { 0x164, "GPUREG_LIGHT2_XY" },
+ { 0x165, "GPUREG_LIGHT2_Z" },
+ { 0x166, "GPUREG_LIGHT2_SPOTDIR_XY" },
+ { 0x167, "GPUREG_LIGHT2_SPOTDIR_Z" },
+
+ { 0x169, "GPUREG_LIGHT2_CONFIG" },
+ { 0x16A, "GPUREG_LIGHT2_ATTENUATION_BIAS" },
+ { 0x16B, "GPUREG_LIGHT2_ATTENUATION_SCALE" },
+
+ { 0x170, "GPUREG_LIGHT3_SPECULAR0" },
+ { 0x171, "GPUREG_LIGHT3_SPECULAR1" },
+ { 0x172, "GPUREG_LIGHT3_DIFFUSE" },
+ { 0x173, "GPUREG_LIGHT3_AMBIENT" },
+ { 0x174, "GPUREG_LIGHT3_XY" },
+ { 0x175, "GPUREG_LIGHT3_Z" },
+ { 0x176, "GPUREG_LIGHT3_SPOTDIR_XY" },
+ { 0x177, "GPUREG_LIGHT3_SPOTDIR_Z" },
+
+ { 0x179, "GPUREG_LIGHT3_CONFIG" },
+ { 0x17A, "GPUREG_LIGHT3_ATTENUATION_BIAS" },
+ { 0x17B, "GPUREG_LIGHT3_ATTENUATION_SCALE" },
+
+ { 0x180, "GPUREG_LIGHT4_SPECULAR0" },
+ { 0x181, "GPUREG_LIGHT4_SPECULAR1" },
+ { 0x182, "GPUREG_LIGHT4_DIFFUSE" },
+ { 0x183, "GPUREG_LIGHT4_AMBIENT" },
+ { 0x184, "GPUREG_LIGHT4_XY" },
+ { 0x185, "GPUREG_LIGHT4_Z" },
+ { 0x186, "GPUREG_LIGHT4_SPOTDIR_XY" },
+ { 0x187, "GPUREG_LIGHT4_SPOTDIR_Z" },
+
+ { 0x189, "GPUREG_LIGHT4_CONFIG" },
+ { 0x18A, "GPUREG_LIGHT4_ATTENUATION_BIAS" },
+ { 0x18B, "GPUREG_LIGHT4_ATTENUATION_SCALE" },
+
+ { 0x190, "GPUREG_LIGHT5_SPECULAR0" },
+ { 0x191, "GPUREG_LIGHT5_SPECULAR1" },
+ { 0x192, "GPUREG_LIGHT5_DIFFUSE" },
+ { 0x193, "GPUREG_LIGHT5_AMBIENT" },
+ { 0x194, "GPUREG_LIGHT5_XY" },
+ { 0x195, "GPUREG_LIGHT5_Z" },
+ { 0x196, "GPUREG_LIGHT5_SPOTDIR_XY" },
+ { 0x197, "GPUREG_LIGHT5_SPOTDIR_Z" },
+
+ { 0x199, "GPUREG_LIGHT5_CONFIG" },
+ { 0x19A, "GPUREG_LIGHT5_ATTENUATION_BIAS" },
+ { 0x19B, "GPUREG_LIGHT5_ATTENUATION_SCALE" },
+
+ { 0x1A0, "GPUREG_LIGHT6_SPECULAR0" },
+ { 0x1A1, "GPUREG_LIGHT6_SPECULAR1" },
+ { 0x1A2, "GPUREG_LIGHT6_DIFFUSE" },
+ { 0x1A3, "GPUREG_LIGHT6_AMBIENT" },
+ { 0x1A4, "GPUREG_LIGHT6_XY" },
+ { 0x1A5, "GPUREG_LIGHT6_Z" },
+ { 0x1A6, "GPUREG_LIGHT6_SPOTDIR_XY" },
+ { 0x1A7, "GPUREG_LIGHT6_SPOTDIR_Z" },
+
+ { 0x1A9, "GPUREG_LIGHT6_CONFIG" },
+ { 0x1AA, "GPUREG_LIGHT6_ATTENUATION_BIAS" },
+ { 0x1AB, "GPUREG_LIGHT6_ATTENUATION_SCALE" },
+
+ { 0x1B0, "GPUREG_LIGHT7_SPECULAR0" },
+ { 0x1B1, "GPUREG_LIGHT7_SPECULAR1" },
+ { 0x1B2, "GPUREG_LIGHT7_DIFFUSE" },
+ { 0x1B3, "GPUREG_LIGHT7_AMBIENT" },
+ { 0x1B4, "GPUREG_LIGHT7_XY" },
+ { 0x1B5, "GPUREG_LIGHT7_Z" },
+ { 0x1B6, "GPUREG_LIGHT7_SPOTDIR_XY" },
+ { 0x1B7, "GPUREG_LIGHT7_SPOTDIR_Z" },
+
+ { 0x1B9, "GPUREG_LIGHT7_CONFIG" },
+ { 0x1BA, "GPUREG_LIGHT7_ATTENUATION_BIAS" },
+ { 0x1BB, "GPUREG_LIGHT7_ATTENUATION_SCALE" },
+
+ { 0x1C0, "GPUREG_LIGHTING_AMBIENT" },
+
+ { 0x1C2, "GPUREG_LIGHTING_NUM_LIGHTS" },
+ { 0x1C3, "GPUREG_LIGHTING_CONFIG0" },
+ { 0x1C4, "GPUREG_LIGHTING_CONFIG1" },
+ { 0x1C5, "GPUREG_LIGHTING_LUT_INDEX" },
+ { 0x1C6, "GPUREG_LIGHTING_ENABLE1" },
+
+ { 0x1C8, "GPUREG_LIGHTING_LUT_DATA0" },
+ { 0x1C9, "GPUREG_LIGHTING_LUT_DATA1" },
+ { 0x1CA, "GPUREG_LIGHTING_LUT_DATA2" },
+ { 0x1CB, "GPUREG_LIGHTING_LUT_DATA3" },
+ { 0x1CC, "GPUREG_LIGHTING_LUT_DATA4" },
+ { 0x1CD, "GPUREG_LIGHTING_LUT_DATA5" },
+ { 0x1CE, "GPUREG_LIGHTING_LUT_DATA6" },
+ { 0x1CF, "GPUREG_LIGHTING_LUT_DATA7" },
+ { 0x1D0, "GPUREG_LIGHTING_LUTINPUT_ABS" },
+ { 0x1D1, "GPUREG_LIGHTING_LUTINPUT_SELECT" },
+ { 0x1D2, "GPUREG_LIGHTING_LUTINPUT_SCALE" },
+
+ { 0x1D9, "GPUREG_LIGHTING_LIGHT_PERMUTATION" },
+
+ { 0x200, "GPUREG_ATTRIBBUFFERS_LOC" },
+ { 0x201, "GPUREG_ATTRIBBUFFERS_FORMAT_LOW" },
+ { 0x202, "GPUREG_ATTRIBBUFFERS_FORMAT_HIGH" },
+ { 0x203, "GPUREG_ATTRIBBUFFER0_OFFSET" },
+ { 0x204, "GPUREG_ATTRIBBUFFER0_CONFIG1" },
+ { 0x205, "GPUREG_ATTRIBBUFFER0_CONFIG2" },
+ { 0x206, "GPUREG_ATTRIBBUFFER1_OFFSET" },
+ { 0x207, "GPUREG_ATTRIBBUFFER1_CONFIG1" },
+ { 0x208, "GPUREG_ATTRIBBUFFER1_CONFIG2" },
+ { 0x209, "GPUREG_ATTRIBBUFFER2_OFFSET" },
+ { 0x20A, "GPUREG_ATTRIBBUFFER2_CONFIG1" },
+ { 0x20B, "GPUREG_ATTRIBBUFFER2_CONFIG2" },
+ { 0x20C, "GPUREG_ATTRIBBUFFER3_OFFSET" },
+ { 0x20D, "GPUREG_ATTRIBBUFFER3_CONFIG1" },
+ { 0x20E, "GPUREG_ATTRIBBUFFER3_CONFIG2" },
+ { 0x20F, "GPUREG_ATTRIBBUFFER4_OFFSET" },
+ { 0x210, "GPUREG_ATTRIBBUFFER4_CONFIG1" },
+ { 0x211, "GPUREG_ATTRIBBUFFER4_CONFIG2" },
+ { 0x212, "GPUREG_ATTRIBBUFFER5_OFFSET" },
+ { 0x213, "GPUREG_ATTRIBBUFFER5_CONFIG1" },
+ { 0x214, "GPUREG_ATTRIBBUFFER5_CONFIG2" },
+ { 0x215, "GPUREG_ATTRIBBUFFER6_OFFSET" },
+ { 0x216, "GPUREG_ATTRIBBUFFER6_CONFIG1" },
+ { 0x217, "GPUREG_ATTRIBBUFFER6_CONFIG2" },
+ { 0x218, "GPUREG_ATTRIBBUFFER7_OFFSET" },
+ { 0x219, "GPUREG_ATTRIBBUFFER7_CONFIG1" },
+ { 0x21A, "GPUREG_ATTRIBBUFFER7_CONFIG2" },
+ { 0x21B, "GPUREG_ATTRIBBUFFER8_OFFSET" },
+ { 0x21C, "GPUREG_ATTRIBBUFFER8_CONFIG1" },
+ { 0x21D, "GPUREG_ATTRIBBUFFER8_CONFIG2" },
+ { 0x21E, "GPUREG_ATTRIBBUFFER9_OFFSET" },
+ { 0x21F, "GPUREG_ATTRIBBUFFER9_CONFIG1" },
+ { 0x220, "GPUREG_ATTRIBBUFFER9_CONFIG2" },
+ { 0x221, "GPUREG_ATTRIBBUFFER10_OFFSET" },
+ { 0x222, "GPUREG_ATTRIBBUFFER10_CONFIG1" },
+ { 0x223, "GPUREG_ATTRIBBUFFER10_CONFIG2" },
+ { 0x224, "GPUREG_ATTRIBBUFFER11_OFFSET" },
+ { 0x225, "GPUREG_ATTRIBBUFFER11_CONFIG1" },
+ { 0x226, "GPUREG_ATTRIBBUFFER11_CONFIG2" },
+ { 0x227, "GPUREG_INDEXBUFFER_CONFIG" },
+ { 0x228, "GPUREG_NUMVERTICES" },
+ { 0x229, "GPUREG_GEOSTAGE_CONFIG" },
+ { 0x22A, "GPUREG_VERTEX_OFFSET" },
+
+ { 0x22D, "GPUREG_POST_VERTEX_CACHE_NUM" },
+ { 0x22E, "GPUREG_DRAWARRAYS" },
+ { 0x22F, "GPUREG_DRAWELEMENTS" },
+
+ { 0x231, "GPUREG_VTX_FUNC" },
+ { 0x232, "GPUREG_FIXEDATTRIB_INDEX" },
+ { 0x233, "GPUREG_FIXEDATTRIB_DATA0" },
+ { 0x234, "GPUREG_FIXEDATTRIB_DATA1" },
+ { 0x235, "GPUREG_FIXEDATTRIB_DATA2" },
+
+ { 0x238, "GPUREG_CMDBUF_SIZE0" },
+ { 0x239, "GPUREG_CMDBUF_SIZE1" },
+ { 0x23A, "GPUREG_CMDBUF_ADDR0" },
+ { 0x23B, "GPUREG_CMDBUF_ADDR1" },
+ { 0x23C, "GPUREG_CMDBUF_JUMP0" },
+ { 0x23D, "GPUREG_CMDBUF_JUMP1" },
+
+ { 0x242, "GPUREG_VSH_NUM_ATTR" },
+
+ { 0x244, "GPUREG_VSH_COM_MODE" },
+ { 0x245, "GPUREG_START_DRAW_FUNC0" },
+
+ { 0x24A, "GPUREG_VSH_OUTMAP_TOTAL1" },
+
+ { 0x251, "GPUREG_VSH_OUTMAP_TOTAL2" },
+ { 0x252, "GPUREG_GSH_MISC0" },
+ { 0x253, "GPUREG_GEOSTAGE_CONFIG2" },
+ { 0x254, "GPUREG_GSH_MISC1" },
+
+ { 0x25E, "GPUREG_PRIMITIVE_CONFIG" },
+ { 0x25F, "GPUREG_RESTART_PRIMITIVE" },
+
+ { 0x280, "GPUREG_GSH_BOOLUNIFORM" },
+ { 0x281, "GPUREG_GSH_INTUNIFORM_I0" },
+ { 0x282, "GPUREG_GSH_INTUNIFORM_I1" },
+ { 0x283, "GPUREG_GSH_INTUNIFORM_I2" },
+ { 0x284, "GPUREG_GSH_INTUNIFORM_I3" },
+
+ { 0x289, "GPUREG_GSH_INPUTBUFFER_CONFIG" },
+ { 0x28A, "GPUREG_GSH_ENTRYPOINT" },
+ { 0x28B, "GPUREG_GSH_ATTRIBUTES_PERMUTATION_LOW" },
+ { 0x28C, "GPUREG_GSH_ATTRIBUTES_PERMUTATION_HIGH" },
+ { 0x28D, "GPUREG_GSH_OUTMAP_MASK" },
+
+ { 0x28F, "GPUREG_GSH_CODETRANSFER_END" },
+ { 0x290, "GPUREG_GSH_FLOATUNIFORM_INDEX" },
+ { 0x291, "GPUREG_GSH_FLOATUNIFORM_DATA0" },
+ { 0x292, "GPUREG_GSH_FLOATUNIFORM_DATA1" },
+ { 0x293, "GPUREG_GSH_FLOATUNIFORM_DATA2" },
+ { 0x294, "GPUREG_GSH_FLOATUNIFORM_DATA3" },
+ { 0x295, "GPUREG_GSH_FLOATUNIFORM_DATA4" },
+ { 0x296, "GPUREG_GSH_FLOATUNIFORM_DATA5" },
+ { 0x297, "GPUREG_GSH_FLOATUNIFORM_DATA6" },
+ { 0x298, "GPUREG_GSH_FLOATUNIFORM_DATA7" },
+
+ { 0x29B, "GPUREG_GSH_CODETRANSFER_INDEX" },
+ { 0x29C, "GPUREG_GSH_CODETRANSFER_DATA0" },
+ { 0x29D, "GPUREG_GSH_CODETRANSFER_DATA1" },
+ { 0x29E, "GPUREG_GSH_CODETRANSFER_DATA2" },
+ { 0x29F, "GPUREG_GSH_CODETRANSFER_DATA3" },
+ { 0x2A0, "GPUREG_GSH_CODETRANSFER_DATA4" },
+ { 0x2A1, "GPUREG_GSH_CODETRANSFER_DATA5" },
+ { 0x2A2, "GPUREG_GSH_CODETRANSFER_DATA6" },
+ { 0x2A3, "GPUREG_GSH_CODETRANSFER_DATA7" },
+
+ { 0x2A5, "GPUREG_GSH_OPDESCS_INDEX" },
+ { 0x2A6, "GPUREG_GSH_OPDESCS_DATA0" },
+ { 0x2A7, "GPUREG_GSH_OPDESCS_DATA1" },
+ { 0x2A8, "GPUREG_GSH_OPDESCS_DATA2" },
+ { 0x2A9, "GPUREG_GSH_OPDESCS_DATA3" },
+ { 0x2AA, "GPUREG_GSH_OPDESCS_DATA4" },
+ { 0x2AB, "GPUREG_GSH_OPDESCS_DATA5" },
+ { 0x2AC, "GPUREG_GSH_OPDESCS_DATA6" },
+ { 0x2AD, "GPUREG_GSH_OPDESCS_DATA7" },
+
+ { 0x2B0, "GPUREG_VSH_BOOLUNIFORM" },
+ { 0x2B1, "GPUREG_VSH_INTUNIFORM_I0" },
+ { 0x2B2, "GPUREG_VSH_INTUNIFORM_I1" },
+ { 0x2B3, "GPUREG_VSH_INTUNIFORM_I2" },
+ { 0x2B4, "GPUREG_VSH_INTUNIFORM_I3" },
+
+ { 0x2B9, "GPUREG_VSH_INPUTBUFFER_CONFIG" },
+ { 0x2BA, "GPUREG_VSH_ENTRYPOINT" },
+ { 0x2BB, "GPUREG_VSH_ATTRIBUTES_PERMUTATION_LOW" },
+ { 0x2BC, "GPUREG_VSH_ATTRIBUTES_PERMUTATION_HIGH" },
+ { 0x2BD, "GPUREG_VSH_OUTMAP_MASK" },
+
+ { 0x2BF, "GPUREG_VSH_CODETRANSFER_END" },
+ { 0x2C0, "GPUREG_VSH_FLOATUNIFORM_INDEX" },
+ { 0x2C1, "GPUREG_VSH_FLOATUNIFORM_DATA0" },
+ { 0x2C2, "GPUREG_VSH_FLOATUNIFORM_DATA1" },
+ { 0x2C3, "GPUREG_VSH_FLOATUNIFORM_DATA2" },
+ { 0x2C4, "GPUREG_VSH_FLOATUNIFORM_DATA3" },
+ { 0x2C5, "GPUREG_VSH_FLOATUNIFORM_DATA4" },
+ { 0x2C6, "GPUREG_VSH_FLOATUNIFORM_DATA5" },
+ { 0x2C7, "GPUREG_VSH_FLOATUNIFORM_DATA6" },
+ { 0x2C8, "GPUREG_VSH_FLOATUNIFORM_DATA7" },
+
+ { 0x2CB, "GPUREG_VSH_CODETRANSFER_INDEX" },
+ { 0x2CC, "GPUREG_VSH_CODETRANSFER_DATA0" },
+ { 0x2CD, "GPUREG_VSH_CODETRANSFER_DATA1" },
+ { 0x2CE, "GPUREG_VSH_CODETRANSFER_DATA2" },
+ { 0x2CF, "GPUREG_VSH_CODETRANSFER_DATA3" },
+ { 0x2D0, "GPUREG_VSH_CODETRANSFER_DATA4" },
+ { 0x2D1, "GPUREG_VSH_CODETRANSFER_DATA5" },
+ { 0x2D2, "GPUREG_VSH_CODETRANSFER_DATA6" },
+ { 0x2D3, "GPUREG_VSH_CODETRANSFER_DATA7" },
+
+ { 0x2D5, "GPUREG_VSH_OPDESCS_INDEX" },
+ { 0x2D6, "GPUREG_VSH_OPDESCS_DATA0" },
+ { 0x2D7, "GPUREG_VSH_OPDESCS_DATA1" },
+ { 0x2D8, "GPUREG_VSH_OPDESCS_DATA2" },
+ { 0x2D9, "GPUREG_VSH_OPDESCS_DATA3" },
+ { 0x2DA, "GPUREG_VSH_OPDESCS_DATA4" },
+ { 0x2DB, "GPUREG_VSH_OPDESCS_DATA5" },
+ { 0x2DC, "GPUREG_VSH_OPDESCS_DATA6" },
+ { 0x2DD, "GPUREG_VSH_OPDESCS_DATA7" },
+};
+
std::string Regs::GetCommandName(int index) {
- static std::unordered_map<u32, std::string> map;
+ static std::unordered_map<u32, const char*> map;
if (map.empty()) {
- #define ADD_FIELD(name) \
- map.insert({static_cast<u32>(PICA_REG_INDEX(name)), #name}); \
- /* TODO: change to Regs::name when VS2015 and other compilers support it */ \
- for (u32 i = PICA_REG_INDEX(name) + 1; i < PICA_REG_INDEX(name) + sizeof(Regs().name) / 4; ++i) \
- map.insert({i, #name + std::string("+") + std::to_string(i-PICA_REG_INDEX(name))}); \
-
- ADD_FIELD(trigger_irq);
- ADD_FIELD(cull_mode);
- ADD_FIELD(viewport_size_x);
- ADD_FIELD(viewport_size_y);
- ADD_FIELD(viewport_depth_range);
- ADD_FIELD(viewport_depth_far_plane);
- ADD_FIELD(viewport_corner);
- ADD_FIELD(texture0_enable);
- ADD_FIELD(texture0);
- ADD_FIELD(texture0_format);
- ADD_FIELD(texture1);
- ADD_FIELD(texture1_format);
- ADD_FIELD(texture2);
- ADD_FIELD(texture2_format);
- ADD_FIELD(tev_stage0);
- ADD_FIELD(tev_stage1);
- ADD_FIELD(tev_stage2);
- ADD_FIELD(tev_stage3);
- ADD_FIELD(tev_combiner_buffer_input);
- ADD_FIELD(tev_stage4);
- ADD_FIELD(tev_stage5);
- ADD_FIELD(tev_combiner_buffer_color);
- ADD_FIELD(output_merger);
- ADD_FIELD(framebuffer);
- ADD_FIELD(vertex_attributes);
- ADD_FIELD(index_array);
- ADD_FIELD(num_vertices);
- ADD_FIELD(vertex_offset);
- ADD_FIELD(trigger_draw);
- ADD_FIELD(trigger_draw_indexed);
- ADD_FIELD(vs_default_attributes_setup);
- ADD_FIELD(command_buffer);
- ADD_FIELD(triangle_topology);
- ADD_FIELD(restart_primitive);
- ADD_FIELD(gs.bool_uniforms);
- ADD_FIELD(gs.int_uniforms);
- ADD_FIELD(gs.main_offset);
- ADD_FIELD(gs.input_register_map);
- ADD_FIELD(gs.uniform_setup);
- ADD_FIELD(gs.program);
- ADD_FIELD(gs.swizzle_patterns);
- ADD_FIELD(vs.bool_uniforms);
- ADD_FIELD(vs.int_uniforms);
- ADD_FIELD(vs.main_offset);
- ADD_FIELD(vs.input_register_map);
- ADD_FIELD(vs.uniform_setup);
- ADD_FIELD(vs.program);
- ADD_FIELD(vs.swizzle_patterns);
-
-#undef ADD_FIELD
+ map.insert(begin(register_names), end(register_names));
}
// Return empty string if no match is found
diff --git a/src/video_core/shader/shader_interpreter.cpp b/src/video_core/shader/shader_interpreter.cpp
index 7b0c20b74..aeced71b0 100644
--- a/src/video_core/shader/shader_interpreter.cpp
+++ b/src/video_core/shader/shader_interpreter.cpp
@@ -515,7 +515,8 @@ void RunInterpreter(UnitState<Debug>& state) {
case OpCode::Id::JMPU:
Record<DebugDataRecord::COND_BOOL_IN>(state.debug, iteration, uniforms.b[instr.flow_control.bool_uniform_id]);
- if (uniforms.b[instr.flow_control.bool_uniform_id]) {
+
+ if (uniforms.b[instr.flow_control.bool_uniform_id] == !(instr.flow_control.num_instructions & 1)) {
state.program_counter = instr.flow_control.dest_offset - 1;
}
break;
diff --git a/src/video_core/shader/shader_jit_x64.cpp b/src/video_core/shader/shader_jit_x64.cpp
index 09a127032..4249675a5 100644
--- a/src/video_core/shader/shader_jit_x64.cpp
+++ b/src/video_core/shader/shader_jit_x64.cpp
@@ -710,7 +710,9 @@ void JitCompiler::Compile_JMP(Instruction instr) {
else
UNREACHABLE();
- FixupBranch b = J_CC(CC_NZ, true);
+ bool inverted_condition = (instr.opcode.Value() == OpCode::Id::JMPU) &&
+ (instr.flow_control.num_instructions & 1);
+ FixupBranch b = J_CC(inverted_condition ? CC_Z : CC_NZ, true);
Compile_Block(instr.flow_control.dest_offset);