Merged some stable bugfixes from r543->548 into rc_0.9.6.

git-svn-id: http://pcsx2.googlecode.com/svn/branches/rc_0.9.6@549 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2009-02-20 09:27:12 +00:00
parent 46944ebde2
commit e714c7a982
10 changed files with 61 additions and 50 deletions

View File

@ -195,10 +195,6 @@ s32 gsOpen()
{
if( m_gsOpened ) return 0;
// mtgs overrides these as necessary...
GSsetBaseMem( PS2MEM_GS );
GSirqCallback( gsIrq );
//video
// Only bind the gsIrq if we're not running the MTGS.
// The MTGS simulates its own gsIrq in order to maintain proper sync.
@ -209,6 +205,9 @@ s32 gsOpen()
// MTGS failed to init or is disabled. Try the GS instead!
// ... and set the memptr again just in case (for switching between GS/MTGS on the fly)
GSsetBaseMem( PS2MEM_GS );
GSirqCallback( gsIrq );
m_gsOpened = !GSopen((void *)&pDsp, "PCSX2", 0);
}
@ -769,16 +768,7 @@ void gsPostVsyncEnd( bool updategs )
*(u32*)(PS2MEM_GS+0x1000) ^= 0x2000; // swap the vsync field
if( mtgsThread != NULL )
{
mtgsThread->SendSimplePacket( GS_RINGTYPE_VSYNC,
(*(u32*)(PS2MEM_GS+0x1000)&0x2000), updategs, 0);
// No need to freeze MMX/XMM registers here since this
// code is always called from the context of a BranchTest.
mtgsThread->SetEvent();
}
else
{
mtgsThread->PostVsyncEnd( updategs ); else {
GSvsync((*(u32*)(PS2MEM_GS+0x1000)&0x2000));
// update here on single thread mode *OBSOLETE*

View File

@ -188,7 +188,7 @@ protected:
SafeAlignedArray<u128,16> m_RingBuffer;
// mtgs needs its own memory space separate from the PS2. The PS2 memory is in
// synch with the EE while this stays in sync with the GS (ie, it lags behind)
// sync with the EE while this stays in sync with the GS (ie, it lags behind)
u8* const m_gsMem;
public:
@ -216,6 +216,8 @@ public:
void Freeze( SaveState& state );
void SetEvent();
void PostVsyncEnd( bool updategs );
uptr FnPtr_SimplePacket() const
{
#ifndef __LINUX__

View File

@ -62,6 +62,10 @@ using namespace std; // for min / max
#define IPU_DMA_FIREINT1 64
#define IPU_DMA_VIFSTALL 128
// FIXME - g_nIPU0Data and Pointer are not saved in the savestate, which breaks savestates for some
// FMVs at random (if they get saved during the half frame of a 30fps rate). The fix is complicated
// since coroutine is such a pita. (air)
static int g_nDMATransfer = 0;
int g_nIPU0Data = 0; // data left to transfer
u8* g_pIPU0Pointer = NULL;
@ -165,7 +169,12 @@ void ipuShutdown()
void SaveState::ipuFreeze() {
IPUProcessInterrupt();
FreezeMem(ipuRegs, sizeof(IPUregisters));
if( GetVersion() < 0x14 )
{
// old versions saved the IPU regs, but they're already saved as part of HW!
FreezeMem(ipuRegs, sizeof(IPUregisters));
}
Freeze(g_nDMATransfer);
Freeze(FIreadpos);
Freeze(FIwritepos);
@ -1574,7 +1583,7 @@ int IPU1dma()
}
int FIFOfrom_write(u32 *value,int size)
int FIFOfrom_write(const u32 *value,int size)
{
int transsize;
int firsttrans;

View File

@ -256,7 +256,7 @@ extern u8 __fastcall getBits8(u8 *address, u32 advance);
extern int __fastcall getBits(u8 *address, u32 size, u32 advance);
// returns number of qw read
int FIFOfrom_write(u32 * value, int size);
int FIFOfrom_write(const u32 * value, int size);
void FIFOfrom_read(void *value,int size);
int FIFOto_read(void *value);
int FIFOto_write(u32* pMem, int size);

View File

@ -436,6 +436,16 @@ __forceinline u32 mtgsThreadObject::_gifTransferDummy( GIF_PATH pathidx, const u
return size;
}
void mtgsThreadObject::PostVsyncEnd( bool updategs )
{
SendSimplePacket( GS_RINGTYPE_VSYNC,
(*(u32*)(PS2MEM_GS+0x1000)&0x2000), updategs, 0);
// No need to freeze MMX/XMM registers here since this
// code is always called from the context of a BranchTest.
SetEvent();
}
struct PacketTagType
{
u32 command;
@ -448,6 +458,7 @@ int mtgsThreadObject::Callback()
memcpy_aligned( m_gsMem, PS2MEM_GS, sizeof(m_gsMem) );
GSsetBaseMem( m_gsMem );
GSirqCallback( NULL );
m_returncode = GSopen((void *)&pDsp, "PCSX2", 1);
@ -534,7 +545,6 @@ int mtgsThreadObject::Callback()
case GS_RINGTYPE_VSYNC:
{
GSvsync(tag.data[0]);
gsFrameSkip( !tag.data[1] );
if( PAD1update != NULL ) PAD1update(0);

View File

@ -1338,15 +1338,21 @@ void vif0Reset() {
void SaveState::vif0Freeze()
{
// Dunno if this one is needed, but whatever, it's small. :)
Freeze( g_vifCycles );
if( GetVersion() >= 0x14 )
Freeze( g_vifCycles );
Freeze( vif0 );
if( GetVersion() >= 0x14 )
{
Freeze( g_vif1HasMask3 );
Freeze( g_vif1Masks );
Freeze( g_vifRow1 );
Freeze( g_vifCol1 );
Freeze( g_vif0HasMask3 );
Freeze( g_vif0Masks );
Freeze( g_vifRow0 );
Freeze( g_vifCol0 );
}
else if( IsLoading() )
{
// Hack to "help" old savestates recover...
SetNewMask(g_vif0Masks, g_vif0HasMask3, vif0Regs->mask, ~vif0Regs->mask);
}
}
@ -2264,9 +2270,9 @@ void SaveState::vif1Freeze()
Freeze( g_vifRow1 );
Freeze( g_vifCol1 );
}
/*if( IsLoading() ){
else if( IsLoading() )
{
SetNewMask(g_vif1Masks, g_vif1HasMask3, vif1Regs->mask, ~vif1Regs->mask);
if(vif1ch->chcr & 0x100)vif1.done = 0;
}*/
//if(vif1ch->chcr & 0x100) vif1.done = 0;
}
}

View File

@ -32,12 +32,12 @@ LRESULT WINAPI AboutDlgProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
switch(uMsg)
{
case WM_INITDIALOG:
hBMP = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(SPLASH_LOGO));
//hBMP = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(SPLASH_LOGO));
hSilverBMP = LoadBitmap(GetModuleHandle(NULL), MAKEINTRESOURCE(IDB_PS2SILVER));
hW = CreateWindow("STATIC", "", WS_VISIBLE | WS_CHILD | SS_BITMAP,
/*hW = CreateWindow("STATIC", "", WS_VISIBLE | WS_CHILD | SS_BITMAP,
230, 10, 211, 110, hDlg, (HMENU)IDC_STATIC, GetModuleHandle(NULL), NULL);
SendMessage(hW, STM_SETIMAGE, (WPARAM)IMAGE_BITMAP, (LPARAM)hBMP);
SendMessage(hW, STM_SETIMAGE, (WPARAM)IMAGE_BITMAP, (LPARAM)hBMP);*/
SetWindowText(hDlg, _("About PCSX2"));

View File

@ -8,6 +8,7 @@
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxresmw.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
@ -1074,18 +1075,19 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
// Dialog
//
ABOUT_DIALOG DIALOGEX 0, 0, 431, 302
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
ABOUT_DIALOG DIALOGEX 0, 0, 431, 294
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_ACCEPTFILES
CAPTION "About PCSX2"
FONT 8, "Microsoft Sans Serif", 400, 0, 0x0
FONT 8, "MS Shell Dlg", 400, 0, 0x0
BEGIN
DEFPUSHBUTTON "OK",IDOK,205,282,50,14
DEFPUSHBUTTON "OK",IDOK,205,273,50,14
CTEXT "PCSX2, a PS2 Emulator...",IDC_PCSX_ABOUT_AUTHORS,9,10,135,127,0,WS_EX_TRANSPARENT
CTEXT "Greets to...",IDC_PCSX_ABOUT_GREETS,89,182,311,77
GROUPBOX "",IDC_STATIC,5,3,145,138
GROUPBOX "",IDC_STATIC,77,173,333,91
CONTROL 132,IDC_PS2SILVER_RECT,"Static",SS_BITMAP,2,183,70,74
CTEXT "Greets to...",IDC_PCSX_ABOUT_GREETS,94,178,319,77
GROUPBOX "",IDC_STATIC,5,3,145,141
GROUPBOX "",IDC_STATIC,87,169,333,91
CONTROL 132,IDC_PS2SILVER_RECT,"Static",SS_BITMAP | SS_SUNKEN,10,179,71,75
CONTROL 113,IDC_STATIC,"Static",SS_BITMAP,162,7,259,137,WS_EX_CLIENTEDGE
END
IDD_HACKS DIALOGEX 0, 0, 335, 263
@ -1129,7 +1131,7 @@ BEGIN
ABOUT_DIALOG, DIALOG
BEGIN
RIGHTMARGIN, 429
BOTTOMMARGIN, 296
BOTTOMMARGIN, 288
END
IDD_HACKS, DIALOG

View File

@ -875,8 +875,7 @@ void recC_LT_xmm(int info)
break;
case (PROCESS_EE_S|PROCESS_EE_T):
// Makes NaNs and +Infinity be +maximum; -Infinity stays
// the same, but this is okay for a Compare operation.
// Note: This fixes a crash in Rule of Rose.
// the same, but this is okay for a Compare operation. // Note: This fixes a crash in Rule of Rose.
SSE_MINSS_M32_to_XMM(EEREC_S, (uptr)&g_maxvals[0]);
SSE_MINSS_M32_to_XMM(EEREC_T, (uptr)&g_maxvals[0]);
SSE_UCOMISS_XMM_to_XMM(EEREC_S, EEREC_T);

View File

@ -1285,7 +1285,6 @@ void recVUMI_FSEQ( VURegs *VU, int info )
CMP16ItoR(EAX, imm);
SETE8R(ftreg);
AND32ItoR(ftreg, 0x1);
}
//------------------------------------------------------------------
@ -1349,10 +1348,9 @@ void recVUMI_FMAND( VURegs *VU, int info )
if( fsreg >= 0 ) {
if( ftreg != fsreg ) MOV32RtoR(ftreg, fsreg);
}
else MOV16MtoR(ftreg, VU_VI_ADDR(_Fs_, 1));
else MOVZX32M16toR(ftreg, VU_VI_ADDR(_Fs_, 1));
AND16MtoR( ftreg, VU_VI_ADDR(REG_MAC_FLAG, 1));
//MOVZX32R16toR(ftreg, ftreg);
}
//------------------------------------------------------------------
@ -1382,7 +1380,6 @@ void recVUMI_FMEQ( VURegs *VU, int info )
CMP16MtoR(fsreg, VU_VI_ADDR(REG_MAC_FLAG, 1));
SETE8R(ftreg);
}
AND32ItoR(ftreg, 0x1);
}
//------------------------------------------------------------------
@ -1430,7 +1427,6 @@ void recVUMI_FCAND( VURegs *VU, int info )
AND32ItoR( EAX, VU->code & 0xFFFFFF );
SETNZ8R(ftreg);
AND32ItoR(ftreg, 0x1);
}
//------------------------------------------------------------------
@ -1448,7 +1444,6 @@ void recVUMI_FCEQ( VURegs *VU, int info )
CMP32ItoR( EAX, VU->code&0xffffff );
SETE8R(ftreg);
AND32ItoR(ftreg, 0x1);
}
//------------------------------------------------------------------
@ -1470,8 +1465,6 @@ void recVUMI_FCOR( VURegs *VU, int info )
SETNZ8R(ftreg);
else
SETZ8R(ftreg);
AND32ItoR(ftreg, 0x1);
}
//------------------------------------------------------------------