forked from ShuriZma/suyu
1
0
Fork 0

Merge pull request #4369 from lioncash/hle-macro

macro_hle: Remove unnecessary std::make_pair calls
This commit is contained in:
LC 2020-07-17 05:20:41 -04:00 committed by GitHub
commit 47956a3bbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 10 deletions

View File

@ -12,8 +12,7 @@ namespace Tegra {
namespace { namespace {
// HLE'd functions // HLE'd functions
static void HLE_771BB18C62444DA0(Engines::Maxwell3D& maxwell3d, void HLE_771BB18C62444DA0(Engines::Maxwell3D& maxwell3d, const std::vector<u32>& parameters) {
const std::vector<u32>& parameters) {
const u32 instance_count = parameters[2] & maxwell3d.GetRegisterValue(0xD1B); const u32 instance_count = parameters[2] & maxwell3d.GetRegisterValue(0xD1B);
maxwell3d.regs.draw.topology.Assign( maxwell3d.regs.draw.topology.Assign(
@ -32,8 +31,7 @@ static void HLE_771BB18C62444DA0(Engines::Maxwell3D& maxwell3d,
maxwell3d.mme_draw.current_mode = Engines::Maxwell3D::MMEDrawMode::Undefined; maxwell3d.mme_draw.current_mode = Engines::Maxwell3D::MMEDrawMode::Undefined;
} }
static void HLE_0D61FC9FAAC9FCAD(Engines::Maxwell3D& maxwell3d, void HLE_0D61FC9FAAC9FCAD(Engines::Maxwell3D& maxwell3d, const std::vector<u32>& parameters) {
const std::vector<u32>& parameters) {
const u32 count = (maxwell3d.GetRegisterValue(0xD1B) & parameters[2]); const u32 count = (maxwell3d.GetRegisterValue(0xD1B) & parameters[2]);
maxwell3d.regs.vertex_buffer.first = parameters[3]; maxwell3d.regs.vertex_buffer.first = parameters[3];
@ -51,8 +49,7 @@ static void HLE_0D61FC9FAAC9FCAD(Engines::Maxwell3D& maxwell3d,
maxwell3d.mme_draw.current_mode = Engines::Maxwell3D::MMEDrawMode::Undefined; maxwell3d.mme_draw.current_mode = Engines::Maxwell3D::MMEDrawMode::Undefined;
} }
static void HLE_0217920100488FF7(Engines::Maxwell3D& maxwell3d, void HLE_0217920100488FF7(Engines::Maxwell3D& maxwell3d, const std::vector<u32>& parameters) {
const std::vector<u32>& parameters) {
const u32 instance_count = (maxwell3d.GetRegisterValue(0xD1B) & parameters[2]); const u32 instance_count = (maxwell3d.GetRegisterValue(0xD1B) & parameters[2]);
const u32 element_base = parameters[4]; const u32 element_base = parameters[4];
const u32 base_instance = parameters[5]; const u32 base_instance = parameters[5];
@ -80,12 +77,12 @@ static void HLE_0217920100488FF7(Engines::Maxwell3D& maxwell3d,
maxwell3d.CallMethodFromMME(0x8e5, 0x0); maxwell3d.CallMethodFromMME(0x8e5, 0x0);
maxwell3d.mme_draw.current_mode = Engines::Maxwell3D::MMEDrawMode::Undefined; maxwell3d.mme_draw.current_mode = Engines::Maxwell3D::MMEDrawMode::Undefined;
} }
} // namespace } // Anonymous namespace
constexpr std::array<std::pair<u64, HLEFunction>, 3> hle_funcs{{ constexpr std::array<std::pair<u64, HLEFunction>, 3> hle_funcs{{
std::make_pair<u64, HLEFunction>(0x771BB18C62444DA0, &HLE_771BB18C62444DA0), {0x771BB18C62444DA0, &HLE_771BB18C62444DA0},
std::make_pair<u64, HLEFunction>(0x0D61FC9FAAC9FCAD, &HLE_0D61FC9FAAC9FCAD), {0x0D61FC9FAAC9FCAD, &HLE_0D61FC9FAAC9FCAD},
std::make_pair<u64, HLEFunction>(0x0217920100488FF7, &HLE_0217920100488FF7), {0x0217920100488FF7, &HLE_0217920100488FF7},
}}; }};
HLEMacro::HLEMacro(Engines::Maxwell3D& maxwell3d) : maxwell3d(maxwell3d) {} HLEMacro::HLEMacro(Engines::Maxwell3D& maxwell3d) : maxwell3d(maxwell3d) {}