recording: Append copyright headers

Squashed commits:

[47be08613] recording: Forgot to refactor the usage of std::size
This commit is contained in:
Tyler Wilding 2018-11-22 23:00:56 -05:00 committed by lightningterror
parent 64104ca9fd
commit 08d923ca6f
19 changed files with 280 additions and 41 deletions

3
.gitignore vendored
View File

@ -57,8 +57,7 @@ oprofile_data/
*.p2s
*.p2m2
*.p2m2_backup
*.p2m
*.p2m_backup
*.p2m2_SaveState.p2s
# Visual Studio upgrades
/Backup*

View File

@ -1,3 +1,18 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2019 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "PrecompiledHeader.h"
#include "AppSaveStates.h"

View File

@ -1,3 +1,18 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2019 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "InputRecordingFile.h"

View File

@ -1,3 +1,18 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2019 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "PrecompiledHeader.h"
#include "App.h"
@ -10,7 +25,7 @@
#define HEADER_SIZE (sizeof(InputRecordingHeader)+4+4)
#define SAVESTATE_HEADER_SIZE (sizeof(bool))
#define BLOCK_HEADER_SIZE (0)
#define BLOCK_HEADER_SIZE (0)
#define BLOCK_DATA_SIZE (18*2)
#define BLOCK_SIZE (BLOCK_HEADER_SIZE+BLOCK_DATA_SIZE)
@ -85,7 +100,7 @@ bool InputRecordingFile::writeSaveState() {
return false;
fseek(recordingFile, SEEKPOINT_SAVESTATE, SEEK_SET);
if (fwrite(&savestate.fromSavestate, sizeof(bool), 1, recordingFile) != 1)
if (fwrite(&savestate.fromSavestate, sizeof(bool), 1, recordingFile) != 1)
return false;
return true;
@ -200,14 +215,14 @@ bool InputRecordingFile::InsertPadData(unsigned long frame, const PadData& key)
bool InputRecordingFile::UpdatePadData(unsigned long frame, const PadData& key)
{
if (recordingFile == NULL)
if (recordingFile == NULL)
return false;
if (!key.fExistKey)
if (!key.fExistKey)
return false;
long seek = _getBlockSeekPoint(frame) + BLOCK_HEADER_SIZE;
fseek(recordingFile, seek, SEEK_SET);
if (fwrite(key.buf, 1, BLOCK_DATA_SIZE, recordingFile) == 0)
if (fwrite(key.buf, 1, BLOCK_DATA_SIZE, recordingFile) == 0)
return false;
fflush(recordingFile);

View File

@ -1,3 +1,18 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2019 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "PadData.h"

View File

@ -1,3 +1,18 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2019 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "PrecompiledHeader.h"
#include "NewRecordingFrame.h"

View File

@ -1,3 +1,18 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2019 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <wx/wx.h>
#include <wx/filepicker.h>
@ -13,7 +28,7 @@ public:
wxString getFile() const;
wxString getAuthor() const;
int getFrom() const;
private:
wxStaticText *m_fileLabel;
wxFilePickerCtrl *m_filePicker;

View File

@ -1,3 +1,18 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2019 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "PrecompiledHeader.h"
#include "NewRecordingFrame.h"

View File

@ -1,3 +1,18 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2019 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <wx/wx.h>
@ -14,7 +29,7 @@ public:
wxString getFile() const;
wxString getAuthor() const;
int getFrom() const;
private:
wxStaticText *m_fileLabel;
wxFilePickerCtrl *m_filePicker;

View File

@ -1,3 +1,18 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2019 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "PrecompiledHeader.h"
#include "Common.h"
@ -20,7 +35,7 @@ PadData::PadData()
void PadData::logPadData(u8 port, u16 bufCount, u8 buf[512]) {
// skip first two bytes because they dont seem to matter
if (port == 0 && bufCount > 2)
if (port == 0 && bufCount > 2)
{
if (bufCount == 3)
{
@ -144,29 +159,29 @@ int PadData::getPressureByte(PadDataNormalButton button) const
{
// Pressure Byte Order
// R - L - U - D - Tri - Sqr - Circle - Cross - L1 - R1 - L2 - R2
if (button == UP)
if (button == UP)
return 2;
else if (button == LEFT)
else if (button == LEFT)
return 1;
else if (button == RIGHT)
else if (button == RIGHT)
return 0;
else if (button == DOWN)
else if (button == DOWN)
return 3;
else if (button == CROSS)
else if (button == CROSS)
return 6;
else if (button == CIRCLE)
else if (button == CIRCLE)
return 5;
else if (button == SQUARE)
else if (button == SQUARE)
return 7;
else if (button == TRIANGLE)
else if (button == TRIANGLE)
return 4;
else if (button == L1)
else if (button == L1)
return 8;
else if (button == L2)
return 10;
else if (button == R1)
else if (button == R1)
return 9;
else if (button == R2)
else if (button == R2)
return 11;
else
return -1;

View File

@ -1,3 +1,18 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2019 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <map>

View File

@ -1,3 +1,18 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2019 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "PrecompiledHeader.h"
#include "GSFrame.h"

View File

@ -1,3 +1,18 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2019 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
class RecordingControls {
@ -21,7 +36,7 @@ public:
private:
uint stopFrameCount = false;
bool fStop = false;
bool fStart = false;
bool fFrameAdvance = false;

View File

@ -1,3 +1,18 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2019 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "PrecompiledHeader.h"
#include "RecordingInputManager.h"

View File

@ -1,3 +1,18 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2019 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include "PadData.h"

View File

@ -1,3 +1,18 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2019 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#include "PrecompiledHeader.h"
#include "Common.h"
@ -15,7 +30,7 @@ wxEND_EVENT_TABLE()
VirtualPad::VirtualPad(wxWindow* parent, wxWindowID id, const wxString& title, int controllerPort, const wxPoint& pos, const wxSize& size, long style) :
wxFrame(parent, id, title, pos, size, wxDEFAULT_FRAME_STYLE)
{
// Define components
// Define components
SetSize(wxSize(1000, 700));
l2Button = new wxToggleButton(this, wxID_ANY, wxT("L2"));
l2ButtonPressure = new wxSpinCtrl(this, wxID_ANY, wxT("0"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 255, 255);
@ -58,8 +73,8 @@ VirtualPad::VirtualPad(wxWindow* parent, wxWindowID id, const wxString& title, i
VirtualPad::controllerPort = controllerPort;
// NOTE: Order MATTERS, these match enum defined in PadData.h
wxToggleButton* tempButtons[16] = {
// Pressure sensitive buttons
wxToggleButton* tempButtons[16] = {
// Pressure sensitive buttons
upButton, rightButton, leftButton, downButton,
crossButton, circleButton, squareButton, triangleButton,
l1Button, l2Button, r1Button, r2Button,
@ -85,23 +100,23 @@ VirtualPad::VirtualPad(wxWindow* parent, wxWindowID id, const wxString& title, i
std::copy(std::begin(tempAnalogVals), std::end(tempAnalogVals), std::begin(analogVals));
// Setup event bindings
for (int i = 0; i < std::size(buttons); i++)
for (int i = 0; i < buttonsLength; i++)
{
(*buttons[i]).Bind(wxEVT_TOGGLEBUTTON, &VirtualPad::OnButtonPress, this);
}
for (int i = 0; i < std::size(buttonsPressure); i++)
for (int i = 0; i < buttonsPressureLength; i++)
{
(*buttonsPressure[i]).Bind(wxEVT_SPINCTRL, &VirtualPad::OnPressureChange, this);
}
for (int i = 0; i < std::size(analogSliders); i++)
for (int i = 0; i < analogSlidersLength; i++)
{
(*analogSliders[i]).Bind(wxEVT_SLIDER, &VirtualPad::OnAnalogSliderChange, this);
}
for (int i = 0; i < std::size(analogVals); i++)
for (int i = 0; i < analogValsLength; i++)
{
(*analogVals[i]).Bind(wxEVT_SPINCTRL, &VirtualPad::OnAnalogValChange, this);
}
// Finalize layout
SetProperties();
DoLayout();
@ -138,14 +153,14 @@ void VirtualPad::OnButtonPress(wxCommandEvent & event)
{
wxToggleButton* pressedButton = (wxToggleButton*) event.GetEventObject();
int buttonId = -1;
for (int i = 0; i < std::size(buttons); i++)
for (int i = 0; i < buttonsLength; i++)
{
if (pressedButton == buttons[i])
if (pressedButton == buttons[i])
{
buttonId = i;
}
}
if (buttonId != -1)
if (buttonId != -1)
{
u8 pressure = 0;
if (event.IsChecked())
@ -167,7 +182,7 @@ void VirtualPad::OnPressureChange(wxSpinEvent & event)
{
wxSpinCtrl* updatedSpinner = (wxSpinCtrl*) event.GetEventObject();
int spinnerId = -1;
for (int i = 0; i < std::size(buttonsPressure); i++)
for (int i = 0; i < buttonsPressureLength; i++)
{
if (updatedSpinner == buttonsPressure[i])
{
@ -189,7 +204,7 @@ void VirtualPad::OnAnalogSliderChange(wxCommandEvent & event)
{
wxSlider* movedSlider = (wxSlider*) event.GetEventObject();
int sliderId = -1;
for (int i = 0; i < std::size(analogSliders); i++)
for (int i = 0; i < analogSlidersLength; i++)
{
if (movedSlider == analogSliders[i])
{
@ -198,14 +213,14 @@ void VirtualPad::OnAnalogSliderChange(wxCommandEvent & event)
}
if (sliderId != -1)
{
if (sliderId % 2 == 0)
if (sliderId % 2 == 0)
{
analogVals[sliderId]->SetValue(event.GetInt());
analogVals[sliderId]->SetValue(event.GetInt());
}
else {
analogVals[sliderId]->SetValue(event.GetInt() * -1);
}
g_RecordingInput.UpdateAnalog(controllerPort, PadDataAnalogVector(sliderId), event.GetInt() + 127);
}
}
@ -214,7 +229,7 @@ void VirtualPad::OnAnalogValChange(wxSpinEvent & event)
{
wxSpinCtrl* updatedSpinner = (wxSpinCtrl*)event.GetEventObject();
int spinnerId = -1;
for (int i = 0; i < std::size(analogVals); i++)
for (int i = 0; i < analogValsLength; i++)
{
if (updatedSpinner == analogVals[i])
{

View File

@ -1,3 +1,18 @@
/* PCSX2 - PS2 Emulator for PCs
* Copyright (C) 2002-2019 PCSX2 Dev Team
*
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with PCSX2.
* If not, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <wx/wx.h>

View File

@ -740,7 +740,7 @@ EXPORT_C_(uint32) GSmakeSnapshot(char* path)
{
std::string s{path};
if (!s.empty() && s[s.length() - 1] != DIRECTORY_SEPARATOR)
if(!s.empty() && s[s.length() - 1] != DIRECTORY_SEPARATOR)
{
s = s + DIRECTORY_SEPARATOR;
}

View File

@ -499,7 +499,7 @@ void GSRenderer::VSync(int field)
bool GSRenderer::MakeSnapshot(const std::string& path)
{
if (m_snapshot.empty())
if(m_snapshot.empty())
{
time_t cur_time = time(nullptr);
static time_t prev_snap;