mirror of https://github.com/PCSX2/pcsx2.git
Assorted cleanup. Deleting and commenting out unused variables & code, and a few minor changes to the Linux code.
git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@213 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
parent
41f7d6f79f
commit
f905ea60f5
|
@ -51,7 +51,7 @@ int getFreeCache(u32 mem, int mode, int * way) {
|
|||
|
||||
if(pCache[i].tag[number] & 0x60) // Valid Dirty
|
||||
{
|
||||
t = (char *)(taddr[number]);
|
||||
t = (char *)(taddr[number]); // fixme - this should probably be cast to (u8*)
|
||||
out = (u8*)(t + (mem & 0xFC0));
|
||||
((u64*)out)[0] = ((u64*)pCache[i].data[number][0].b8._8)[0];
|
||||
((u64*)out)[1] = ((u64*)pCache[i].data[number][0].b8._8)[1];
|
||||
|
@ -328,7 +328,7 @@ void CACHE() {
|
|||
{
|
||||
int index = (addr >> 6) & 0x3F;
|
||||
int way = addr & 0x1;
|
||||
u8 * out = pCache[index].data[way][(addr>>4) & 0x3].b8._8;
|
||||
//u8 * out = pCache[index].data[way][(addr>>4) & 0x3].b8._8;
|
||||
*(u32*)(&pCache[index].data[way][(addr>>4) & 0x3].b8._8[(addr&0xf)]) = cpuRegs.CP0.r[28];
|
||||
#ifdef CACHE_LOG
|
||||
CACHE_LOG("CACHE DXSDT addr %x, index %d, way %d, DATA %x\n",addr,index,way,cpuRegs.CP0.r[28]);
|
||||
|
|
|
@ -1531,26 +1531,27 @@ void P_BC2TL(char *buf){ sprintf(buf, "bc2tl\t%s", offset_decode()); }
|
|||
|
||||
const char *dest_string(void)
|
||||
{
|
||||
static char str[5];
|
||||
int i;
|
||||
i = 0;
|
||||
if(_X) str[i++] = 'x';
|
||||
if(_Y) str[i++] = 'y';
|
||||
if(_Z) str[i++] = 'z';
|
||||
if(_W) str[i++] = 'w';
|
||||
str[i++] = 0;
|
||||
return (const char *)str;
|
||||
static char str[5];
|
||||
int i = 0;
|
||||
|
||||
if(_X) str[i++] = 'x';
|
||||
if(_Y) str[i++] = 'y';
|
||||
if(_Z) str[i++] = 'z';
|
||||
if(_W) str[i++] = 'w';
|
||||
str[i++] = 0;
|
||||
|
||||
return (const char *)str;
|
||||
}
|
||||
|
||||
char dest_fsf()
|
||||
{
|
||||
const arr[4] = { 'x', 'y', 'z', 'w' };
|
||||
const char arr[4] = { 'x', 'y', 'z', 'w' };
|
||||
return arr[(cpuRegs.code>>21)&3];
|
||||
}
|
||||
|
||||
char dest_ftf()
|
||||
{
|
||||
const arr[4] = { 'x', 'y', 'z', 'w' };
|
||||
const char arr[4] = { 'x', 'y', 'z', 'w' };
|
||||
return arr[(cpuRegs.code>>23)&3];
|
||||
}
|
||||
|
||||
|
|
|
@ -165,10 +165,10 @@ unsigned int parseCommandLine( char *filename )
|
|||
i;
|
||||
|
||||
args_ptr -= 256;
|
||||
if ( args_ptr < 0 )
|
||||
/*if ( args_ptr < 0 ) //fixme - This, of course is impossible.
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}*/
|
||||
args[ 255 ] = 0;
|
||||
memcpy( &PS2MEM_BASE[ args_ptr ], args, 256 ); //params 1, 2, etc copied
|
||||
memset( &PS2MEM_BASE[ args_ptr + strlen( args ) ], 0, 256 - strlen( args ) );
|
||||
|
@ -188,10 +188,10 @@ unsigned int parseCommandLine( char *filename )
|
|||
p = filename;
|
||||
}
|
||||
args_ptr -= strlen( p ) + 1;
|
||||
if ( args_ptr < 0 )
|
||||
/* if ( args_ptr < 0 ) // fixme- This is still impossible.
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}*/
|
||||
strcpy( (char*)&PS2MEM_BASE[ args_ptr ], p ); //fill param 0; i.e. name of the program
|
||||
|
||||
for ( i = strlen( p ) + 1 + 256, argc = 0; i > 0; i-- )
|
||||
|
@ -211,7 +211,7 @@ unsigned int parseCommandLine( char *filename )
|
|||
if ( ( PS2MEM_BASE[ args_ptr + i ] != 0 ) && ( PS2MEM_BASE[ args_ptr + i ] != 32 ) )
|
||||
{ //i==0
|
||||
argc++;
|
||||
if ( args_ptr - 4 - 4 - argc * 4 < 0 )
|
||||
if ( args_ptr - 4 - 4 - argc * 4 < 0 ) // fixme - Should this be cast to a signed int?
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -222,7 +222,7 @@ unsigned int parseCommandLine( char *filename )
|
|||
if ( ( PS2MEM_BASE[ args_ptr + i + 1 ] != 0 ) && ( PS2MEM_BASE[ args_ptr + i + 1 ] != 32 ) )
|
||||
{
|
||||
argc++;
|
||||
if ( args_ptr - 4 - 4 - argc * 4 < 0 )
|
||||
if ( args_ptr - 4 - 4 - argc * 4 < 0 ) // fixme - Should this be cast to a signed int?
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -565,8 +565,7 @@ extern int LoadPatch(char *patchfile);
|
|||
extern void LoadGameSpecificSettings();
|
||||
|
||||
int loadElfFile(char *filename) {
|
||||
char str[256];
|
||||
char str2[256];
|
||||
char str[256],str2[256];
|
||||
u32 crc;
|
||||
u32 i;
|
||||
|
||||
|
|
|
@ -1259,7 +1259,6 @@ void dmaGIF() {
|
|||
#define spr0 ((DMACh*)&PS2MEM_HW[0xD000])
|
||||
|
||||
static unsigned int mfifocycles;
|
||||
static unsigned int giftempqwc = 0;
|
||||
static unsigned int gifqwc = 0;
|
||||
static unsigned int gifdone = 0;
|
||||
|
||||
|
|
|
@ -404,13 +404,18 @@ void ipuConstRead64(u32 mem, int mmreg)
|
|||
|
||||
#else
|
||||
|
||||
int ipuConstRead32(u32 x86reg, u32 mem)
|
||||
int ipuConstRead32(u32 x86reg, u32 mem)
|
||||
{
|
||||
// Let's see if this ever gets called
|
||||
printf("ipuConstRead32 called on a 64-bit system!\n");
|
||||
assert(0);
|
||||
return 0; //It won't return, but it makes the compiler happy.
|
||||
}
|
||||
|
||||
void ipuConstRead64(u32 mem, int mmreg)
|
||||
{
|
||||
// Let's see if this ever gets called
|
||||
printf("ipuConstRead64 called on a 64-bit system!\n");
|
||||
assert(0);
|
||||
}
|
||||
|
||||
|
@ -1928,8 +1933,8 @@ int IPU0dma()
|
|||
int readsize;
|
||||
void* pMem;
|
||||
|
||||
int qwc = ipu0dma->qwc;
|
||||
u32 chcr = ipu0dma->chcr;
|
||||
//int qwc = ipu0dma->qwc;
|
||||
//u32 chcr = ipu0dma->chcr;
|
||||
|
||||
if( !(ipu0dma->chcr & 0x100) || (cpuRegs.interrupt & (1<<DMAC_FROM_IPU)) ) {
|
||||
return 0;
|
||||
|
|
|
@ -104,41 +104,6 @@ GtkWidget *DumpRDlg, *DumpRTEntry, *DumpRFEntry;
|
|||
GtkWidget *MemWriteDlg, *MemEntry, *DataEntry;
|
||||
GtkAdjustment *DebugAdj;
|
||||
GtkWidget *GameFixDlg, *SpeedHacksDlg, *AdvDlg;
|
||||
|
||||
#define is_checked(main_widget, widget_name) (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name))))
|
||||
#define set_checked(main_widget,widget_name, state) gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name)), state)
|
||||
|
||||
#define set_flag(v, flag, value) if (value == TRUE) v |= flag; else v &= flag;
|
||||
#define get_flag(v,flag) (v & flag)
|
||||
|
||||
#define FLAG_SLOW_DVD 0x1
|
||||
#define FLAG_VU_CLIP 0x2
|
||||
#define FLAG_FPU_CLAMP 0x4
|
||||
#define FLAG_VU_BRANCH 0x8
|
||||
|
||||
#define FLAG_VU_NO_OVERFLOW 0x2
|
||||
#define FLAG_VU_EXTRA_OVERFLOW 0x40
|
||||
|
||||
#define FLAG_FPU_NO_OVERFLOW 0x800
|
||||
#define FLAG_FPU_EXTRA_OVERFLOW 0x1000
|
||||
|
||||
#define FLAG_EE_2_SYNC 0x1
|
||||
#define FLAG_TIGHT_SPU_SYNC 0x4
|
||||
#define FLAG_NO_UNDERFLOW 0x8
|
||||
#define FLAG_IOP_2_SYNC 0x10
|
||||
#define FLAG_TRIPLE_SYNC 0x20
|
||||
#define FLAG_FAST_BRANCHES 0x80
|
||||
#define FLAG_NO_VU_FLAGS 0x100
|
||||
#define FLAG_NO_FPU_FLAGS 0x200
|
||||
#define FLAG_ESC 0x400
|
||||
|
||||
#define FLAG_ROUND_NEAR 0x0000
|
||||
#define FLAG_ROUND_NEGATIVE 0x2000
|
||||
#define FLAG_ROUND_POSITIVE 0x4000
|
||||
#define FLAG_ROUND_ZERO 0x6000
|
||||
|
||||
#define FLAG_FLUSH_ZERO 0x8000
|
||||
#define FLAG_DENORMAL_ZERO 0x0040
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -105,5 +105,43 @@ extern int g_ZeroGSOptions;
|
|||
|
||||
char cfgfile[256];
|
||||
|
||||
/* Hacks */
|
||||
|
||||
int Config_hacks_backup;
|
||||
|
||||
#define is_checked(main_widget, widget_name) (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name))))
|
||||
#define set_checked(main_widget,widget_name, state) gtk_toggle_button_set_state(GTK_TOGGLE_BUTTON(lookup_widget(main_widget, widget_name)), state)
|
||||
|
||||
#define set_flag(v, flag, value) if (value == TRUE) v |= flag; else v &= flag;
|
||||
#define get_flag(v,flag) (v & flag)
|
||||
|
||||
#define FLAG_SLOW_DVD 0x1
|
||||
#define FLAG_VU_CLIP 0x2
|
||||
#define FLAG_FPU_CLAMP 0x4
|
||||
#define FLAG_VU_BRANCH 0x8
|
||||
|
||||
#define FLAG_VU_NO_OVERFLOW 0x2
|
||||
#define FLAG_VU_EXTRA_OVERFLOW 0x40
|
||||
|
||||
#define FLAG_FPU_NO_OVERFLOW 0x800
|
||||
#define FLAG_FPU_EXTRA_OVERFLOW 0x1000
|
||||
|
||||
#define FLAG_EE_2_SYNC 0x1
|
||||
#define FLAG_TIGHT_SPU_SYNC 0x4
|
||||
#define FLAG_NO_UNDERFLOW 0x8
|
||||
#define FLAG_IOP_2_SYNC 0x10
|
||||
#define FLAG_TRIPLE_SYNC 0x20
|
||||
#define FLAG_FAST_BRANCHES 0x80
|
||||
#define FLAG_NO_VU_FLAGS 0x100
|
||||
#define FLAG_NO_FPU_FLAGS 0x200
|
||||
#define FLAG_ESC 0x400
|
||||
|
||||
#define FLAG_ROUND_NEAR 0x0000
|
||||
#define FLAG_ROUND_NEGATIVE 0x2000
|
||||
#define FLAG_ROUND_POSITIVE 0x4000
|
||||
#define FLAG_ROUND_ZERO 0x6000
|
||||
|
||||
#define FLAG_FLUSH_ZERO 0x8000
|
||||
#define FLAG_DENORMAL_ZERO 0x0040
|
||||
|
||||
#endif /* __LINUX_H__ */
|
||||
|
|
|
@ -288,6 +288,11 @@ void KeyEvent(keyEvent* ev) {
|
|||
{
|
||||
if (SHIFT_EVT(ev->key))
|
||||
shift = 1;
|
||||
if (CAPS_LOCK_EVT(ev->key))
|
||||
{
|
||||
//Set up anything we want to happen while caps lock is down.
|
||||
//Config_hacks_backup = Config.Hacks;
|
||||
}
|
||||
|
||||
switch (ev->key) {
|
||||
case XK_F1: ProcessFKeys(1, shift); break;
|
||||
|
@ -327,6 +332,11 @@ void KeyEvent(keyEvent* ev) {
|
|||
{
|
||||
if (SHIFT_EVT(ev->key))
|
||||
shift = 0;
|
||||
if (CAPS_LOCK_EVT(ev->key))
|
||||
{
|
||||
//Release caps lock
|
||||
//Config_hacks_backup = Config.Hacks;
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
|
@ -43,10 +43,10 @@ char* phelpmsg =
|
|||
"\n"
|
||||
#endif
|
||||
"Load Plugins:\n"
|
||||
"\t-cdvd [dllpath] {specify the dll load path of the CDVD plugin}\n"
|
||||
"\t-gs [dllpath] {specify the dll load path of the GS plugin}\n"
|
||||
"\t-cdvd [libpath] {specify the library load path of the CDVD plugin}\n"
|
||||
"\t-gs [libpath] {specify the library load path of the GS plugin}\n"
|
||||
"-pad [tsxcal] {specify to hold down on the triangle, square, circle, x, start, select buttons}\n"
|
||||
"\t-spu [dllpath] {specify the dll load path of the SPU2 plugin}\n"
|
||||
"\t-spu [libpath] {specify the library load path of the SPU2 plugin}\n"
|
||||
"\n";
|
||||
|
||||
#endif
|
||||
|
|
|
@ -758,7 +758,7 @@ int SaveGSState(char *file)
|
|||
return 0;
|
||||
}
|
||||
|
||||
extern long pDsp;
|
||||
extern uptr pDsp;
|
||||
int LoadGSState(char *file)
|
||||
{
|
||||
int ret;
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
psxCounter psxCounters[8];
|
||||
u32 psxNextCounter, psxNextsCounter;
|
||||
static int cnts = 6;
|
||||
u8 psxhblankgate = 0;
|
||||
u8 psxvblankgate = 0;
|
||||
u8 psxcntmask = 0;
|
||||
|
@ -35,12 +34,12 @@ static void psxRcntUpd32(u32 index) {
|
|||
psxCounters[index].sCycleT = psxRegs.cycle;
|
||||
}
|
||||
|
||||
static void psxRcntReset16(u32 index) {
|
||||
psxCounters[index].count = 0;
|
||||
//static void psxRcntReset16(u32 index) {
|
||||
// psxCounters[index].count = 0;
|
||||
|
||||
psxCounters[index].mode&= ~0x18301C00;
|
||||
psxRcntUpd16(index);
|
||||
}
|
||||
// psxCounters[index].mode&= ~0x18301C00;
|
||||
// psxRcntUpd16(index);
|
||||
//}
|
||||
|
||||
static void psxRcntReset32(u32 index) {
|
||||
psxCounters[index].count = 0;
|
||||
|
|
|
@ -166,7 +166,7 @@ int psxDma7Interrupt() {
|
|||
extern int eesifbusy[2];
|
||||
void psxDma9(u32 madr, u32 bcr, u32 chcr) {
|
||||
|
||||
DMACh *dma = (DMACh*)&PS2MEM_HW[0xc000];
|
||||
//DMACh *dma = (DMACh*)&PS2MEM_HW[0xc000]; //Not used
|
||||
|
||||
#ifdef SIF_LOG
|
||||
SIF_LOG("IOP: dmaSIF0 chcr = %lx, madr = %lx, bcr = %lx, tadr = %lx\n", chcr, madr, bcr, HW_DMA9_TADR);
|
||||
|
@ -182,7 +182,7 @@ void psxDma9(u32 madr, u32 bcr, u32 chcr) {
|
|||
}
|
||||
|
||||
void psxDma10(u32 madr, u32 bcr, u32 chcr) {
|
||||
DMACh *dma = (DMACh*)&PS2MEM_HW[0xc400];
|
||||
//DMACh *dma = (DMACh*)&PS2MEM_HW[0xc400]; //Not used
|
||||
|
||||
#ifdef SIF_LOG
|
||||
SIF_LOG("IOP: dmaSIF1 chcr = %lx, madr = %lx, bcr = %lx\n", chcr, madr, bcr);
|
||||
|
|
|
@ -37,7 +37,6 @@ u32* _vifRow = NULL, *_vifCol = NULL;
|
|||
vifStruct *_vif;
|
||||
|
||||
static int n;
|
||||
static int i;
|
||||
|
||||
__inline static int _limit( int a, int max )
|
||||
{
|
||||
|
@ -484,7 +483,6 @@ __inline int mfifoVIF1chain() {
|
|||
}
|
||||
|
||||
#define spr0 ((DMACh*)&PS2MEM_HW[0xD000])
|
||||
static int tempqwc = 0;
|
||||
|
||||
void mfifoVIF1transfer(int qwc) {
|
||||
u32 *ptag;
|
||||
|
|
|
@ -1176,7 +1176,7 @@ int VIF0transfer(u32 *data, int size, int istag) {
|
|||
|
||||
int _VIF0chain() {
|
||||
u32 *pMem;
|
||||
u32 qwc = vif0ch->qwc;
|
||||
//u32 qwc = vif0ch->qwc;
|
||||
u32 ret;
|
||||
|
||||
if (vif0ch->qwc == 0 && vif0.vifstalled == 0) return 0;
|
||||
|
@ -2084,7 +2084,7 @@ int VIF1transfer(u32 *data, int size, int istag) {
|
|||
|
||||
int _VIF1chain() {
|
||||
u32 *pMem;
|
||||
u32 qwc = vif1ch->qwc;
|
||||
//u32 qwc = vif1ch->qwc;
|
||||
u32 ret;
|
||||
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="windows-1253"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
Version="9.00"
|
||||
Name="pcsx2"
|
||||
ProjectGUID="{1CEFD830-2B76-4596-A4EE-BCD7280A60BD}"
|
||||
RootNamespace="pcsx2"
|
||||
|
@ -52,6 +52,8 @@
|
|||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
WarningLevel="4"
|
||||
Detect64BitPortabilityProblems="true"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
|
@ -693,10 +695,6 @@
|
|||
RelativePath="..\..\Misc.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Misc.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Patch.c"
|
||||
>
|
||||
|
@ -756,6 +754,10 @@
|
|||
RelativePath="..\cheats\cheats.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Misc.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
<Filter
|
||||
|
|
|
@ -277,6 +277,8 @@ int _signExtendXMMtoM(u32 to, x86SSERegType from, int candestroy); // returns tr
|
|||
#define IS_PSXCONSTREG(reg) (reg>=0&&((reg)&MEM_PSXCONSTTAG))
|
||||
#define IS_MMXREG(reg) (reg>=0&&((reg)&MEM_MMXTAG))
|
||||
#define IS_XMMREG(reg) (reg>=0&&((reg)&MEM_XMMTAG))
|
||||
|
||||
// fixme - these 4 are only called for u32 registers; should the reg>=0 really be there?
|
||||
#define IS_X86REG(reg) (reg>=0&&((reg)&MEM_X86TAG))
|
||||
#define IS_GPRREG(reg) (reg>=0&&((reg)&MEM_GPRTAG))
|
||||
#define IS_CONSTREG(reg) (reg>=0&&((reg)&MEM_CONSTTAG))
|
||||
|
|
|
@ -64,6 +64,8 @@ u32 g_psxMaxRecMem = 0;
|
|||
extern char *disRNameGPR[];
|
||||
extern char* disR3000Fasm(u32 code, u32 pc);
|
||||
|
||||
u32 s_psxrecblocks[] = {0};
|
||||
|
||||
void psxRecRecompile(u32 startpc);
|
||||
|
||||
uptr *psxRecLUT;
|
||||
|
@ -79,7 +81,6 @@ uptr *psxRecLUT;
|
|||
// R3000A statics
|
||||
int psxreclog = 0;
|
||||
|
||||
static u32 s_BranchCount = 0;
|
||||
static char *recMem; // the recompiled blocks will be here
|
||||
static BASEBLOCK *recRAM; // and the ptr to the blocks here
|
||||
static BASEBLOCK *recROM; // and here
|
||||
|
@ -93,7 +94,11 @@ static u32 s_nInstCacheSize = 0;
|
|||
|
||||
static BASEBLOCK* s_pCurBlock = NULL;
|
||||
static BASEBLOCKEX* s_pCurBlockEx = NULL;
|
||||
|
||||
#if defined(_MSC_VER) && !defined(__x86_64__)
|
||||
static BASEBLOCK* s_pDispatchBlock = NULL;
|
||||
#endif
|
||||
|
||||
static u32 s_nEndBlock = 0; // what psxpc the current block ends
|
||||
|
||||
static u32 s_nNextBlock = 0; // next free block in recBlocks
|
||||
|
@ -140,6 +145,7 @@ BASEBLOCKEX* PSX_GETBLOCKEX(BASEBLOCK* p)
|
|||
}
|
||||
|
||||
////////////////////////////////////////////////////
|
||||
#ifdef _DEBUG
|
||||
static void iDumpBlock( int startpc, char * ptr )
|
||||
{
|
||||
FILE *f;
|
||||
|
@ -224,6 +230,7 @@ sprintf( filename, "dumps\\psxdump%.8X.txt", startpc);
|
|||
f = fopen( filename, "a+" );
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
u8 _psxLoadWritesRs(u32 tempcode)
|
||||
{
|
||||
|
@ -1197,6 +1204,7 @@ void iDumpPsxRegisters(u32 startpc, u32 temp)
|
|||
|
||||
void iDumpPsxRegisters(u32 startpc);
|
||||
|
||||
#ifdef _DEBUG
|
||||
static void printfn()
|
||||
{
|
||||
static int lastrec = 0;
|
||||
|
@ -1227,8 +1235,7 @@ static void printfn()
|
|||
lastrec = g_psxlastpc;
|
||||
}
|
||||
}
|
||||
|
||||
u32 s_psxrecblocks[] = {0};
|
||||
#endif
|
||||
|
||||
void psxRecRecompile(u32 startpc)
|
||||
{
|
||||
|
|
|
@ -51,9 +51,9 @@ static VURegs * const VU = (VURegs*)&VU0;
|
|||
extern u32 vudump;
|
||||
#endif
|
||||
|
||||
static u32 vuprogcount = 0;
|
||||
//static u32 vuprogcount = 0;
|
||||
|
||||
void recExecuteVU0Block( void )
|
||||
void recExecuteVU0Block( void ) // fixme - are all these comments at all useful, or can they be removed?
|
||||
{
|
||||
//SysPrintf("executeVU0 %x\n", VU0.VI[ REG_TPC ].UL);
|
||||
//QueryPerformanceCounter(&vu0base);
|
||||
|
@ -64,7 +64,7 @@ void recExecuteVU0Block( void )
|
|||
return;
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
vuprogcount++;
|
||||
//vuprogcount++;
|
||||
|
||||
// __Log("VU: %x %x\n", VU0.VI[ REG_TPC ].UL, vuprogcount);
|
||||
// iDumpVU0Registers();
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include <string.h>
|
||||
#include <float.h>
|
||||
#include <malloc.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "Common.h"
|
||||
#include "InterTables.h"
|
||||
|
@ -50,8 +51,6 @@
|
|||
u32 vu1recpcold = -1;
|
||||
u32 vu1reccountold = -1;
|
||||
|
||||
static _vuopinfo _opinfo[256];
|
||||
|
||||
//Lower/Upper instructions can use that..
|
||||
#define _Ft_ ((VU1.code >> 16) & 0x1F) // The rt part of the instruction register
|
||||
#define _Fs_ ((VU1.code >> 11) & 0x1F) // The rd part of the instruction register
|
||||
|
@ -83,8 +82,6 @@ static _vuopinfo _opinfo[256];
|
|||
#define VU1_ACCz_ADDR (uptr)&VU1.ACC.UL[2]
|
||||
#define VU1_ACCw_ADDR (uptr)&VU1.ACC.UL[3]
|
||||
|
||||
static void VU1RecompileBlock(void);
|
||||
|
||||
void recVU1Init()
|
||||
{
|
||||
SuperVUInit(1);
|
||||
|
|
|
@ -3808,13 +3808,13 @@ void recVUMI_RSQRT(VURegs *VU, int info)
|
|||
|
||||
AND32ItoR( EAX, 0x01 ); // Grab "Is Zero" bits from the previous calculation
|
||||
ajmp32 = JZ32(0); // Skip if none are
|
||||
OR32ItoM(VU_VI_ADDR(REG_STATUS_FLAG, 2), 0x820); // Zero divide flag
|
||||
OR32ItoM(VU_VI_ADDR(REG_STATUS_FLAG, 2), 0x820); // Zero divide flag
|
||||
|
||||
_unpackVFSS_xyzw(EEREC_TEMP, EEREC_S, _Fsf_);
|
||||
SSE_ANDPS_M128_to_XMM(EEREC_TEMP, (uptr)&VU_Signed_Zero_Mask[0]);
|
||||
SSE_ORPS_M128_to_XMM(EEREC_TEMP, (uptr)&g_maxvals[0]); // If division by zero, then EEREC_TEMP = positive fmax
|
||||
SSE_MOVSS_XMM_to_M32(VU_VI_ADDR(REG_Q, 0), EEREC_TEMP);
|
||||
bjmp32 = JMP32(0);
|
||||
_unpackVFSS_xyzw(EEREC_TEMP, EEREC_S, _Fsf_);
|
||||
SSE_ANDPS_M128_to_XMM(EEREC_TEMP, (uptr)&VU_Signed_Zero_Mask[0]);
|
||||
SSE_ORPS_M128_to_XMM(EEREC_TEMP, (uptr)&g_maxvals[0]); // If division by zero, then EEREC_TEMP = positive fmax
|
||||
SSE_MOVSS_XMM_to_M32(VU_VI_ADDR(REG_Q, 0), EEREC_TEMP);
|
||||
bjmp32 = JMP32(0);
|
||||
x86SetJ32(ajmp32);
|
||||
}
|
||||
|
||||
|
@ -3844,13 +3844,13 @@ void recVUMI_RSQRT(VURegs *VU, int info)
|
|||
|
||||
AND32ItoR( EAX, 0x01 ); // Grab "Is Zero" bits from the previous calculation
|
||||
ajmp32 = JZ32(0); // Skip if none are
|
||||
OR32ItoM(VU_VI_ADDR(REG_STATUS_FLAG, 2), 0x820); // Zero divide flag
|
||||
OR32ItoM(VU_VI_ADDR(REG_STATUS_FLAG, 2), 0x820); // Zero divide flag
|
||||
|
||||
_unpackVFSS_xyzw(EEREC_TEMP, EEREC_S, _Fsf_);
|
||||
SSE_ANDPS_M128_to_XMM(EEREC_TEMP, (uptr)&VU_Signed_Zero_Mask[0]);
|
||||
SSE_ORPS_M128_to_XMM(EEREC_TEMP, (uptr)&g_maxvals[0]); // If division by zero, then EEREC_TEMP = positive fmax
|
||||
SSE_MOVSS_XMM_to_M32(VU_VI_ADDR(REG_Q, 0), EEREC_TEMP);
|
||||
bjmp32 = JMP32(0);
|
||||
_unpackVFSS_xyzw(EEREC_TEMP, EEREC_S, _Fsf_);
|
||||
SSE_ANDPS_M128_to_XMM(EEREC_TEMP, (uptr)&VU_Signed_Zero_Mask[0]);
|
||||
SSE_ORPS_M128_to_XMM(EEREC_TEMP, (uptr)&g_maxvals[0]); // If division by zero, then EEREC_TEMP = positive fmax
|
||||
SSE_MOVSS_XMM_to_M32(VU_VI_ADDR(REG_Q, 0), EEREC_TEMP);
|
||||
bjmp32 = JMP32(0);
|
||||
x86SetJ32(ajmp32);
|
||||
}
|
||||
|
||||
|
|
|
@ -524,7 +524,6 @@ void SuperVUDumpBlock(list<VuBaseBlock*>& blocks, int vuindex)
|
|||
char filename[ 256 ], str[256];
|
||||
u32 *mem;
|
||||
u32 i;
|
||||
static int gid = 0;
|
||||
|
||||
#ifdef _WIN32
|
||||
CreateDirectory("dumps", NULL);
|
||||
|
@ -973,8 +972,7 @@ static VuBaseBlock* SuperVUBuildBlocks(VuBaseBlock* parent, u32 startpc, const V
|
|||
|
||||
// count inst non-dummy insts
|
||||
itinst = pblock->insts.begin();
|
||||
u32 inst = 0;
|
||||
int cycleoff = 0;
|
||||
int cycleoff = 0;
|
||||
|
||||
while(dummyinst > 0) {
|
||||
if( itinst->type & INST_DUMMY )
|
||||
|
@ -2390,7 +2388,7 @@ uptr s_vu1ebp, s_vuebx, s_vuedi, s_vu1esi;
|
|||
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
|
||||
|
||||
static u32 s_ssecsr;
|
||||
//static u32 s_ssecsr;
|
||||
static int s_JumpX86;
|
||||
static int s_ScheduleXGKICK = 0, s_XGKICKReg = -1;
|
||||
|
||||
|
@ -2605,10 +2603,14 @@ static void SuperVURecompile()
|
|||
}
|
||||
|
||||
// debug
|
||||
static u32 s_svulast = 0, s_vufnheader;
|
||||
|
||||
#ifdef _DEBUG
|
||||
extern "C" u32 s_vucount;
|
||||
u32 g_vu1lastrec = 0, skipparent = -1;
|
||||
|
||||
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__
|
||||
|
@ -2623,8 +2625,6 @@ u32 g_curdebugvu;
|
|||
#if defined(_MSC_VER) && !defined(__x86_64__)
|
||||
__declspec(naked) static void svudispfn()
|
||||
{
|
||||
static u32 i;
|
||||
|
||||
__asm {
|
||||
mov g_curdebugvu, eax
|
||||
mov s_saveecx, ecx
|
||||
|
@ -2640,7 +2640,6 @@ extern "C" void svudispfn();
|
|||
|
||||
extern "C" void svudispfntemp()
|
||||
{
|
||||
static u32 i;
|
||||
#endif
|
||||
|
||||
// VU1.VF[7].F[0] = vuDouble(VU1.VF[7].UL[0]);
|
||||
|
@ -2649,7 +2648,9 @@ extern "C" void svudispfntemp()
|
|||
// VU1.VF[7].F[3] = vuDouble(VU1.VF[7].UL[3]);
|
||||
|
||||
#ifdef _DEBUG
|
||||
if( ((vudump&8) && g_curdebugvu) || ((vudump&0x80) && !g_curdebugvu) ) { //&& g_vu1lastrec != g_vu1last ) {
|
||||
static u32 i;
|
||||
|
||||
if( ((vudump&8) && g_curdebugvu) || ((vudump&0x80) && !g_curdebugvu) ) { //&& g_vu1lastrec != g_vu1last ) {
|
||||
|
||||
if( skipparent != g_vu1lastrec ) {
|
||||
for(i = 0; i < ARRAYSIZE(badaddrs); ++i) {
|
||||
|
@ -2685,7 +2686,7 @@ extern "C" void svudispfntemp()
|
|||
#endif
|
||||
}
|
||||
|
||||
// frees an xmmreg depending on the liveness info of hte current inst
|
||||
// frees an xmmreg depending on the liveness info of the current inst
|
||||
//void SuperVUFreeXMMreg(int xmmreg, int xmmtype, int reg)
|
||||
//{
|
||||
// if( !xmmregs[xmmreg].inuse ) return;
|
||||
|
@ -3151,18 +3152,18 @@ int VuInstruction::SetCachedRegs(int upper, u32 vuxyz)
|
|||
return info;
|
||||
}
|
||||
|
||||
static void checkvucodefn(u32 curpc, u32 vuindex, u32 oldcode)
|
||||
{
|
||||
SysPrintf("vu%c code changed (old:%x, new: %x)! %x %x\n", '0'+vuindex, oldcode, s_vu?*(u32*)&VU1.Micro[curpc]:*(u32*)&VU0.Micro[curpc], curpc, cpuRegs.cycle);
|
||||
}
|
||||
//static void checkvucodefn(u32 curpc, u32 vuindex, u32 oldcode)
|
||||
//{
|
||||
// SysPrintf("vu%c code changed (old:%x, new: %x)! %x %x\n", '0'+vuindex, oldcode, s_vu?*(u32*)&VU1.Micro[curpc]:*(u32*)&VU0.Micro[curpc], curpc, cpuRegs.cycle);
|
||||
//}
|
||||
|
||||
void VuInstruction::Recompile(list<VuInstruction>::iterator& itinst, u32 vuxyz)
|
||||
{
|
||||
static PCSX2_ALIGNED16(VECTOR _VF);
|
||||
static PCSX2_ALIGNED16(VECTOR _VFc);
|
||||
static PCSX2_ALIGNED16(VECTOR _VFc);
|
||||
u32 *ptr;
|
||||
u8* pjmp;
|
||||
int vfregstore=0, viregstore=0;
|
||||
int vfregstore=0;
|
||||
|
||||
assert( s_pCurInst == this);
|
||||
s_WriteToReadQ = 0;
|
||||
|
@ -3673,7 +3674,7 @@ void VuInstruction::Recompile(list<VuInstruction>::iterator& itinst, u32 vuxyz)
|
|||
#endif
|
||||
|
||||
// check if inst before branch and the write is the same as the read in the branch (wipeout)
|
||||
int oldreg=0;
|
||||
// int oldreg=0;
|
||||
// if( pc == s_pCurBlock->endpc-16 ) {
|
||||
// itinst2 = itinst; ++itinst2;
|
||||
// if( itinst2->regs[0].pipe == VUPIPE_BRANCH && (itinst->regs[0].VIwrite&itinst2->regs[0].VIread) ) {
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <malloc.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "Common.h"
|
||||
#include "Memory.h"
|
||||
|
@ -2768,9 +2769,8 @@ extern u32 psxdump;
|
|||
static void printfn()
|
||||
{
|
||||
static int lastrec = 0;
|
||||
static int curcount = 0, count2 = 0;
|
||||
static int curcount = 0;
|
||||
const int skip = 0;
|
||||
static int i;
|
||||
|
||||
assert( !g_globalMMXSaved );
|
||||
assert( !g_globalXMMSaved );
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <malloc.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "Common.h"
|
||||
#include "Memory.h"
|
||||
|
@ -79,7 +80,7 @@ u32 g_EEFreezeRegs = 0; // if set, should freeze the regs
|
|||
|
||||
static BASEBLOCK* s_pCurBlock = NULL;
|
||||
static BASEBLOCKEX* s_pCurBlockEx = NULL;
|
||||
static BASEBLOCK* s_pDispatchBlock = NULL;
|
||||
//static BASEBLOCK* s_pDispatchBlock = NULL;
|
||||
static u32 s_nEndBlock = 0; // what pc the current block ends
|
||||
static u32 s_nHasDelay = 0;
|
||||
|
||||
|
@ -1965,7 +1966,7 @@ static void checkcodefn()
|
|||
{
|
||||
int pctemp;
|
||||
|
||||
__asm__("movl %%eax, %0" : "=m"(pctemp) );
|
||||
__asm__("movl %%eax, %0" : "=m"(pctemp) );
|
||||
|
||||
SysPrintf("code changed! %x\n", pctemp);
|
||||
assert(0);
|
||||
|
@ -2233,9 +2234,8 @@ extern u32 psxdump;
|
|||
static void printfn()
|
||||
{
|
||||
static int lastrec = 0;
|
||||
static int curcount = 0, count2 = 0;
|
||||
static int curcount = 0;
|
||||
const int skip = 0;
|
||||
static int i;
|
||||
|
||||
assert( !g_globalXMMSaved );
|
||||
|
||||
|
|
|
@ -75,8 +75,6 @@ void recADDIU( void )
|
|||
|
||||
////////////////////////////////////////////////////
|
||||
void recDADDI( void ) {
|
||||
int rsreg;
|
||||
int rtreg;
|
||||
|
||||
if (!_Rt_) return;
|
||||
|
||||
|
|
|
@ -152,11 +152,6 @@ void tests() {
|
|||
|
||||
////////////////////////////////////////////////////
|
||||
void recLW( void ) {
|
||||
int rsreg;
|
||||
int rtreg;
|
||||
int t0reg;
|
||||
int t1reg;
|
||||
int t2reg;
|
||||
|
||||
iFlushCall(FLUSH_EVERYTHING);
|
||||
|
||||
|
|
|
@ -73,7 +73,6 @@ REC_FUNC( MTLO1, 0 );
|
|||
|
||||
////////////////////////////////////////////////////
|
||||
void recLUI( void ) {
|
||||
int rtreg;
|
||||
|
||||
if (!_Rt_) return;
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include <stdio.h>
|
||||
|
||||
#include "ix86.h"
|
||||
#include "Misc.h"
|
||||
|
||||
#if defined (_MSC_VER) && _MSC_VER >= 1400
|
||||
|
||||
|
|
Loading…
Reference in New Issue