diff options
author | Jesse Talavera-Greenberg <jesse@jesse.tg> | 2023-11-09 15:54:51 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-09 21:54:51 +0100 |
commit | 4558be0d8eb79d276c89392b9410e6edb649db95 (patch) | |
tree | 3e2b37e31b38337adec64c5391e57ddf45af5d23 /src/ARM.cpp | |
parent | 88072a02c523e26390af6bd726608b3e567f996f (diff) |
Refactor the GPU to be object-oriented (#1873)
* Refactor GPU3D to be an object
- Who has two thumbs and is the sworn enemy of global state? This guy!
* Refactor GPU itself to be an object
- Wow, it's used in a lot of places
- Also introduce a new `Melon` namespace for a few classes
- I expect other classes will be moved into `Melon` over time
* Change signature of Renderer3D::SetRenderSettings
- Make it noexcept, and its argument const
* Remove some stray whitespace
Diffstat (limited to 'src/ARM.cpp')
-rw-r--r-- | src/ARM.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ARM.cpp b/src/ARM.cpp index 4f2f892..18d50fe 100644 --- a/src/ARM.cpp +++ b/src/ARM.cpp @@ -109,10 +109,11 @@ u32 ARM::ConditionTable[16] = }; -ARM::ARM(u32 num) +ARM::ARM(u32 num, Melon::GPU& gpu) : #ifdef GDBSTUB_ENABLED - : GdbStub(this, Platform::GetConfigInt(num ? Platform::GdbPortARM7 : Platform::GdbPortARM9)) + GdbStub(this, Platform::GetConfigInt(num ? Platform::GdbPortARM7 : Platform::GdbPortARM9)), #endif + GPU(gpu) { // well uh Num = num; @@ -133,7 +134,7 @@ ARM::~ARM() // dorp } -ARMv5::ARMv5() : ARM(0) +ARMv5::ARMv5(Melon::GPU& gpu) : ARM(0, gpu) { #ifndef JIT_ENABLED DTCM = new u8[DTCMPhysicalSize]; @@ -142,7 +143,7 @@ ARMv5::ARMv5() : ARM(0) PU_Map = PU_PrivMap; } -ARMv4::ARMv4() : ARM(1) +ARMv4::ARMv4(Melon::GPU& gpu) : ARM(1, gpu) { // } @@ -1144,7 +1145,7 @@ void ARM::WriteMem(u32 addr, int size, u32 v) void ARM::ResetGdb() { NDS::Reset(); - GPU::StartFrame(); // need this to properly kick off the scheduler & frame output + GPU.StartFrame(); // need this to properly kick off the scheduler & frame output } int ARM::RemoteCmd(const u8* cmd, size_t len) { |