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:
Jesse Talavera
2023-12-12 05:07:22 -05:00
committed by GitHub
parent 2cba2e783a
commit 9bfc9c08ff
57 changed files with 253 additions and 243 deletions

View File

@ -256,7 +256,7 @@ void NDS::InitTimings()
// handled later: GBA slot, wifi
}
bool NDS::NeedsDirectBoot()
bool NDS::NeedsDirectBoot() const
{
if (ConsoleType == 1)
{
@ -1152,7 +1152,7 @@ void NDS::SetKeyMask(u32 mask)
CheckKeyIRQ(1, oldkey, KeyInput);
}
bool NDS::IsLidClosed()
bool NDS::IsLidClosed() const
{
if (KeyInput & (1<<23)) return true;
return false;
@ -1345,7 +1345,7 @@ void NDS::ClearIRQ2(u32 irq)
UpdateIRQ(1);
}
bool NDS::HaltInterrupted(u32 cpu)
bool NDS::HaltInterrupted(u32 cpu) const
{
if (cpu == 0)
{
@ -1416,7 +1416,7 @@ void NDS::EnterSleepMode()
ARM7.Halt(2);
}
u32 NDS::GetPC(u32 cpu)
u32 NDS::GetPC(u32 cpu) const
{
return cpu ? ARM7.R[15] : ARM9.R[15];
}
@ -1644,7 +1644,7 @@ void NDS::TimerStart(u32 id, u16 cnt)
bool NDS::DMAsInMode(u32 cpu, u32 mode)
bool NDS::DMAsInMode(u32 cpu, u32 mode) const
{
cpu <<= 2;
if (DMAs[cpu+0].IsInMode(mode)) return true;
@ -1655,7 +1655,7 @@ bool NDS::DMAsInMode(u32 cpu, u32 mode)
return false;
}
bool NDS::DMAsRunning(u32 cpu)
bool NDS::DMAsRunning(u32 cpu) const
{
cpu <<= 2;
if (DMAs[cpu+0].IsRunning()) return true;