mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-27 00:00:07 -06:00
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
This commit is contained in:
12
src/DSi.cpp
12
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;
|
||||
|
Reference in New Issue
Block a user