From cb7425c59f39fe9718a4f4fe39f584cd9805655b Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Sun, 15 Jul 2018 21:21:46 -0400 Subject: [PATCH] recording: removed C++ reserved pattern usages, removed japanese comments --- pcsx2/DebugTools/Debug.h | 2 +- pcsx2/Recording/InputRecording.cpp | 30 +++++++++++------------- pcsx2/Recording/InputRecording.h | 5 ---- pcsx2/Recording/InputRecordingEditor.cpp | 3 +-- pcsx2/Recording/InputRecordingEditor.h | 4 ---- pcsx2/Recording/InputRecordingFile.h | 18 ++------------ pcsx2/Recording/NewRecordingFrame.h | 2 +- pcsx2/Recording/PadData.h | 5 ---- pcsx2/Recording/RecordingControls.cpp | 22 ++++++++--------- pcsx2/Recording/RecordingControls.h | 4 ---- pcsx2/Recording/RecordingInputManager.h | 1 + pcsx2/Recording/VirtualPad.h | 1 + 12 files changed, 31 insertions(+), 66 deletions(-) diff --git a/pcsx2/DebugTools/Debug.h b/pcsx2/DebugTools/Debug.h index d67d7bcee2..3adb63fc29 100644 --- a/pcsx2/DebugTools/Debug.h +++ b/pcsx2/DebugTools/Debug.h @@ -403,4 +403,4 @@ extern void __Log( const char* fmt, ... ); #ifndef DISABLE_RECORDING # define recordingConLog SysConsole.recordingConsole.IsActive() && SysConsole.recordingConsole.Write # define controlLog SysConsole.controlInfo.IsActive() && SysConsole.controlInfo.Write -#endif \ No newline at end of file +#endif diff --git a/pcsx2/Recording/InputRecording.cpp b/pcsx2/Recording/InputRecording.cpp index f8ba129616..f2ee85ece9 100644 --- a/pcsx2/Recording/InputRecording.cpp +++ b/pcsx2/Recording/InputRecording.cpp @@ -1,10 +1,10 @@ #include "PrecompiledHeader.h" -#include "MemoryTypes.h" +#include "AppSaveStates.h" #include "Common.h" -#include "Counters.h" // use"g_FrameCount" -#include "SaveState.h" // create "SaveStateBase::InputRecordingFreeze()" -#include "AppSaveStates.h" // use "States_GetCurrentSlot()" +#include "Counters.h" +#include "MemoryTypes.h" +#include "SaveState.h" #include "Recording/RecordingControls.h" #include "InputRecording.h" @@ -14,29 +14,27 @@ InputRecording g_InputRecording; -//----------------------------------------------- -// Save or Load - Save frame number -// Save or load - �Ńt���[�����̕ۑ� -//----------------------------------------------- +// -------------------------------- +// Tag and save framecount along with savestate +// -------------------------------- void SaveStateBase::InputRecordingFreeze() { FreezeTag("InputRecording"); - Freeze(g_FrameCount); // Somehow the function saved the frame successfully - // Freeze�֐��łȂ���frame�̕ۑ������܂������� - + Freeze(g_FrameCount); if (IsLoading()) { g_InputRecordingData.addUndoCount(); } } //---------------------------------- -// Main func for handling recording and inputting controller data +// Main func for handling controller input data // Called by Sio.cpp::sioWriteController //---------------------------------- void InputRecording::ControllerInterrupt(u8 &data, u8 &port, u16 & bufCount, u8 buf[]) { + // TODO - Multi-Tap Support // Only examine controllers 1 / 2 - if (port < 0 || 1 < port ) + if (port < 0 || 1 < port) return; //========================== @@ -47,7 +45,7 @@ void InputRecording::ControllerInterrupt(u8 &data, u8 &port, u16 & bufCount, u8 // See - Lilypad.cpp:1254 // 0x42 is the magic number for the default read query // - // NOTE: this appears to possibly break if you have logging enabled in LilyPad's config! + // NOTE: this appears to break if you have logging enabled in LilyPad's config! //========================== if (bufCount == 1) { if (data == 0x42) @@ -59,7 +57,7 @@ void InputRecording::ControllerInterrupt(u8 &data, u8 &port, u16 & bufCount, u8 return; } } - else if ( bufCount == 2 ){ + else if ( bufCount == 2 ) { // See - LilyPad.cpp:1255 // 0x5A is always the second byte in the buffer // when the normal READ_DATA_AND_VIBRRATE (0x42) @@ -77,7 +75,7 @@ void InputRecording::ControllerInterrupt(u8 &data, u8 &port, u16 & bufCount, u8 return; // We do not want to record or save the first two - // bytes in the return from LilyPad + // bytes in the data returned from LilyPad if (bufCount < 3) return; diff --git a/pcsx2/Recording/InputRecording.h b/pcsx2/Recording/InputRecording.h index 6911a032cf..e6afe1cf06 100644 --- a/pcsx2/Recording/InputRecording.h +++ b/pcsx2/Recording/InputRecording.h @@ -1,6 +1,4 @@ #pragma once -#ifndef __KEY_MOVIE_H__ -#define __KEY_MOVIE_H__ #include "InputRecordingFile.h" @@ -47,6 +45,3 @@ private: extern InputRecording g_InputRecording; #define g_InputRecordingData (g_InputRecording.getInputRecordingData()) #define g_InputRecordingHeader (g_InputRecording.getInputRecordingData().getHeader()) - - -#endif diff --git a/pcsx2/Recording/InputRecordingEditor.cpp b/pcsx2/Recording/InputRecordingEditor.cpp index 050ab79441..8eacf3a90b 100644 --- a/pcsx2/Recording/InputRecordingEditor.cpp +++ b/pcsx2/Recording/InputRecordingEditor.cpp @@ -169,8 +169,7 @@ void InputRecordingEditor::FrameUpdate() //------------------------------- void InputRecordingEditor::DrawKeyFrameList(long selectFrame) { - // Decide the number of frames to display - // �\������t���[������߂� + // Determine the number of frames to display int start = selectFrame - 100; unsigned int end = selectFrame +100; if (start < 0) { diff --git a/pcsx2/Recording/InputRecordingEditor.h b/pcsx2/Recording/InputRecordingEditor.h index 53d3ef249b..7ff1de9d30 100644 --- a/pcsx2/Recording/InputRecordingEditor.h +++ b/pcsx2/Recording/InputRecordingEditor.h @@ -1,6 +1,4 @@ #pragma once -#ifndef __KEY_EDITOR_H__ -#define __KEY_EDITOR_H__ #include #include @@ -65,5 +63,3 @@ private: wxDECLARE_EVENT_TABLE(); }; - -#endif diff --git a/pcsx2/Recording/InputRecordingFile.h b/pcsx2/Recording/InputRecordingFile.h index f0f23a5d01..371a702bab 100644 --- a/pcsx2/Recording/InputRecordingFile.h +++ b/pcsx2/Recording/InputRecordingFile.h @@ -1,24 +1,14 @@ #pragma once -#ifndef __KEY_MOVIE_ONFILE_H__ -#define __KEY_MOVIE_ONFILE_H__ #include "PadData.h" #include "System.h" -//---------------------------- -// header -// fseek since the direct place designation is done with, the order of the variables is important -// Specifically, "FrameMax" +2 "UndoCount" is located at the position of +6 bytes -// fseek�Œ��ڏꏊ�w�肵�Ă���̂ŕϐ��̏��Ԃ͑厖 -// ��̓I�ɂ́uFrameMax�v��+2�uUndoCount�v��+6�o�C�g�̈ʒu�ɔz�u -//---------------------------- struct InputRecordingHeader { u8 version = 3; - u8 ID = 0xCC; // Especially, there is no meaning, a key file or ID for judgment - // ���ɈӖ��͂Ȃ��Akey�t�@�C��������p��ID + u8 ID = 0xCC; - char emu[50] = "PCSX2-1.4.0-rr"; + char emu[50] = "pcsx2-1.5.X"; char author[50] = ""; char cdrom[50] = ""; @@ -105,7 +95,3 @@ private: }; - - - -#endif diff --git a/pcsx2/Recording/NewRecordingFrame.h b/pcsx2/Recording/NewRecordingFrame.h index 7631bdac5f..ad273270f1 100644 --- a/pcsx2/Recording/NewRecordingFrame.h +++ b/pcsx2/Recording/NewRecordingFrame.h @@ -1,4 +1,5 @@ #pragma once + #include #include @@ -24,4 +25,3 @@ private: wxButton *m_startRecording; wxButton *m_cancelRecording; }; - diff --git a/pcsx2/Recording/PadData.h b/pcsx2/Recording/PadData.h index abd11d7494..73c5a1105d 100644 --- a/pcsx2/Recording/PadData.h +++ b/pcsx2/Recording/PadData.h @@ -1,6 +1,4 @@ #pragma once -#ifndef __PAD_DATA_H__ -#define __PAD_DATA_H__ #include @@ -81,6 +79,3 @@ private: }; - - -#endif \ No newline at end of file diff --git a/pcsx2/Recording/RecordingControls.cpp b/pcsx2/Recording/RecordingControls.cpp index cf28738896..21ebeda7d8 100644 --- a/pcsx2/Recording/RecordingControls.cpp +++ b/pcsx2/Recording/RecordingControls.cpp @@ -3,30 +3,25 @@ #include "GSFrame.h" #include "MemoryTypes.h" -#include "App.h" // use "CoreThread" -#include "Counters.h" // use"g_FrameCount" +#include "App.h" +#include "Counters.h" #include "RecordingControls.h" RecordingControls g_RecordingControls; +// TODO - I think these functions could be named a lot better... //----------------------------------------------- -// The game is running with CoreThread, and it will not accept processing of GSFrame (wxFrame) while it is running -// (It seems that two places are accepted for key input within CoreThread and GSFrame, too) -// While CoreThread is stopped, the input of wxFrame works like a mechanism -// �Q�[����CoreThread�œ����Ă���A�����Ă���Ԃ�GSFrame(wxFrame)�̏�����󂯕t���Ȃ� -// (�L�[���͂̎󂯕t����CoreThread���GSFrame���2�ӏ����ݒ肳��Ă���ۂ�) -// CoreThread����~���Ă���Ԃ�wxFrame�̓��͂������d�g�݂��ۂ� +// Status on whether or not the current recording is stopped //----------------------------------------------- - bool RecordingControls::isStop() { return (fPauseState && CoreThread.IsOpen() && CoreThread.IsPaused()); } //----------------------------------------------- -// Counters(CoreThread)��̒�~����p (For stop judgment in) +// Called after inputs are recorded for that frame, places lock on input recording, effectively releasing resources and resuming CoreThread. //----------------------------------------------- void RecordingControls::StartCheck() { @@ -37,6 +32,10 @@ void RecordingControls::StartCheck() } } +//----------------------------------------------- +// Called at VSYNC End / VRender Begin, updates everything recording related for the next frame, +// toggles RecordingControl flags back to enable input recording for the next frame. +//----------------------------------------------- void RecordingControls::StopCheck() { if (fFrameAdvance) { @@ -62,8 +61,7 @@ void RecordingControls::StopCheck() if (fStop && CoreThread.IsOpen() && CoreThread.IsRunning()) { fPauseState = true; - CoreThread.PauseSelf(); // I can not stop unless it is self - // self����Ȃ��Ǝ~�܂�Ȃ� + CoreThread.PauseSelf(); } } diff --git a/pcsx2/Recording/RecordingControls.h b/pcsx2/Recording/RecordingControls.h index e7a2aacfe3..054cf5ff5f 100644 --- a/pcsx2/Recording/RecordingControls.h +++ b/pcsx2/Recording/RecordingControls.h @@ -1,6 +1,4 @@ #pragma once -#ifndef __MOVIE_CONTROLS_H__ -#define __MOVIE_CONTROLS_H__ class RecordingControls { public: @@ -31,5 +29,3 @@ private: }; extern RecordingControls g_RecordingControls; - -#endif diff --git a/pcsx2/Recording/RecordingInputManager.h b/pcsx2/Recording/RecordingInputManager.h index 978ceef362..1bbcb976a0 100644 --- a/pcsx2/Recording/RecordingInputManager.h +++ b/pcsx2/Recording/RecordingInputManager.h @@ -1,4 +1,5 @@ #pragma once + #include "PadData.h" class RecordingInputManager diff --git a/pcsx2/Recording/VirtualPad.h b/pcsx2/Recording/VirtualPad.h index 2c52272e53..e820c40b94 100644 --- a/pcsx2/Recording/VirtualPad.h +++ b/pcsx2/Recording/VirtualPad.h @@ -1,4 +1,5 @@ #pragma once + #include #include #include