properly stop any started cameras upon reset/shutdown

This commit is contained in:
Arisotura
2022-10-02 23:29:24 +02:00
parent 62879c4484
commit 571d1c403f
5 changed files with 24 additions and 0 deletions

View File

@ -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