aboutsummaryrefslogtreecommitdiff
path: root/src/DSi.cpp
diff options
context:
space:
mode:
authorJesse Talavera <jesse@jesse.tg>2023-12-12 05:07:22 -0500
committerGitHub <noreply@github.com>2023-12-12 11:07:22 +0100
commit9bfc9c08ffe88de4b54734d6fd03182c0a51e181 (patch)
tree28a9177f377f6ab85f9aabc54c3a523fd7d610ff /src/DSi.cpp
parent2cba2e783a2ef3a83b7d8bf0cb6e42a6298edbf6 (diff)
Sprinkle `const` around where appropriate (#1909)
* Sprinkle `const` around where appropriate - This will make it easier to use `NDS` objects in `const` contexts (e.g. `const` parameters or methods) * Remove the `const` qualifier on `DSi_DSP::DSPRead16` - MMIO reads can be non-pure, so this may not be `const` in the future
Diffstat (limited to 'src/DSi.cpp')
-rw-r--r--src/DSi.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/DSi.cpp b/src/DSi.cpp
index ce716db..c929c6d 100644
--- a/src/DSi.cpp
+++ b/src/DSi.cpp
@@ -181,7 +181,7 @@ std::unique_ptr<NDSCart::CartCommon> DSi::EjectCart()
return oldcart;
}
-void DSi::CamInputFrame(int cam, u32* data, int width, int height, bool rgb)
+void DSi::CamInputFrame(int cam, const u32* data, int width, int height, bool rgb)
{
switch (cam)
{
@@ -277,7 +277,7 @@ void DSi::SetCartInserted(bool inserted)
SCFG_MC |= 1;
}
-void DSi::DecryptModcryptArea(u32 offset, u32 size, u8* iv)
+void DSi::DecryptModcryptArea(u32 offset, u32 size, const u8* iv)
{
AES_ctx ctx;
u8 key[16];
@@ -957,21 +957,21 @@ void DSi::StallNDMAs()
}
-bool DSi::DMAsInMode(u32 cpu, u32 mode)
+bool DSi::DMAsInMode(u32 cpu, u32 mode) const
{
if (NDS::DMAsInMode(cpu, mode)) return true;
return NDMAsInMode(cpu, NDMAModes[mode]);
}
-bool DSi::DMAsRunning(u32 cpu)
+bool DSi::DMAsRunning(u32 cpu) const
{
if (NDS::DMAsRunning(cpu)) return true;
return NDMAsRunning(cpu);
}
-bool DSi::NDMAsInMode(u32 cpu, u32 mode)
+bool DSi::NDMAsInMode(u32 cpu, u32 mode) const
{
cpu <<= 2;
if (NDMAs[cpu+0].IsInMode(mode)) return true;
@@ -981,7 +981,7 @@ bool DSi::NDMAsInMode(u32 cpu, u32 mode)
return false;
}
-bool DSi::NDMAsRunning(u32 cpu)
+bool DSi::NDMAsRunning(u32 cpu) const
{
cpu <<= 2;
if (NDMAs[cpu+0].IsRunning()) return true;