mirror of https://github.com/PCSX2/pcsx2.git
Converted codebase to use the C++ compiler. The C++ option is force-enabled through the project files manually, instead of renaming files to *.cpp (files may be renamed at a later date).
Note: VC2005 project is currently broken, as is the Linux build. Both will be updated soon. git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@435 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
parent
fba8545c8e
commit
6ec2864e5e
|
|
@ -90,7 +90,7 @@ char *sCmdName[0x100]= {
|
|||
};
|
||||
|
||||
// NVM (eeprom) layout info
|
||||
typedef struct {
|
||||
struct NVMLayout {
|
||||
u32 biosVer; // bios version that this eeprom layout is for
|
||||
s32 config0; // offset of 1st config block
|
||||
s32 config1; // offset of 2nd config block
|
||||
|
|
@ -100,7 +100,7 @@ typedef struct {
|
|||
s32 modelNum; // offset of ps2 model number (eg "SCPH-70002")
|
||||
s32 regparams; // offset of RegionParams for PStwo
|
||||
s32 mac; // offset of the value written to 0xFFFE0188 and 0xFFFE018C on PStwo
|
||||
} NVMLayout;
|
||||
};
|
||||
|
||||
#define NVM_FORMAT_MAX 2
|
||||
NVMLayout nvmlayouts[NVM_FORMAT_MAX] =
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
#include "PsxCommon.h"
|
||||
|
||||
typedef struct {
|
||||
struct cdvdRTC {
|
||||
u8 status;
|
||||
u8 second;
|
||||
u8 minute;
|
||||
|
|
@ -30,9 +30,9 @@ typedef struct {
|
|||
u8 day;
|
||||
u8 month;
|
||||
u8 year;
|
||||
} cdvdRTC;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct cdvdStruct {
|
||||
u8 nCommand;
|
||||
u8 Ready;
|
||||
u8 Error;
|
||||
|
|
@ -83,7 +83,7 @@ typedef struct {
|
|||
u8 mg_kbit[16];//last BIT key 'seen'
|
||||
u8 mg_kcon[16];//last content key 'seen'
|
||||
// char Unused[4096];
|
||||
} cdvdStruct;
|
||||
};
|
||||
|
||||
void cdvdReset();
|
||||
void cdvdReadTimeRcnt(int mode);
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ struct dir_toc_data{
|
|||
unsigned int current_sector;
|
||||
unsigned int current_sector_offset;
|
||||
unsigned int inc_dirs;
|
||||
unsigned char extension_list[128+1];
|
||||
char extension_list[128+1];
|
||||
};
|
||||
|
||||
//static u8 cdVolDescriptor[2048];
|
||||
|
|
@ -246,13 +246,13 @@ int CDVD_GetVolumeDescriptor(void){
|
|||
// CdSync(0x00);
|
||||
|
||||
// If this is still a volume Descriptor
|
||||
if (strncmp(localVolDesc.volID, "CD001", 5) == 0)
|
||||
if (strncmp((char*)localVolDesc.volID, "CD001", 5) == 0)
|
||||
{
|
||||
if ((localVolDesc.filesystemType == 1) ||
|
||||
(localVolDesc.filesystemType == 2))
|
||||
{
|
||||
FreezeMMXRegs(1);
|
||||
memcpy_fast(&CDVolDesc, &localVolDesc, sizeof(struct cdVolDesc));
|
||||
memcpy_fast(&CDVolDesc, &localVolDesc, sizeof(cdVolDesc));
|
||||
FreezeMMXRegs(0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,13 +90,13 @@ struct cdVolDesc
|
|||
u32 secDirTableLBA; // LBA of Secondary Dir Table //+94
|
||||
u32 reserved8; //+98
|
||||
struct rootDirTocHeader rootToc;
|
||||
u8 volSetName[128];
|
||||
u8 publisherName[128];
|
||||
u8 preparerName[128];
|
||||
u8 applicationName[128];
|
||||
u8 copyrightFileName[37];
|
||||
u8 abstractFileName[37];
|
||||
u8 bibliographyFileName[37];
|
||||
s8 volSetName[128];
|
||||
s8 publisherName[128];
|
||||
s8 preparerName[128];
|
||||
s8 applicationName[128];
|
||||
s8 copyrightFileName[37];
|
||||
s8 abstractFileName[37];
|
||||
s8 bibliographyFileName[37];
|
||||
struct asciiDate creationDate;
|
||||
struct asciiDate modificationDate;
|
||||
struct asciiDate effectiveDate;
|
||||
|
|
@ -134,7 +134,7 @@ struct dirTocEntry
|
|||
unsigned char fileProperties;
|
||||
unsigned char reserved2[6];
|
||||
unsigned char filenameLength;
|
||||
unsigned char filename[128];
|
||||
char filename[128];
|
||||
#if defined(_MSC_VER)
|
||||
};
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ struct TocEntry
|
|||
u32 fileSize;
|
||||
u8 fileProperties;
|
||||
u8 padding1[3];
|
||||
u8 filename[128+1];
|
||||
s8 filename[128+1];
|
||||
u8 date[7];
|
||||
#if defined(_WIN32)
|
||||
};
|
||||
|
|
|
|||
|
|
@ -23,6 +23,8 @@
|
|||
#include "Common.h"
|
||||
#include "Cache.h"
|
||||
|
||||
_cacheS pCache[64];
|
||||
|
||||
#ifndef PCSX2_VIRTUAL_MEM
|
||||
/*_cacheS pCache[64];*/
|
||||
int getFreeCache(u32 mem, int mode, int * way) {
|
||||
|
|
|
|||
|
|
@ -21,22 +21,23 @@
|
|||
|
||||
#include "Common.h"
|
||||
|
||||
typedef struct __u8bit_128 {
|
||||
u8 _8[16];
|
||||
|
||||
}_u8bit_128;
|
||||
struct _u8bit_128 {
|
||||
u8 _8[16];
|
||||
|
||||
typedef struct _u128v2 {
|
||||
};
|
||||
|
||||
struct u128 {
|
||||
_u8bit_128 b8;
|
||||
|
||||
}u128;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct _cacheS {
|
||||
u32 tag[2];
|
||||
u128 data[2][4];
|
||||
} _cacheS;
|
||||
};
|
||||
|
||||
extern _cacheS pCache[64];
|
||||
|
||||
_cacheS pCache[64];
|
||||
void writeCache8(u32 mem, u8 value);
|
||||
void writeCache16(u32 mem, u16 value);
|
||||
void writeCache32(u32 mem, u32 value);
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ char *CmdName[0x100]= {
|
|||
"CdlReset", NULL, "CDlReadToc", NULL
|
||||
};
|
||||
|
||||
cdrStruct cdr;
|
||||
long LoadCdBios;
|
||||
int cdOpenCase;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,8 @@
|
|||
#include "Decode_XA.h"
|
||||
#include "PS2Edefs.h"
|
||||
|
||||
typedef struct {
|
||||
struct cdrStruct
|
||||
{
|
||||
u8 OCUP;
|
||||
u8 Reg1Mode;
|
||||
u8 Reg2;
|
||||
|
|
@ -69,9 +70,9 @@ typedef struct {
|
|||
unsigned long eCycle;
|
||||
|
||||
char Unused[4087];
|
||||
} cdrStruct;
|
||||
};
|
||||
|
||||
cdrStruct cdr;
|
||||
extern cdrStruct cdr;
|
||||
|
||||
s32 MSFtoLSN(u8 *Time);
|
||||
void LSNtoMSF(u8 *Time, s32 lsn);
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
#define __LINUX__
|
||||
#endif
|
||||
|
||||
#include <zlib.h>
|
||||
#include <zlib.h> // fixme: is zlib.h stuff used by that many modules that it should be here in common?
|
||||
#include <string.h>
|
||||
|
||||
#include "PS2Etypes.h"
|
||||
|
|
@ -34,16 +34,8 @@
|
|||
|
||||
#if defined(_WIN32)
|
||||
|
||||
#include <windows.h>
|
||||
#include <windows.h> // fixme: windows.h should be included to windows gui modules only.
|
||||
|
||||
typedef struct {
|
||||
HWND hWnd; // Main window handle
|
||||
HINSTANCE hInstance; // Application instance
|
||||
HMENU hMenu; // Main window menu
|
||||
HANDLE hConsole;
|
||||
} AppData;
|
||||
|
||||
extern AppData gApp;
|
||||
#define pthread_mutex__unlock pthread_mutex_unlock
|
||||
|
||||
#define strnicmp _strnicmp
|
||||
|
|
@ -76,14 +68,6 @@ extern AppData gApp;
|
|||
#define _aligned_free(x) __mingw_aligned_free(x)
|
||||
#define pthread_mutex__unlock pthread_mutex_unlock
|
||||
|
||||
#define fpusqrtf sqrtf
|
||||
#define fpufabsf fabsf
|
||||
#define fpusinf sinf
|
||||
#define fpucosf cosf
|
||||
#define fpuexpf expf
|
||||
#define fpuatanf atanf
|
||||
#define fpuatan2f atan2f
|
||||
|
||||
#else
|
||||
|
||||
#include <sys/types.h>
|
||||
|
|
@ -120,7 +104,7 @@ extern AppData gApp;
|
|||
|
||||
#endif
|
||||
|
||||
typedef struct _TESTRUNARGS
|
||||
struct TESTRUNARGS
|
||||
{
|
||||
u8 enabled;
|
||||
u8 jpgcapture;
|
||||
|
|
@ -137,7 +121,7 @@ typedef struct _TESTRUNARGS
|
|||
const char* plogname;
|
||||
const char* pgsdll, *pcdvddll, *pspudll;
|
||||
|
||||
} TESTRUNARGS;
|
||||
};
|
||||
|
||||
extern TESTRUNARGS g_TestRun;
|
||||
|
||||
|
|
@ -180,11 +164,9 @@ extern TESTRUNARGS g_TestRun;
|
|||
#include "Memory.h"
|
||||
#include "Elfheader.h"
|
||||
#include "Hw.h"
|
||||
//#include "GS.h"
|
||||
#include "Vif.h"
|
||||
#include "SPR.h"
|
||||
#include "Sif.h"
|
||||
#include "PS2Edefs.h"
|
||||
#include "Misc.h"
|
||||
#include "Counters.h"
|
||||
#include "IPU/IPU.h"
|
||||
|
|
@ -200,31 +182,8 @@ extern u16 logProtocol;
|
|||
extern u8 logSource;
|
||||
#define PCSX2_VERSION "Playground (beta)"
|
||||
|
||||
// C++ code for sqrtf
|
||||
void InitFPUOps();
|
||||
extern float (*fpusqrtf)(float fval);
|
||||
extern float (*fpufabsf)(float fval);
|
||||
extern float (*fpusinf)(float fval);
|
||||
extern float (*fpucosf)(float fval);
|
||||
extern float (*fpuexpf)(float fval);
|
||||
extern float (*fpuatanf)(float fval);
|
||||
extern float (*fpuatan2f)(float fvalx, float fvaly);
|
||||
|
||||
// Added Feb 16, 2006 by efp
|
||||
#ifdef __LINUX__
|
||||
#include <errno.h> // EBUSY
|
||||
#endif /* __LINUX__ */
|
||||
|
||||
#define DESTROY_MUTEX(mutex) { \
|
||||
int err = pthread_mutex_destroy(&mutex); \
|
||||
if( err == EBUSY ) \
|
||||
SysPrintf("cannot destroy"#mutex"\n"); \
|
||||
} \
|
||||
|
||||
#define DESTROY_COND(cond) { \
|
||||
int err = pthread_cond_destroy(&cond); \
|
||||
if( err == EBUSY ) \
|
||||
SysPrintf("cannot destroy"#cond"\n"); \
|
||||
} \
|
||||
#endif
|
||||
|
||||
#endif /* __COMMON_H__ */
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ static int iFrame = 0;
|
|||
static s64 m_iTicks=0;
|
||||
static u64 m_iStart=0;
|
||||
|
||||
typedef struct
|
||||
struct vSyncTimingInfo
|
||||
{
|
||||
u32 Framerate; // frames per second * 100 (so 2500 for PAL and 2997 for NTSC)
|
||||
u32 Render; // time from vblank end to vblank start (cycles)
|
||||
|
|
@ -133,7 +133,7 @@ typedef struct
|
|||
u32 hRender; // time from hblank end to hblank start (cycles)
|
||||
u32 hBlank; // time from hblank start to hblank end (cycles)
|
||||
u32 hScanlinesPerFrame; // number of scanlines per frame (525/625 for NTSC/PAL)
|
||||
} vSyncTimingInfo;
|
||||
};
|
||||
|
||||
|
||||
static vSyncTimingInfo vSyncInfo;
|
||||
|
|
|
|||
|
|
@ -21,14 +21,14 @@
|
|||
|
||||
// fixme: Cycle and sCycleT members are unused.
|
||||
// But they can't be removed without making a new savestate version.
|
||||
typedef struct {
|
||||
struct Counter {
|
||||
u32 count, mode, target, hold;
|
||||
u32 rate, interrupt;
|
||||
u32 Cycle;
|
||||
u32 sCycle; // start cycle of timer
|
||||
s32 CycleT;
|
||||
u32 sCycleT; // delta values should be signed.
|
||||
} Counter;
|
||||
};
|
||||
|
||||
//------------------------------------------------------------------
|
||||
// SPEED HACKS!!! (1 is normal) (They have inverse affects, only set 1 at a time)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
#include "Debug.h"
|
||||
|
||||
char ostr[256];
|
||||
static char ostr[1024];
|
||||
|
||||
// Names of registers
|
||||
static char *disRNameGPR[] = {
|
||||
|
|
|
|||
|
|
@ -24,8 +24,7 @@
|
|||
#include "R5900.h"
|
||||
#include "VU.h"
|
||||
|
||||
long jumpMode;
|
||||
char ostr[1024];
|
||||
static char ostr[1024];
|
||||
|
||||
// Names of registers
|
||||
char *disRNameGPR[] = {
|
||||
|
|
@ -162,10 +161,10 @@ typedef char* (*TdisR5900F)DisFInterface;
|
|||
#define dCode() sprintf(ostr, "%s %8.8x,", ostr, (code >> 6) & 0xffffff)
|
||||
#define dSaR() sprintf(ostr, "%s %8.8x,", ostr, cpuRegs.sa)
|
||||
|
||||
typedef struct {
|
||||
struct sSymbol {
|
||||
u32 addr;
|
||||
char name[32];
|
||||
} sSymbol;
|
||||
};
|
||||
|
||||
static sSymbol *dSyms = NULL;
|
||||
static int nSyms = 0;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
#include "Debug.h"
|
||||
|
||||
char ostr[1024];
|
||||
static char ostr[1024];
|
||||
|
||||
// Type deffinition of our functions
|
||||
#define DisFInterface (u32 code, u32 pc)
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
#include "Debug.h"
|
||||
#include "VUmicro.h"
|
||||
|
||||
char ostr[1024];
|
||||
static char ostr[1024];
|
||||
|
||||
// Type deffinition of our functions
|
||||
#define DisFInterface (u32 code, u32 pc)
|
||||
|
|
|
|||
|
|
@ -28,9 +28,13 @@
|
|||
#pragma warning(disable:4996) //ignore the stricmp deprecated warning
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
AppData gApp;
|
||||
#endif
|
||||
|
||||
u32 ElfCRC;
|
||||
|
||||
typedef struct {
|
||||
struct ELF_HEADER {
|
||||
u8 e_ident[16]; //0x7f,"ELF" (ELF file identifier)
|
||||
u16 e_type; //ELF type: 0=NONE, 1=REL, 2=EXEC, 3=SHARED, 4=CORE
|
||||
u16 e_machine; //Processor: 8=MIPS R3000
|
||||
|
|
@ -45,9 +49,9 @@ typedef struct {
|
|||
u16 e_shentsize; //Section headers entry size
|
||||
u16 e_shnum; //Number of section headers
|
||||
u16 e_shstrndx; //Section header stringtable index
|
||||
} ELF_HEADER;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct ELF_PHR {
|
||||
u32 p_type; //see notes1
|
||||
u32 p_offset; //Offset from file start to program segment.
|
||||
u32 p_vaddr; //Virtual address of the segment
|
||||
|
|
@ -56,7 +60,7 @@ typedef struct {
|
|||
u32 p_memsz; //Number of bytes in the memory image of the segment
|
||||
u32 p_flags; //Flags for segment
|
||||
u32 p_align; //Alignment. The address of 0x08 and 0x0C must fit this alignment. 0=no alignment
|
||||
} ELF_PHR;
|
||||
};
|
||||
|
||||
/*
|
||||
notes1
|
||||
|
|
@ -70,7 +74,7 @@ notes1
|
|||
6=The array element must specify location and size of the program header table.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
struct ELF_SHR {
|
||||
u32 sh_name; //No. to the index of the Section header stringtable index
|
||||
u32 sh_type; //See notes2
|
||||
u32 sh_flags; //see notes3
|
||||
|
|
@ -81,7 +85,8 @@ typedef struct {
|
|||
u32 sh_info; //Info
|
||||
u32 sh_addralign; //Alignment. The adress of 0x0C must fit this alignment. 0=no alignment.
|
||||
u32 sh_entsize; //Fixed size entries.
|
||||
} ELF_SHR;
|
||||
};
|
||||
|
||||
/*
|
||||
notes 2
|
||||
-------
|
||||
|
|
@ -111,21 +116,21 @@ Section Flags: (1 bit, you may combine them like 3 = alloc & write permission)
|
|||
0xf0000000=Mask bits processor-specific
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
struct Elf32_Sym {
|
||||
u32 st_name;
|
||||
u32 st_value;
|
||||
u32 st_size;
|
||||
u8 st_info;
|
||||
u8 st_other;
|
||||
u16 st_shndx;
|
||||
} Elf32_Sym;
|
||||
};
|
||||
|
||||
#define ELF32_ST_TYPE(i) ((i)&0xf)
|
||||
|
||||
typedef struct {
|
||||
struct Elf32_Rel {
|
||||
u32 r_offset;
|
||||
u32 r_info;
|
||||
} Elf32_Rel;
|
||||
};
|
||||
|
||||
//unfinished!!!!
|
||||
|
||||
|
|
@ -499,9 +504,6 @@ BOOL loadSectionHeaders( char * Exepath )
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
extern int LoadPatch(char *patchfile);
|
||||
extern void LoadGameSpecificSettings();
|
||||
|
||||
int loadElfFile(char *filename) {
|
||||
char str[256],str2[256];
|
||||
u32 crc;
|
||||
|
|
|
|||
|
|
@ -22,8 +22,10 @@
|
|||
//2002-09-20 (Florin)
|
||||
extern char args[256]; //to be filled by GUI
|
||||
extern unsigned int args_ptr;
|
||||
|
||||
//-------------------
|
||||
int loadElfFile(char *filename);
|
||||
void LoadGameSpecificSettings();
|
||||
|
||||
extern u32 ElfCRC;
|
||||
|
||||
|
|
|
|||
10
pcsx2/FPU.c
10
pcsx2/FPU.c
|
|
@ -16,7 +16,7 @@
|
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
#include "Common.h"
|
||||
#include "R5900.h"
|
||||
#include "InterTables.h"
|
||||
|
|
@ -355,10 +355,10 @@ void RSQRT_S() {
|
|||
}
|
||||
else if ( _FtValUl_ & 0x80000000 ) { // Ft is negative
|
||||
_ContVal_ |= FPUflagI | FPUflagSI;
|
||||
temp.f = fpusqrtf( fpufabsf( fpuDouble( _FtValUl_ ) ) );
|
||||
temp.f = sqrt( fabs( fpuDouble( _FtValUl_ ) ) );
|
||||
_FdValf_ = fpuDouble( _FsValUl_ ) / fpuDouble( temp.UL );
|
||||
}
|
||||
else { _FdValf_ = fpuDouble( _FsValUl_ ) / fpusqrtf( fpuDouble( _FtValUl_ ) ); } // Ft is positive and not zero
|
||||
else { _FdValf_ = fpuDouble( _FsValUl_ ) / sqrt( fpuDouble( _FtValUl_ ) ); } // Ft is positive and not zero
|
||||
|
||||
checkOverflow( _FdValUl_, 0, 1 );
|
||||
checkUnderflow( _FdValUl_, 0, 1 );
|
||||
|
|
@ -368,9 +368,9 @@ void SQRT_S() {
|
|||
if ( ( _FtValUl_ & 0xFF800000 ) == 0x80000000 ) { _FdValUl_ = 0x80000000; } // If Ft = -0
|
||||
else if ( _FtValUl_ & 0x80000000 ) { // If Ft is Negative
|
||||
_ContVal_ |= FPUflagI | FPUflagSI;
|
||||
_FdValf_ = fpusqrtf( fpufabsf( fpuDouble( _FtValUl_ ) ) );
|
||||
_FdValf_ = sqrt( fabs( fpuDouble( _FtValUl_ ) ) );
|
||||
}
|
||||
else { _FdValf_ = fpusqrtf( fpuDouble( _FtValUl_ ) ); } // If Ft is Positive
|
||||
else { _FdValf_ = sqrt( fpuDouble( _FtValUl_ ) ); } // If Ft is Positive
|
||||
clearFPUFlags( FPUflagD );
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ void WriteFIFO(u32 mem, u64 *value) {
|
|||
IPU_LOG("WriteFIFO IPU_in[%d] <- %8.8X_%8.8X_%8.8X_%8.8X\n", (mem - 0x10007010)/8, ((u32*)value)[3], ((u32*)value)[2], ((u32*)value)[1], ((u32*)value)[0]);
|
||||
|
||||
//commiting every 16 bytes
|
||||
while( FIFOto_write((void*)value, 1) == 0 ) {
|
||||
while( FIFOto_write((u32*)value, 1) == 0 ) {
|
||||
SysPrintf("IPU sleeping\n");
|
||||
_TIMESLICE();
|
||||
}
|
||||
|
|
|
|||
139
pcsx2/GS.cpp
139
pcsx2/GS.cpp
|
|
@ -202,8 +202,6 @@ static void mutex_unlock( mutex_t& mutex )
|
|||
#endif
|
||||
|
||||
|
||||
extern "C" {
|
||||
|
||||
#include "Common.h"
|
||||
#include "zlib.h"
|
||||
#include "VU.h"
|
||||
|
|
@ -226,12 +224,68 @@ static int m_mtgsCopyCommandTally = 0;
|
|||
int g_FFXHack=0;
|
||||
|
||||
#ifdef PCSX2_DEVBUILD
|
||||
static long g_pGSvSyncCount = 0;
|
||||
static s32 g_pGSvSyncCount = 0;
|
||||
|
||||
// GS Playback
|
||||
int g_SaveGSStream = 0; // save GS stream; 1 - prepare, 2 - save
|
||||
int g_nLeftGSFrames = 0; // when saving, number of frames left
|
||||
gzFile g_fGSSave;
|
||||
|
||||
void GSGIFTRANSFER1(u32 *pMem, u32 addr) {
|
||||
if( g_SaveGSStream == 2) {
|
||||
u32 type = GSRUN_TRANS1;
|
||||
u32 size = (0x4000-(addr))/16;
|
||||
gzwrite(g_fGSSave, &type, sizeof(type));
|
||||
gzwrite(g_fGSSave, &size, 4);
|
||||
gzwrite(g_fGSSave, ((u8*)pMem)+(addr), size*16);
|
||||
}
|
||||
GSgifTransfer1(pMem, addr);
|
||||
}
|
||||
|
||||
void GSGIFTRANSFER2(u32 *pMem, u32 size) {
|
||||
if( g_SaveGSStream == 2) {
|
||||
u32 type = GSRUN_TRANS2;
|
||||
u32 _size = size;
|
||||
gzwrite(g_fGSSave, &type, sizeof(type));
|
||||
gzwrite(g_fGSSave, &_size, 4);
|
||||
gzwrite(g_fGSSave, pMem, _size*16);
|
||||
}
|
||||
GSgifTransfer2(pMem, size);
|
||||
}
|
||||
|
||||
void GSGIFTRANSFER3(u32 *pMem, u32 size) {
|
||||
if( g_SaveGSStream == 2 ) {
|
||||
u32 type = GSRUN_TRANS3;
|
||||
u32 _size = size;
|
||||
gzwrite(g_fGSSave, &type, sizeof(type));
|
||||
gzwrite(g_fGSSave, &_size, 4);
|
||||
gzwrite(g_fGSSave, pMem, _size*16);
|
||||
}
|
||||
GSgifTransfer3(pMem, size);
|
||||
}
|
||||
|
||||
__forceinline void GSVSYNC(void) {
|
||||
if( g_SaveGSStream == 2 ) {
|
||||
u32 type = GSRUN_VSYNC;
|
||||
gzwrite(g_fGSSave, &type, sizeof(type));
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
||||
__forceinline void GSGIFTRANSFER1(u32 *pMem, u32 addr) {
|
||||
GSgifTransfer1(pMem, addr);
|
||||
}
|
||||
|
||||
__forceinline void GSGIFTRANSFER2(u32 *pMem, u32 size) {
|
||||
GSgifTransfer2(pMem, size);
|
||||
}
|
||||
|
||||
__forceinline void GSGIFTRANSFER3(u32 *pMem, u32 size) {
|
||||
GSgifTransfer3(pMem, size);
|
||||
}
|
||||
|
||||
__forceinline void GSVSYNC(void) {
|
||||
}
|
||||
#endif
|
||||
|
||||
u32 CSRw;
|
||||
|
|
@ -241,8 +295,6 @@ typedef u8* PU8;
|
|||
|
||||
PCSX2_ALIGNED16(u8 g_MTGSMem[0x2000]); // mtgs has to have its own memory
|
||||
|
||||
} // extern "C"
|
||||
|
||||
#ifdef PCSX2_VIRTUAL_MEM
|
||||
#define gif ((DMACh*)&PS2MEM_HW[0xA000])
|
||||
#else
|
||||
|
|
@ -257,7 +309,7 @@ u8 g_RealGSMem[0x2000];
|
|||
#endif
|
||||
|
||||
// dummy GS for processing SIGNAL, FINISH, and LABEL commands
|
||||
typedef struct
|
||||
struct GIFTAG
|
||||
{
|
||||
u32 nloop : 15;
|
||||
u32 eop : 1;
|
||||
|
|
@ -269,7 +321,7 @@ typedef struct
|
|||
u32 nreg : 4;
|
||||
u32 regs[2];
|
||||
u32 curreg;
|
||||
} GIFTAG;
|
||||
};
|
||||
|
||||
static GIFTAG g_path[3];
|
||||
static PCSX2_ALIGNED16(u8 s_byRegs[3][16]);
|
||||
|
|
@ -285,8 +337,8 @@ extern int g_nCounters[];
|
|||
//#define RINGBUF_DEBUG_STACK
|
||||
#ifdef RINGBUF_DEBUG_STACK
|
||||
#include <list>
|
||||
std::list<long> ringposStack;
|
||||
CRITICAL_SECTION stackLock;
|
||||
std::list<uptr> ringposStack;
|
||||
mutex_t stackLock;
|
||||
#endif
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
|
@ -305,7 +357,7 @@ static bool m_StrictSkipping = false;
|
|||
|
||||
static void (*s_prevExecuteVU1Block)() = NULL;
|
||||
|
||||
extern "C" void DummyExecuteVU1Block(void);
|
||||
void DummyExecuteVU1Block(void);
|
||||
|
||||
static void OnModeChanged( u32 framerate, u32 iTicks )
|
||||
{
|
||||
|
|
@ -332,7 +384,7 @@ static void OnModeChanged( u32 framerate, u32 iTicks )
|
|||
}
|
||||
}
|
||||
|
||||
extern "C" void gsSetVideoRegionType( u32 isPal )
|
||||
void gsSetVideoRegionType( u32 isPal )
|
||||
{
|
||||
u32 framerate;
|
||||
|
||||
|
|
@ -409,7 +461,7 @@ s32 gsOpen()
|
|||
mutex_init( gsRingRestartLock );
|
||||
|
||||
# ifdef RINGBUF_DEBUG_STACK
|
||||
mutex_init( &stackLock );
|
||||
mutex_init( stackLock );
|
||||
# endif
|
||||
|
||||
if( !thread_create( g_hVuGsThread ) )
|
||||
|
|
@ -501,7 +553,7 @@ void GSRINGBUF_DONECOPY(const u8* mem, u32 size)
|
|||
}
|
||||
#endif
|
||||
|
||||
InterlockedExchangePointer(&g_pGSWritePos, temp);
|
||||
AtomicExchangePointer( g_pGSWritePos, temp );
|
||||
|
||||
// if enough copies have queued up then go ahead and initiate the GS thread..
|
||||
|
||||
|
|
@ -623,7 +675,7 @@ u8* GSRingBufCopy( u32 size, u32 type )
|
|||
mutex_lock( gsRingRestartLock );
|
||||
GSRingBufSimplePacket( GS_RINGTYPE_RESTART, 0, 0, 0 );
|
||||
writepos = GS_RINGBUFFERBASE;
|
||||
InterlockedExchangePointer(&g_pGSWritePos, writepos );
|
||||
AtomicExchangePointer( g_pGSWritePos, writepos );
|
||||
mutex_unlock( gsRingRestartLock );
|
||||
|
||||
// stall until the read position is past the end of our incoming block,
|
||||
|
|
@ -660,7 +712,7 @@ u8* GSRingBufCopy( u32 size, u32 type )
|
|||
|
||||
#ifdef RINGBUF_DEBUG_STACK
|
||||
mutex_lock( stackLock );
|
||||
ringposStack.push_front( (long)writepos );
|
||||
ringposStack.push_front( (uptr)writepos );
|
||||
mutex_unlock( stackLock );
|
||||
#endif
|
||||
|
||||
|
|
@ -685,7 +737,7 @@ void GSRingBufSimplePacket(int type, int data0, int data1, int data2)
|
|||
|
||||
#ifdef RINGBUF_DEBUG_STACK
|
||||
mutex_lock( stackLock );
|
||||
ringposStack.push_front( (long)writepos );
|
||||
ringposStack.push_front( (uptr)writepos );
|
||||
mutex_unlock( stackLock );
|
||||
#endif
|
||||
|
||||
|
|
@ -695,7 +747,7 @@ void GSRingBufSimplePacket(int type, int data0, int data1, int data2)
|
|||
*(u32*)(writepos+12) = data2;
|
||||
|
||||
assert( future_writepos != *(volatile PU8*)&g_pGSRingPos );
|
||||
InterlockedExchangePointer(&g_pGSWritePos, future_writepos);
|
||||
AtomicExchangePointer( g_pGSWritePos, future_writepos );
|
||||
}
|
||||
|
||||
void gsReset()
|
||||
|
|
@ -707,9 +759,9 @@ void gsReset()
|
|||
// * Signal a reset.
|
||||
// * clear the path and byRegs structs (used by GIFtagDummy)
|
||||
|
||||
InterlockedExchangePointer( &g_pGSRingPos, g_pGSWritePos );
|
||||
AtomicExchangePointer( g_pGSRingPos, g_pGSWritePos );
|
||||
#ifdef PCSX2_DEVBUILD
|
||||
InterlockedExchange( &g_pGSvSyncCount, 0 );
|
||||
AtomicExchange( g_pGSvSyncCount, 0 );
|
||||
#endif
|
||||
MTGS_LOG( "MTGS > Sending Reset...\n" );
|
||||
GSRingBufSimplePacket( GS_RINGTYPE_RESET, 0, 0, 0 );
|
||||
|
|
@ -783,7 +835,7 @@ void gsGIFReset()
|
|||
psHu32(GIF_MODE) = 0;
|
||||
}
|
||||
|
||||
void CSRwrite(u32 value)
|
||||
void gsCSRwrite(u32 value)
|
||||
{
|
||||
CSRw |= value & ~0x60;
|
||||
|
||||
|
|
@ -828,13 +880,13 @@ static void IMRwrite(u32 value) {
|
|||
void gsWrite8(u32 mem, u8 value) {
|
||||
switch (mem) {
|
||||
case 0x12001000: // GS_CSR
|
||||
CSRwrite((CSRw & ~0x000000ff) | value); break;
|
||||
gsCSRwrite((CSRw & ~0x000000ff) | value); break;
|
||||
case 0x12001001: // GS_CSR
|
||||
CSRwrite((CSRw & ~0x0000ff00) | (value << 8)); break;
|
||||
gsCSRwrite((CSRw & ~0x0000ff00) | (value << 8)); break;
|
||||
case 0x12001002: // GS_CSR
|
||||
CSRwrite((CSRw & ~0x00ff0000) | (value << 16)); break;
|
||||
gsCSRwrite((CSRw & ~0x00ff0000) | (value << 16)); break;
|
||||
case 0x12001003: // GS_CSR
|
||||
CSRwrite((CSRw & ~0xff000000) | (value << 24)); break;
|
||||
gsCSRwrite((CSRw & ~0xff000000) | (value << 24)); break;
|
||||
default:
|
||||
*PS2GS_BASE(mem) = value;
|
||||
|
||||
|
|
@ -860,10 +912,10 @@ void gsWrite16(u32 mem, u16 value) {
|
|||
break;
|
||||
|
||||
case 0x12001000: // GS_CSR
|
||||
CSRwrite( (CSRw&0xffff0000) | value);
|
||||
gsCSRwrite( (CSRw&0xffff0000) | value);
|
||||
return; // do not write to MTGS memory
|
||||
case 0x12001002: // GS_CSR
|
||||
CSRwrite( (CSRw&0xffff) | ((u32)value<<16));
|
||||
gsCSRwrite( (CSRw&0xffff) | ((u32)value<<16));
|
||||
return; // do not write to MTGS memory
|
||||
case 0x12001010: // GS_IMR
|
||||
//SysPrintf("writing to IMR 16\n");
|
||||
|
|
@ -894,7 +946,7 @@ void gsWrite32(u32 mem, u32 value)
|
|||
break;
|
||||
|
||||
case 0x12001000: // GS_CSR
|
||||
CSRwrite(value);
|
||||
gsCSRwrite(value);
|
||||
return;
|
||||
|
||||
case 0x12001010: // GS_IMR
|
||||
|
|
@ -924,7 +976,7 @@ void gsWrite64(u32 mem, u64 value) {
|
|||
break;
|
||||
|
||||
case 0x12001000: // GS_CSR
|
||||
CSRwrite((u32)value);
|
||||
gsCSRwrite((u32)value);
|
||||
return;
|
||||
|
||||
case 0x12001010: // GS_IMR
|
||||
|
|
@ -1004,7 +1056,6 @@ static void GSRegHandlerLABEL(u32* data)
|
|||
|
||||
typedef void (*GIFRegHandler)(u32* data);
|
||||
static GIFRegHandler s_GSHandlers[3] = { GSRegHandlerSIGNAL, GSRegHandlerFINISH, GSRegHandlerLABEL };
|
||||
extern "C" int Path3transfer;
|
||||
|
||||
/*midnight madness cares because the tag is 5 dwords*/ \
|
||||
static __forceinline void TagPathTransfer( const GIFTAG* ptag, GIFTAG *path )
|
||||
|
|
@ -1678,7 +1729,7 @@ void gifMFIFOInterrupt()
|
|||
cpuRegs.interrupt &= ~(1 << 11);
|
||||
}
|
||||
|
||||
extern "C" void gsSyncLimiterLostTime( s32 deltaTime )
|
||||
void gsSyncLimiterLostTime( s32 deltaTime )
|
||||
{
|
||||
// This sync issue applies only to configs that are trying to maintain
|
||||
// a perfect "specific" framerate (where both min and max fps are the same)
|
||||
|
|
@ -1766,7 +1817,7 @@ static __forceinline void frameSkip()
|
|||
GSsetFrameSkip(1);
|
||||
|
||||
if( CHECK_FRAMELIMIT == PCSX2_FRAMELIMIT_VUSKIP )
|
||||
InterlockedExchangePointer( &Cpu->ExecuteVU1Block, DummyExecuteVU1Block );
|
||||
AtomicExchangePointer( Cpu->ExecuteVU1Block, DummyExecuteVU1Block );
|
||||
|
||||
FramesToRender = noSkipFrames+1;
|
||||
FramesToSkip = yesSkipFrames;
|
||||
|
|
@ -1809,7 +1860,7 @@ static __forceinline void frameSkip()
|
|||
|
||||
m_justSkipped = true;
|
||||
if( CHECK_FRAMELIMIT == PCSX2_FRAMELIMIT_VUSKIP )
|
||||
InterlockedExchangePointer( &Cpu->ExecuteVU1Block, s_prevExecuteVU1Block );
|
||||
AtomicExchangePointer( Cpu->ExecuteVU1Block, s_prevExecuteVU1Block );
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
|
@ -1828,14 +1879,14 @@ static __forceinline void frameSkip()
|
|||
}
|
||||
}
|
||||
|
||||
extern "C" void gsPostVsyncEnd()
|
||||
void gsPostVsyncEnd()
|
||||
{
|
||||
*(u32*)(PS2MEM_GS+0x1000) ^= 0x2000; // swap the vsync field
|
||||
|
||||
if( CHECK_MULTIGS )
|
||||
{
|
||||
#ifdef PCSX2_DEVBUILD
|
||||
InterlockedIncrement( &g_pGSvSyncCount );
|
||||
AtomicIncrement( g_pGSvSyncCount );
|
||||
//SysPrintf( " Sending VSync : %d \n", g_pGSvSyncCount );
|
||||
#endif
|
||||
GSRingBufSimplePacket(GS_RINGTYPE_VSYNC, (*(u32*)(PS2MEM_GS+0x1000)&0x2000), 0, 0);
|
||||
|
|
@ -1858,12 +1909,12 @@ extern "C" void gsPostVsyncEnd()
|
|||
|
||||
static void _resetFrameskip()
|
||||
{
|
||||
InterlockedExchangePointer( &Cpu->ExecuteVU1Block, s_prevExecuteVU1Block );
|
||||
AtomicExchangePointer( Cpu->ExecuteVU1Block, s_prevExecuteVU1Block );
|
||||
GSsetFrameSkip( 0 );
|
||||
}
|
||||
|
||||
// Disables the GS Frameskip at runtime without any racy mess...
|
||||
extern "C" void gsResetFrameSkip()
|
||||
void gsResetFrameSkip()
|
||||
{
|
||||
if( CHECK_MULTIGS )
|
||||
GSRingBufSimplePacket(GS_RINGTYPE_FRAMESKIP, 0, 0, 0);
|
||||
|
|
@ -1871,8 +1922,8 @@ extern "C" void gsResetFrameSkip()
|
|||
_resetFrameskip();
|
||||
}
|
||||
|
||||
extern "C" void frameLimitReset();
|
||||
extern "C" void gsDynamicSkipEnable()
|
||||
void frameLimitReset(); // defined in Counters.c
|
||||
void gsDynamicSkipEnable()
|
||||
{
|
||||
if( !m_StrictSkipping ) return;
|
||||
|
||||
|
|
@ -1911,8 +1962,8 @@ GS_THREADPROC
|
|||
// pop a ringpos off the stack. It should match this one!
|
||||
|
||||
EnterCriticalSection( &stackLock );
|
||||
long stackpos = ringposStack.back();
|
||||
if( stackpos != (long)g_pGSRingPos )
|
||||
uptr stackpos = ringposStack.back();
|
||||
if( stackpos != (uptr)g_pGSRingPos )
|
||||
{
|
||||
SysPrintf( "MTGS Ringbuffer Critical Failure ---> %x to %x (prevCmd: %x)\n", stackpos, (long)g_pGSRingPos, prevCmd );
|
||||
}
|
||||
|
|
@ -1925,7 +1976,7 @@ GS_THREADPROC
|
|||
switch( tag&0xffff )
|
||||
{
|
||||
case GS_RINGTYPE_RESTART:
|
||||
InterlockedExchangePointer(&g_pGSRingPos, GS_RINGBUFFERBASE);
|
||||
AtomicExchangePointer(g_pGSRingPos, GS_RINGBUFFERBASE);
|
||||
|
||||
// stall for a bit to let the MainThread have time to update the g_pGSWritePos.
|
||||
mutex_lock( gsRingRestartLock );
|
||||
|
|
@ -1962,7 +2013,7 @@ GS_THREADPROC
|
|||
//SysPrintf( " Processing VSync : %d \n", syncCount );
|
||||
// vSyncCount should never dip below zero.
|
||||
assert( syncCount >= 0 );
|
||||
InterlockedDecrement( &g_pGSvSyncCount );
|
||||
AtomicDecrement( g_pGSvSyncCount );
|
||||
# endif
|
||||
break;
|
||||
}
|
||||
|
|
@ -2074,7 +2125,7 @@ GS_THREADPROC
|
|||
assert(0);
|
||||
g_pGSRingPos = g_pGSWritePos;
|
||||
#ifdef PCSX2_DEVBUILD
|
||||
InterlockedExchange( &g_pGSvSyncCount, 0 );
|
||||
AtomicExchange( g_pGSvSyncCount, 0 );
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
|
|
@ -2084,7 +2135,7 @@ GS_THREADPROC
|
|||
if( newringpos == GS_RINGBUFFEREND )
|
||||
newringpos = GS_RINGBUFFERBASE;
|
||||
|
||||
InterlockedExchangePointer( &g_pGSRingPos, newringpos );
|
||||
AtomicExchangePointer( g_pGSRingPos, newringpos );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,11 +24,11 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
typedef struct
|
||||
struct GSRegSIGBLID
|
||||
{
|
||||
u32 SIGID;
|
||||
u32 LBLID;
|
||||
} GSRegSIGBLID;
|
||||
};
|
||||
|
||||
#define GSPATH3FIX
|
||||
|
||||
|
|
@ -90,6 +90,7 @@ extern void gsWaitGS();
|
|||
|
||||
// used for resetting GIF fifo
|
||||
void gsGIFReset();
|
||||
void gsCSRwrite(u32 value);
|
||||
|
||||
void gsWrite8(u32 mem, u8 value);
|
||||
void gsConstWrite8(u32 mem, int mmreg);
|
||||
|
|
|
|||
16
pcsx2/Hw.c
16
pcsx2/Hw.c
|
|
@ -91,8 +91,8 @@ u8 hwRead8(u32 mem)
|
|||
|
||||
SPR_LOG("Hardware read 8bit at %lx, ret %lx\n", mem, psHu8(mem));
|
||||
|
||||
switch (mem) {
|
||||
default:
|
||||
// switch (mem) {
|
||||
// default:
|
||||
if ((mem & 0xffffff0f) == 0x1000f200) {
|
||||
if(mem == 0x1000f260) ret = 0;
|
||||
else if(mem == 0x1000F240) {
|
||||
|
|
@ -109,8 +109,8 @@ u8 hwRead8(u32 mem)
|
|||
}
|
||||
else ret = 0;
|
||||
HW_LOG("Unknown Hardware Read 8 at %x\n",mem);
|
||||
break;
|
||||
}
|
||||
// break;
|
||||
// }
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -318,15 +318,15 @@ u64 hwRead64(u32 mem) {
|
|||
return ipuRead64(mem);
|
||||
}
|
||||
|
||||
switch (mem) {
|
||||
default:
|
||||
// switch (mem) {
|
||||
// default:
|
||||
if (mem < 0x10010000) {
|
||||
ret = psHu64(mem);
|
||||
}
|
||||
else ret = 0;
|
||||
HW_LOG("Unknown Hardware Read 64 at %x\n",mem);
|
||||
break;
|
||||
}
|
||||
// break;
|
||||
// }
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ void ConstWriteFIFO(u32 mem);
|
|||
// --- DMA ---
|
||||
//
|
||||
|
||||
typedef struct tagDMACh{
|
||||
struct DMACh {
|
||||
u32 chcr;
|
||||
u32 null0[3];
|
||||
u32 madr;
|
||||
|
|
@ -77,7 +77,7 @@ typedef struct tagDMACh{
|
|||
u32 asr1;
|
||||
u32 null5[11];
|
||||
u32 sadr;
|
||||
} DMACh;
|
||||
};
|
||||
|
||||
// HW defines
|
||||
|
||||
|
|
|
|||
|
|
@ -122,8 +122,11 @@ u8 PCT[]={'r', 'I', 'P', 'B', 'D', '-', '-', '-'};
|
|||
decoder_t g_decoder; //static, only to place it in bss
|
||||
decoder_t tempdec;
|
||||
|
||||
extern u8 mpeg2_scan_norm[64];
|
||||
extern u8 mpeg2_scan_alt[64];
|
||||
extern "C"
|
||||
{
|
||||
extern u8 mpeg2_scan_norm[64];
|
||||
extern u8 mpeg2_scan_alt[64];
|
||||
}
|
||||
|
||||
PCSX2_ALIGNED16(u8 _readbits[80]); //local buffer (ring buffer)
|
||||
u8* readbits = _readbits; // always can decrement by one 1qw
|
||||
|
|
|
|||
|
|
@ -121,18 +121,18 @@ typedef union {
|
|||
//
|
||||
// Bitfield Structure
|
||||
//
|
||||
typedef struct {
|
||||
struct tIPU_BP {
|
||||
u32 BP; // Bit stream point
|
||||
u16 IFC; // Input FIFO counter
|
||||
u8 FP; // FIFO point
|
||||
u8 bufferhasnew;
|
||||
} tIPU_BP;
|
||||
};
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma pack()
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
struct tIPU_CMD_IDEC {
|
||||
u32 FB : 6;
|
||||
u32 UN2 :10;
|
||||
u32 QSC : 5;
|
||||
|
|
@ -142,9 +142,9 @@ typedef struct {
|
|||
u32 DTE : 1;
|
||||
u32 OFM : 1;
|
||||
u32 cmd : 4;
|
||||
} tIPU_CMD_IDEC;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct tIPU_CMD_BDEC {
|
||||
u32 FB : 6;
|
||||
u32 UN2 :10;
|
||||
u32 QSC : 5;
|
||||
|
|
@ -153,15 +153,15 @@ typedef struct {
|
|||
u32 DCR : 1;
|
||||
u32 MBI : 1;
|
||||
u32 cmd : 4;
|
||||
} tIPU_CMD_BDEC;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct tIPU_CMD_CSC {
|
||||
u32 MBC :11;
|
||||
u32 UN2 :15;
|
||||
u32 DTE : 1;
|
||||
u32 OFM : 1;
|
||||
u32 cmd : 4;
|
||||
} tIPU_CMD_CSC;
|
||||
};
|
||||
|
||||
#define SCE_IPU_BCLR 0x0
|
||||
#define SCE_IPU_IDEC 0x1
|
||||
|
|
@ -174,7 +174,7 @@ typedef struct {
|
|||
#define SCE_IPU_PACK 0x8
|
||||
#define SCE_IPU_SETTH 0x9
|
||||
|
||||
typedef struct {
|
||||
struct IPUregisters {
|
||||
tIPU_CMD cmd;
|
||||
u32 dummy0[2];
|
||||
tIPU_CTRL ctrl;
|
||||
|
|
@ -184,7 +184,7 @@ typedef struct {
|
|||
u32 top;
|
||||
u32 topbusy;
|
||||
u32 dummy3[2];
|
||||
} IPUregisters, *PIPUregisters;
|
||||
};
|
||||
|
||||
#define ipuRegs ((IPUregisters*)(PS2MEM_HW+0x2000))
|
||||
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
#include "PS2Etypes.h"
|
||||
#include "coroutine.h"
|
||||
|
||||
typedef struct s_coroutine {
|
||||
struct coroutine {
|
||||
void* pcalladdr;
|
||||
void *pcurstack;
|
||||
#ifdef __x86_64__
|
||||
|
|
@ -42,7 +42,7 @@ typedef struct s_coroutine {
|
|||
//struct s_coroutine *caller;
|
||||
//struct s_coroutine *restarget;
|
||||
|
||||
} coroutine;
|
||||
};
|
||||
|
||||
#define CO_STK_ALIGN 256
|
||||
#define CO_STK_COROSIZE ((sizeof(coroutine) + CO_STK_ALIGN - 1) & ~(CO_STK_ALIGN - 1))
|
||||
|
|
@ -66,7 +66,7 @@ coroutine_t so_create(void (*func)(void *), void *data, void *stack, int size)
|
|||
alloc = size;
|
||||
}
|
||||
endstack = (char*)stack + size - 64;
|
||||
co = stack;
|
||||
co = (coroutine*)stack;
|
||||
stack = (char *) stack + CO_STK_COROSIZE;
|
||||
*(void**)endstack = NULL;
|
||||
*(void**)((char*)endstack+sizeof(void*)) = data;
|
||||
|
|
|
|||
|
|
@ -19,10 +19,6 @@
|
|||
#ifndef PCSX2_COROUTINE_LIB
|
||||
#define PCSX2_COROUTINE_LIB
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// low level coroutine library
|
||||
typedef void *coroutine_t;
|
||||
|
||||
|
|
@ -32,8 +28,4 @@ void so_call(coroutine_t coro);
|
|||
void so_resume(void);
|
||||
void so_exit(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ static void mpeg2_idct_add_c (const int last, s16 * block,
|
|||
}
|
||||
}
|
||||
|
||||
u8 mpeg2_scan_norm[64] = {
|
||||
extern "C" u8 mpeg2_scan_norm[64] = {
|
||||
/* Zig-Zag scan pattern */
|
||||
0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5,
|
||||
12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28,
|
||||
|
|
@ -239,7 +239,7 @@ u8 mpeg2_scan_norm[64] = {
|
|||
58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63
|
||||
};
|
||||
|
||||
u8 mpeg2_scan_alt[64] = {
|
||||
extern "C" u8 mpeg2_scan_alt[64] = {
|
||||
/* Alternate scan pattern */
|
||||
0, 8, 16, 24, 1, 9, 2, 10, 17, 25, 32, 40, 48, 56, 57, 49,
|
||||
41, 33, 26, 18, 3, 11, 4, 12, 19, 27, 34, 42, 50, 58, 35, 43,
|
||||
|
|
|
|||
|
|
@ -913,9 +913,10 @@ extern u8* g_pIPU0Pointer;
|
|||
|
||||
#if defined(_MSC_VER)
|
||||
#pragma pack(push, 1)
|
||||
#else
|
||||
__attribute__((packed))
|
||||
#endif
|
||||
|
||||
typedef struct _TGA_HEADER
|
||||
struct TGA_HEADER
|
||||
{
|
||||
u8 identsize; // size of ID field that follows 18 u8 header (0 usually)
|
||||
u8 colourmaptype; // type of colour map 0=none, 1=has palette
|
||||
|
|
@ -933,12 +934,10 @@ typedef struct _TGA_HEADER
|
|||
u8 descriptor; // image descriptor bits (vh flip bits)
|
||||
|
||||
// pixel data follows header
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
} TGA_HEADER;
|
||||
};
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma pack(pop)
|
||||
#else
|
||||
} TGA_HEADER __attribute__((packed));
|
||||
#endif
|
||||
|
||||
void SaveTGA(const char* filename, int width, int height, void* pdata)
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ struct macroblock_rgb16{
|
|||
struct rgb16 c[16][16];
|
||||
};
|
||||
|
||||
struct decoder_s {
|
||||
struct decoder_t {
|
||||
/* first, state that carries information from one macroblock to the */
|
||||
/* next inside a slice, and is never used outside of mpeg2_slice() */
|
||||
|
||||
|
|
@ -160,8 +160,6 @@ struct decoder_s {
|
|||
int mpeg1;
|
||||
};
|
||||
|
||||
typedef struct decoder_s decoder_t;
|
||||
|
||||
#define IDEC 0
|
||||
#define BDEC 1
|
||||
void mpeg2sliceIDEC(void* pdone);
|
||||
|
|
|
|||
|
|
@ -75,41 +75,41 @@ do { \
|
|||
/* take num bits from the high part of bit_buf and sign extend them */
|
||||
#define SBITS(bit_buf,num) (((s32)(bit_buf)) >> (32 - (num)))
|
||||
|
||||
typedef struct {
|
||||
struct MBtab {
|
||||
u8 modes;
|
||||
u8 len;
|
||||
} MBtab;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct MVtab {
|
||||
u8 delta;
|
||||
u8 len;
|
||||
} MVtab;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct DMVtab {
|
||||
s8 dmv;
|
||||
u8 len;
|
||||
} DMVtab;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct CBPtab {
|
||||
u8 cbp;
|
||||
u8 len;
|
||||
} CBPtab;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct DCtab {
|
||||
u8 size;
|
||||
u8 len;
|
||||
} DCtab;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct DCTtab {
|
||||
u8 run;
|
||||
u8 level;
|
||||
u8 len;
|
||||
} DCTtab;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct MBAtab {
|
||||
u8 mba;
|
||||
u8 len;
|
||||
} MBAtab;
|
||||
};
|
||||
|
||||
|
||||
#define INTRA MACROBLOCK_INTRA
|
||||
|
|
|
|||
|
|
@ -29,14 +29,14 @@
|
|||
#include "yuv2rgb.h"
|
||||
|
||||
//#include "convert_internal.h" //START
|
||||
typedef struct {
|
||||
struct convert_rgb_t {
|
||||
u8 * rgb_ptr;
|
||||
int width;
|
||||
int uv_stride, uv_stride_frame;
|
||||
int rgb_stride, rgb_stride_frame;
|
||||
void (* yuv2rgb) (u8 *, u8 *, u8 *, u8 *,
|
||||
void *, void *, int);
|
||||
} convert_rgb_t;
|
||||
};
|
||||
|
||||
typedef void yuv2rgb_copy (void * id, u8 * const * src,
|
||||
unsigned int v_offset);
|
||||
|
|
|
|||
|
|
@ -30,13 +30,13 @@
|
|||
#define CONVERT_BOTTOM_FIELD 2
|
||||
#define CONVERT_BOTH_FIELDS 3
|
||||
|
||||
typedef struct convert_init_s {
|
||||
struct convert_init_t {
|
||||
void * id;
|
||||
int id_size;
|
||||
int buf_size[3];
|
||||
void (* start) (void * id, u8 * dest, int flags);
|
||||
void (* copy) (void * id, u8 * Y, u8 * Cr, u8 * Cb, unsigned int v_offset);
|
||||
} convert_init_t;
|
||||
};
|
||||
|
||||
typedef void convert_t (int width, int height, u32 accel, void * arg,
|
||||
convert_init_t * result);
|
||||
|
|
|
|||
|
|
@ -619,7 +619,7 @@ void PADDSB() {
|
|||
_PADDSB(i);
|
||||
}
|
||||
|
||||
__forceinline void _PSUBSB(n)
|
||||
static __forceinline void _PSUBSB( u8 n )
|
||||
{
|
||||
s16 sTemp16;
|
||||
sTemp16 = (s16)cpuRegs.GPR.r[_Rs_].SC[n] - (s16)cpuRegs.GPR.r[_Rt_].SC[n];
|
||||
|
|
@ -752,7 +752,7 @@ void PCEQW() {
|
|||
_PCEQW(0); _PCEQW(1); _PCEQW(2); _PCEQW(3);
|
||||
}
|
||||
|
||||
__forceinline void _PMINW(n)
|
||||
static __forceinline void _PMINW( u8 n )
|
||||
{
|
||||
if (cpuRegs.GPR.r[_Rs_].SL[n] < cpuRegs.GPR.r[_Rt_].SL[n])
|
||||
cpuRegs.GPR.r[_Rd_].SL[n] = cpuRegs.GPR.r[_Rs_].SL[n];
|
||||
|
|
@ -785,7 +785,7 @@ void PABSH() {
|
|||
_PABSH(4); _PABSH(5); _PABSH(6); _PABSH(7);
|
||||
}
|
||||
|
||||
__forceinline void _PCEQH(n)
|
||||
static __forceinline void _PCEQH( u8 n )
|
||||
{
|
||||
if (cpuRegs.GPR.r[_Rs_].US[n] == cpuRegs.GPR.r[_Rt_].US[n])
|
||||
cpuRegs.GPR.r[_Rd_].US[n] = 0xFFFF;
|
||||
|
|
@ -800,7 +800,7 @@ void PCEQH() {
|
|||
_PCEQH(4); _PCEQH(5); _PCEQH(6); _PCEQH(7);
|
||||
}
|
||||
|
||||
__forceinline void _PMINH(n)
|
||||
static __forceinline void _PMINH( u8 n )
|
||||
{
|
||||
if (cpuRegs.GPR.r[_Rs_].SS[n] < cpuRegs.GPR.r[_Rt_].SS[n])
|
||||
cpuRegs.GPR.r[_Rd_].US[n] = cpuRegs.GPR.r[_Rs_].US[n];
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ PSMEMORYBLOCK s_psM = {0}, s_psHw = {0}, s_psS = {0}, s_psxM = {0}, s_psVuMem =
|
|||
|
||||
#ifdef _WIN32 // windows implementation of vm
|
||||
|
||||
PSMEMORYMAP initMemoryMap(ULONG_PTR* aPFNs, ULONG_PTR* aVFNs)
|
||||
static PSMEMORYMAP initMemoryMap(uptr* aPFNs, uptr* aVFNs)
|
||||
{
|
||||
PSMEMORYMAP m;
|
||||
m.aPFNs = aPFNs;
|
||||
|
|
|
|||
|
|
@ -31,10 +31,10 @@
|
|||
#ifdef PCSX2_VIRTUAL_MEM
|
||||
|
||||
#ifdef _WIN32
|
||||
typedef struct _PSMEMORYMAP
|
||||
struct PSMEMORYMAP
|
||||
{
|
||||
uptr* aPFNs, *aVFNs;
|
||||
} PSMEMORYMAP;
|
||||
};
|
||||
#endif
|
||||
|
||||
#define TRANSFORM_ADDR(memaddr) ( ((u32)(memaddr)>=0x40000000) ? ((memaddr)&~0xa0000000) : (memaddr) )
|
||||
|
|
|
|||
|
|
@ -556,7 +556,7 @@ int LoadState(const char *file) {
|
|||
int i;
|
||||
u32 dud; // for loading unused vars.
|
||||
#ifdef PCSX2_VIRTUAL_MEM
|
||||
u32 OldProtect;
|
||||
DWORD OldProtect;
|
||||
#endif
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
|
@ -776,10 +776,10 @@ int CheckState(const char *file) {
|
|||
}
|
||||
|
||||
|
||||
typedef struct {
|
||||
struct LangDef {
|
||||
char id[8];
|
||||
char name[64];
|
||||
} LangDef;
|
||||
};
|
||||
|
||||
LangDef sLangs[] = {
|
||||
{ "ar_AR", N_("Arabic") },
|
||||
|
|
@ -922,7 +922,7 @@ void ProcessFKeys(int fkey, int shift)
|
|||
|
||||
break;
|
||||
}
|
||||
InterlockedExchange( &Config.Options, newOptions );
|
||||
AtomicExchange( Config.Options, newOptions );
|
||||
|
||||
SysPrintf("Frame Limit Mode Changed: %s\n", limitMsg );
|
||||
|
||||
|
|
|
|||
39
pcsx2/Misc.h
39
pcsx2/Misc.h
|
|
@ -96,7 +96,7 @@ void CombinePaths( char* dest, const char* srcPath, const char* srcFile );
|
|||
#define CHECK_VU0REC (Config.Options&PCSX2_VU0REC)
|
||||
#define CHECK_VU1REC (Config.Options&PCSX2_VU1REC)
|
||||
|
||||
typedef struct {
|
||||
struct PcsxConfig {
|
||||
char Bios[g_MaxPath];
|
||||
char GS[g_MaxPath];
|
||||
char PAD1[g_MaxPath];
|
||||
|
|
@ -126,7 +126,7 @@ typedef struct {
|
|||
int CustomConsecutiveSkip;
|
||||
u32 sseMXCSR;
|
||||
u32 sseVUMXCSR;
|
||||
} PcsxConfig;
|
||||
};
|
||||
|
||||
extern PcsxConfig Config;
|
||||
extern u32 BiosVersion;
|
||||
|
|
@ -394,6 +394,41 @@ static __forceinline long InterlockedCompareExchangePointer(PVOID volatile *dest
|
|||
}
|
||||
#endif
|
||||
|
||||
// define some overloads for InterlockedExchanges, for commonly used types.
|
||||
static void AtomicExchange( u32& Target, u32 value )
|
||||
{
|
||||
InterlockedExchange( (volatile LONG*)&Target, value );
|
||||
}
|
||||
|
||||
static void AtomicIncrement( u32& Target )
|
||||
{
|
||||
InterlockedIncrement( (volatile LONG*)&Target );
|
||||
}
|
||||
|
||||
static void AtomicDecrement( u32& Target )
|
||||
{
|
||||
InterlockedDecrement( (volatile LONG*)&Target );
|
||||
}
|
||||
|
||||
static void AtomicExchange( s32& Target, s32 value )
|
||||
{
|
||||
InterlockedExchange( (volatile LONG*)&Target, value );
|
||||
}
|
||||
|
||||
static void AtomicIncrement( s32& Target )
|
||||
{
|
||||
InterlockedIncrement( (volatile LONG*)&Target );
|
||||
}
|
||||
|
||||
static void AtomicDecrement( s32& Target )
|
||||
{
|
||||
InterlockedDecrement( (volatile LONG*)&Target );
|
||||
}
|
||||
|
||||
// No fancy templating or overloading can save us from having to use C-style dereferences here.
|
||||
#define AtomicExchangePointer( target, value ) \
|
||||
InterlockedExchangePointer( reinterpret_cast<PVOID volatile*>(&target), reinterpret_cast<uptr>(value) )
|
||||
|
||||
extern void InitCPUTicks();
|
||||
extern u64 GetTickFrequency();
|
||||
extern u64 GetCPUTicks();
|
||||
|
|
|
|||
|
|
@ -105,9 +105,9 @@ char* CALLBACK PS2EgetLibName(void);
|
|||
#define KEYPRESS 1
|
||||
#define KEYRELEASE 2
|
||||
|
||||
typedef struct {
|
||||
typedef struct _keyEvent {
|
||||
u32 key;
|
||||
u32 event;
|
||||
u32 evt;
|
||||
} keyEvent;
|
||||
|
||||
// for 64bit compilers
|
||||
|
|
@ -121,7 +121,7 @@ typedef char __keyEvent_Size__[(sizeof(keyEvent) == 8)?1:-1];
|
|||
|
||||
typedef int (CALLBACK * SIOchangeSlotCB)(int slot);
|
||||
|
||||
typedef struct {
|
||||
typedef struct _cdvdSubQ {
|
||||
u8 ctrl:4; // control and mode bits
|
||||
u8 mode:4; // control and mode bits
|
||||
u8 trackNum; // current track number (1 to 99)
|
||||
|
|
@ -135,12 +135,12 @@ typedef struct {
|
|||
u8 discF; // current frame offset from first track (BCD encoded)
|
||||
} cdvdSubQ;
|
||||
|
||||
typedef struct { // NOT bcd coded
|
||||
typedef struct _cdvdTD { // NOT bcd coded
|
||||
u32 lsn;
|
||||
u8 type;
|
||||
} cdvdTD;
|
||||
|
||||
typedef struct {
|
||||
typedef struct _cdvdTN {
|
||||
u8 strack; //number of the first track (usually 1)
|
||||
u8 etrack; //number of the last track
|
||||
} cdvdTN;
|
||||
|
|
@ -192,19 +192,23 @@ typedef int (*USBhandler)(void);
|
|||
#define FREEZE_SAVE 1
|
||||
#define FREEZE_SIZE 2
|
||||
|
||||
typedef struct {
|
||||
typedef struct _GSdriverInfo {
|
||||
char name[8];
|
||||
void *common;
|
||||
} GSdriverInfo;
|
||||
|
||||
#ifdef _WIN32
|
||||
typedef struct { // unsupported values must be set to zero
|
||||
typedef struct _winInfo { // unsupported values must be set to zero
|
||||
HWND hWnd;
|
||||
HMENU hMenu;
|
||||
HWND hStatusWnd;
|
||||
} winInfo;
|
||||
#endif
|
||||
|
||||
#ifdef _cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* GS plugin API */
|
||||
|
||||
// if this file is included with this define
|
||||
|
|
@ -880,4 +884,8 @@ extern _FWtest FWtest;
|
|||
extern _FWabout FWabout;
|
||||
#endif
|
||||
|
||||
#ifdef _cplusplus
|
||||
} // End extern "C"
|
||||
#endif
|
||||
|
||||
#endif /* __PS2EDEFS_H__ */
|
||||
|
|
|
|||
|
|
@ -392,7 +392,7 @@ void patchFunc_patch( char * cmd, char * param )
|
|||
|
||||
pText = strtok( NULL, "," );
|
||||
inifile_trim( pText );
|
||||
patch[ patchnumber ].cpu = PatchTableExecute( pText, NULL, cpuCore );
|
||||
patch[ patchnumber ].cpu = (patch_cpu_type)PatchTableExecute( pText, NULL, cpuCore );
|
||||
if ( patch[ patchnumber ].cpu == 0 )
|
||||
{
|
||||
SysPrintf( "Unrecognized patch '%s'\n", pText );
|
||||
|
|
@ -405,7 +405,7 @@ void patchFunc_patch( char * cmd, char * param )
|
|||
|
||||
pText = strtok( NULL, "," );
|
||||
inifile_trim( pText );
|
||||
patch[ patchnumber ].type = PatchTableExecute( pText, NULL, dataType );
|
||||
patch[ patchnumber ].type = (patch_data_type)PatchTableExecute( pText, NULL, dataType );
|
||||
if ( patch[ patchnumber ].type == 0 )
|
||||
{
|
||||
SysPrintf( "Unrecognized patch '%s'\n", pText );
|
||||
|
|
@ -558,9 +558,9 @@ int AddPatch(int Mode, int Place, int Address, int Size, u64 data)
|
|||
else
|
||||
patch[patchnumber].placetopatch = Mode;
|
||||
|
||||
patch[patchnumber].cpu = Place;
|
||||
patch[patchnumber].cpu = (patch_cpu_type)Place;
|
||||
patch[patchnumber].addr=Address;
|
||||
patch[patchnumber].type=Size;
|
||||
patch[patchnumber].type=(patch_data_type)Size;
|
||||
patch[patchnumber].data = data;
|
||||
return patchnumber++;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,23 +54,36 @@ enum patch_data_type {
|
|||
//
|
||||
typedef void (*PATCHTABLEFUNC)( char * text1, char * text2 );
|
||||
|
||||
typedef struct
|
||||
struct PatchTextTable
|
||||
{
|
||||
char *text;
|
||||
int code;
|
||||
PATCHTABLEFUNC func;
|
||||
} PatchTextTable;
|
||||
};
|
||||
|
||||
typedef struct
|
||||
struct IniPatch
|
||||
{
|
||||
int enabled;
|
||||
int group;
|
||||
enum patch_data_type type;
|
||||
enum patch_cpu_type cpu;
|
||||
patch_data_type type;
|
||||
patch_cpu_type cpu;
|
||||
int placetopatch;
|
||||
u32 addr;
|
||||
u64 data;
|
||||
} IniPatch;
|
||||
};
|
||||
|
||||
#ifdef _WIN32
|
||||
#include<windows.h>
|
||||
struct AppData
|
||||
{
|
||||
HWND hWnd; // Main window handle
|
||||
HINSTANCE hInstance; // Application instance
|
||||
HMENU hMenu; // Main window menu
|
||||
HANDLE hConsole;
|
||||
};
|
||||
|
||||
extern AppData gApp;
|
||||
#endif
|
||||
|
||||
//
|
||||
// Function prototypes
|
||||
|
|
@ -118,11 +131,13 @@ extern void SetVUNanMode(int mode);
|
|||
extern int path3hack;
|
||||
extern int g_FFXHack;
|
||||
//extern int g_VUGameFixes;
|
||||
extern int g_ZeroGSOptions;
|
||||
extern u32 g_sseMXCSR;
|
||||
extern u32 g_sseVUMXCSR;
|
||||
void SetCPUState(u32 sseMXCSR, u32 sseVUMXCSR);
|
||||
|
||||
void SetCPUState(u32 sseMXCSR, u32 sseVUMXCSR);
|
||||
void SetRoundMode(u32 ee, u32 vu);
|
||||
int LoadPatch(char *patchfile);
|
||||
|
||||
#endif /* __PATCH_H__ */
|
||||
|
||||
|
|
|
|||
|
|
@ -214,6 +214,11 @@ _FWfreeze FWfreeze;
|
|||
_FWtest FWtest;
|
||||
_FWabout FWabout;
|
||||
|
||||
|
||||
DEV9handler dev9Handler;
|
||||
USBhandler usbHandler;
|
||||
|
||||
|
||||
#define CheckErr(func) \
|
||||
err = SysLibError(); \
|
||||
if (err != NULL) { SysMessage (_("%s: Error loading %s: %s"), filename, func, err); return -1; }
|
||||
|
|
@ -708,7 +713,7 @@ extern void spu2DMA4Irq();
|
|||
extern void spu2DMA7Irq();
|
||||
extern void spu2Irq();
|
||||
|
||||
typedef struct _PluginOpenStatusFlags
|
||||
struct PluginOpenStatusFlags
|
||||
{
|
||||
u8 GS : 1
|
||||
, CDVD : 1
|
||||
|
|
@ -719,7 +724,7 @@ typedef struct _PluginOpenStatusFlags
|
|||
, PAD2 : 1
|
||||
, FW : 1;
|
||||
|
||||
} PluginOpenStatusFlags;
|
||||
};
|
||||
|
||||
static PluginOpenStatusFlags OpenStatus;
|
||||
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
#ifndef __PSX_BIOS_H__
|
||||
#define __PSX_BIOS_H__
|
||||
|
||||
typedef struct {
|
||||
struct irxImageInfo {
|
||||
u32 next, //+00
|
||||
name; //+04
|
||||
u16 version, //+08
|
||||
|
|
@ -54,13 +54,13 @@ typedef struct {
|
|||
bss_size, //+24
|
||||
_pad28, //+28
|
||||
_pad2C; //+2C
|
||||
} irxImageInfo; //=30
|
||||
}; //=30
|
||||
|
||||
typedef struct {
|
||||
struct _sifServer {
|
||||
int active;
|
||||
u32 server;
|
||||
u32 fhandler;
|
||||
} _sifServer;
|
||||
};
|
||||
|
||||
#define SIF_SERVERS 32
|
||||
|
||||
|
|
@ -71,16 +71,16 @@ _sifServer sifServer[SIF_SERVERS];
|
|||
#define IRX_MODULES 64
|
||||
#define IRX_FUNCS 256
|
||||
|
||||
typedef struct {
|
||||
struct irxFunc {
|
||||
u32 num;
|
||||
u32 entry;
|
||||
} irxFunc;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct irxModule {
|
||||
int active;
|
||||
u32 name[2];
|
||||
irxFunc funcs[IRX_FUNCS];
|
||||
} irxModule;
|
||||
};
|
||||
|
||||
irxModule irxMod[IRX_MODULES];
|
||||
|
||||
|
|
|
|||
|
|
@ -22,14 +22,14 @@
|
|||
// fixme: sCycle, Cycle, and otarget are unused
|
||||
// Can't remove them without making a new savestate version though.
|
||||
|
||||
typedef struct {
|
||||
struct psxCounter {
|
||||
u64 count, target;
|
||||
u32 mode;
|
||||
u32 rate, interrupt, otarget;
|
||||
u32 sCycle, Cycle;
|
||||
u32 sCycleT;
|
||||
s32 CycleT;
|
||||
} psxCounter;
|
||||
};
|
||||
|
||||
extern psxCounter psxCounters[8];
|
||||
extern s32 psxNextCounter;
|
||||
|
|
|
|||
|
|
@ -31,12 +31,13 @@ void psxDma10(u32 madr, u32 bcr, u32 chcr);
|
|||
int psxDma4Interrupt();
|
||||
int psxDma7Interrupt();
|
||||
void dev9Interrupt();
|
||||
DEV9handler dev9Handler;
|
||||
void dev9Irq(int cycles);
|
||||
void usbInterrupt();
|
||||
USBhandler usbHandler;
|
||||
void usbIrq(int cycles);
|
||||
void fwIrq();
|
||||
void spu2Irq();
|
||||
|
||||
extern DEV9handler dev9Handler;
|
||||
extern USBhandler usbHandler;
|
||||
|
||||
#endif /* __PSXDMA_H__ */
|
||||
|
|
|
|||
|
|
@ -40,11 +40,11 @@ extern void (*psxCP2BSC[32])();
|
|||
extern void bios_write();
|
||||
extern void bios_printf();
|
||||
|
||||
typedef struct {
|
||||
char name[8];
|
||||
char names[64][32];
|
||||
struct irxlib {
|
||||
char name[16];
|
||||
char names[64][64];
|
||||
int maxn;
|
||||
} irxlib;
|
||||
};
|
||||
|
||||
#define IRXLIBS 14
|
||||
irxlib irxlibs[32] = {
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@
|
|||
|
||||
#include "PsxCommon.h"
|
||||
|
||||
sio2Struct sio2;
|
||||
|
||||
/*
|
||||
w [8268]=0x3bc sio2_start/sio2man
|
||||
r [8270] padman_start/padman
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ struct SIO2_packet {
|
|||
unsigned int dmacCount2;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct sio2Struct {
|
||||
struct SIO2_packet packet;
|
||||
u32 ctrl;
|
||||
u32 intr;
|
||||
|
|
@ -60,9 +60,9 @@ typedef struct {
|
|||
int cmdlength; //length of a command sent to a port
|
||||
//is less_equal than the dma send size
|
||||
u8 buf[BUFSIZE];
|
||||
} sio2Struct;
|
||||
};
|
||||
|
||||
sio2Struct sio2;
|
||||
extern sio2Struct sio2;
|
||||
|
||||
void sio2Reset();
|
||||
|
||||
|
|
|
|||
|
|
@ -23,20 +23,20 @@
|
|||
|
||||
extern u32 g_psxNextBranchCycle;
|
||||
|
||||
typedef struct {
|
||||
struct R3000Acpu {
|
||||
int (*Init)();
|
||||
void (*Reset)();
|
||||
void (*Execute)(); /* executes up to a break */
|
||||
void (*ExecuteBlock)(); /* executes up to a jump */
|
||||
void (*Clear)(u32 Addr, u32 Size);
|
||||
void (*Shutdown)();
|
||||
} R3000Acpu;
|
||||
};
|
||||
|
||||
extern R3000Acpu *psxCpu;
|
||||
extern R3000Acpu psxInt;
|
||||
extern R3000Acpu psxRec;
|
||||
|
||||
typedef union {
|
||||
union GPRRegs {
|
||||
struct {
|
||||
u32 r0, at, v0, v1, a0, a1, a2, a3,
|
||||
t0, t1, t2, t3, t4, t5, t6, t7,
|
||||
|
|
@ -44,9 +44,9 @@ typedef union {
|
|||
t8, t9, k0, k1, gp, sp, s8, ra, hi, lo; // hi needs to be at index 32! don't change
|
||||
} n;
|
||||
u32 r[34]; /* Lo, Hi in r[33] and r[32] */
|
||||
} GPRRegs;
|
||||
};
|
||||
|
||||
typedef union {
|
||||
union CP0Regs {
|
||||
struct {
|
||||
u32 Index, Random, EntryLo0, EntryLo1,
|
||||
Context, PageMask, Wired, Reserved0,
|
||||
|
|
@ -58,33 +58,33 @@ typedef union {
|
|||
TagLo, TagHi, ErrorEPC, Reserved6;
|
||||
} n;
|
||||
u32 r[32];
|
||||
} CP0Regs;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct SVector2D {
|
||||
short x, y;
|
||||
} SVector2D;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct SVector2Dz {
|
||||
short z, pad;
|
||||
} SVector2Dz;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct SVector3D {
|
||||
short x, y, z, pad;
|
||||
} SVector3D;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct LVector3D {
|
||||
short x, y, z, pad;
|
||||
} LVector3D;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct CBGR {
|
||||
unsigned char r, g, b, c;
|
||||
} CBGR;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct SMatrix3D {
|
||||
short m11, m12, m13, m21, m22, m23, m31, m32, m33, pad;
|
||||
} SMatrix3D;
|
||||
};
|
||||
|
||||
typedef union {
|
||||
union CP2Data {
|
||||
struct {
|
||||
SVector3D v0, v1, v2;
|
||||
CBGR rgb;
|
||||
|
|
@ -99,9 +99,9 @@ typedef union {
|
|||
s32 lzcs, lzcr;
|
||||
} n;
|
||||
u32 r[32];
|
||||
} CP2Data;
|
||||
};
|
||||
|
||||
typedef union {
|
||||
union CP2Ctrl {
|
||||
struct {
|
||||
SMatrix3D rMatrix;
|
||||
s32 trX, trY, trZ;
|
||||
|
|
@ -116,9 +116,9 @@ typedef union {
|
|||
s32 flag;
|
||||
} n;
|
||||
u32 r[32];
|
||||
} CP2Ctrl;
|
||||
};
|
||||
|
||||
typedef struct psxRegisters_t {
|
||||
struct psxRegisters {
|
||||
GPRRegs GPR; /* General Purpose Registers */
|
||||
CP0Regs CP0; /* Coprocessor0 Registers */
|
||||
CP2Data CP2D; /* Cop2 data registers */
|
||||
|
|
@ -131,7 +131,7 @@ typedef struct psxRegisters_t {
|
|||
s32 eCycle[64]; // cycle delta for signaled ints (sCycle + eCycle == branch cycle)
|
||||
u32 _msflag[32];
|
||||
u32 _smflag[32];
|
||||
} psxRegisters;
|
||||
};
|
||||
|
||||
extern PCSX2_ALIGNED16_DECL(psxRegisters psxRegs);
|
||||
|
||||
|
|
|
|||
|
|
@ -52,8 +52,6 @@ int cpuInit()
|
|||
SysPrintf("PCSX2 " PCSX2_VERSION " save ver: %x\n", dwSaveVersion);
|
||||
SysPrintf("EE pc offset: 0x%x, PSX pc offset: 0x%x\n", (u32)&cpuRegs.pc - (u32)&cpuRegs, (u32)&psxRegs.pc - (u32)&psxRegs);
|
||||
|
||||
InitFPUOps();
|
||||
|
||||
cpuRegs.constzero = 0;
|
||||
#ifdef PCSX2_NORECBUILD
|
||||
Cpu = &intCpu;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
#include <stdio.h>
|
||||
|
||||
typedef struct {
|
||||
struct R5900cpu {
|
||||
int (*Init)();
|
||||
void (*Reset)();
|
||||
void (*Step)();
|
||||
|
|
@ -35,14 +35,14 @@ typedef struct {
|
|||
void (*ClearVU0)(u32 Addr, u32 Size);
|
||||
void (*ClearVU1)(u32 Addr, u32 Size);
|
||||
void (*Shutdown)();
|
||||
} R5900cpu;
|
||||
};
|
||||
|
||||
extern R5900cpu *Cpu;
|
||||
extern R5900cpu intCpu;
|
||||
extern R5900cpu recCpu;
|
||||
extern u32 bExecBIOS;
|
||||
|
||||
typedef union { // Declare union type GPR register
|
||||
union GPR_reg { // Declare union type GPR register
|
||||
u64 UD[2]; //128 bits
|
||||
s64 SD[2];
|
||||
u32 UL[4];
|
||||
|
|
@ -51,9 +51,9 @@ typedef union { // Declare union type GPR register
|
|||
s16 SS[8];
|
||||
u8 UC[16];
|
||||
s8 SC[16];
|
||||
} GPR_reg;
|
||||
};
|
||||
|
||||
typedef union {
|
||||
union GPRregs {
|
||||
struct {
|
||||
GPR_reg r0, at, v0, v1, a0, a1, a2, a3,
|
||||
t0, t1, t2, t3, t4, t5, t6, t7,
|
||||
|
|
@ -61,16 +61,16 @@ typedef union {
|
|||
t8, t9, k0, k1, gp, sp, s8, ra;
|
||||
} n;
|
||||
GPR_reg r[32];
|
||||
} GPRregs;
|
||||
};
|
||||
|
||||
typedef union {
|
||||
union PERFregs {
|
||||
struct {
|
||||
u32 pccr, pcr0, pcr1, pad;
|
||||
} n;
|
||||
u32 r[4];
|
||||
} PERFregs;
|
||||
};
|
||||
|
||||
typedef union {
|
||||
union CP0regs {
|
||||
struct {
|
||||
u32 Index, Random, EntryLo0, EntryLo1,
|
||||
Context, PageMask, Wired, Reserved0,
|
||||
|
|
@ -103,9 +103,9 @@ typedef union {
|
|||
TagLo, TagHi, ErrorEPC, DESAVE;
|
||||
} n;
|
||||
u32 r[32];
|
||||
} CP0regs;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct cpuRegisters {
|
||||
GPRregs GPR; // GPR regs
|
||||
// NOTE: don't change order since recompiler uses it
|
||||
GPR_reg HI;
|
||||
|
|
@ -123,7 +123,7 @@ typedef struct {
|
|||
int branch;
|
||||
int opmode; // operating mode
|
||||
u32 tempcycles;
|
||||
} cpuRegisters;
|
||||
};
|
||||
|
||||
extern s32 EEsCycle;
|
||||
extern u32 EEoCycle;
|
||||
|
|
@ -157,21 +157,21 @@ typedef union {
|
|||
extern PCSX2_ALIGNED16_DECL(GPR_reg64 g_cpuConstRegs[32]);
|
||||
extern u32 g_cpuHasConstReg, g_cpuFlushedConstReg;
|
||||
|
||||
typedef union {
|
||||
union FPRreg {
|
||||
float f;
|
||||
u32 UL;
|
||||
} FPRreg;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct fpuRegisters {
|
||||
FPRreg fpr[32]; // 32bit floating point registers
|
||||
u32 fprc[32]; // 32bit floating point control registers
|
||||
FPRreg ACC; // 32 bit accumulator
|
||||
} fpuRegisters;
|
||||
};
|
||||
|
||||
extern PCSX2_ALIGNED16_DECL(fpuRegisters fpuRegs);
|
||||
|
||||
|
||||
typedef struct {
|
||||
struct tlbs {
|
||||
u32 PageMask,EntryHi;
|
||||
u32 EntryLo0,EntryLo1;
|
||||
u32 Mask, nMask;
|
||||
|
|
@ -180,7 +180,7 @@ typedef struct {
|
|||
u32 VPN2;
|
||||
u32 PFN0;
|
||||
u32 PFN1;
|
||||
} tlbs;
|
||||
};
|
||||
|
||||
extern PCSX2_ALIGNED16_DECL(tlbs tlb[48]);
|
||||
|
||||
|
|
|
|||
|
|
@ -36,18 +36,18 @@
|
|||
|
||||
|
||||
#pragma pack(1)
|
||||
typedef struct tag_DECI2_HEADER{
|
||||
struct DECI2_HEADER {
|
||||
u16 length, //+00
|
||||
_pad, //+02
|
||||
protocol; //+04
|
||||
char source, //+06
|
||||
destination;//+07
|
||||
} DECI2_HEADER; //=08
|
||||
}; //=08
|
||||
|
||||
typedef struct tag_DECI2_DBGP_BRK{
|
||||
struct DECI2_DBGP_BRK{
|
||||
u32 address, //+00
|
||||
count; //+04
|
||||
} DECI2_DBGP_BRK; //=08
|
||||
}; //=08
|
||||
#pragma pack()
|
||||
|
||||
#define STOP 0
|
||||
|
|
@ -65,7 +65,7 @@ extern HANDLE runEvent; //i don't like this;
|
|||
extern int connected;
|
||||
//when add linux code this might change
|
||||
|
||||
int writeData(char *result);
|
||||
int writeData(const u8 *result);
|
||||
void exchangeSD(DECI2_HEADER *h);
|
||||
|
||||
#endif//__DECI2_H__
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
#include "VUmicro.h"
|
||||
#include "deci2.h"
|
||||
|
||||
typedef struct tag_DECI2_DBGP_HEADER{
|
||||
struct DECI2_DBGP_HEADER{
|
||||
DECI2_HEADER h; //+00
|
||||
u16 id; //+08
|
||||
u8 type, //+0A
|
||||
|
|
@ -29,9 +29,9 @@ typedef struct tag_DECI2_DBGP_HEADER{
|
|||
result, //+0C
|
||||
count; //+0D
|
||||
u16 _pad; //+0E
|
||||
} DECI2_DBGP_HEADER; //=10
|
||||
}; //=10
|
||||
|
||||
typedef struct tag_DECI2_DBGP_CONF{
|
||||
struct DECI2_DBGP_CONF{
|
||||
u32 major_ver, //+00
|
||||
minor_ver, //+04
|
||||
target_id, //+08
|
||||
|
|
@ -49,7 +49,7 @@ typedef struct tag_DECI2_DBGP_CONF{
|
|||
run_stop_state, //+38
|
||||
hdbg_area_addr, //+3C
|
||||
hdbg_area_size; //+40
|
||||
} DECI2_DBGP_CONF; //=44
|
||||
}; //=44
|
||||
|
||||
DECI2_DBGP_CONF
|
||||
cpu={3, 0, PROTO_EDBGP, 0, 0x41F, 1, 7, 32, 32, 1, 0xFF, 0xFF, 0x1F, 0x400, 2, 0x80020c70, 0x100},
|
||||
|
|
@ -59,39 +59,39 @@ iop={3, 0, PROTO_IDBGP, 0, 0x00F, 1, 5, 62, 32, 1, 0x00, 0x00, 0x07, 0x200, 1, 0
|
|||
//iop={3, 0, PROTO_IDBGP, 0, 0x00F, 1, 5, 62, 0, 1, 0x00, 0x00, 0x07, 0x200, 0, 0x00006940, 0x100};
|
||||
|
||||
#pragma pack(2)
|
||||
typedef struct tag_DECI2_DBGP_EREG{
|
||||
struct DECI2_DBGP_EREG{
|
||||
u8 kind, //+00
|
||||
number; //+01
|
||||
u16 _pad; //+02
|
||||
u64 value[2]; //+04
|
||||
} DECI2_DBGP_EREG; //=14
|
||||
}; //=14
|
||||
|
||||
typedef struct tag_DECI2_DBGP_IREG{
|
||||
struct DECI2_DBGP_IREG{
|
||||
u8 kind, //+00
|
||||
number; //+01
|
||||
u16 _pad; //+02
|
||||
u32 value; //+04
|
||||
} DECI2_DBGP_IREG; //=08
|
||||
}; //=08
|
||||
|
||||
typedef struct tag_DECI2_DBGP_MEM{
|
||||
struct DECI2_DBGP_MEM{
|
||||
u8 space, //+00
|
||||
align; //+01
|
||||
u16 _pad; //+02
|
||||
u32 address; //+04
|
||||
u32 length; //+08
|
||||
} DECI2_DBGP_MEM; //=0C
|
||||
}; //=0C
|
||||
|
||||
typedef struct tag_DECI2_DBGP_RUN{
|
||||
struct DECI2_DBGP_RUN{
|
||||
u32 entry, //+00
|
||||
gp, //+04
|
||||
_pad, //+08
|
||||
_pad1, //+0C
|
||||
argc; //+10
|
||||
u32 argv[0]; //+14
|
||||
} DECI2_DBGP_RUN; //=14
|
||||
}; //=14
|
||||
#pragma pack()
|
||||
|
||||
void D2_DBGP(char *inbuffer, char *outbuffer, char *message, char *eepc, char *ioppc, char *eecy, char *iopcy){
|
||||
void D2_DBGP(const u8 *inbuffer, u8 *outbuffer, char *message, char *eepc, char *ioppc, char *eecy, char *iopcy){
|
||||
DECI2_DBGP_HEADER *in=(DECI2_DBGP_HEADER*)inbuffer,
|
||||
*out=(DECI2_DBGP_HEADER*)outbuffer;
|
||||
u8 *data=(u8*)in+sizeof(DECI2_DBGP_HEADER);
|
||||
|
|
@ -410,5 +410,5 @@ void sendBREAK(u8 source, u16 id, u8 code, u8 result, u8 count){
|
|||
tmp.result =result;
|
||||
tmp.count =count;
|
||||
tmp._pad =0;
|
||||
writeData((char*)&tmp);
|
||||
writeData((u8*)&tmp);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
#include "Common.h"
|
||||
#include "deci2.h"
|
||||
|
||||
void D2_DBGP(char *inbuffer, char *outbuffer, char *message, char *eepc, char *ioppc, char *eecy, char *iopcy);
|
||||
void D2_DBGP(const u8 *inbuffer, u8 *outbuffer, char *message, char *eepc, char *ioppc, char *eecy, char *iopcy);
|
||||
void sendBREAK(u8 source, u16 id, u8 code, u8 result, u8 count);
|
||||
|
||||
#endif//__DECI2DBGP_H__
|
||||
|
|
|
|||
|
|
@ -19,27 +19,27 @@
|
|||
#include "Common.h"
|
||||
#include "deci2.h"
|
||||
|
||||
typedef struct tag_DECI2_DCMP_HEADER{
|
||||
struct DECI2_DCMP_HEADER{
|
||||
DECI2_HEADER h; //+00
|
||||
u8 type, //+08
|
||||
code; //+09
|
||||
u16 _pad; //+0A
|
||||
} DECI2_DCMP_HEADER; //=0C
|
||||
}; //=0C
|
||||
|
||||
typedef struct tag_DECI2_DCMP_CONNECT{
|
||||
struct DECI2_DCMP_CONNECT{
|
||||
u8 result, //+00
|
||||
_pad[3];//+01
|
||||
u64 EEboot, //+04
|
||||
IOPboot;//+0C
|
||||
} DECI2_DCMP_CONNECT; //=14
|
||||
}; //=14
|
||||
|
||||
typedef struct tag_DECI2_DCMP_ECHO{
|
||||
struct DECI2_DCMP_ECHO{
|
||||
u16 identifier, //+00
|
||||
sequence; //+02
|
||||
u8 data[32]; //+04
|
||||
} DECI2_DCMP_ECHO; //=24
|
||||
}; //=24
|
||||
|
||||
void D2_DCMP(char *inbuffer, char *outbuffer, char *message){
|
||||
void D2_DCMP(const u8 *inbuffer, u8 *outbuffer, char *message){
|
||||
DECI2_DCMP_HEADER *in=(DECI2_DCMP_HEADER*)inbuffer,
|
||||
*out=(DECI2_DCMP_HEADER*)outbuffer;
|
||||
u8 *data=(u8*)in+sizeof(DECI2_DCMP_HEADER);
|
||||
|
|
@ -49,8 +49,8 @@ void D2_DCMP(char *inbuffer, char *outbuffer, char *message){
|
|||
|
||||
memcpy(outbuffer, inbuffer, 128*1024);//BUFFERSIZE
|
||||
out->h.length=sizeof(DECI2_DCMP_HEADER);
|
||||
switch(in->type){
|
||||
/* case 0:
|
||||
/* switch(in->type){
|
||||
case 0:
|
||||
sprintf(message, " [DCMP] type=CONNECT code=%s EEboot=0x%I64X IOP=0x%I64X",
|
||||
in->code==0?"CONNECT":"DISCONNECT", connect->EEboot, connect->IOPboot);
|
||||
data=(u8*)out+sizeof(DECI2_DCMP_HEADER);
|
||||
|
|
@ -64,12 +64,12 @@ void D2_DCMP(char *inbuffer, char *outbuffer, char *message){
|
|||
// not implemented, not needed?
|
||||
default:
|
||||
sprintf(message, " [DCMP] type=%d[unknown]", in->type);
|
||||
*/ }
|
||||
}*/
|
||||
out->code++;
|
||||
}
|
||||
|
||||
void sendDCMP(u16 protocol, u8 source, u8 destination, u8 type, u8 code, char *data, int size){
|
||||
static char tmp[100];
|
||||
static u8 tmp[100];
|
||||
((DECI2_DCMP_HEADER*)tmp)->h.length =sizeof(DECI2_DCMP_HEADER)+size;
|
||||
((DECI2_DCMP_HEADER*)tmp)->h._pad =0;
|
||||
((DECI2_DCMP_HEADER*)tmp)->h.protocol =protocol;
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
#include "Common.h"
|
||||
#include "deci2.h"
|
||||
|
||||
void D2_DCMP(char *inbuffer, char *outbuffer, char *message);
|
||||
void D2_DCMP(const u8 *inbuffer, u8 *outbuffer, char *message);
|
||||
void sendDCMP(u16 protocol, u8 source, u8 destination, u8 type, u8 code, char *data, int size);
|
||||
|
||||
#endif//__DECI2DCMP_H__
|
||||
|
|
|
|||
|
|
@ -21,16 +21,16 @@
|
|||
#include "PsxBios2.h"
|
||||
#include "deci2.h"
|
||||
|
||||
typedef struct tag_DECI2_ILOADP_HEADER{
|
||||
struct DECI2_ILOADP_HEADER{
|
||||
DECI2_HEADER h; //+00
|
||||
u8 code, //+08 cmd
|
||||
action, //+09
|
||||
result, //+0A
|
||||
stamp; //+0B
|
||||
u32 moduleId; //+0C
|
||||
} DECI2_ILOADP_HEADER; //=10
|
||||
}; //=10
|
||||
|
||||
typedef struct tag_DECI2_ILOADP_INFO{
|
||||
struct DECI2_ILOADP_INFO{
|
||||
u16 version, //+00
|
||||
flags; //+02
|
||||
u32 module_address, //+04
|
||||
|
|
@ -38,7 +38,7 @@ typedef struct tag_DECI2_ILOADP_INFO{
|
|||
data_size, //+0C
|
||||
bss_size, //+10
|
||||
_pad[3]; //+14
|
||||
} DECI2_ILOADP_INFO;
|
||||
};
|
||||
|
||||
void writeInfo(DECI2_ILOADP_INFO *info,
|
||||
u16 version, u16 flags, u32 module_address,
|
||||
|
|
@ -52,7 +52,7 @@ void writeInfo(DECI2_ILOADP_INFO *info,
|
|||
info->_pad[0]=info->_pad[1]=info->_pad[2]=0;
|
||||
}
|
||||
|
||||
void D2_ILOADP(char *inbuffer, char *outbuffer, char *message){
|
||||
void D2_ILOADP(const u8 *inbuffer, u8 *outbuffer, char *message){
|
||||
DECI2_ILOADP_HEADER *in=(DECI2_ILOADP_HEADER*)inbuffer,
|
||||
*out=(DECI2_ILOADP_HEADER*)outbuffer;
|
||||
u8 *data=(u8*)in+sizeof(DECI2_ILOADP_HEADER);
|
||||
|
|
@ -87,9 +87,9 @@ void D2_ILOADP(char *inbuffer, char *outbuffer, char *message){
|
|||
writeInfo((DECI2_ILOADP_INFO*)data,
|
||||
iii->version, iii->flags, iii->vaddr, iii->text_size, iii->data_size, iii->bss_size);
|
||||
data+=sizeof(DECI2_ILOADP_INFO);
|
||||
strcpy(data, PSXM(iii->name));
|
||||
data+=strlen(PSXM(iii->name))+4;
|
||||
data=(char*)((int)data & 0xFFFFFFFC);
|
||||
strcpy((char*)data, (char*)PSXM(iii->name));
|
||||
data+=strlen((char*)PSXM(iii->name))+4;
|
||||
data=(u8*)((int)data & 0xFFFFFFFC);
|
||||
break;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,6 @@
|
|||
#include "Common.h"
|
||||
#include "deci2.h"
|
||||
|
||||
void D2_ILOADP(char *inbuffer, char *outbuffer, char *message);
|
||||
void D2_ILOADP(const u8 *inbuffer, u8 *outbuffer, char *message);
|
||||
|
||||
#endif//__DECI2ILOADP_H__
|
||||
|
|
|
|||
|
|
@ -19,23 +19,23 @@
|
|||
#include "Common.h"
|
||||
#include "deci2.h"
|
||||
|
||||
typedef struct tag_DECI2_NETMP_HEADER{
|
||||
struct DECI2_NETMP_HEADER{
|
||||
DECI2_HEADER h; //+00
|
||||
u8 code, //+08
|
||||
result; //+09
|
||||
} DECI2_NETMP_HEADER; //=0A
|
||||
}; //=0A
|
||||
|
||||
typedef struct tag_DECI2_NETMP_CONNECT{
|
||||
struct DECI2_NETMP_CONNECT{
|
||||
u8 priority, //+00
|
||||
_pad; //+01
|
||||
u16 protocol; //+02
|
||||
} DECI2_NETMP_CONNECT; //=04
|
||||
}; //=04
|
||||
|
||||
char d2_message[100];
|
||||
int d2_count=1;
|
||||
DECI2_NETMP_CONNECT d2_connect[50]={0xFF, 0, 0x400};
|
||||
|
||||
void D2_NETMP(char *inbuffer, char *outbuffer, char *message){
|
||||
void D2_NETMP(const u8 *inbuffer, u8 *outbuffer, char *message){
|
||||
DECI2_NETMP_HEADER *in=(DECI2_NETMP_HEADER*)inbuffer,
|
||||
*out=(DECI2_NETMP_HEADER*)outbuffer;
|
||||
u8 *data=(u8*)in+sizeof(DECI2_NETMP_HEADER);
|
||||
|
|
@ -96,7 +96,7 @@ void D2_NETMP(char *inbuffer, char *outbuffer, char *message){
|
|||
break;
|
||||
case 4://[OK]
|
||||
sprintf(line, "code=MESSAGE %s", data);//null terminated by the memset with 0 call
|
||||
strcpy(d2_message, data);
|
||||
strcpy(d2_message, (char*)data);
|
||||
writeData(outbuffer);
|
||||
break;
|
||||
case 6://[ok]
|
||||
|
|
@ -122,7 +122,7 @@ void D2_NETMP(char *inbuffer, char *outbuffer, char *message){
|
|||
case 10:
|
||||
sprintf(line, "code=VERSION %s", data);
|
||||
data=(u8*)out+sizeof(DECI2_NETMP_HEADER);
|
||||
strcpy(data, "0.2.0");data+=strlen("0.2.0");//emu version;)
|
||||
strcpy((char*)data, "0.2.0");data+=strlen("0.2.0");//emu version;)
|
||||
out->h.length=data-(u8*)out;
|
||||
writeData(outbuffer);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -22,6 +22,6 @@
|
|||
#include "Common.h"
|
||||
#include "deci2.h"
|
||||
|
||||
void D2_NETMP(char *inbuffer, char *outbuffer, char *message);
|
||||
void D2_NETMP(const u8 *inbuffer, u8 *outbuffer, char *message);
|
||||
|
||||
#endif//__DECI2NETMP_H__
|
||||
|
|
|
|||
|
|
@ -19,11 +19,11 @@
|
|||
#include "Common.h"
|
||||
#include "deci2.h"
|
||||
|
||||
typedef struct tag_DECI2_TTYP_HEADER{
|
||||
struct DECI2_TTYP_HEADER{
|
||||
DECI2_HEADER h; //+00
|
||||
u32 flushreq; //+08
|
||||
u8 data[0]; //+0C
|
||||
} DECI2_TTYP_HEADER; //=0C
|
||||
}; //=0C
|
||||
|
||||
void sendTTYP(u16 protocol, u8 source, char *data){
|
||||
static char tmp[2048];
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ DMACh *sif2ch;
|
|||
#define FIFO_SIF0_W 128
|
||||
#define FIFO_SIF1_W 128
|
||||
|
||||
typedef struct {
|
||||
struct _sif0{
|
||||
u32 fifoData[FIFO_SIF0_W];
|
||||
int fifoReadPos;
|
||||
int fifoWritePos;
|
||||
|
|
@ -47,9 +47,9 @@ typedef struct {
|
|||
int tagMode;
|
||||
int counter;
|
||||
struct sifData sifData;
|
||||
} _sif0;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct _sif1 {
|
||||
u32 fifoData[FIFO_SIF1_W];
|
||||
int fifoReadPos;
|
||||
int fifoWritePos;
|
||||
|
|
@ -58,7 +58,7 @@ typedef struct {
|
|||
int end;
|
||||
int tagMode;
|
||||
int counter;
|
||||
} _sif1;
|
||||
};
|
||||
|
||||
_sif0 sif0;
|
||||
_sif1 sif1;
|
||||
|
|
|
|||
19
pcsx2/Sio.c
19
pcsx2/Sio.c
|
|
@ -30,6 +30,7 @@
|
|||
#endif
|
||||
|
||||
FILE * MemoryCard1, * MemoryCard2;
|
||||
_sio sio;
|
||||
|
||||
const unsigned char cardh[4] = { 0xFF, 0xFF, 0x5a, 0x5d };
|
||||
// Memory Card Specs : Sector size etc.
|
||||
|
|
@ -46,20 +47,20 @@ struct mc_command_0x26_tag mc_command_0x26= {'+', 512, 16, 0x4000, 0x52, 0x5A};
|
|||
#define SIO_FORCEINLINE __forceinline
|
||||
#endif
|
||||
|
||||
void _ReadMcd(char *data, u32 adr, int size) {
|
||||
static void _ReadMcd(u8 *data, u32 adr, int size) {
|
||||
ReadMcd(sio.CtrlReg&0x2000?2:1, data, adr, size);
|
||||
}
|
||||
|
||||
void _SaveMcd(char *data, u32 adr, int size) {
|
||||
static void _SaveMcd(const u8 *data, u32 adr, int size) {
|
||||
SaveMcd(sio.CtrlReg&0x2000?2:1, data, adr, size);
|
||||
}
|
||||
|
||||
void _EraseMCDBlock(u32 adr) {
|
||||
static void _EraseMCDBlock(u32 adr) {
|
||||
EraseMcd(sio.CtrlReg&0x2000?2:1, adr);
|
||||
}
|
||||
|
||||
unsigned char sio_xor(unsigned char *buf, unsigned int length){
|
||||
register unsigned char i, x;
|
||||
u8 sio_xor(u8 *buf, unsigned int length){
|
||||
u8 i, x;
|
||||
|
||||
for (x=0, i=0; i<length; i++) x ^= buf[i];
|
||||
return x & 0xFF;
|
||||
|
|
@ -85,8 +86,8 @@ void psxSIOShutdown()
|
|||
if(MemoryCard2) fclose(MemoryCard2);
|
||||
}
|
||||
|
||||
unsigned char sioRead8() {
|
||||
unsigned char ret = 0xFF;
|
||||
u8 sioRead8() {
|
||||
u8 ret = 0xFF;
|
||||
|
||||
if (sio.StatReg & RX_RDY) {
|
||||
ret = sio.buf[sio.parp];
|
||||
|
|
@ -566,7 +567,7 @@ void SeekMcd(FILE *f, u32 adr) {
|
|||
fseek(f, adr, SEEK_SET);
|
||||
}
|
||||
|
||||
void ReadMcd(int mcd, char *data, u32 adr, int size) {
|
||||
void ReadMcd(int mcd, u8 *data, u32 adr, int size) {
|
||||
if(mcd == 1)
|
||||
{
|
||||
if (MemoryCard1 == NULL) {
|
||||
|
|
@ -587,7 +588,7 @@ void ReadMcd(int mcd, char *data, u32 adr, int size) {
|
|||
}
|
||||
}
|
||||
|
||||
void SaveMcd(int mcd, char *data, u32 adr, int size) {
|
||||
void SaveMcd(int mcd, const u8 *data, u32 adr, int size) {
|
||||
if(mcd == 1)
|
||||
{
|
||||
SeekMcd(MemoryCard1, adr);
|
||||
|
|
|
|||
23
pcsx2/Sio.h
23
pcsx2/Sio.h
|
|
@ -38,7 +38,7 @@
|
|||
//#define SIO_INLINE_IRQS
|
||||
|
||||
|
||||
typedef struct {
|
||||
struct _sio {
|
||||
u16 StatReg;
|
||||
u16 ModeReg;
|
||||
u16 CtrlReg;
|
||||
|
|
@ -60,8 +60,9 @@ typedef struct {
|
|||
u32 sector;
|
||||
u32 k;
|
||||
u32 count;
|
||||
} _sio;
|
||||
_sio sio;
|
||||
};
|
||||
|
||||
extern _sio sio;
|
||||
|
||||
#define MCD_SIZE (1024 * 8 * 16)
|
||||
#define MC2_SIZE (1024 * 528 * 16)
|
||||
|
|
@ -87,12 +88,10 @@ _sio sio;
|
|||
#define RTS 0x0020
|
||||
#define SIO_RESET 0x0040
|
||||
|
||||
int Mcd1Size, Mcd2Size;
|
||||
|
||||
int sioInit();
|
||||
void sioShutdown();
|
||||
void psxSIOShutdown();
|
||||
unsigned char sioRead8();
|
||||
u8 sioRead8();
|
||||
void sioWrite8(unsigned char value);
|
||||
void sioWriteCtrl16(unsigned short value);
|
||||
extern void sioInterrupt();
|
||||
|
|
@ -100,19 +99,19 @@ int sioFreeze(gzFile f, int Mode);
|
|||
void InitializeSIO(u8 value);
|
||||
|
||||
FILE *LoadMcd(int mcd);
|
||||
void ReadMcd(int mcd, char *data, u32 adr, int size);
|
||||
void SaveMcd(int mcd, char *data, u32 adr, int size);
|
||||
void ReadMcd(int mcd, u8 *data, u32 adr, int size);
|
||||
void SaveMcd(int mcd, const u8 *data, u32 adr, int size);
|
||||
void EraseMcd(int mcd, u32 adr);
|
||||
void CreateMcd(char *mcd);
|
||||
|
||||
typedef struct {
|
||||
struct McdBlock {
|
||||
char Title[48];
|
||||
char ID[14];
|
||||
char Name[16];
|
||||
int IconCount;
|
||||
short Icon[16*16*3];
|
||||
unsigned char Flags;
|
||||
} McdBlock;
|
||||
u16 Icon[16*16*3];
|
||||
u8 Flags;
|
||||
};
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma pack(1)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
#include <time.h>
|
||||
|
||||
typedef struct {
|
||||
struct Stats {
|
||||
time_t vsyncTime;
|
||||
u32 vsyncCount;
|
||||
u32 eeCycles;
|
||||
|
|
@ -33,7 +33,8 @@ typedef struct {
|
|||
u32 framecount;
|
||||
u32 vu1count;
|
||||
u32 vif1count;
|
||||
} Stats;
|
||||
};
|
||||
|
||||
Stats stats;
|
||||
|
||||
void statsOpen();
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ void SysMunmap(uptr base, u32 size);
|
|||
|
||||
#ifdef PCSX2_VIRTUAL_MEM
|
||||
|
||||
typedef struct _PSMEMORYBLOCK
|
||||
struct PSMEMORYBLOCK
|
||||
{
|
||||
#ifdef _WIN32
|
||||
int NumberPages;
|
||||
|
|
@ -46,7 +46,7 @@ typedef struct _PSMEMORYBLOCK
|
|||
char* pname; // given name
|
||||
int size; // size of allocated region
|
||||
#endif
|
||||
} PSMEMORYBLOCK;
|
||||
};
|
||||
|
||||
int SysPhysicalAlloc(u32 size, PSMEMORYBLOCK* pblock);
|
||||
void SysPhysicalFree(PSMEMORYBLOCK* pblock);
|
||||
|
|
|
|||
22
pcsx2/VU.h
22
pcsx2/VU.h
|
|
@ -79,22 +79,22 @@ typedef union {
|
|||
#define VUFLAG_BREAKONMFLAG 0x00000001
|
||||
#define VUFLAG_MFLAGSET 0x00000002
|
||||
|
||||
typedef struct {
|
||||
struct fdivPipe {
|
||||
int enable;
|
||||
REG_VI reg;
|
||||
u32 sCycle;
|
||||
u32 Cycle;
|
||||
u32 statusflag;
|
||||
} fdivPipe;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct efuPipe {
|
||||
int enable;
|
||||
REG_VI reg;
|
||||
u32 sCycle;
|
||||
u32 Cycle;
|
||||
} efuPipe;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct fmacPipe {
|
||||
int enable;
|
||||
int reg;
|
||||
int xyzw;
|
||||
|
|
@ -103,9 +103,9 @@ typedef struct {
|
|||
u32 macflag;
|
||||
u32 statusflag;
|
||||
u32 clipflag;
|
||||
} fmacPipe;
|
||||
};
|
||||
|
||||
typedef struct _VURegs {
|
||||
struct VURegs {
|
||||
VECTOR VF[32];
|
||||
REG_VI VI[32];
|
||||
VECTOR ACC;
|
||||
|
|
@ -119,7 +119,7 @@ typedef struct _VURegs {
|
|||
u32 cycle;
|
||||
u32 flags;
|
||||
|
||||
void (*vuExec)(struct _VURegs*);
|
||||
void (*vuExec)(VURegs*);
|
||||
VIFregisters *vifRegs;
|
||||
|
||||
u8 *Mem;
|
||||
|
|
@ -137,7 +137,7 @@ typedef struct _VURegs {
|
|||
fdivPipe fdiv;
|
||||
efuPipe efu;
|
||||
|
||||
} VURegs;
|
||||
};
|
||||
|
||||
#define VUPIPE_NONE 0
|
||||
#define VUPIPE_FMAC 1
|
||||
|
|
@ -150,7 +150,7 @@ typedef struct _VURegs {
|
|||
#define VUREG_READ 0x1
|
||||
#define VUREG_WRITE 0x2
|
||||
|
||||
typedef struct {
|
||||
struct _VURegsNum {
|
||||
u8 pipe; // if 0xff, COP2
|
||||
u8 VFwrite;
|
||||
u8 VFwxyzw;
|
||||
|
|
@ -161,7 +161,7 @@ typedef struct {
|
|||
u32 VIwrite;
|
||||
u32 VIread;
|
||||
int cycles;
|
||||
} _VURegsNum;
|
||||
};
|
||||
|
||||
extern VURegs* g_pVU1;
|
||||
extern PCSX2_ALIGNED16_DECL(VURegs VU0);
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ int vu0Init()
|
|||
|
||||
// since vuregisters are mapped in vumem0, go to diff addr, but mapping to same physical addr
|
||||
VirtualFree((void*)0x11000000, 0x10000, MEM_RELEASE); // free just in case
|
||||
VU0.Mem = VirtualAlloc((void*)0x11000000, 0x10000, MEM_RESERVE|MEM_PHYSICAL, PAGE_READWRITE);
|
||||
VU0.Mem = (u8*)VirtualAlloc((void*)0x11000000, 0x10000, MEM_RESERVE|MEM_PHYSICAL, PAGE_READWRITE);
|
||||
|
||||
if( VU0.Mem != (void*)0x11000000 ) {
|
||||
SysPrintf("Failed to alloc vu0mem 0x11000000 %d\n", GetLastError());
|
||||
|
|
|
|||
|
|
@ -335,7 +335,7 @@ void vu1Exec(VURegs* VU) {
|
|||
_vuTables(VU1, VU1);
|
||||
_vuRegsTables(VU1, VU1regs);
|
||||
|
||||
void VU1unknown(_VURegsNum *VUregsn) {
|
||||
void VU1unknown() {
|
||||
//assert(0);
|
||||
CPU_LOG("Unknown VU micromode opcode called\n");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,9 +16,7 @@
|
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#define PLUGINtypedefs // for GSgifTransfer1
|
||||
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
#include <stdlib.h>
|
||||
#include "Common.h"
|
||||
#include "VUmicro.h"
|
||||
|
|
@ -26,8 +24,6 @@
|
|||
#include "VUops.h"
|
||||
#include "GS.h"
|
||||
|
||||
extern _GSgifTransfer1 GSgifTransfer1;
|
||||
|
||||
//Lower/Upper instructions can use that..
|
||||
#define _Ft_ ((VU->code >> 16) & 0x1F) // The rt part of the instruction register
|
||||
#define _Fs_ ((VU->code >> 11) & 0x1F) // The rd part of the instruction register
|
||||
|
|
@ -346,10 +342,10 @@ float vuDouble(u32 f)
|
|||
void _vuABS(VURegs * VU) {
|
||||
if (_Ft_ == 0) return;
|
||||
|
||||
if (_X){ VU->VF[_Ft_].f.x = fpufabsf(vuDouble(VU->VF[_Fs_].i.x)); }
|
||||
if (_Y){ VU->VF[_Ft_].f.y = fpufabsf(vuDouble(VU->VF[_Fs_].i.y)); }
|
||||
if (_Z){ VU->VF[_Ft_].f.z = fpufabsf(vuDouble(VU->VF[_Fs_].i.z)); }
|
||||
if (_W){ VU->VF[_Ft_].f.w = fpufabsf(vuDouble(VU->VF[_Fs_].i.w)); }
|
||||
if (_X){ VU->VF[_Ft_].f.x = fabs(vuDouble(VU->VF[_Fs_].i.x)); }
|
||||
if (_Y){ VU->VF[_Ft_].f.y = fabs(vuDouble(VU->VF[_Fs_].i.y)); }
|
||||
if (_Z){ VU->VF[_Ft_].f.z = fabs(vuDouble(VU->VF[_Fs_].i.z)); }
|
||||
if (_W){ VU->VF[_Ft_].f.w = fabs(vuDouble(VU->VF[_Fs_].i.w)); }
|
||||
}/*Reworked from define to function. asadr*/
|
||||
|
||||
|
||||
|
|
@ -1408,7 +1404,7 @@ void _vuITOF15(VURegs * VU) {
|
|||
|
||||
/* Different type of clipping by presaving w. asadr */
|
||||
void _vuCLIP(VURegs * VU) {
|
||||
float value = fpufabsf(vuDouble(VU->VF[_Ft_].i.w));
|
||||
float value = fabs(vuDouble(VU->VF[_Ft_].i.w));
|
||||
|
||||
VU->clipflag <<= 6;
|
||||
if ( vuDouble(VU->VF[_Fs_].i.x) > +value ) VU->clipflag|= 0x01;
|
||||
|
|
@ -1461,7 +1457,7 @@ void _vuSQRT(VURegs * VU) {
|
|||
|
||||
if (ft < 0.0 )
|
||||
VU->statusflag |= 0x10;
|
||||
VU->q.F = fpusqrtf(fpufabsf(ft));
|
||||
VU->q.F = sqrt(fabs(ft));
|
||||
VU->q.F = vuDouble(VU->q.UL);
|
||||
} //last update 15/01/06 zerofrog
|
||||
|
||||
|
|
@ -1503,7 +1499,7 @@ void _vuRSQRT(VURegs * VU) {
|
|||
VU->statusflag |= 0x10;
|
||||
}
|
||||
|
||||
temp = fpusqrtf(fpufabsf(ft));
|
||||
temp = sqrt(fabs(ft));
|
||||
VU->q.F = fs / temp;
|
||||
VU->q.F = vuDouble(VU->q.UL);
|
||||
}
|
||||
|
|
@ -1976,7 +1972,7 @@ void _vuERSADD(VURegs * VU) {
|
|||
void _vuELENG(VURegs * VU) {
|
||||
float p = vuDouble(VU->VF[_Fs_].i.x) * vuDouble(VU->VF[_Fs_].i.x) + vuDouble(VU->VF[_Fs_].i.y) * vuDouble(VU->VF[_Fs_].i.y) + vuDouble(VU->VF[_Fs_].i.z) * vuDouble(VU->VF[_Fs_].i.z);
|
||||
if(p >= 0){
|
||||
p = fpusqrtf(p);
|
||||
p = sqrt(p);
|
||||
}
|
||||
VU->p.F = p;
|
||||
}
|
||||
|
|
@ -1985,7 +1981,7 @@ void _vuELENG(VURegs * VU) {
|
|||
void _vuERLENG(VURegs * VU) {
|
||||
float p = vuDouble(VU->VF[_Fs_].i.x) * vuDouble(VU->VF[_Fs_].i.x) + vuDouble(VU->VF[_Fs_].i.y) * vuDouble(VU->VF[_Fs_].i.y) + vuDouble(VU->VF[_Fs_].i.z) * vuDouble(VU->VF[_Fs_].i.z);
|
||||
if (p >= 0) {
|
||||
p = fpusqrtf(p);
|
||||
p = sqrt(p);
|
||||
if (p != 0) {
|
||||
p = 1.0f / p;
|
||||
}
|
||||
|
|
@ -1997,7 +1993,7 @@ void _vuERLENG(VURegs * VU) {
|
|||
void _vuEATANxy(VURegs * VU) {
|
||||
float p = 0;
|
||||
if(vuDouble(VU->VF[_Fs_].i.x) != 0) {
|
||||
p = fpuatan2f(vuDouble(VU->VF[_Fs_].i.y), vuDouble(VU->VF[_Fs_].i.x));
|
||||
p = atan2(vuDouble(VU->VF[_Fs_].i.y), vuDouble(VU->VF[_Fs_].i.x));
|
||||
}
|
||||
VU->p.F = p;
|
||||
}
|
||||
|
|
@ -2006,7 +2002,7 @@ void _vuEATANxy(VURegs * VU) {
|
|||
void _vuEATANxz(VURegs * VU) {
|
||||
float p = 0;
|
||||
if(vuDouble(VU->VF[_Fs_].i.x) != 0) {
|
||||
p = fpuatan2f(vuDouble(VU->VF[_Fs_].i.z), vuDouble(VU->VF[_Fs_].i.x));
|
||||
p = atan2(vuDouble(VU->VF[_Fs_].i.z), vuDouble(VU->VF[_Fs_].i.x));
|
||||
}
|
||||
VU->p.F = p;
|
||||
}
|
||||
|
|
@ -2029,7 +2025,7 @@ void _vuERCPR(VURegs * VU) {
|
|||
void _vuESQRT(VURegs * VU) {
|
||||
float p = vuDouble(VU->VF[_Fs_].UL[_Fsf_]);
|
||||
if (p >= 0){
|
||||
p = fpusqrtf(p);
|
||||
p = sqrt(p);
|
||||
}
|
||||
VU->p.F = p;
|
||||
}
|
||||
|
|
@ -2038,7 +2034,7 @@ void _vuESQRT(VURegs * VU) {
|
|||
void _vuERSQRT(VURegs * VU) {
|
||||
float p = vuDouble(VU->VF[_Fs_].UL[_Fsf_]);
|
||||
if (p >= 0) {
|
||||
p = fpusqrtf(p);
|
||||
p = sqrt(p);
|
||||
if (p) {
|
||||
p = 1.0f / p;
|
||||
}
|
||||
|
|
@ -2047,17 +2043,17 @@ void _vuERSQRT(VURegs * VU) {
|
|||
}
|
||||
|
||||
void _vuESIN(VURegs * VU) {
|
||||
float p = fpusinf(vuDouble(VU->VF[_Fs_].UL[_Fsf_]));
|
||||
float p = sin(vuDouble(VU->VF[_Fs_].UL[_Fsf_]));
|
||||
VU->p.F = p;
|
||||
}
|
||||
|
||||
void _vuEATAN(VURegs * VU) {
|
||||
float p = fpuatanf(vuDouble(VU->VF[_Fs_].UL[_Fsf_]));
|
||||
float p = atan(vuDouble(VU->VF[_Fs_].UL[_Fsf_]));
|
||||
VU->p.F = p;
|
||||
}
|
||||
|
||||
void _vuEEXP(VURegs * VU) {
|
||||
float p = fpuexpf(-(vuDouble(VU->VF[_Fs_].UL[_Fsf_])));
|
||||
float p = exp(-(vuDouble(VU->VF[_Fs_].UL[_Fsf_])));
|
||||
VU->p.F = p;
|
||||
}
|
||||
|
||||
|
|
|
|||
17
pcsx2/Vif.h
17
pcsx2/Vif.h
|
|
@ -19,12 +19,12 @@
|
|||
#ifndef __VIF_H__
|
||||
#define __VIF_H__
|
||||
|
||||
typedef struct {
|
||||
struct vifCycle {
|
||||
u8 cl, wl;
|
||||
u8 pad[2];
|
||||
} vifCycle;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
struct VIFregisters {
|
||||
u32 stat;
|
||||
u32 pad0[3];
|
||||
u32 fbrst;
|
||||
|
|
@ -75,7 +75,16 @@ typedef struct {
|
|||
u32 pad23[3];
|
||||
u32 offset; // internal UNPACK offset
|
||||
u32 addr;
|
||||
} VIFregisters;
|
||||
};
|
||||
|
||||
extern "C"
|
||||
{
|
||||
// these use cdecl for Asm code references.
|
||||
extern VIFregisters *_vifRegs;
|
||||
extern u32* _vifMaskRegs;
|
||||
extern u32* _vifRow;
|
||||
extern u32* _vifCol;
|
||||
}
|
||||
|
||||
#define vif0Regs ((VIFregisters*)&PS2MEM_HW[0x3800])
|
||||
#define vif1Regs ((VIFregisters*)&PS2MEM_HW[0x3c00])
|
||||
|
|
|
|||
|
|
@ -38,14 +38,21 @@
|
|||
#define gif ((DMACh*)&PS2MEM_HW[0xA000])
|
||||
|
||||
// Extern variables
|
||||
extern VIFregisters *_vifRegs;
|
||||
extern vifStruct *_vif;
|
||||
extern u32* _vifMaskRegs;
|
||||
extern "C"
|
||||
{
|
||||
// Need cdecl on these for ASM references.
|
||||
extern VIFregisters *_vifRegs;
|
||||
extern u32* _vifMaskRegs;
|
||||
extern u32* _vifRow;
|
||||
extern u32* _vifCol;
|
||||
}
|
||||
|
||||
extern PCSX2_ALIGNED16_DECL(u32 g_vifRow0[4]);
|
||||
extern PCSX2_ALIGNED16_DECL(u32 g_vifCol0[4]);
|
||||
extern PCSX2_ALIGNED16_DECL(u32 g_vifRow1[4]);
|
||||
extern PCSX2_ALIGNED16_DECL(u32 g_vifCol1[4]);
|
||||
extern u32* _vifRow, *_vifCol;
|
||||
|
||||
extern vifStruct *_vif;
|
||||
|
||||
vifStruct vif0, vif1;
|
||||
|
||||
|
|
@ -59,12 +66,6 @@ static const unsigned int VIF1intc = 5;
|
|||
static const unsigned int VIF0dmanum = 0;
|
||||
static const unsigned int VIF1dmanum = 1;
|
||||
|
||||
#if defined(_WIN32) && !defined(WIN32_PTHREADS)
|
||||
extern HANDLE g_hGsEvent;
|
||||
#else
|
||||
extern pthread_cond_t g_condGsEvent;
|
||||
#endif
|
||||
|
||||
int g_vifCycles = 0;
|
||||
int path3hack = 0;
|
||||
|
||||
|
|
@ -79,7 +80,7 @@ extern void (*Vif0CMDTLB[75])();
|
|||
extern int (*Vif1TransTLB[128])(u32 *data);
|
||||
extern int (*Vif0TransTLB[128])(u32 *data);
|
||||
|
||||
typedef struct {
|
||||
struct VIFUnpackFuncTable {
|
||||
UNPACKFUNCTYPE funcU;
|
||||
UNPACKFUNCTYPE funcS;
|
||||
|
||||
|
|
@ -88,7 +89,7 @@ typedef struct {
|
|||
int gsize; // size of data in bytes used for each write cycle
|
||||
int qsize; // used for unpack parts, num of vectors that
|
||||
// will be decompressed from data for 1 cycle
|
||||
} VIFUnpackFuncTable;
|
||||
};
|
||||
|
||||
/* block size; data size; group size; qword size; */
|
||||
#define _UNPACK_TABLE32(name, bsize, dsize, gsize, qsize) \
|
||||
|
|
@ -125,21 +126,23 @@ static const VIFUnpackFuncTable VIFfuncTable[16] = {
|
|||
|
||||
#if !defined(PCSX2_NORECBUILD)
|
||||
|
||||
typedef struct {
|
||||
struct VIFSSEUnpackTable {
|
||||
// regular 0, 1, 2; mask 0, 1, 2
|
||||
UNPACKPARTFUNCTYPESSE funcU[9], funcS[9];
|
||||
} VIFSSEUnpackTable;
|
||||
};
|
||||
|
||||
#define DECL_UNPACK_TABLE_SSE(name, sign) \
|
||||
extern int UNPACK_SkippingWrite_##name##_##sign##_Regular_0(u32* dest, u32* data, int dmasize); \
|
||||
extern int UNPACK_SkippingWrite_##name##_##sign##_Regular_1(u32* dest, u32* data, int dmasize); \
|
||||
extern int UNPACK_SkippingWrite_##name##_##sign##_Regular_2(u32* dest, u32* data, int dmasize); \
|
||||
extern int UNPACK_SkippingWrite_##name##_##sign##_Mask_0(u32* dest, u32* data, int dmasize); \
|
||||
extern int UNPACK_SkippingWrite_##name##_##sign##_Mask_1(u32* dest, u32* data, int dmasize); \
|
||||
extern int UNPACK_SkippingWrite_##name##_##sign##_Mask_2(u32* dest, u32* data, int dmasize); \
|
||||
extern int UNPACK_SkippingWrite_##name##_##sign##_WriteMask_0(u32* dest, u32* data, int dmasize); \
|
||||
extern int UNPACK_SkippingWrite_##name##_##sign##_WriteMask_1(u32* dest, u32* data, int dmasize); \
|
||||
extern int UNPACK_SkippingWrite_##name##_##sign##_WriteMask_2(u32* dest, u32* data, int dmasize); \
|
||||
extern "C" { \
|
||||
extern int UNPACK_SkippingWrite_##name##_##sign##_Regular_0(u32* dest, u32* data, int dmasize); \
|
||||
extern int UNPACK_SkippingWrite_##name##_##sign##_Regular_1(u32* dest, u32* data, int dmasize); \
|
||||
extern int UNPACK_SkippingWrite_##name##_##sign##_Regular_2(u32* dest, u32* data, int dmasize); \
|
||||
extern int UNPACK_SkippingWrite_##name##_##sign##_Mask_0(u32* dest, u32* data, int dmasize); \
|
||||
extern int UNPACK_SkippingWrite_##name##_##sign##_Mask_1(u32* dest, u32* data, int dmasize); \
|
||||
extern int UNPACK_SkippingWrite_##name##_##sign##_Mask_2(u32* dest, u32* data, int dmasize); \
|
||||
extern int UNPACK_SkippingWrite_##name##_##sign##_WriteMask_0(u32* dest, u32* data, int dmasize); \
|
||||
extern int UNPACK_SkippingWrite_##name##_##sign##_WriteMask_1(u32* dest, u32* data, int dmasize); \
|
||||
extern int UNPACK_SkippingWrite_##name##_##sign##_WriteMask_2(u32* dest, u32* data, int dmasize); \
|
||||
}
|
||||
|
||||
#define _UNPACK_TABLE_SSE(name, sign) \
|
||||
UNPACK_SkippingWrite_##name##_##sign##_Regular_0, \
|
||||
|
|
@ -340,7 +343,7 @@ static void VIFunpack(u32 *data, vifCode *v, int size, const unsigned int VIFdma
|
|||
u8 *cdata = (u8*)data;
|
||||
//u64 basetick = GetCPUTick();
|
||||
#ifdef _DEBUG
|
||||
int memsize;
|
||||
u32 memsize;
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
|
@ -468,7 +471,7 @@ static void VIFunpack(u32 *data, vifCode *v, int size, const unsigned int VIFdma
|
|||
if (vifRegs->cycle.cl >= vifRegs->cycle.wl) { // skipping write
|
||||
|
||||
#ifdef _DEBUG
|
||||
static s_count=0;
|
||||
static int s_count=0;
|
||||
#endif
|
||||
//u32* olddest = dest;
|
||||
|
||||
|
|
@ -1621,18 +1624,17 @@ static int Vif1TransDirectHL(u32 *data){
|
|||
}
|
||||
//if(splitptr < 4) SysPrintf("Whoopsie\n");
|
||||
if( CHECK_MULTIGS ) {
|
||||
u64* gsmem = (u64*)GSRingBufCopy(16, GS_RINGTYPE_P2);
|
||||
if( gsmem != NULL ) {
|
||||
//FreezeMMXRegs(1);
|
||||
//memcpy_fast(gsmem, (u32*)splittransfer[0], 16);
|
||||
//FreezeMMXRegs(0);
|
||||
|
||||
u8* gsmem = GSRingBufCopy(16, GS_RINGTYPE_P2);
|
||||
if( gsmem != NULL )
|
||||
{
|
||||
// copy 16 bytes the fast way:
|
||||
gsmem[0] = ((u64*)splittransfer[0])[0];
|
||||
gsmem[1] = ((u64*)splittransfer[0])[1];
|
||||
const u64* src = (u64*)splittransfer[0];
|
||||
u64* dst = (u64*)gsmem;
|
||||
dst[0] = src[0];
|
||||
dst[1] = src[1];
|
||||
|
||||
GSRINGBUF_DONECOPY(gsmem, 16);
|
||||
GSgifTransferDummy(1, (u32*)splittransfer[0], 1);
|
||||
GSRINGBUF_DONECOPY((u8*)gsmem, 16);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
@ -1667,7 +1669,7 @@ static int Vif1TransDirectHL(u32 *data){
|
|||
vif1.cmd = 0;
|
||||
}
|
||||
|
||||
|
||||
//TODO: ret is guaranteed to be qword aligned ?
|
||||
|
||||
if( CHECK_MULTIGS ) {
|
||||
u8* gsmem = GSRingBufCopy(ret<<2, GS_RINGTYPE_P2);
|
||||
|
|
|
|||
|
|
@ -18,16 +18,16 @@
|
|||
#ifndef __VIFDMA_H__
|
||||
#define __VIFDMA_H__
|
||||
|
||||
typedef struct {
|
||||
struct vifCode {
|
||||
u32 addr;
|
||||
u32 size;
|
||||
u32 cmd;
|
||||
u16 wl;
|
||||
u16 cl;
|
||||
} vifCode;
|
||||
};
|
||||
|
||||
// NOTE, if debugging vif stalls, use sega classics, spyro, gt4, and taito
|
||||
typedef struct {
|
||||
struct vifStruct {
|
||||
vifCode tag;
|
||||
int cmd;
|
||||
int irq;
|
||||
|
|
@ -40,9 +40,10 @@ typedef struct {
|
|||
u8 irqoffset; // 32bit offset where next vif code is
|
||||
u32 savedtag; // need this for backwards compat with save states
|
||||
u32 vifpacketsize;
|
||||
} vifStruct;
|
||||
};
|
||||
|
||||
extern vifStruct vif0, vif1;
|
||||
extern int Path3transfer;
|
||||
|
||||
#define vif0ch ((DMACh*)&PS2MEM_HW[0x8000])
|
||||
#define vif1ch ((DMACh*)&PS2MEM_HW[0x9000])
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ HWND debughWnd;
|
|||
unsigned long DebuggerIOPPC=0;
|
||||
HWND hIOPDlg;//IOP debugger
|
||||
|
||||
breakpoints bkpt_regv[NUM_BREAKPOINTS];
|
||||
|
||||
|
||||
void RefreshDebugAll()//refresh disasm and register window
|
||||
{
|
||||
|
|
@ -163,7 +165,7 @@ BOOL APIENTRY DumpProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
|||
opcode_addr=temp;
|
||||
MakeDebugOpcode();
|
||||
OpcodePrintTable[(cpuRegs.code) >> 26](tmp);
|
||||
if (HasBreakpoint(temp))
|
||||
if (HasBreakpoint())
|
||||
{
|
||||
sprintf(buf, "*%08X %08X: %s", temp, cpuRegs.code, tmp);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,16 +30,13 @@ extern BOOL APIENTRY DebuggerProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM
|
|||
extern BOOL APIENTRY MemoryProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
extern void RefreshDebugger(void);
|
||||
|
||||
unsigned long opcode_addr;
|
||||
extern unsigned long opcode_addr;
|
||||
|
||||
typedef struct
|
||||
struct breakpoints
|
||||
{
|
||||
int type;
|
||||
unsigned long value;
|
||||
} breakpoints;
|
||||
|
||||
breakpoints bkpt_regv[NUM_BREAKPOINTS];
|
||||
|
||||
};
|
||||
|
||||
|
||||
LRESULT CALLBACK R5900reg(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);
|
||||
|
|
|
|||
|
|
@ -24,13 +24,11 @@
|
|||
#include "libintlmsc.h"
|
||||
#define _(String) dgettext (PACKAGE, String)
|
||||
|
||||
extern "C"{
|
||||
#include "PS2Edefs.h"
|
||||
#include "resource.h"
|
||||
#include "Misc.h"
|
||||
#include "System.h"
|
||||
#include "McdsDlg.h"
|
||||
}
|
||||
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
|
|
|||
|
|
@ -107,12 +107,12 @@ int CreateSocket(HWND hDlg, int port){
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
int readData(char *buffer){
|
||||
int readData(u8 *buffer){
|
||||
int r, count=0;
|
||||
u8 *p=buffer;
|
||||
|
||||
memset(buffer, 0, BUFFERSIZE);
|
||||
while (((count+= r = recv(remote, p, BUFFERSIZE, 0))!=INVALID_SOCKET) &&
|
||||
while (((count+= r = recv(remote, (char*)p, BUFFERSIZE, 0))!=INVALID_SOCKET) &&
|
||||
(count<*(u16*)buffer))
|
||||
p+=r;
|
||||
|
||||
|
|
@ -122,12 +122,12 @@ int readData(char *buffer){
|
|||
return count;
|
||||
}
|
||||
|
||||
int writeData(char *result){
|
||||
int writeData(const u8 *result){
|
||||
int r;/*, i;
|
||||
static char l[300], p[10];
|
||||
DECI2_HEADER *header=(DECI2_HEADER*)result;
|
||||
*/
|
||||
r = send(remote, result, *(u16*)result, 0);
|
||||
r = send(remote, (const char*)result, *(u16*)result, 0);
|
||||
if (r==SOCKET_ERROR)
|
||||
return 0;
|
||||
/*
|
||||
|
|
@ -144,11 +144,11 @@ int writeData(char *result){
|
|||
|
||||
DWORD WINAPI ServingFunction(LPVOID lpParam){
|
||||
static u8 buffer[BUFFERSIZE], //a big buffer
|
||||
result[BUFFERSIZE], //a big buffer
|
||||
eepc[9], ioppc[9], eecy[15], iopcy[15];
|
||||
result[BUFFERSIZE]; //a big buffer
|
||||
static TCHAR eepc[9], ioppc[9], eecy[15], iopcy[15];
|
||||
SOCKADDR_IN saClient;
|
||||
HWND hDlg=(HWND)lpParam;
|
||||
DWORD size=sizeof(struct sockaddr);
|
||||
int size=sizeof(struct sockaddr);
|
||||
int exit=FALSE;
|
||||
|
||||
if ((remote = accept(serversocket, (struct sockaddr*)&saClient, &size))==INVALID_SOCKET){
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -34,9 +34,9 @@ void SaveConfig();
|
|||
|
||||
extern int needReset;
|
||||
|
||||
AppData gApp;
|
||||
HWND hStatusWnd;
|
||||
PcsxConfig winConfig; // local storage of the configuration options.
|
||||
extern AppData gApp;
|
||||
extern HWND hStatusWnd;
|
||||
extern PcsxConfig winConfig; // local storage of the configuration options.
|
||||
|
||||
LRESULT WINAPI MainWndProc(HWND, UINT, WPARAM, LPARAM);
|
||||
void CreateMainWindow(int nCmdShow);
|
||||
|
|
|
|||
|
|
@ -65,14 +65,17 @@ static unsigned int langsMax;
|
|||
// user's conf file accidentally.
|
||||
PcsxConfig winConfig; // local storage of the configuration options.
|
||||
|
||||
HWND hStatusWnd;
|
||||
|
||||
extern int g_SaveGSStream;
|
||||
|
||||
int needReset = 1;
|
||||
int RunExe = 0;
|
||||
|
||||
typedef struct {
|
||||
char lang[256];
|
||||
} _langs;
|
||||
struct _langs {
|
||||
TCHAR lang[256];
|
||||
};
|
||||
|
||||
_langs *langs = NULL;
|
||||
|
||||
static int UseGui = 1;
|
||||
|
|
@ -111,7 +114,6 @@ void strcatz(char *dst, char *src) {
|
|||
BOOL APIENTRY CmdlineProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);//forward def
|
||||
//-------------------
|
||||
|
||||
extern int g_ZeroGSOptions;
|
||||
void RunExecute(int run) {
|
||||
SetThreadPriority(GetCurrentThread(), Config.ThPriority);
|
||||
SetPriorityClass(GetCurrentProcess(), Config.ThPriority == THREAD_PRIORITY_HIGHEST ? ABOVE_NORMAL_PRIORITY_CLASS : NORMAL_PRIORITY_CLASS);
|
||||
|
|
@ -342,7 +344,7 @@ static const char* phelpmsg =
|
|||
"\n";
|
||||
|
||||
/// This code is courtesy of http://alter.org.ua/en/docs/win/args/
|
||||
static PTCHAR* _CommandLineToArgv( PTCHAR CmdLine, int* _argc )
|
||||
static PTCHAR* _CommandLineToArgv( const TCHAR *CmdLine, int* _argc )
|
||||
{
|
||||
PTCHAR* argv;
|
||||
PTCHAR _argv;
|
||||
|
|
@ -425,7 +427,7 @@ static PTCHAR* _CommandLineToArgv( PTCHAR CmdLine, int* _argc )
|
|||
// returns 1 if the user requested help (show help and exit)
|
||||
// returns zero on success.
|
||||
// returns -1 on failure (bad command line argument)
|
||||
static int ParseCommandLine( int tokenCount, const TCHAR** tokens )
|
||||
static int ParseCommandLine( int tokenCount, TCHAR *const *const tokens )
|
||||
{
|
||||
int tidx = 0;
|
||||
g_TestRun.efile = 0;
|
||||
|
|
@ -513,8 +515,6 @@ static int ParseCommandLine( int tokenCount, const TCHAR** tokens )
|
|||
return 0;
|
||||
}
|
||||
|
||||
extern void LoadPatch(char *crc);
|
||||
|
||||
BOOL SysLoggedSetLockPagesPrivilege ( HANDLE hProcess, BOOL bEnable);
|
||||
|
||||
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
|
||||
|
|
@ -564,9 +564,8 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
|||
|
||||
{
|
||||
int argc;
|
||||
TCHAR** argv;
|
||||
TCHAR *const *const argv = _CommandLineToArgv( lpCmdLine, &argc );
|
||||
|
||||
argv = _CommandLineToArgv( lpCmdLine, &argc );
|
||||
if( argv == NULL )
|
||||
{
|
||||
SysMessage( "A fatal error occured while attempting to parse the command line.\n" );
|
||||
|
|
@ -583,7 +582,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
|||
return 0;
|
||||
}
|
||||
|
||||
switch( LoadConfig( &winConfig ) )
|
||||
switch( LoadConfig() )
|
||||
{
|
||||
case 0: break; // everything worked!
|
||||
case 1:
|
||||
|
|
@ -747,13 +746,13 @@ void CALLBACK KeyEvent(keyEvent* ev)
|
|||
{
|
||||
|
||||
if (ev == NULL) return;
|
||||
if (ev->event == KEYRELEASE) {
|
||||
if (ev->evt == KEYRELEASE) {
|
||||
switch (ev->key) {
|
||||
case VK_SHIFT: shiftkey = 0; break;
|
||||
}
|
||||
GSkeyEvent(ev); return;
|
||||
}
|
||||
if (ev->event != KEYPRESS)
|
||||
if (ev->evt != KEYPRESS)
|
||||
return;
|
||||
|
||||
//some pad plugins don't give a key released event for shift, so this is needed
|
||||
|
|
@ -842,7 +841,7 @@ BOOL APIENTRY LogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) {
|
|||
Log = 1;
|
||||
else Log = 0;
|
||||
|
||||
SaveConfig( &winConfig );
|
||||
SaveConfig();
|
||||
|
||||
EndDialog(hDlg, TRUE);
|
||||
}
|
||||
|
|
@ -1152,7 +1151,7 @@ LRESULT WINAPI MainWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) {
|
|||
HDC hdc = BeginPaint(gApp.hWnd, &ps);
|
||||
|
||||
HDC hdcMem = CreateCompatibleDC(hdc);
|
||||
HBITMAP hbmOld = SelectObject(hdcMem, hbitmap_background);
|
||||
HBITMAP hbmOld = (HBITMAP)SelectObject(hdcMem, hbitmap_background);
|
||||
|
||||
GetObject(hbitmap_background, sizeof(bm), &bm);
|
||||
// BitBlt(hdc, 0, 0, bm.bmWidth, bm.bmHeight, hdcMem, 0, 0, SRCCOPY);
|
||||
|
|
@ -2284,7 +2283,7 @@ int SysPhysicalAlloc(u32 size, PSMEMORYBLOCK* pblock)
|
|||
pblock->NumberPages = (size+s_dwPageSize-1)/s_dwPageSize;
|
||||
PFNArraySize = pblock->NumberPages * sizeof (ULONG_PTR);
|
||||
|
||||
pblock->aPFNs = (ULONG_PTR *) HeapAlloc (GetProcessHeap (), 0, PFNArraySize);
|
||||
pblock->aPFNs = (uptr*)HeapAlloc (GetProcessHeap (), 0, PFNArraySize);
|
||||
|
||||
if (pblock->aPFNs == NULL) {
|
||||
SysPrintf("Failed to allocate on heap.\n");
|
||||
|
|
@ -2293,7 +2292,7 @@ int SysPhysicalAlloc(u32 size, PSMEMORYBLOCK* pblock)
|
|||
|
||||
// Allocate the physical memory.
|
||||
NumberOfPagesInitial = pblock->NumberPages;
|
||||
bResult = AllocateUserPhysicalPages( GetCurrentProcess(), &pblock->NumberPages, pblock->aPFNs );
|
||||
bResult = AllocateUserPhysicalPages( GetCurrentProcess(), (PULONG_PTR)&pblock->NumberPages, (PULONG_PTR)pblock->aPFNs );
|
||||
|
||||
if( bResult != TRUE )
|
||||
{
|
||||
|
|
@ -2307,7 +2306,7 @@ int SysPhysicalAlloc(u32 size, PSMEMORYBLOCK* pblock)
|
|||
goto eCleanupAndExit;
|
||||
}
|
||||
|
||||
pblock->aVFNs = (ULONG_PTR*)HeapAlloc(GetProcessHeap(), 0, PFNArraySize);
|
||||
pblock->aVFNs = (uptr*)HeapAlloc(GetProcessHeap(), 0, PFNArraySize);
|
||||
|
||||
return 0;
|
||||
|
||||
|
|
@ -2321,7 +2320,7 @@ void SysPhysicalFree(PSMEMORYBLOCK* pblock)
|
|||
assert( pblock != NULL );
|
||||
|
||||
// Free the physical pages.
|
||||
FreeUserPhysicalPages( GetCurrentProcess(), &pblock->NumberPages, pblock->aPFNs );
|
||||
FreeUserPhysicalPages( GetCurrentProcess(), (PULONG_PTR)&pblock->NumberPages, (PULONG_PTR)pblock->aPFNs );
|
||||
|
||||
if( pblock->aPFNs != NULL ) HeapFree(GetProcessHeap(), 0, pblock->aPFNs);
|
||||
if( pblock->aVFNs != NULL ) HeapFree(GetProcessHeap(), 0, pblock->aVFNs);
|
||||
|
|
@ -2341,10 +2340,10 @@ int SysVirtualPhyAlloc(void* base, u32 size, PSMEMORYBLOCK* pblock)
|
|||
}
|
||||
|
||||
// Map the physical memory into the window.
|
||||
bResult = MapUserPhysicalPages( base, pblock->NumberPages, pblock->aPFNs );
|
||||
bResult = MapUserPhysicalPages( base, (ULONG_PTR)pblock->NumberPages, (PULONG_PTR)pblock->aPFNs );
|
||||
|
||||
for(i = 0; i < pblock->NumberPages; ++i)
|
||||
pblock->aVFNs[i] = (ULONG_PTR)base + 0x1000*i;
|
||||
pblock->aVFNs[i] = (uptr)base + 0x1000*i;
|
||||
|
||||
if( bResult != TRUE )
|
||||
{
|
||||
|
|
@ -2374,7 +2373,7 @@ void SysVirtualFree(void* lpMemReserved, u32 size)
|
|||
|
||||
int SysMapUserPhysicalPages(void* Addr, uptr NumPages, uptr* pfn, int pageoffset)
|
||||
{
|
||||
BOOL bResult = MapUserPhysicalPages(Addr, NumPages, pfn+pageoffset);
|
||||
BOOL bResult = MapUserPhysicalPages(Addr, NumPages, (PULONG_PTR)(pfn+pageoffset));
|
||||
|
||||
#ifdef _DEBUG
|
||||
//if( !bResult )
|
||||
|
|
|
|||
|
|
@ -30,14 +30,12 @@ using namespace std;
|
|||
#include "PS2Etypes.h"
|
||||
|
||||
|
||||
extern "C" {
|
||||
#include "windows/resource.h"
|
||||
#include "PS2Edefs.h"
|
||||
#include "Memory.h"
|
||||
#include "Elfheader.h"
|
||||
#include "cheats.h"
|
||||
#include "../../patch.h"
|
||||
}
|
||||
|
||||
HWND hWndBrowser;
|
||||
|
||||
|
|
@ -356,10 +354,10 @@ u8 DecryptGS2v3(u32* address, u32* value, u8 ctrl)
|
|||
|
||||
}
|
||||
|
||||
typedef struct
|
||||
struct Cheat
|
||||
{
|
||||
unsigned int address, value;
|
||||
}Cheat;
|
||||
};
|
||||
|
||||
int ParseCheats(char *cur, std::vector<Cheat> &Cheats, HWND hWnd)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -24,14 +24,12 @@
|
|||
|
||||
#include "PS2Etypes.h"
|
||||
|
||||
extern "C" {
|
||||
#include "windows/resource.h"
|
||||
#include "PS2Edefs.h"
|
||||
#include "Memory.h"
|
||||
|
||||
#include "cheats.h"
|
||||
#include "../../patch.h"
|
||||
}
|
||||
|
||||
class result
|
||||
{
|
||||
|
|
@ -77,7 +75,7 @@ char tv[100];
|
|||
u8 *mptr[2]={PS2MEM_BASE,PS2MEM_PSX};
|
||||
#else
|
||||
char *mptr[2];
|
||||
extern "C" extern s8 *psxM;
|
||||
extern s8 *psxM;
|
||||
#endif
|
||||
|
||||
int msize[2]={0x02000000,0x00200000};
|
||||
|
|
|
|||
|
|
@ -72,7 +72,6 @@ MEMCPY_AMD.CPP
|
|||
//#include <stddef.h>
|
||||
|
||||
// Inline assembly syntax for use with Visual C++
|
||||
extern "C" {
|
||||
|
||||
#include "PS2Etypes.h"
|
||||
|
||||
|
|
@ -85,18 +84,17 @@ extern "C" {
|
|||
#if defined(_MSC_VER) && !defined(__x86_64__)
|
||||
|
||||
#ifdef _DEBUG
|
||||
extern char g_globalMMXLocked, g_globalMMXSaved;
|
||||
extern u8 g_globalMMXSaved;
|
||||
|
||||
void checkregs()
|
||||
{
|
||||
assert( !g_globalMMXLocked || g_globalMMXSaved );
|
||||
assert( g_globalMMXSaved );
|
||||
}
|
||||
#endif
|
||||
|
||||
void * memcpy_amd_(void *dest, const void *src, size_t n)
|
||||
{
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
__asm call checkregs
|
||||
#endif
|
||||
|
|
@ -591,6 +589,4 @@ End:
|
|||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif // PCSX2_NORECBUILD
|
||||
|
|
|
|||
|
|
@ -23,8 +23,6 @@
|
|||
#include <assert.h>
|
||||
#include <malloc.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
#include "PS2Etypes.h"
|
||||
|
||||
#if defined(_WIN32)
|
||||
|
|
@ -62,8 +60,6 @@ PCSX2_ALIGNED16(u64 g_globalXMMData[2*XMMREGS]);
|
|||
// X86 caching
|
||||
_x86regs x86regs[X86REGS], s_saveX86regs[X86REGS];
|
||||
|
||||
} // end extern "C"
|
||||
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
|
|
@ -1329,7 +1325,7 @@ EEINSTWRITEBACK* _recCheckWriteBack(int cycle)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
extern "C" void cpudetectSSE3(void* pfnCallSSE3)
|
||||
void cpudetectSSE3(void* pfnCallSSE3)
|
||||
{
|
||||
cpucaps.hasStreamingSIMD3Extensions = 1;
|
||||
|
||||
|
|
@ -1351,7 +1347,7 @@ extern "C" void cpudetectSSE3(void* pfnCallSSE3)
|
|||
#endif
|
||||
}
|
||||
|
||||
extern "C" void cpudetectSSE4(void* pfnCallSSE4)
|
||||
void cpudetectSSE4(void* pfnCallSSE4)
|
||||
{
|
||||
return;
|
||||
cpucaps.hasStreamingSIMD4Extensions = 1;
|
||||
|
|
|
|||
|
|
@ -34,17 +34,17 @@
|
|||
#define BLOCKTYPE_STARTPC 4 // startpc offset
|
||||
#define BLOCKTYPE_DELAYSLOT 1 // if bit set, delay slot
|
||||
|
||||
typedef struct _BASEBLOCK
|
||||
struct BASEBLOCK
|
||||
{
|
||||
u32 pFnptr : 28;
|
||||
u32 uType : 4;
|
||||
u32 startpc;
|
||||
} BASEBLOCK;
|
||||
};
|
||||
|
||||
C_ASSERT( sizeof(BASEBLOCK) == 8 );
|
||||
|
||||
// extra block info (only valid for start of fn)
|
||||
typedef struct _BASEBLOCKEX
|
||||
struct BASEBLOCKEX
|
||||
{
|
||||
u16 size; // size in dwords
|
||||
u16 dummy;
|
||||
|
|
@ -55,7 +55,7 @@ typedef struct _BASEBLOCKEX
|
|||
LARGE_INTEGER ltime; // regs it assumes to have set already
|
||||
#endif
|
||||
|
||||
} BASEBLOCKEX;
|
||||
};
|
||||
|
||||
#define GET_BLOCKTYPE(b) ((b)->Type)
|
||||
#define PC_GETBLOCK_(x, reclut) ((BASEBLOCK*)(reclut[((u32)(x)) >> 16] + (sizeof(BASEBLOCK)/4)*((x) & 0xffff)))
|
||||
|
|
@ -79,7 +79,7 @@ typedef struct _BASEBLOCKEX
|
|||
|
||||
#define X86_ISVI(type) ((type&~X86TYPE_VU1) == X86TYPE_VI)
|
||||
|
||||
typedef struct {
|
||||
struct _x86regs {
|
||||
u8 inuse;
|
||||
u8 reg; // value of 0 - not used
|
||||
u8 mode;
|
||||
|
|
@ -87,7 +87,7 @@ typedef struct {
|
|||
u8 type; // X86TYPE_
|
||||
u16 counter;
|
||||
u32 extra; // extra info assoc with the reg
|
||||
} _x86regs;
|
||||
};
|
||||
|
||||
extern _x86regs x86regs[X86REGS], s_saveX86regs[X86REGS];
|
||||
|
||||
|
|
@ -178,7 +178,7 @@ void _flushConstReg(int reg);
|
|||
#define XMMGPR_HI 32
|
||||
#define XMMFPU_ACC 32
|
||||
|
||||
typedef struct {
|
||||
struct _xmmregs {
|
||||
u8 inuse;
|
||||
u8 reg;
|
||||
u8 type;
|
||||
|
|
@ -186,7 +186,7 @@ typedef struct {
|
|||
u8 needed;
|
||||
u8 VU; // 0 = VU0, 1 = VU1
|
||||
u16 counter;
|
||||
} _xmmregs;
|
||||
};
|
||||
|
||||
void _initXMMregs();
|
||||
int _getFreeXMMreg();
|
||||
|
|
@ -308,7 +308,7 @@ int _signExtendXMMtoM(u32 to, x86SSERegType from, int candestroy); // returns tr
|
|||
#define EEINSTINFO_MMX EEINST_MMX
|
||||
#define EEINSTINFO_XMM EEINST_XMM
|
||||
|
||||
typedef struct _EEINST
|
||||
struct EEINST
|
||||
{
|
||||
u8 regs[34]; // includes HI/LO (HI=32, LO=33)
|
||||
u8 fpuregs[33]; // ACC=32
|
||||
|
|
@ -323,7 +323,7 @@ typedef struct _EEINST
|
|||
_VURegsNum vuregs;
|
||||
|
||||
u8 numpeeps; // number of peephole optimizations
|
||||
} EEINST;
|
||||
};
|
||||
|
||||
extern EEINST* g_pCurInstInfo; // info for the cur instruction
|
||||
void _recClearInst(EEINST* pinst);
|
||||
|
|
@ -353,12 +353,12 @@ void _recFillRegister(EEINST* pinst, int type, int reg, int write);
|
|||
#define EEINST_ISSIGNEXT(reg) (g_cpuPrevRegHasSignExt&(1<<(reg)))
|
||||
|
||||
// writeback inst (used for cop2)
|
||||
typedef struct _EEINSTWRITEBACK
|
||||
struct EEINSTWRITEBACK
|
||||
{
|
||||
int cycle;
|
||||
u32 viwrite; // mask of written viregs (REG_STATUS_FLAG and REG_MAC_FLAG are treated the same)
|
||||
EEINST* parent;
|
||||
} EEINSTWRITEBACK;
|
||||
};
|
||||
|
||||
void _recClearWritebacks();
|
||||
void _recAddWriteBack(int cycle, u32 viwrite, EEINST* parent);
|
||||
|
|
@ -433,13 +433,13 @@ void SetFPUstate();
|
|||
#define MMX_IS32BITS(x) (((x)>=MMX_FPU&&(x)<MMX_COP0+32)||(x)==MMX_FPUACC)
|
||||
#define MMX_ISGPR(x) ((x) >= MMX_GPR && (x) < MMX_GPR+34)
|
||||
|
||||
typedef struct {
|
||||
struct _mmxregs {
|
||||
u8 inuse;
|
||||
u8 reg; // value of 0 - not used
|
||||
u8 mode;
|
||||
u8 needed;
|
||||
u16 counter;
|
||||
} _mmxregs;
|
||||
};
|
||||
|
||||
void _initMMXregs();
|
||||
int _getFreeMMXreg();
|
||||
|
|
@ -478,10 +478,6 @@ extern u8 g_globalMMXSaved;
|
|||
extern _mmxregs mmxregs[MMXREGS], s_saveMMXregs[MMXREGS];
|
||||
extern u16 x86FpuState, iCWstate;
|
||||
|
||||
#ifdef _DEBUG
|
||||
extern char g_globalMMXLocked;
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
void LogicalOp64RtoR(x86IntRegType to, x86IntRegType from, int op);
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@
|
|||
|
||||
using namespace std;
|
||||
|
||||
extern "C" {
|
||||
#include "zlib.h"
|
||||
#include "Elfheader.h"
|
||||
#include "Misc.h"
|
||||
|
|
@ -53,10 +52,6 @@ extern "C" {
|
|||
|
||||
extern u32 CSRw;
|
||||
|
||||
}
|
||||
|
||||
void CSRwrite(u32 value);
|
||||
|
||||
#ifdef PCSX2_VIRTUAL_MEM
|
||||
#define PS2GS_BASE(mem) ((PS2MEM_BASE+0x12000000)+(mem&0x13ff))
|
||||
#else
|
||||
|
|
@ -74,7 +69,7 @@ void gsConstWrite8(u32 mem, int mmreg)
|
|||
AND32ItoR(EAX, 0xff<<(mem&3)*8);
|
||||
AND32ItoR(ECX, ~(0xff<<(mem&3)*8));
|
||||
OR32ItoR(EAX, ECX);
|
||||
_callFunctionArg1((uptr)CSRwrite, EAX|MEM_X86TAG, 0);
|
||||
_callFunctionArg1((uptr)gsCSRwrite, EAX|MEM_X86TAG, 0);
|
||||
break;
|
||||
default:
|
||||
_eeWriteConstMem8( (uptr)PS2GS_BASE(mem), mmreg );
|
||||
|
|
@ -110,8 +105,8 @@ void gsConstWrite16(u32 mem, int mmreg)
|
|||
AND32ItoR(EAX, 0xffff<<(mem&2)*8);
|
||||
AND32ItoR(ECX, ~(0xffff<<(mem&2)*8));
|
||||
OR32ItoR(EAX, ECX);
|
||||
_callFunctionArg1((uptr)CSRwrite, EAX|MEM_X86TAG, 0);
|
||||
return; // don't write to GSMEM
|
||||
_callFunctionArg1((uptr)gsCSRwrite, EAX|MEM_X86TAG, 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
_eeWriteConstMem16( (uptr)PS2GS_BASE(mem), mmreg );
|
||||
|
|
@ -168,7 +163,7 @@ void gsConstWrite32(u32 mem, int mmreg) {
|
|||
|
||||
case 0x12001000: // GS_CSR
|
||||
iFlushCall(0);
|
||||
_callFunctionArg1((uptr)CSRwrite, mmreg, 0);
|
||||
_callFunctionArg1((uptr)gsCSRwrite, mmreg, 0);
|
||||
break;
|
||||
|
||||
case 0x12001010: // GS_IMR
|
||||
|
|
@ -201,7 +196,7 @@ void gsConstWrite64(u32 mem, int mmreg)
|
|||
|
||||
case 0x12001000: // GS_CSR
|
||||
iFlushCall(0);
|
||||
_callFunctionArg1((uptr)CSRwrite, mmreg, 0);
|
||||
_callFunctionArg1((uptr)gsCSRwrite, mmreg, 0);
|
||||
break;
|
||||
|
||||
case 0x12001010: // GS_IMR
|
||||
|
|
@ -241,7 +236,7 @@ void gsConstWrite128(u32 mem, int mmreg)
|
|||
|
||||
case 0x12001000: // GS_CSR
|
||||
iFlushCall(0);
|
||||
_callFunctionArg1((uptr)CSRwrite, mmreg, 0);
|
||||
_callFunctionArg1((uptr)gsCSRwrite, mmreg, 0);
|
||||
break;
|
||||
|
||||
case 0x12001010: // GS_IMR
|
||||
|
|
|
|||
|
|
@ -506,7 +506,7 @@ static void PrintDebug(u8 value)
|
|||
}
|
||||
|
||||
// fixme: this would be more optimal as a C++ template (with bit as the template parameter)
|
||||
static __forceinline void ConstWrite_ExecTimer( void (*name)(), u8 index, u8 bit, int mmreg)
|
||||
static __forceinline void ConstWrite_ExecTimer( uptr func, u8 index, u8 bit, int mmreg)
|
||||
{
|
||||
if( bit != 32 )
|
||||
{
|
||||
|
|
@ -522,28 +522,28 @@ static __forceinline void ConstWrite_ExecTimer( void (*name)(), u8 index, u8 bit
|
|||
_recPushReg(mmreg);
|
||||
iFlushCall(0);
|
||||
PUSH32I(index);
|
||||
CALLFunc((uptr)name);
|
||||
CALLFunc(func);
|
||||
ADD32ItoR(ESP, 8);
|
||||
}
|
||||
|
||||
#define CONSTWRITE_TIMERS(bit) \
|
||||
case 0x10000000: ConstWrite_ExecTimer(rcntWcount, 0, bit, mmreg); break; \
|
||||
case 0x10000010: ConstWrite_ExecTimer(rcntWmode, 0, bit, mmreg); break; \
|
||||
case 0x10000020: ConstWrite_ExecTimer(rcntWtarget, 0, bit, mmreg); break; \
|
||||
case 0x10000030: ConstWrite_ExecTimer(rcntWhold, 0, bit, mmreg); break; \
|
||||
case 0x10000000: ConstWrite_ExecTimer((uptr)&rcntWcount, 0, bit, mmreg); break; \
|
||||
case 0x10000010: ConstWrite_ExecTimer((uptr)&rcntWmode, 0, bit, mmreg); break; \
|
||||
case 0x10000020: ConstWrite_ExecTimer((uptr)&rcntWtarget, 0, bit, mmreg); break; \
|
||||
case 0x10000030: ConstWrite_ExecTimer((uptr)&rcntWhold, 0, bit, mmreg); break; \
|
||||
\
|
||||
case 0x10000800: ConstWrite_ExecTimer(rcntWcount, 1, bit, mmreg); break; \
|
||||
case 0x10000810: ConstWrite_ExecTimer(rcntWmode, 1, bit, mmreg); break; \
|
||||
case 0x10000820: ConstWrite_ExecTimer(rcntWtarget, 1, bit, mmreg); break; \
|
||||
case 0x10000830: ConstWrite_ExecTimer(rcntWhold, 1, bit, mmreg); break; \
|
||||
case 0x10000800: ConstWrite_ExecTimer((uptr)&rcntWcount, 1, bit, mmreg); break; \
|
||||
case 0x10000810: ConstWrite_ExecTimer((uptr)&rcntWmode, 1, bit, mmreg); break; \
|
||||
case 0x10000820: ConstWrite_ExecTimer((uptr)&rcntWtarget, 1, bit, mmreg); break; \
|
||||
case 0x10000830: ConstWrite_ExecTimer((uptr)&rcntWhold, 1, bit, mmreg); break; \
|
||||
\
|
||||
case 0x10001000: ConstWrite_ExecTimer(rcntWcount, 2, bit, mmreg); break; \
|
||||
case 0x10001010: ConstWrite_ExecTimer(rcntWmode, 2, bit, mmreg); break; \
|
||||
case 0x10001020: ConstWrite_ExecTimer(rcntWtarget, 2, bit, mmreg); break; \
|
||||
case 0x10001000: ConstWrite_ExecTimer((uptr)&rcntWcount, 2, bit, mmreg); break; \
|
||||
case 0x10001010: ConstWrite_ExecTimer((uptr)&rcntWmode, 2, bit, mmreg); break; \
|
||||
case 0x10001020: ConstWrite_ExecTimer((uptr)&rcntWtarget, 2, bit, mmreg); break; \
|
||||
\
|
||||
case 0x10001800: ConstWrite_ExecTimer(rcntWcount, 3, bit, mmreg); break; \
|
||||
case 0x10001810: ConstWrite_ExecTimer(rcntWmode, 3, bit, mmreg); break; \
|
||||
case 0x10001820: ConstWrite_ExecTimer(rcntWtarget, 3, bit, mmreg); break; \
|
||||
case 0x10001800: ConstWrite_ExecTimer((uptr)&rcntWcount, 3, bit, mmreg); break; \
|
||||
case 0x10001810: ConstWrite_ExecTimer((uptr)&rcntWmode, 3, bit, mmreg); break; \
|
||||
case 0x10001820: ConstWrite_ExecTimer((uptr)&rcntWtarget, 3, bit, mmreg); break; \
|
||||
|
||||
void hwConstWrite8(u32 mem, int mmreg)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@
|
|||
#pragma warning(disable:4761)
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
|
@ -68,8 +67,6 @@ u32 s_psxrecblocks[] = {0};
|
|||
void psxRecRecompile(u32 startpc);
|
||||
|
||||
uptr *psxRecLUT;
|
||||
}
|
||||
|
||||
|
||||
#define PSX_NUMBLOCKS (1<<12)
|
||||
#define MAPBASE 0x48000000
|
||||
|
|
@ -80,12 +77,12 @@ uptr *psxRecLUT;
|
|||
// R3000A statics
|
||||
int psxreclog = 0;
|
||||
|
||||
static s8 *recMem; // the recompiled blocks will be here
|
||||
static u8 *recMem; // the recompiled blocks will be here
|
||||
static BASEBLOCK *recRAM; // and the ptr to the blocks here
|
||||
static BASEBLOCK *recROM; // and here
|
||||
static BASEBLOCK *recROM1; // also here
|
||||
static BASEBLOCKEX *recBlocks = NULL;
|
||||
static s8 *recPtr;
|
||||
static u8 *recPtr;
|
||||
u32 psxpc; // recompiler psxpc
|
||||
int psxbranch; // set for branch
|
||||
static EEINST* s_pInstCache = NULL;
|
||||
|
|
@ -117,9 +114,7 @@ extern void (*rpsxBSC_co[64])();
|
|||
void rpsxpropBSC(EEINST* prev, EEINST* pinst);
|
||||
|
||||
#ifdef _DEBUG
|
||||
extern "C" {
|
||||
u32 psxdump = 0;
|
||||
}
|
||||
#else
|
||||
#define psxdump 0
|
||||
#endif
|
||||
|
|
@ -145,7 +140,7 @@ BASEBLOCKEX* PSX_GETBLOCKEX(BASEBLOCK* p)
|
|||
|
||||
////////////////////////////////////////////////////
|
||||
#ifdef _DEBUG
|
||||
static void iDumpBlock( int startpc, s8 * ptr )
|
||||
static void iIopDumpBlock( int startpc, u8 * ptr )
|
||||
{
|
||||
FILE *f;
|
||||
char filename[ g_MaxPath ];
|
||||
|
|
@ -443,7 +438,7 @@ void psxRecompileCodeConst0(R3000AFNPTR constcode, R3000AFNPTR_INFO constscode,
|
|||
PSX_DEL_CONST(_Rd_);
|
||||
}
|
||||
|
||||
extern "C" void zeroEx();
|
||||
void zeroEx();
|
||||
|
||||
// rt = rs op imm16
|
||||
void psxRecompileCodeConst1(R3000AFNPTR constcode, R3000AFNPTR_INFO noconstcode)
|
||||
|
|
@ -538,7 +533,7 @@ static int recInit() {
|
|||
// can't have upper 4 bits nonzero!
|
||||
startaddr = 0x0f000000;
|
||||
while(!(startaddr & 0xf0000000)) {
|
||||
recMem = (s8*)SysMmap(startaddr, RECMEM_SIZE);
|
||||
recMem = (u8*)SysMmap(startaddr, RECMEM_SIZE);
|
||||
if( (uptr)recMem & 0xf0000000 ) {
|
||||
SysMunmap((uptr)recMem, RECMEM_SIZE); recMem = NULL;
|
||||
startaddr += 0x00100000;
|
||||
|
|
@ -679,7 +674,7 @@ static __forceinline void R3000AExecute()
|
|||
}
|
||||
|
||||
#else
|
||||
extern "C" void R3000AExecute();
|
||||
void R3000AExecute();
|
||||
#endif
|
||||
|
||||
extern u32 g_psxNextBranchCycle;
|
||||
|
|
@ -840,18 +835,10 @@ recomp:
|
|||
|
||||
#else // _MSC_VER
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void psxDispatcher();
|
||||
void psxDispatcherClear();
|
||||
void psxDispatcherReg();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _MSC_VER
|
||||
|
||||
static void recClear(u32 Addr, u32 Size)
|
||||
|
|
@ -898,7 +885,7 @@ void psxRecClearMem(BASEBLOCK* p)
|
|||
assert( p->pFnptr != 0 );
|
||||
assert( p->startpc );
|
||||
|
||||
x86Ptr = (s8*)p->pFnptr;
|
||||
x86Ptr = (u8*)p->pFnptr;
|
||||
|
||||
// there is a small problem: mem can be ored with 0xa<<28 or 0x8<<28, and don't know which
|
||||
MOV32ItoR(EDX, p->startpc);
|
||||
|
|
@ -909,7 +896,7 @@ void psxRecClearMem(BASEBLOCK* p)
|
|||
PUSH32I((uptr)x86Ptr);
|
||||
#endif
|
||||
JMP32((uptr)psxDispatcherClear - ( (uptr)x86Ptr + 5 ));
|
||||
assert( x86Ptr == (s8*)p->pFnptr + IOP_MIN_BLOCK_BYTES );
|
||||
assert( x86Ptr == (u8*)p->pFnptr + IOP_MIN_BLOCK_BYTES );
|
||||
|
||||
pstart = PSX_GETBLOCK(p->startpc);
|
||||
pexblock = PSX_GETBLOCKEX(pstart);
|
||||
|
|
@ -1072,7 +1059,7 @@ void rpsxSYSCALL()
|
|||
//if (!psxbranch) psxbranch = 2;
|
||||
}
|
||||
|
||||
extern "C" void psxBREAK();
|
||||
void psxBREAK();
|
||||
void rpsxBREAK()
|
||||
{
|
||||
MOV32ItoM( (uptr)&psxRegs.code, psxRegs.code );
|
||||
|
|
@ -1133,7 +1120,7 @@ void psxRecompileNextInstruction(int delayslot)
|
|||
else {
|
||||
|
||||
if( !(delayslot && pblock->startpc == psxpc) ) {
|
||||
s8* oldX86 = x86Ptr;
|
||||
u8* oldX86 = x86Ptr;
|
||||
//__Log("clear block %x\n", pblock->startpc);
|
||||
psxRecClearMem(pblock);
|
||||
x86Ptr = oldX86;
|
||||
|
|
@ -1206,7 +1193,6 @@ static void recExecuteBlock()
|
|||
|
||||
#include "PsxHw.h"
|
||||
|
||||
extern "C"
|
||||
void iDumpPsxRegisters(u32 startpc, u32 temp)
|
||||
{
|
||||
int i;
|
||||
|
|
@ -1460,12 +1446,12 @@ StartRecomp:
|
|||
// dump code
|
||||
for(i = 0; i < ARRAYSIZE(s_psxrecblocks); ++i) {
|
||||
if( startpc == s_psxrecblocks[i] ) {
|
||||
iDumpBlock(startpc, recPtr);
|
||||
iIopDumpBlock(startpc, recPtr);
|
||||
}
|
||||
}
|
||||
|
||||
if( (psxdump & 1) )
|
||||
iDumpBlock(startpc, recPtr);
|
||||
iIopDumpBlock(startpc, recPtr);
|
||||
#endif
|
||||
|
||||
g_pCurInstInfo = s_pInstCache;
|
||||
|
|
@ -1475,7 +1461,7 @@ StartRecomp:
|
|||
|
||||
#ifdef _DEBUG
|
||||
if( (psxdump & 1) )
|
||||
iDumpBlock(startpc, recPtr);
|
||||
iIopDumpBlock(startpc, recPtr);
|
||||
#endif
|
||||
|
||||
assert( (psxpc-startpc)>>2 <= 0xffff );
|
||||
|
|
@ -1533,7 +1519,7 @@ StartRecomp:
|
|||
}
|
||||
}
|
||||
|
||||
assert( x86Ptr >= (s8*)s_pCurBlock->pFnptr + IOP_MIN_BLOCK_BYTES );
|
||||
assert( x86Ptr >= (u8*)s_pCurBlock->pFnptr + IOP_MIN_BLOCK_BYTES );
|
||||
assert( x86Ptr < recMem+RECMEM_SIZE );
|
||||
|
||||
recPtr = x86Ptr;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@
|
|||
// stop compiling if NORECBUILD build (only for Visual Studio)
|
||||
#if !(defined(_MSC_VER) && defined(PCSX2_NORECBUILD))
|
||||
|
||||
extern "C" {
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
|
|
@ -53,7 +52,6 @@ extern void psxSWR();
|
|||
|
||||
extern int g_psxWriteOk;
|
||||
extern u32 g_psxMaxRecMem;
|
||||
}
|
||||
|
||||
// R3000A instruction implementation
|
||||
#define REC_FUNC(f) \
|
||||
|
|
@ -1286,7 +1284,7 @@ void rpsxJALR()
|
|||
static void* s_pbranchjmp;
|
||||
static u32 s_do32 = 0;
|
||||
|
||||
#define JUMPVALID(pjmp) (( x86Ptr - (s8*)pjmp ) <= 0x80)
|
||||
#define JUMPVALID(pjmp) (( x86Ptr - (u8*)pjmp ) <= 0x80)
|
||||
|
||||
void rpsxSetBranchEQ(int info, int process)
|
||||
{
|
||||
|
|
@ -1333,7 +1331,7 @@ void rpsxBEQ_process(int info, int process)
|
|||
else
|
||||
{
|
||||
_psxFlushAllUnused();
|
||||
s8* prevx86 = x86Ptr;
|
||||
u8* prevx86 = x86Ptr;
|
||||
s_do32 = 0;
|
||||
psxSaveBranchState();
|
||||
|
||||
|
|
@ -1397,7 +1395,7 @@ void rpsxBNE_process(int info, int process)
|
|||
}
|
||||
|
||||
_psxFlushAllUnused();
|
||||
s8* prevx86 = x86Ptr;
|
||||
u8* prevx86 = x86Ptr;
|
||||
s_do32 = 0;
|
||||
rpsxSetBranchEQ(info, process);
|
||||
|
||||
|
|
@ -1451,7 +1449,7 @@ void rpsxBLTZ()
|
|||
}
|
||||
|
||||
CMP32ItoM((uptr)&psxRegs.GPR.r[_Rs_], 0);
|
||||
s8* prevx86 = x86Ptr;
|
||||
u8* prevx86 = x86Ptr;
|
||||
u8* pjmp = JL8(0);
|
||||
|
||||
psxSaveBranchState();
|
||||
|
|
@ -1498,7 +1496,7 @@ void rpsxBGEZ()
|
|||
}
|
||||
|
||||
CMP32ItoM((uptr)&psxRegs.GPR.r[_Rs_], 0);
|
||||
s8* prevx86 = x86Ptr;
|
||||
u8* prevx86 = x86Ptr;
|
||||
u8* pjmp = JGE8(0);
|
||||
|
||||
psxSaveBranchState();
|
||||
|
|
@ -1552,7 +1550,7 @@ void rpsxBLTZAL()
|
|||
}
|
||||
|
||||
CMP32ItoM((uptr)&psxRegs.GPR.r[_Rs_], 0);
|
||||
s8* prevx86 = x86Ptr;
|
||||
u8* prevx86 = x86Ptr;
|
||||
u8* pjmp = JL8(0);
|
||||
|
||||
psxSaveBranchState();
|
||||
|
|
@ -1605,7 +1603,7 @@ void rpsxBGEZAL()
|
|||
}
|
||||
|
||||
CMP32ItoM((uptr)&psxRegs.GPR.r[_Rs_], 0);
|
||||
s8* prevx86 = x86Ptr;
|
||||
u8* prevx86 = x86Ptr;
|
||||
u8* pjmp = JGE8(0);
|
||||
|
||||
MOV32ItoM((uptr)&psxRegs.GPR.r[31], psxpc+4);
|
||||
|
|
@ -1659,7 +1657,7 @@ void rpsxBLEZ()
|
|||
_clearNeededX86regs();
|
||||
|
||||
CMP32ItoM((uptr)&psxRegs.GPR.r[_Rs_], 0);
|
||||
s8* prevx86 = x86Ptr;
|
||||
u8* prevx86 = x86Ptr;
|
||||
u8* pjmp = JLE8(0);
|
||||
|
||||
psxSaveBranchState();
|
||||
|
|
@ -1707,7 +1705,7 @@ void rpsxBGTZ()
|
|||
_clearNeededX86regs();
|
||||
|
||||
CMP32ItoM((uptr)&psxRegs.GPR.r[_Rs_], 0);
|
||||
s8* prevx86 = x86Ptr;
|
||||
u8* prevx86 = x86Ptr;
|
||||
u8* pjmp = JG8(0);
|
||||
|
||||
psxSaveBranchState();
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ void _eeOnWriteReg(int reg, int signext);
|
|||
void _deleteEEreg(int reg, int flush);
|
||||
|
||||
// allocates memory on the instruction size and returns the pointer
|
||||
void* recAllocStackMem(int size, int align);
|
||||
u32* recAllocStackMem(int size, int align);
|
||||
|
||||
//////////////////////////////////////
|
||||
// Templates for code recompilation //
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ void recResetVU1( void ) {
|
|||
branch = 0;
|
||||
}
|
||||
|
||||
static void iDumpBlock()
|
||||
static void iVU1DumpBlock()
|
||||
{
|
||||
FILE *f;
|
||||
char filename[ g_MaxPath ];
|
||||
|
|
|
|||
|
|
@ -22,8 +22,6 @@
|
|||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#define PLUGINtypedefs // for GSgifTransfer1
|
||||
|
||||
#include "Common.h"
|
||||
#include "GS.h"
|
||||
#include "InterTables.h"
|
||||
|
|
@ -45,71 +43,6 @@
|
|||
#pragma warning(disable:4761)
|
||||
#endif
|
||||
|
||||
extern _GSgifTransfer1 GSgifTransfer1;
|
||||
|
||||
#ifdef PCSX2_DEVBUILD
|
||||
|
||||
// These would make more sense in GS.cpp, but then the legacy "C" files
|
||||
// (like this one!) wouldn't be able to access them (C++ name mangling)
|
||||
|
||||
__forceinline void GSGIFTRANSFER1(u32 *pMem, u32 addr) {
|
||||
if( g_SaveGSStream == 2) {
|
||||
u32 type = GSRUN_TRANS1;
|
||||
u32 size = (0x4000-(addr))/16;
|
||||
gzwrite(g_fGSSave, &type, sizeof(type));
|
||||
gzwrite(g_fGSSave, &size, 4);
|
||||
gzwrite(g_fGSSave, ((u8*)pMem)+(addr), size*16);
|
||||
}
|
||||
GSgifTransfer1(pMem, addr);
|
||||
}
|
||||
|
||||
__forceinline void GSGIFTRANSFER2(u32 *pMem, u32 size) {
|
||||
if( g_SaveGSStream == 2) {
|
||||
u32 type = GSRUN_TRANS2;
|
||||
u32 _size = size;
|
||||
gzwrite(g_fGSSave, &type, sizeof(type));
|
||||
gzwrite(g_fGSSave, &_size, 4);
|
||||
gzwrite(g_fGSSave, pMem, _size*16);
|
||||
}
|
||||
GSgifTransfer2(pMem, size);
|
||||
}
|
||||
|
||||
__forceinline void GSGIFTRANSFER3(u32 *pMem, u32 size) {
|
||||
if( g_SaveGSStream == 2 ) {
|
||||
u32 type = GSRUN_TRANS3;
|
||||
u32 _size = size;
|
||||
gzwrite(g_fGSSave, &type, sizeof(type));
|
||||
gzwrite(g_fGSSave, &_size, 4);
|
||||
gzwrite(g_fGSSave, pMem, _size*16);
|
||||
}
|
||||
GSgifTransfer3(pMem, size);
|
||||
}
|
||||
|
||||
__forceinline void GSVSYNC(void) {
|
||||
if( g_SaveGSStream == 2 ) {
|
||||
u32 type = GSRUN_VSYNC;
|
||||
gzwrite(g_fGSSave, &type, sizeof(type));
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
__forceinline void GSGIFTRANSFER1(u32 *pMem, u32 addr) {
|
||||
GSgifTransfer1(pMem, addr);
|
||||
}
|
||||
|
||||
__forceinline void GSGIFTRANSFER2(u32 *pMem, u32 size) {
|
||||
GSgifTransfer2(pMem, size);
|
||||
}
|
||||
|
||||
__forceinline void GSGIFTRANSFER3(u32 *pMem, u32 size) {
|
||||
GSgifTransfer3(pMem, size);
|
||||
}
|
||||
|
||||
__forceinline void GSVSYNC(void) {
|
||||
}
|
||||
#endif
|
||||
|
||||
int g_VuNanHandling = 0; // for now enable all the time
|
||||
|
||||
int vucycle;
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ void _recvuAddLowerStalls(VURegs * VU, _VURegsNum *VUregsn);
|
|||
#define VUOP_WRITE 4
|
||||
|
||||
// save on mem
|
||||
typedef struct {
|
||||
struct _vuopinfo {
|
||||
int cycle;
|
||||
int cycles;
|
||||
u8 statusflag;
|
||||
|
|
@ -81,7 +81,7 @@ typedef struct {
|
|||
u8 q;
|
||||
u8 p;
|
||||
u16 pqinst; // bit of instruction specifying index (srec only)
|
||||
} _vuopinfo;
|
||||
};
|
||||
extern _vuopinfo *cinfo;
|
||||
|
||||
void SuperVUAnalyzeOp(VURegs *VU, _vuopinfo *info, _VURegsNum* pCodeRegs);
|
||||
|
|
|
|||
|
|
@ -27,15 +27,6 @@
|
|||
#include <malloc.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "PS2Etypes.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#define PLUGINtypedefs // for GSgifTransfer1
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <windows.h>
|
||||
#else
|
||||
|
|
@ -43,18 +34,11 @@ extern "C" {
|
|||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#include "PS2Edefs.h"
|
||||
#include "zlib.h"
|
||||
#include "Misc.h"
|
||||
#include "System.h"
|
||||
#include "R5900.h"
|
||||
#include "Vif.h"
|
||||
#include "VU.h"
|
||||
#include "Common.h"
|
||||
|
||||
#include "Memory.h"
|
||||
#include "Hw.h"
|
||||
#include "GS.h"
|
||||
|
||||
#include "R5900.h"
|
||||
#include "VU.h"
|
||||
#include "ix86/ix86.h"
|
||||
#include "iR5900.h"
|
||||
|
||||
|
|
@ -68,12 +52,6 @@ extern void iDumpVU1Registers();
|
|||
extern char* disVU1MicroUF(u32 code, u32 pc);
|
||||
extern char* disVU1MicroLF(u32 code, u32 pc);
|
||||
|
||||
extern _GSgifTransfer1 GSgifTransfer1;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <map>
|
||||
|
|
@ -117,7 +95,7 @@ static const u32 PWaitTimes[] = { 53, 43, 28, 23, 17, 11, 10 };
|
|||
static u32 s_vuInfo; // info passed into rec insts
|
||||
|
||||
static const u32 s_MemSize[2] = {VU0_MEMSIZE, VU1_MEMSIZE};
|
||||
static s8* s_recVUMem = NULL, *s_recVUPtr = NULL;
|
||||
static u8* s_recVUMem = NULL, *s_recVUPtr = NULL;
|
||||
|
||||
// tables
|
||||
extern void (*recSVU_UPPER_OPCODE[64])();
|
||||
|
|
@ -330,8 +308,8 @@ static u32 s_UnconditionalDelay = 0; // 1 if there are two sequential branches a
|
|||
static u32 g_nLastBlockExecuted = 0;
|
||||
|
||||
// Global functions
|
||||
extern "C" void* SuperVUGetProgram(u32 startpc, int vuindex);
|
||||
extern "C" void SuperVUCleanupProgram(u32 startpc, int vuindex);
|
||||
void* SuperVUGetProgram(u32 startpc, int vuindex);
|
||||
void SuperVUCleanupProgram(u32 startpc, int vuindex);
|
||||
static VuFunctionHeader* SuperVURecompileProgram(u32 startpc, int vuindex);
|
||||
static VuBaseBlock* SuperVUBuildBlocks(VuBaseBlock* parent, u32 startpc, const VUPIPELINES& pipes);
|
||||
static void SuperVUInitLiveness(VuBaseBlock* pblock);
|
||||
|
|
@ -345,14 +323,14 @@ void SuperVUFreeXMMregs(u32* livevars);
|
|||
|
||||
static u32* SuperVUStaticAlloc(u32 size);
|
||||
static void SuperVURecompile();
|
||||
extern "C" void SuperVUEndProgram();
|
||||
void SuperVUEndProgram();
|
||||
|
||||
// allocate VU resources
|
||||
void SuperVUInit(int vuindex)
|
||||
{
|
||||
if( vuindex < 0 ) {
|
||||
// upper 4 bits cannot be nonzero!
|
||||
s_recVUMem = (s8*)SysMmap(0x0c000000, VU_EXESIZE);
|
||||
s_recVUMem = (u8*)SysMmap(0x0c000000, VU_EXESIZE);
|
||||
if( (uptr)s_recVUMem > 0x80000000 )
|
||||
SysPrintf("bad SuperVU alloc %x\n", s_recVUMem);
|
||||
memset(s_recVUMem, 0xcd, VU_EXESIZE);
|
||||
|
|
@ -469,9 +447,7 @@ static u32 s_WriteToReadQ = 0;
|
|||
static u32 s_VIBranchDelay = 0; //Value of register to use in a vi branch delayed situation
|
||||
|
||||
|
||||
extern "C" {
|
||||
u32 s_TotalVUCycles; // total cycles since start of program execution
|
||||
}
|
||||
|
||||
int SuperVUGetLiveness(int vfreg)
|
||||
{
|
||||
|
|
@ -657,10 +633,8 @@ void SuperVUDumpBlock(list<VuBaseBlock*>& blocks, int vuindex)
|
|||
fclose( f );
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
LARGE_INTEGER svubase, svufinal;
|
||||
static u64 svutime;
|
||||
}
|
||||
|
||||
// uncomment to count svu exec time
|
||||
//#define SUPERVU_COUNT
|
||||
|
|
@ -1950,7 +1924,7 @@ void VuBaseBlock::AssignVFRegs()
|
|||
if( i == XMMREGS ) return; // nothing changed
|
||||
}
|
||||
|
||||
s8* oldX86 = x86Ptr;
|
||||
u8* oldX86 = x86Ptr;
|
||||
|
||||
FORIT(itinst, insts) {
|
||||
|
||||
|
|
@ -2372,7 +2346,6 @@ static void SuperVUAssignRegs()
|
|||
// Recompilation
|
||||
//////////////////
|
||||
|
||||
extern "C" {
|
||||
// cycles in which the last Q,P regs were finished (written to VU->VI[])
|
||||
// the write occurs before the instruction is executed at that cycle
|
||||
// compare with s_TotalVUCycles
|
||||
|
|
@ -2385,8 +2358,6 @@ uptr s_vu1esp, s_callstack;//, s_vu1esp
|
|||
uptr s_vu1ebp, s_vuebx, s_vuedi, s_vu1esi;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
static int s_recWriteQ, s_recWriteP; // wait times during recompilation
|
||||
static int s_needFlush; // first bit - Q, second bit - P, third bit - Q has been written, fourth bit - P has been written
|
||||
|
||||
|
|
@ -2394,7 +2365,7 @@ static int s_needFlush; // first bit - Q, second bit - P, third bit - Q has been
|
|||
static int s_JumpX86;
|
||||
static int s_ScheduleXGKICK = 0, s_XGKICKReg = -1;
|
||||
|
||||
extern "C" u32 g_sseVUMXCSR, g_sseMXCSR;
|
||||
extern u32 g_sseVUMXCSR, g_sseMXCSR;
|
||||
|
||||
void recSVUMI_XGKICK_( VURegs *VU );
|
||||
|
||||
|
|
@ -2607,22 +2578,20 @@ static void SuperVURecompile()
|
|||
// debug
|
||||
|
||||
#ifdef _DEBUG
|
||||
extern "C" u32 s_vucount;
|
||||
extern u32 s_vucount;
|
||||
|
||||
static u32 g_vu1lastrec = 0, skipparent = -1;
|
||||
static u32 s_svulast = 0, s_vufnheader;
|
||||
static u32 badaddrs[][2] = {0,0xffff};
|
||||
#endif
|
||||
extern "C" {
|
||||
|
||||
#ifndef __x86_64__
|
||||
u32 s_saveecx, s_saveedx, s_saveebx, s_saveesi, s_saveedi, s_saveebp;
|
||||
#endif
|
||||
|
||||
u32 g_curdebugvu;
|
||||
}
|
||||
|
||||
//extern "C" float vuDouble(u32 f);
|
||||
//float vuDouble(u32 f);
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__x86_64__)
|
||||
__declspec(naked) static void svudispfn()
|
||||
|
|
@ -2638,9 +2607,9 @@ __declspec(naked) static void svudispfn()
|
|||
}
|
||||
#else
|
||||
|
||||
extern "C" void svudispfn();
|
||||
void svudispfn();
|
||||
|
||||
extern "C" void svudispfntemp()
|
||||
void svudispfntemp()
|
||||
{
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -21,10 +21,6 @@
|
|||
#ifndef VU1_SUPER_RECOMPILER
|
||||
#define VU1_SUPER_RECOMPILER
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void SuperVUInit(int vuindex); // if vuindex is -1, inits the global VU resources
|
||||
void SuperVUDestroy(int vuindex); // if vuindex is -1, destroys everything
|
||||
void SuperVUReset(int vuindex); // if vuindex is -1, resets everything
|
||||
|
|
@ -42,8 +38,4 @@ u32 SuperVUGetVIAddr(int reg, int read);
|
|||
// if p == 0, flush q else flush p; if wait is != 0, waits for p/q
|
||||
void SuperVUFlush(int p, int wait);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -22,10 +22,6 @@
|
|||
#include <math.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "Common.h"
|
||||
#include "ix86/ix86.h"
|
||||
#include "Vif.h"
|
||||
|
|
@ -33,10 +29,6 @@ extern "C" {
|
|||
|
||||
#include <assert.h>
|
||||
|
||||
extern VIFregisters *_vifRegs;
|
||||
extern u32* _vifMaskRegs;
|
||||
extern u32* _vifRow, _vifCol;
|
||||
|
||||
// sse2 highly optimized vif (~200 separate functions are built) zerofrog(@gmail.com)
|
||||
extern u32 g_vif1Masks[48], g_vif0Masks[48];
|
||||
extern u32 g_vif1HasMask3[4], g_vif0HasMask3[4];
|
||||
|
|
@ -67,7 +59,8 @@ static PCSX2_ALIGNED16(u32 s_maskarr[16][4]) = {
|
|||
};
|
||||
|
||||
extern u8 s_maskwrite[256];
|
||||
PCSX2_ALIGNED16(u32 s_TempDecompress[4]) = {0};
|
||||
|
||||
extern "C" PCSX2_ALIGNED16(u32 s_TempDecompress[4]) = {0};
|
||||
|
||||
#if defined(_MSC_VER) // gcc functions can be found in iVif.S
|
||||
|
||||
|
|
@ -151,8 +144,4 @@ void SetNewMask(u32* vif1masks, u32* hasmask, u32 mask, u32 oldmask)
|
|||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // PCSX2_NORECBUILD
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@
|
|||
#include <assert.h>
|
||||
#include <malloc.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
#include "PS2Etypes.h"
|
||||
|
||||
#if defined(_WIN32)
|
||||
|
|
@ -43,10 +41,6 @@ u16 g_mmxAllocCounter = 0;
|
|||
// use FreezeMMXRegs, FreezeXMMRegs
|
||||
u8 g_globalMMXSaved = 0;
|
||||
|
||||
#ifdef _DEBUG
|
||||
char g_globalMMXLocked = 0;
|
||||
#endif
|
||||
|
||||
PCSX2_ALIGNED16(u64 g_globalMMXData[8]);
|
||||
|
||||
// X86 caching
|
||||
|
|
@ -54,8 +48,6 @@ extern _x86regs x86regs[X86REGS];
|
|||
int g_x86checknext;
|
||||
extern u16 g_x86AllocCounter;
|
||||
|
||||
} // end extern "C"
|
||||
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
|
|
|
|||
|
|
@ -66,13 +66,13 @@ uptr *recLUT;
|
|||
|
||||
#define EE_NUMBLOCKS (1<<15)
|
||||
|
||||
static char *recMem = NULL; // the recompiled blocks will be here
|
||||
static char* recStack = NULL; // stack mem
|
||||
static u8 *recMem = NULL; // the recompiled blocks will be here
|
||||
static u8* recStack = NULL; // stack mem
|
||||
static BASEBLOCK *recRAM = NULL; // and the ptr to the blocks here
|
||||
static BASEBLOCK *recROM = NULL; // and here
|
||||
static BASEBLOCK *recROM1 = NULL; // also here
|
||||
static BASEBLOCKEX *recBlocks = NULL;
|
||||
static char *recPtr = NULL, *recStackPtr = NULL;
|
||||
static u8* recPtr = NULL, *recStackPtr = NULL;
|
||||
static EEINST* s_pInstCache = NULL;
|
||||
static u32 s_nInstCacheSize = 0;
|
||||
|
||||
|
|
@ -137,7 +137,7 @@ BASEBLOCKEX* PC_GETBLOCKEX(BASEBLOCK* p)
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
void iDumpBlock( int startpc, s8 * ptr )
|
||||
static void iDumpBlock( int startpc, u8 * ptr )
|
||||
{
|
||||
FILE *f;
|
||||
char filename[ g_MaxPath ];
|
||||
|
|
@ -333,7 +333,7 @@ u32* _eeGetConstReg(int reg)
|
|||
// if written in the future, don't flush
|
||||
if( _recIsRegWritten(g_pCurInstInfo+1, (s_nEndBlock-pc)/4, XMMTYPE_GPRREG, reg) ) {
|
||||
u32* ptempmem;
|
||||
ptempmem = (u32*)recAllocStackMem(8, 4);
|
||||
ptempmem = recAllocStackMem(8, 4);
|
||||
ptempmem[0] = g_cpuConstRegs[ reg ].UL[0];
|
||||
ptempmem[1] = g_cpuConstRegs[ reg ].UL[1];
|
||||
return ptempmem;
|
||||
|
|
@ -456,12 +456,12 @@ void _flushConstRegs()
|
|||
}
|
||||
}
|
||||
|
||||
void* recAllocStackMem(int size, int align)
|
||||
u32* recAllocStackMem(int size, int align)
|
||||
{
|
||||
// write to a temp loc, trick
|
||||
if( (u32)recStackPtr % align ) recStackPtr += align - ((u32)recStackPtr%align);
|
||||
recStackPtr += size;
|
||||
return recStackPtr-size;
|
||||
return (u32*)(recStackPtr-size);
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
|
@ -1488,14 +1488,14 @@ int recInit( void )
|
|||
memset( recLUT, 0, 0x010000 * sizeof(uptr) );
|
||||
|
||||
// can't have upper 4 bits nonzero!
|
||||
recMem = (char*)SysMmap(0x0d000000, REC_CACHEMEM);
|
||||
recMem = (u8*)SysMmap(0x0d000000, REC_CACHEMEM);
|
||||
|
||||
// 32 alignment necessary
|
||||
recRAM = (BASEBLOCK*) _aligned_malloc( sizeof(BASEBLOCK)/4*0x02000000 , 4*sizeof(BASEBLOCK));
|
||||
recROM = (BASEBLOCK*) _aligned_malloc( sizeof(BASEBLOCK)/4*0x00400000 , 4*sizeof(BASEBLOCK));
|
||||
recROM1= (BASEBLOCK*) _aligned_malloc( sizeof(BASEBLOCK)/4*0x00040000 , 4*sizeof(BASEBLOCK));
|
||||
recBlocks = (BASEBLOCKEX*) _aligned_malloc( sizeof(BASEBLOCKEX)*EE_NUMBLOCKS, 16);
|
||||
recStack = (char*)malloc( RECSTACK_SIZE );
|
||||
recStack = (u8*)malloc( RECSTACK_SIZE );
|
||||
|
||||
s_nInstCacheSize = 128;
|
||||
s_pInstCache = (EEINST*)malloc( sizeof(EEINST) * s_nInstCacheSize );
|
||||
|
|
@ -2021,13 +2021,13 @@ void recClearMem(BASEBLOCK* p)
|
|||
assert( p->pFnptr != 0 );
|
||||
assert( p->startpc );
|
||||
|
||||
x86Ptr = (s8*)p->pFnptr;
|
||||
x86Ptr = (u8*)p->pFnptr;
|
||||
|
||||
// there is a small problem: mem can be ored with 0xa<<28 or 0x8<<28, and don't know which
|
||||
MOV32ItoR(EDX, p->startpc);
|
||||
PUSH32I((u32)x86Ptr); // will be replaced by JMP32
|
||||
JMP32((u32)DispatcherClear - ( (u32)x86Ptr + 5 ));
|
||||
assert( x86Ptr == (s8*)p->pFnptr + EE_MIN_BLOCK_BYTES );
|
||||
assert( x86Ptr == (u8*)p->pFnptr + EE_MIN_BLOCK_BYTES );
|
||||
|
||||
pstart = PC_GETBLOCK(p->startpc);
|
||||
pexblock = PC_GETBLOCKEX(pstart);
|
||||
|
|
@ -2512,7 +2512,7 @@ void recompileNextInstruction(int delayslot)
|
|||
else {
|
||||
|
||||
if( !(delayslot && pblock->startpc == pc) ) {
|
||||
s8* oldX86 = x86Ptr;
|
||||
u8* oldX86 = x86Ptr;
|
||||
//__Log("clear block %x\n", pblock->startpc);
|
||||
recClearMem(pblock);
|
||||
x86Ptr = oldX86;
|
||||
|
|
@ -3251,7 +3251,7 @@ StartRecomp:
|
|||
}
|
||||
}
|
||||
|
||||
assert( x86Ptr >= (s8*)s_pCurBlock->pFnptr + EE_MIN_BLOCK_BYTES );
|
||||
assert( x86Ptr >= (u8*)s_pCurBlock->pFnptr + EE_MIN_BLOCK_BYTES );
|
||||
assert( x86Ptr < recMem+REC_CACHEMEM );
|
||||
assert( recStackPtr < recStack+RECSTACK_SIZE );
|
||||
assert( x86FpuState == 0 );
|
||||
|
|
|
|||
|
|
@ -507,7 +507,7 @@ EERECOMPILE_CODE0(BNEL, XMMINFO_READS|XMMINFO_READT);
|
|||
//}
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
void recBLTZAL(int info)
|
||||
void recBLTZAL()
|
||||
{
|
||||
u32 branchTo = ((s32)_Imm_ * 4) + pc;
|
||||
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue