diff --git a/Core/AVIDump.cpp b/Core/AVIDump.cpp index ce02743d02..456698936b 100644 --- a/Core/AVIDump.cpp +++ b/Core/AVIDump.cpp @@ -92,7 +92,7 @@ bool AVIDump::CreateAVI() { // Use gameID_EmulatedTimestamp for filename std::string discID = g_paramSFO.GetDiscID(); - std::string video_file_name = StringFromFormat("%s%s_%d.avi", GetSysDirectory(DIRECTORY_VIDEO).c_str(), discID.c_str(), returnEmulatedTime()).c_str(); + std::string video_file_name = StringFromFormat("%s%s_%d.avi", GetSysDirectory(DIRECTORY_VIDEO).c_str(), discID.c_str(), KernelTimeNow()).c_str(); s_format_context = avformat_alloc_context(); std::stringstream s_file_index_str; diff --git a/Core/HLE/__sceAudio.cpp b/Core/HLE/__sceAudio.cpp index a6185256cd..ed9c7c1c76 100644 --- a/Core/HLE/__sceAudio.cpp +++ b/Core/HLE/__sceAudio.cpp @@ -387,7 +387,7 @@ void __AudioUpdate(bool resetRecording) { if (g_Config.bSaveLoadResetsAVdumping && resetRecording) { __StopLogAudio(); std::string discID = g_paramSFO.GetDiscID(); - std::string audio_file_name = StringFromFormat("%s%s_%d.wav", GetSysDirectory(DIRECTORY_AUDIO).c_str(), discID.c_str(), returnEmulatedTime()).c_str(); + std::string audio_file_name = StringFromFormat("%s%s_%d.wav", GetSysDirectory(DIRECTORY_AUDIO).c_str(), discID.c_str(), KernelTimeNow()).c_str(); INFO_LOG(COMMON, "Restarted audio recording to: %s", audio_file_name.c_str()); if (!File::Exists(GetSysDirectory(DIRECTORY_AUDIO))) File::CreateDir(GetSysDirectory(DIRECTORY_AUDIO)); @@ -398,7 +398,7 @@ void __AudioUpdate(bool resetRecording) { if (g_Config.bDumpAudio) { // Use gameID_EmulatedTimestamp for filename std::string discID = g_paramSFO.GetDiscID(); - std::string audio_file_name = StringFromFormat("%s%s_%d.wav", GetSysDirectory(DIRECTORY_AUDIO).c_str(), discID.c_str(), returnEmulatedTime()).c_str(); + std::string audio_file_name = StringFromFormat("%s%s_%d.wav", GetSysDirectory(DIRECTORY_AUDIO).c_str(), discID.c_str(), KernelTimeNow()).c_str(); INFO_LOG(COMMON,"Recording audio to: %s", audio_file_name.c_str()); // Create the path just in case it doesn't exist if (!File::Exists(GetSysDirectory(DIRECTORY_AUDIO))) diff --git a/Core/HLE/sceKernelTime.cpp b/Core/HLE/sceKernelTime.cpp index 32265fdf1b..a4f2df2a60 100644 --- a/Core/HLE/sceKernelTime.cpp +++ b/Core/HLE/sceKernelTime.cpp @@ -172,6 +172,6 @@ u32 sceKernelLibcGettimeofday(u32 timeAddr, u32 tzAddr) return 0; } -u32 returnEmulatedTime() { +u32 KernelTimeNow() { return (u32)start_time + (u32)(CoreTiming::GetGlobalTimeUs() / 1000000ULL); } \ No newline at end of file diff --git a/Core/HLE/sceKernelTime.h b/Core/HLE/sceKernelTime.h index df81f20663..15c064d7ce 100644 --- a/Core/HLE/sceKernelTime.h +++ b/Core/HLE/sceKernelTime.h @@ -27,7 +27,7 @@ int sceKernelSysClock2USec(u32 sysclockPtr, u32 highPtr, u32 lowPtr); int sceKernelSysClock2USecWide(u32 lowClock, u32 highClock, u32 lowPtr, u32 highPtr); u64 sceKernelUSec2SysClockWide(u32 usec); u32 sceKernelLibcClock(); -u32 returnEmulatedTime(); +u32 KernelTimeNow(); void __KernelTimeInit(); void __KernelTimeDoState(PointerWrap &p); diff --git a/Core/SaveState.cpp b/Core/SaveState.cpp index ebed78f879..7c3719f1a0 100644 --- a/Core/SaveState.cpp +++ b/Core/SaveState.cpp @@ -49,9 +49,6 @@ #ifndef MOBILE_DEVICE #include "Core/AVIDump.h" #include "Core/HLE/__sceAudio.h" - -AVIDump video; -WAVDump audio; #endif namespace SaveState @@ -602,11 +599,11 @@ namespace SaveState #ifndef MOBILE_DEVICE if (g_Config.bSaveLoadResetsAVdumping) { if (g_Config.bDumpFrames) { - video.Stop(); - video.Start(PSP_CoreParameter().renderWidth, PSP_CoreParameter().renderHeight); + AVIDump::Stop(); + AVIDump::Start(PSP_CoreParameter().renderWidth, PSP_CoreParameter().renderHeight); } if (g_Config.bDumpAudio) { - audio.Reset(); + WAVDump::Reset(); } } #endif @@ -637,11 +634,11 @@ namespace SaveState #ifndef MOBILE_DEVICE if (g_Config.bSaveLoadResetsAVdumping) { if (g_Config.bDumpFrames) { - video.Stop(); - video.Start(PSP_CoreParameter().renderWidth, PSP_CoreParameter().renderHeight); + AVIDump::Stop(); + AVIDump::Start(PSP_CoreParameter().renderWidth, PSP_CoreParameter().renderHeight); } if (g_Config.bDumpAudio) { - audio.Reset(); + WAVDump::Reset(); } } #endif diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index fc089d3c3c..f8d8727899 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -79,7 +79,7 @@ #endif #ifndef MOBILE_DEVICE -AVIDump avi; +static AVIDump avi; #endif static bool frameStep_;