diff --git a/Source/Core/Core/Src/Core.cpp b/Source/Core/Core/Src/Core.cpp index 906e42a44e..404ea95f70 100644 --- a/Source/Core/Core/Src/Core.cpp +++ b/Source/Core/Core/Src/Core.cpp @@ -297,7 +297,7 @@ void Stop() // - Hammertime! SConfig::GetInstance().m_SYSCONF->Reload(); INFO_LOG(CONSOLE, "Stop [Main Thread]\t\t---- Shutdown complete ----"); - + Frame::g_InputCounter = 0; g_bStopping = false; } @@ -551,7 +551,7 @@ void VideoThrottle() #else // Summary information std::string SFPS; if (Frame::g_recordfd) - SFPS = StringFromFormat("Frame: %d | FPS: %u - VPS: %u - SPEED: %u%%", Frame::g_frameCounter, FPS, VPS, Speed); + SFPS = StringFromFormat("VI: %u - Frame: %u - FPS: %u - VPS: %u - SPEED: %u%%", Frame::g_frameCounter, Frame::g_InputCounter, FPS, VPS, Speed); else SFPS = StringFromFormat("FPS: %u - VPS: %u - SPEED: %u%%", FPS, VPS, Speed); #endif diff --git a/Source/Core/Core/Src/Core.h b/Source/Core/Core/Src/Core.h index 69814a7e97..4b45d4bad2 100644 --- a/Source/Core/Core/Src/Core.h +++ b/Source/Core/Core/Src/Core.h @@ -96,7 +96,7 @@ void RerecordingStart(); void RerecordingStop(); void WindBack(int Counter); -extern int g_FrameCounter; +extern int g_FrameCounter,g_InputCounter; extern bool g_FrameStep; #endif diff --git a/Source/Core/Core/Src/HW/SI_DeviceGCController.cpp b/Source/Core/Core/Src/HW/SI_DeviceGCController.cpp index 8cb56a4304..a928bc6874 100644 --- a/Source/Core/Core/Src/HW/SI_DeviceGCController.cpp +++ b/Source/Core/Core/Src/HW/SI_DeviceGCController.cpp @@ -32,7 +32,7 @@ #include "../CoreTiming.h" #include "SystemTimers.h" #include "ProcessorInterface.h" - +#include "../Core.h" // --- standard gamecube controller --- CSIDevice_GCController::CSIDevice_GCController(int _iDeviceNumber) @@ -140,11 +140,19 @@ bool CSIDevice_GCController::GetData(u32& _Hi, u32& _Low) Frame::SetPolledDevice(); if(Frame::IsPlayingInput()) + { Frame::PlayController(&PadStatus, ISIDevice::m_iDeviceNumber); + if(!Core::g_CoreStartupParameter.bWii) + Frame::InputUpdate(); + } else { if(Frame::IsRecordingInput()) + { Frame::RecordInput(&PadStatus, ISIDevice::m_iDeviceNumber); + if(!Core::g_CoreStartupParameter.bWii) + Frame::InputUpdate(); + } } // Thankfully changing mode does not change the high bits ;) diff --git a/Source/Core/Core/Src/OnFrame.cpp b/Source/Core/Core/Src/OnFrame.cpp index 9643079642..62d777e716 100644 --- a/Source/Core/Core/Src/OnFrame.cpp +++ b/Source/Core/Core/Src/OnFrame.cpp @@ -52,7 +52,7 @@ int g_numPads = 0; ControllerState g_padState; File::IOFile g_recordfd; -u64 g_frameCounter = 0, g_lagCounter = 0, g_totalFrameCount = 0; +u32 g_frameCounter = 0, g_lagCounter = 0, g_totalFrameCount = 0, g_InputCounter = 0; bool g_bRecordingFromSaveState = false; bool g_bPolled = false; @@ -93,6 +93,11 @@ void FrameUpdate() g_bPolled = false; } +void InputUpdate() +{ + g_InputCounter++; +} + void SetFrameSkipping(unsigned int framesToSkip) { std::lock_guard lk(cs_frameSkip); @@ -337,7 +342,7 @@ void RecordWiimote(int wiimote, u8 *data, s8 size) { if(!IsRecordingInput() || !IsUsingWiimote(wiimote)) return; - + g_InputCounter++; g_recordfd.WriteArray(&size, 1); g_recordfd.WriteArray(data, 1); } @@ -539,7 +544,7 @@ bool PlayWiimote(int wiimote, u8 *data, s8 &size) s8 count = 0; if(!IsPlayingInput() || !IsUsingWiimote(wiimote)) return false; - + g_InputCounter++; g_recordfd.ReadArray(&count, 1); size = (count > size) ? size : count; diff --git a/Source/Core/Core/Src/OnFrame.h b/Source/Core/Core/Src/OnFrame.h index 6a54fa8b2e..f2ccff6906 100644 --- a/Source/Core/Core/Src/OnFrame.h +++ b/Source/Core/Core/Src/OnFrame.h @@ -63,7 +63,7 @@ extern char g_playingFile[256]; extern File::IOFile g_recordfd; extern std::string g_recordFile; -extern u64 g_frameCounter, g_lagCounter; +extern u32 g_frameCounter, g_lagCounter, g_InputCounter; extern int g_numRerecords; @@ -94,6 +94,7 @@ struct DTMHeader { #pragma pack(pop) void FrameUpdate(); +void InputUpdate(); void SetPolledDevice();