some of the files i committed had old data; reverted a few files, and fixed others to include the data i was missing.

git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@7 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
cottonvibes 2008-08-12 08:50:07 +00:00 committed by Gregory Hainaut
parent 4b69e809e5
commit dabe75ff69
7 changed files with 42 additions and 46 deletions

View File

@ -5,15 +5,15 @@
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <string.h> #include <string.h>
@ -31,9 +31,7 @@ extern u8 psxhblankgate;
int hblankend = 0; int hblankend = 0;
Counter counters[6]; Counter counters[6];
u32 nextCounter, nextsCounter; u32 nextCounter, nextsCounter;
static void (*s_prevExecuteVU0Block)() = NULL;
static void (*s_prevExecuteVU1Block)() = NULL; static void (*s_prevExecuteVU1Block)() = NULL;
LARGE_INTEGER lfreq; LARGE_INTEGER lfreq;
// its so it doesnt keep triggering an interrupt once its reached its target // its so it doesnt keep triggering an interrupt once its reached its target
@ -128,9 +126,7 @@ void rcntInit() {
rcntSet(); rcntSet();
assert(Cpu != NULL && Cpu->ExecuteVU1Block != NULL ); assert(Cpu != NULL && Cpu->ExecuteVU1Block != NULL );
s_prevExecuteVU0Block = Cpu->ExecuteVU0Block;
s_prevExecuteVU1Block = Cpu->ExecuteVU1Block; s_prevExecuteVU1Block = Cpu->ExecuteVU1Block;
} }
// debug code, used for stats // debug code, used for stats
@ -166,7 +162,6 @@ u64 GetCPUTicks()
#endif #endif
} }
void UpdateVSyncRate() { void UpdateVSyncRate() {
if (Config.PsxType & 1) { if (Config.PsxType & 1) {
SysPrintf("PAL\n"); SysPrintf("PAL\n");
@ -250,11 +245,8 @@ void VSync()
// swap the vsync field // swap the vsync field
u32 newfield = (*(u32*)(PS2MEM_GS+0x1000)&0x2000) ? 0 : 0x2000; u32 newfield = (*(u32*)(PS2MEM_GS+0x1000)&0x2000) ? 0 : 0x2000;
*(u32*)(PS2MEM_GS+0x1000) = (*(u32*)(PS2MEM_GS+0x1000) & ~(1<<13)) | newfield; *(u32*)(PS2MEM_GS+0x1000) = (*(u32*)(PS2MEM_GS+0x1000) & ~(1<<13)) | newfield;
iFrame++; iFrame++;
// wait until GS stops // wait until GS stops
if( CHECK_MULTIGS ) { if( CHECK_MULTIGS ) {
GSRingBufSimplePacket(GS_RINGTYPE_VSYNC, newfield, 0, 0); GSRingBufSimplePacket(GS_RINGTYPE_VSYNC, newfield, 0, 0);
@ -310,10 +302,7 @@ void VSync()
if( CHECK_MULTIGS ) GSRingBufSimplePacket(GS_RINGTYPE_FRAMESKIP, 1, 0, 0); if( CHECK_MULTIGS ) GSRingBufSimplePacket(GS_RINGTYPE_FRAMESKIP, 1, 0, 0);
else GSsetFrameSkip(1); else GSsetFrameSkip(1);
if( CHECK_FRAMELIMIT == PCSX2_FRAMELIMIT_VUSKIP ) if( CHECK_FRAMELIMIT == PCSX2_FRAMELIMIT_VUSKIP )
{
Cpu->ExecuteVU1Block = DummyExecuteVU1Block; Cpu->ExecuteVU1Block = DummyExecuteVU1Block;
//Cpu->ExecuteVU0Block = NULL;
}
bOkayToSkip = noSkipFrames; bOkayToSkip = noSkipFrames;
bKeepSkipping = yesSkipFrames; bKeepSkipping = yesSkipFrames;
} }
@ -322,11 +311,8 @@ void VSync()
{ {
if (bKeepSkipping <= 1) { if (bKeepSkipping <= 1) {
//first set VU1 to enabled THEN unfreeze GS regs //first set VU1 to enabled THEN unfreeze GS regs
if( CHECK_FRAMELIMIT == PCSX2_FRAMELIMIT_VUSKIP ) if( CHECK_FRAMELIMIT == PCSX2_FRAMELIMIT_VUSKIP )
{
Cpu->ExecuteVU1Block = s_prevExecuteVU1Block; Cpu->ExecuteVU1Block = s_prevExecuteVU1Block;
//Cpu->ExecuteVU0Block = s_prevExecuteVU0Block;
}
if( CHECK_MULTIGS ) GSRingBufSimplePacket(GS_RINGTYPE_FRAMESKIP, 0, 0, 0); if( CHECK_MULTIGS ) GSRingBufSimplePacket(GS_RINGTYPE_FRAMESKIP, 0, 0, 0);
else GSsetFrameSkip(0); else GSsetFrameSkip(0);
bOkayToSkip--; bOkayToSkip--;
@ -627,11 +613,15 @@ void rcntWmode(int index, u32 value)
} }
//if(change != 0) SysPrintf("Weee\n"); //if(change != 0) SysPrintf("Weee\n");
//counters[index].sCycleT = cpuRegs.cycle - ((cpuRegs.cycle - counters[index].sCycleT) % counters[index].rate); //counters[index].sCycleT = cpuRegs.cycle - ((cpuRegs.cycle - counters[index].sCycleT) % counters[index].rate);
#ifdef PCSX2_DEVBUILD
if(!(value & 0x80)) SysPrintf("Stopping\n"); if(!(value & 0x80)) SysPrintf("Stopping\n");
#endif
} }
else { else {
#ifdef PCSX2_DEVBUILD
SysPrintf("Counter %d not running c%x s%x c%x\n", index, counters[index].count, counters[index].sCycleT, cpuRegs.cycle); SysPrintf("Counter %d not running c%x s%x c%x\n", index, counters[index].count, counters[index].sCycleT, cpuRegs.cycle);
if(value & 0x80) SysPrintf("Starting %d, v%x\n", index, value); if(value & 0x80) SysPrintf("Starting %d, v%x\n", index, value);
#endif
counters[index].sCycleT = cpuRegs.cycle; counters[index].sCycleT = cpuRegs.cycle;
} }
//if((value & 0x80) && !(counters[index].mode & 0x80)) rcntUpd(index); //Counter wasnt started, so set the start cycle //if((value & 0x80) && !(counters[index].mode & 0x80)) rcntUpd(index); //Counter wasnt started, so set the start cycle

View File

@ -1,19 +1,19 @@
/* Pcsx2 - Pc Ps2 Emulator /* Pcsx2 - Pc Ps2 Emulator
* Copyright (C) 2002-2003 Pcsx2 Team * Copyright (C) 2002-2008 Pcsx2 Team
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <stdio.h> #include <stdio.h>
@ -40,6 +40,8 @@
#include "Cache.h" #include "Cache.h"
#include "Paths.h"
u32 dwSaveVersion = 0x7a300010; u32 dwSaveVersion = 0x7a300010;
u32 dwCurSaveStateVer = 0; u32 dwCurSaveStateVer = 0;
extern u32 s_iLastCOP0Cycle; extern u32 s_iLastCOP0Cycle;
@ -434,6 +436,7 @@ int Load(char *ExePath) {
} }
*/ */
FILE *emuLog; FILE *emuLog;
#ifdef PCSX2_DEVBUILD #ifdef PCSX2_DEVBUILD
@ -579,8 +582,8 @@ int SaveState(char *file) {
SysPrintf("Saving GS\n"); SysPrintf("Saving GS\n");
if( CHECK_MULTIGS ) { if( CHECK_MULTIGS ) {
// have to call in thread, otherwise weird stuff will start happening // have to call in thread, otherwise weird stuff will start happening
uptr uf = (uptr)f; u64 uf = (uptr)f;
GSRingBufSimplePacket(GS_RINGTYPE_SAVE, (int)(uf&0xffffffff), (int)(uf>>32), 0); GSRingBufSimplePacket(GS_RINGTYPE_SAVE, (u32)(uf&0xffffffff), (u32)(uf>>32), 0);
gsWaitGS(); gsWaitGS();
} }
else { else {
@ -711,8 +714,8 @@ int LoadState(char *file) {
SysPrintf("Loading GS\n"); SysPrintf("Loading GS\n");
if( CHECK_MULTIGS ) { if( CHECK_MULTIGS ) {
// have to call in thread, otherwise weird stuff will start happening // have to call in thread, otherwise weird stuff will start happening
uptr uf = (uptr)f; u64 uf = (uptr)f;
GSRingBufSimplePacket(GS_RINGTYPE_LOAD, (int)(uf&0xffffffff), (int)(uf>>32), 0); GSRingBufSimplePacket(GS_RINGTYPE_LOAD, (u32)(uf&0xffffffff), (u32)(uf>>32), 0);
gsWaitGS(); gsWaitGS();
} }
else { else {
@ -755,7 +758,7 @@ int SaveGSState(char *file)
return 0; return 0;
} }
extern long pDsp; extern HWND pDsp;
int LoadGSState(char *file) int LoadGSState(char *file)
{ {
int ret; int ret;
@ -766,7 +769,7 @@ int LoadGSState(char *file)
f = gzopen(file, "rb"); f = gzopen(file, "rb");
if (f == NULL) { if (f == NULL) {
sprintf(strfile, "sstates/%s", file); sprintf(strfile, SSTATES_DIR "/%s", file);
// try prefixing with sstates // try prefixing with sstates
f = gzopen(strfile, "rb"); f = gzopen(strfile, "rb");
if( f == NULL ) { if( f == NULL ) {
@ -892,7 +895,7 @@ void ProcessFKeys(int fkey, int shift)
assert(fkey >= 1 && fkey <= 12 ); assert(fkey >= 1 && fkey <= 12 );
switch(fkey) { switch(fkey) {
case 1: case 1:
sprintf(Text, "sstates/%8.8X.%3.3d", ElfCRC, StatesC); sprintf(Text, SSTATES_DIR "/%8.8X.%3.3d", ElfCRC, StatesC);
ret = SaveState(Text); ret = SaveState(Text);
break; break;
case 2: case 2:
@ -902,12 +905,12 @@ void ProcessFKeys(int fkey, int shift)
StatesC = (StatesC+1)%NUM_STATES; StatesC = (StatesC+1)%NUM_STATES;
SysPrintf("*PCSX2*: Selected State %ld\n", StatesC); SysPrintf("*PCSX2*: Selected State %ld\n", StatesC);
if( GSchangeSaveState != NULL ) { if( GSchangeSaveState != NULL ) {
sprintf(Text, "sstates/%8.8X.%3.3d", ElfCRC, StatesC); sprintf(Text, SSTATES_DIR "/%8.8X.%3.3d", ElfCRC, StatesC);
GSchangeSaveState(StatesC, Text); GSchangeSaveState(StatesC, Text);
} }
break; break;
case 3: case 3:
sprintf (Text, "sstates/%8.8X.%3.3d", ElfCRC, StatesC); sprintf (Text, SSTATES_DIR "/%8.8X.%3.3d", ElfCRC, StatesC);
ret = LoadState(Text); ret = LoadState(Text);
break; break;
@ -994,10 +997,10 @@ void ProcessFKeys(int fkey, int shift)
tok = strtok(NULL, " "); tok = strtok(NULL, " ");
if( tok != NULL ) strcat(name, tok); if( tok != NULL ) strcat(name, tok);
sprintf(Text, "sstates/%s.%d.gs", name, StatesC); sprintf(Text, SSTATES_DIR "/%s.%d.gs", name, StatesC);
} }
else else
sprintf(Text, "sstates/%8.8X.%d.gs", ElfCRC, StatesC); sprintf(Text, SSTATES_DIR "/%8.8X.%d.gs", ElfCRC, StatesC);
SaveGSState(Text); SaveGSState(Text);
} }

View File

@ -13,7 +13,7 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#ifndef __MISC_H__ #ifndef __MISC_H__

View File

@ -1,19 +1,19 @@
/* Pcsx2 - Pc Ps2 Emulator /* Pcsx2 - Pc Ps2 Emulator
* Copyright (C) 2002-2004 Pcsx2 Team * Copyright (C) 2002-2008 Pcsx2 Team
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include <windows.h> #include <windows.h>
@ -112,6 +112,7 @@ BOOL CALLBACK CpuDlgProc(HWND hW, UINT uMsg, WPARAM wParam, LPARAM lParam)
// ShowWindow(GetDlgItem(hW, IDC_CPU_VU1REC), SW_HIDE); // ShowWindow(GetDlgItem(hW, IDC_CPU_VU1REC), SW_HIDE);
//#endif //#endif
CheckDlgButton(hW, IDC_CPU_GSMULTI, !!CHECK_MULTIGS); CheckDlgButton(hW, IDC_CPU_GSMULTI, !!CHECK_MULTIGS);
CheckDlgButton(hW, IDC_CPU_MULTI, !!CHECK_DUALCORE); CheckDlgButton(hW, IDC_CPU_MULTI, !!CHECK_DUALCORE);

View File

@ -13,7 +13,7 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#define WINVER 0x0500 #define WINVER 0x0500
@ -49,6 +49,8 @@
#include "cheats/cheats.h" #include "cheats/cheats.h"
#include "../Paths.h"
#define COMPILEDATE __DATE__ #define COMPILEDATE __DATE__
static int efile; static int efile;
@ -1367,8 +1369,8 @@ void ChangeLanguage(char *lang) {
static int sinit=0; static int sinit=0;
int SysInit() { int SysInit() {
CreateDirectory("memcards", NULL); CreateDirectory(MEMCARDS_DIR, NULL);
CreateDirectory("sstates", NULL); CreateDirectory(SSTATES_DIR, NULL);
#ifdef EMU_LOG #ifdef EMU_LOG
CreateDirectory("logs", NULL); CreateDirectory("logs", NULL);
@ -1380,7 +1382,7 @@ int SysInit() {
#endif #endif
if( emuLog != NULL ) if( emuLog != NULL )
setvbuf(emuLog, NULL, _IONBF, 0); emuLog = fopen(LOGS_DIR "\\emuLog.txt","w");
#endif #endif
if (cpuInit() == -1) return -1; if (cpuInit() == -1) return -1;

View File

@ -1,5 +1,5 @@
/* Pcsx2 - Pc Ps2 Emulator /* Pcsx2 - Pc Ps2 Emulator
* Copyright (C) 2002-2005 Pcsx2 Team * Copyright (C) 2002-2008 Pcsx2 Team
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -13,7 +13,7 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
// recompiler reworked to add dynamic linking Jan06 // recompiler reworked to add dynamic linking Jan06

View File

@ -1,5 +1,5 @@
/* Pcsx2 - Pc Ps2 Emulator /* Pcsx2 - Pc Ps2 Emulator
* Copyright (C) 2002-2005 Pcsx2 Team * Copyright (C) 2002-2008 Pcsx2 Team
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -13,7 +13,7 @@
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
// recompiler reworked to add dynamic linking zerofrog(@gmail.com) Jan06 // recompiler reworked to add dynamic linking zerofrog(@gmail.com) Jan06