Skip to content

VERY experimental Nintendo Switch 2 emulator

C++

Corrections and styling

Fernando Sahmkow5c4de1e3fb04
diff --git a/src/video_core/engines/engine_upload.cpp b/src/video_core/engines/engine_upload.cpp
index 201f8e273e..663d5517a0 100644
--- a/src/video_core/engines/engine_upload.cpp
+++ b/src/video_core/engines/engine_upload.cpp
@@ -9,11 +9,14 @@
namespace Tegra::Engines::Upload {
+State::State(MemoryManager& memory_manager, Data& regs)
+ : memory_manager(memory_manager), regs(regs) {}
+
void State::ProcessExec(const bool is_linear) {
write_offset = 0;
copy_size = regs.line_length_in * regs.line_count;
inner_buffer.resize(copy_size);
- linear = is_linear;
+ this->is_linear = is_linear;
}
void State::ProcessData(const u32 data, const bool is_last_call) {
diff --git a/src/video_core/engines/engine_upload.h b/src/video_core/engines/engine_upload.h
index 3a817140ab..431f56030d 100644
--- a/src/video_core/engines/engine_upload.h
+++ b/src/video_core/engines/engine_upload.h
@@ -56,7 +56,7 @@ struct Data {
class State {
public:
- State(MemoryManager& memory_manager, Data& regs) : memory_manager(memory_manager), regs(regs) {}
+ State(MemoryManager& memory_manager, Data& regs);
~State() = default;
void ProcessExec(const bool is_linear);
@@ -66,7 +66,7 @@ private:
u32 write_offset = 0;
u32 copy_size = 0;
std::vector<u8> inner_buffer;
- bool linear;
+ bool is_linear;
Data& regs;
MemoryManager& memory_manager;
};
diff --git a/src/video_core/engines/kepler_compute.cpp b/src/video_core/engines/kepler_compute.cpp
index 28f1f6a7d2..7404a8163c 100644
--- a/src/video_core/engines/kepler_compute.cpp
+++ b/src/video_core/engines/kepler_compute.cpp
@@ -34,7 +34,7 @@ void KeplerCompute::CallMethod(const GPU::MethodCall& method_call) {
break;
}
case KEPLER_COMPUTE_REG_INDEX(data_upload): {
- bool is_last_call = method_call.IsLastCall();
+ const bool is_last_call = method_call.IsLastCall();
upload_state.ProcessData(method_call.argument, is_last_call);
if (is_last_call) {
system.GPU().Maxwell3D().dirty_flags.OnMemoryWrite();
diff --git a/src/video_core/engines/kepler_memory.cpp b/src/video_core/engines/kepler_memory.cpp
index 71fa499d3e..0561f676cb 100644
--- a/src/video_core/engines/kepler_memory.cpp
+++ b/src/video_core/engines/kepler_memory.cpp
@@ -31,7 +31,7 @@ void KeplerMemory::CallMethod(const GPU::MethodCall& method_call) {
break;
}
case KEPLERMEMORY_REG_INDEX(data): {
- bool is_last_call = method_call.IsLastCall();
+ const bool is_last_call = method_call.IsLastCall();
upload_state.ProcessData(method_call.argument, is_last_call);
if (is_last_call) {
system.GPU().Maxwell3D().dirty_flags.OnMemoryWrite();
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp
index 78810dbbb5..d7b586db93 100644
--- a/src/video_core/engines/maxwell_3d.cpp
+++ b/src/video_core/engines/maxwell_3d.cpp
@@ -258,7 +258,7 @@ void Maxwell3D::CallMethod(const GPU::MethodCall& method_call) {
break;
}
case MAXWELL3D_REG_INDEX(data_upload): {
- bool is_last_call = method_call.IsLastCall();
+ const bool is_last_call = method_call.IsLastCall();
upload_state.ProcessData(method_call.argument, is_last_call);
if (is_last_call) {
dirty_flags.OnMemoryWrite();