2009-09-08 12:08:10 +00:00
|
|
|
/* PCSX2 - PS2 Emulator for PCs
|
|
|
|
* Copyright (C) 2002-2009 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.
|
2009-02-09 21:15:56 +00:00
|
|
|
*
|
2009-09-08 12:08:10 +00:00
|
|
|
* 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/>.
|
2009-02-09 21:15:56 +00:00
|
|
|
*/
|
|
|
|
#ifndef __PATCH_H__
|
|
|
|
#define __PATCH_H__
|
|
|
|
|
2009-04-29 11:47:05 +00:00
|
|
|
#include "Pcsx2Defs.h"
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Defines
|
|
|
|
//
|
|
|
|
#define MAX_PATCH 1024
|
|
|
|
|
|
|
|
#define IFIS(x,str) if(!strnicmp(x,str,sizeof(str)-1))
|
|
|
|
|
|
|
|
#define GETNEXT_PARAM() \
|
|
|
|
while ( *param && ( *param != ',' ) ) param++; \
|
|
|
|
if ( *param ) param++; \
|
|
|
|
while ( *param && ( *param == ' ' ) ) param++; \
|
Lots of new code maintenance stuffs:
* Completely new assertion macros: pxAssert, pxAssertMsg, and pxFail, pxAssertDev (both which default to using a message). These replace *all* wxASSERT, DevAssert, and jASSUME varieties of macros. New macros borrow the best of all assertion worlds: MSVCRT, wxASSERT, and AtlAssume. :)
* Rewrote the Console namespace as a structure called IConsoleWriter, and created several varieties of ConsoleWriters for handling different states of log and console availability (should help reduce overhead of console logging nicely).
* More improvements to the PersistentThread model, using safely interlocked "Do*" style callbacks for starting and cleaning up threads.
* Fixed console logs so that they're readable in Win32 notepad again (the log writer adds CRs to naked LFs).
* Added AppInit.cpp -- contains constructor, destructor, OnInit, and command line parsing mess.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1950 96395faa-99c1-11dd-bbfe-3dabce05a288
2009-10-04 08:27:27 +00:00
|
|
|
if ( *param == 0 ) { Console.Error( _( "Not enough params for inicommand" ) ); return; }
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Enums
|
|
|
|
//
|
|
|
|
|
|
|
|
enum patch_cpu_type {
|
|
|
|
NO_CPU,
|
|
|
|
CPU_EE,
|
|
|
|
CPU_IOP
|
|
|
|
};
|
|
|
|
|
|
|
|
enum patch_data_type {
|
|
|
|
NO_TYPE,
|
|
|
|
BYTE_T,
|
|
|
|
SHORT_T,
|
|
|
|
WORD_T,
|
|
|
|
DOUBLE_T,
|
|
|
|
EXTENDED_T
|
|
|
|
};
|
|
|
|
|
|
|
|
//
|
|
|
|
// Typedefs
|
|
|
|
//
|
|
|
|
typedef void (*PATCHTABLEFUNC)( char * text1, char * text2 );
|
|
|
|
|
|
|
|
struct IniPatch
|
|
|
|
{
|
|
|
|
int enabled;
|
|
|
|
int group;
|
|
|
|
patch_data_type type;
|
|
|
|
patch_cpu_type cpu;
|
|
|
|
int placetopatch;
|
|
|
|
u32 addr;
|
|
|
|
u64 data;
|
|
|
|
};
|
|
|
|
|
|
|
|
//
|
|
|
|
// Function prototypes
|
|
|
|
//
|
|
|
|
void patchFunc_comment( char * text1, char * text2 );
|
|
|
|
void patchFunc_gametitle( char * text1, char * text2 );
|
|
|
|
void patchFunc_patch( char * text1, char * text2 );
|
|
|
|
void patchFunc_fastmemory( char * text1, char * text2 );
|
|
|
|
void patchFunc_roundmode( char * text1, char * text2 );
|
|
|
|
void patchFunc_zerogs( char * text1, char * text2 );
|
|
|
|
void patchFunc_vunanmode( char * text1, char * text2 );
|
|
|
|
void patchFunc_ffxhack( char * text1, char * text2 );
|
|
|
|
void patchFunc_xkickdelay( char * text1, char * text2 );
|
|
|
|
|
|
|
|
void inifile_trim( char * buffer );
|
|
|
|
|
|
|
|
//
|
|
|
|
// Variables
|
|
|
|
//
|
|
|
|
extern IniPatch patch[ MAX_PATCH ];
|
|
|
|
extern int patchnumber;
|
|
|
|
|
|
|
|
void applypatch( int place );
|
|
|
|
void inifile_read( const char * name );
|
|
|
|
void inifile_command( char * cmd );
|
|
|
|
void resetpatch( void );
|
|
|
|
|
|
|
|
int AddPatch(int Mode, int Place, int Address, int Size, u64 data);
|
|
|
|
|
|
|
|
extern void SetFastMemory(int); // iR5900LoadStore.c
|
|
|
|
|
|
|
|
//extern int g_VUGameFixes;
|
|
|
|
extern int g_ZeroGSOptions;
|
|
|
|
|
2009-11-02 07:00:59 +00:00
|
|
|
extern void SetRoundMode(SSE_RoundMode ee, SSE_RoundMode vu);
|
2009-04-27 02:04:31 +00:00
|
|
|
extern int LoadPatch(const wxString& patchfile);
|
2009-02-09 21:15:56 +00:00
|
|
|
|
|
|
|
#endif /* __PATCH_H__ */
|
|
|
|
|