/[pcsx2_0.9.7]/trunk/pcsx2/Patch.h
ViewVC logotype

Contents of /trunk/pcsx2/Patch.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 62 - (show annotations) (download)
Tue Sep 7 11:08:22 2010 UTC (9 years, 11 months ago) by william
File MIME type: text/plain
File size: 1755 byte(s)
Auto Commited Import of: pcsx2-0.9.7-r3738-debug in ./trunk
1 /* PCSX2 - PS2 Emulator for PCs
2 * Copyright (C) 2002-2010 PCSX2 Dev Team
3 *
4 * PCSX2 is free software: you can redistribute it and/or modify it under the terms
5 * of the GNU Lesser General Public License as published by the Free Software Found-
6 * ation, either version 3 of the License, or (at your option) any later version.
7 *
8 * PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10 * PURPOSE. See the GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License along with PCSX2.
13 * If not, see <http://www.gnu.org/licenses/>.
14 */
15
16 #pragma once
17
18 #include "Pcsx2Defs.h"
19 #include "SysForwardDefs.h"
20
21 #define MAX_PATCH 512
22 #define MAX_CHEAT 1024
23
24 enum patch_cpu_type {
25 NO_CPU,
26 CPU_EE,
27 CPU_IOP
28 };
29
30 enum patch_data_type {
31 NO_TYPE,
32 BYTE_T,
33 SHORT_T,
34 WORD_T,
35 DOUBLE_T,
36 EXTENDED_T
37 };
38
39 typedef void PATCHTABLEFUNC( const wxString& text1, const wxString& text2 );
40
41 struct IniPatch
42 {
43 int enabled;
44 int group;
45 patch_data_type type;
46 patch_cpu_type cpu;
47 int placetopatch;
48 u32 addr;
49 u64 data;
50 };
51
52 namespace PatchFunc
53 {
54 PATCHTABLEFUNC comment;
55 PATCHTABLEFUNC gametitle;
56 PATCHTABLEFUNC patch;
57 PATCHTABLEFUNC cheat;
58 }
59
60 extern int InitCheats(const wxString& name);
61 extern void inifile_command(bool isCheat, const wxString& cmd);
62 extern void inifile_trim(wxString& buffer);
63
64 extern int InitPatches(const wxString& name, const Game_Data& game);
65 extern int AddPatch(int Mode, int Place, int Address, int Size, u64 data);
66 extern void ResetPatch(void);
67 extern void ApplyPatch(int place = 1);
68 extern void ApplyCheat(int place = 1);
69 extern void _ApplyPatch(IniPatch *p);
70

  ViewVC Help
Powered by ViewVC 1.1.22