Skip to content

Commit

Permalink
recording: Append copyright headers
Browse files Browse the repository at this point in the history
Squashed commits:

[47be086] recording: Forgot to refactor the usage of std::size
  • Loading branch information
xTVaser authored and lightningterror committed Apr 20, 2019
1 parent 64104ca commit 08d923c
Show file tree
Hide file tree
Showing 19 changed files with 280 additions and 41 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ oprofile_data/
*.p2s
*.p2m2
*.p2m2_backup
*.p2m
*.p2m_backup
*.p2m2_SaveState.p2s

# Visual Studio upgrades
/Backup*
Expand Down
15 changes: 15 additions & 0 deletions pcsx2/Recording/InputRecording.cpp
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
15 changes: 15 additions & 0 deletions pcsx2/Recording/InputRecording.h
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
25 changes: 20 additions & 5 deletions pcsx2/Recording/InputRecordingFile.cpp
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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)

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down
15 changes: 15 additions & 0 deletions pcsx2/Recording/InputRecordingFile.h
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
15 changes: 15 additions & 0 deletions pcsx2/Recording/KeyMovieFrame.cpp
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
17 changes: 16 additions & 1 deletion pcsx2/Recording/KeyMovieFrame.h
Original file line number Diff line number Diff line change
@@ -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>
Expand All @@ -13,7 +28,7 @@ class NewRecordingFrame : public wxDialog
wxString getFile() const;
wxString getAuthor() const;
int getFrom() const;

private:
wxStaticText *m_fileLabel;
wxFilePickerCtrl *m_filePicker;
Expand Down
15 changes: 15 additions & 0 deletions pcsx2/Recording/NewRecordingFrame.cpp
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
17 changes: 16 additions & 1 deletion pcsx2/Recording/NewRecordingFrame.h
Original file line number Diff line number Diff line change
@@ -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>
Expand All @@ -14,7 +29,7 @@ class NewRecordingFrame : public wxDialog
wxString getFile() const;
wxString getAuthor() const;
int getFrom() const;

private:
wxStaticText *m_fileLabel;
wxFilePickerCtrl *m_filePicker;
Expand Down
39 changes: 27 additions & 12 deletions pcsx2/Recording/PadData.cpp
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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)
{
Expand Down Expand Up @@ -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;
Expand Down
15 changes: 15 additions & 0 deletions pcsx2/Recording/PadData.h
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
15 changes: 15 additions & 0 deletions pcsx2/Recording/RecordingControls.cpp
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
17 changes: 16 additions & 1 deletion pcsx2/Recording/RecordingControls.h
Original file line number Diff line number Diff line change
@@ -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 {
Expand All @@ -21,7 +36,7 @@ class RecordingControls {

private:
uint stopFrameCount = false;

bool fStop = false;
bool fStart = false;
bool fFrameAdvance = false;
Expand Down
15 changes: 15 additions & 0 deletions pcsx2/Recording/RecordingInputManager.cpp
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
15 changes: 15 additions & 0 deletions pcsx2/Recording/RecordingInputManager.h
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
Loading

0 comments on commit 08d923c

Please sign in to comment.