diff options
author | Arisotura <thetotalworm@gmail.com> | 2022-10-02 23:29:24 +0200 |
---|---|---|
committer | Arisotura <thetotalworm@gmail.com> | 2022-10-02 23:29:24 +0200 |
commit | 571d1c403f516f62bd4ae2ea3fba52266c7e9dc3 (patch) | |
tree | e071449d4d55c79663de388b971617886cd85cb4 /src | |
parent | 62879c44840f66a9854ab3938412b97828154d7f (diff) |
properly stop any started cameras upon reset/shutdown
Diffstat (limited to 'src')
-rw-r--r-- | src/DSi.cpp | 5 | ||||
-rw-r--r-- | src/DSi.h | 1 | ||||
-rw-r--r-- | src/DSi_Camera.cpp | 13 | ||||
-rw-r--r-- | src/DSi_Camera.h | 2 | ||||
-rw-r--r-- | src/NDS.cpp | 3 |
5 files changed, 24 insertions, 0 deletions
diff --git a/src/DSi.cpp b/src/DSi.cpp index 0217261..cfce0ac 100644 --- a/src/DSi.cpp +++ b/src/DSi.cpp @@ -172,6 +172,11 @@ void Reset() GPU::DispStat[1] |= (1<<6); } +void Stop() +{ + DSi_CamModule::Stop(); +} + void DoSavestate(Savestate* file) { file->Section("DSIG"); @@ -56,6 +56,7 @@ extern u32 NWRAMMask[2][3]; bool Init(); void DeInit(); void Reset(); +void Stop(); void DoSavestate(Savestate* file); diff --git a/src/DSi_Camera.cpp b/src/DSi_Camera.cpp index 3c9db2d..dcf41a9 100644 --- a/src/DSi_Camera.cpp +++ b/src/DSi_Camera.cpp @@ -83,6 +83,12 @@ void Reset() NDS::ScheduleEvent(NDS::Event_DSi_CamIRQ, true, kIRQInterval, IRQ, 0); } +void Stop() +{ + Camera0->Stop(); + Camera1->Stop(); +} + void DoSavestate(Savestate* file) { file->Section("CAMi"); @@ -418,6 +424,8 @@ void Camera::DoSavestate(Savestate* file) void Camera::Reset() { + Platform::Camera_Stop(Num); + DataPos = 0; RegAddr = 0; RegData = 0; @@ -439,6 +447,11 @@ void Camera::Reset() memset(FrameBuffer, 0, (640*480/2)*sizeof(u32)); } +void Camera::Stop() +{ + Platform::Camera_Stop(Num); +} + bool Camera::IsActivated() { if (StandbyCnt & (1<<14)) return false; // standby diff --git a/src/DSi_Camera.h b/src/DSi_Camera.h index 75e97f2..bf18e59 100644 --- a/src/DSi_Camera.h +++ b/src/DSi_Camera.h @@ -33,6 +33,7 @@ extern Camera* Camera1; bool Init(); void DeInit(); void Reset(); +void Stop(); void DoSavestate(Savestate* file); @@ -56,6 +57,7 @@ public: void DoSavestate(Savestate* file); void Reset(); + void Stop(); bool IsActivated(); void StartTransfer(); diff --git a/src/NDS.cpp b/src/NDS.cpp index 4118836..966b252 100644 --- a/src/NDS.cpp +++ b/src/NDS.cpp @@ -693,6 +693,9 @@ void Stop() Platform::StopEmu(); GPU::Stop(); SPU::Stop(); + + if (ConsoleType == 1) + DSi::Stop(); } bool DoSavestate_Scheduler(Savestate* file) |