GSnull: A bit more work on the gif transfers.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1186 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
arcum42 2009-05-15 01:57:00 +00:00
parent c671bba45a
commit fde4685f77
5 changed files with 67 additions and 8 deletions

View File

@ -27,6 +27,7 @@
using namespace std;
#include "GS.h"
#ifdef __LINUX__
Display *display;
int screen;
@ -174,14 +175,17 @@ EXPORT_C_(void) GSvsync(int field)
EXPORT_C_(void) GSgifTransfer1(u32 *pMem, u32 addr)
{
_GSgifTransfer1(pMem, addr);
}
EXPORT_C_(void) GSgifTransfer2(u32 *pMem, u32 size)
{
_GSgifTransfer2(pMem, size);
}
EXPORT_C_(void) GSgifTransfer3(u32 *pMem, u32 size)
{
_GSgifTransfer3(pMem, size);
}
// returns the last tag processed (64 bits)

View File

@ -44,6 +44,8 @@ extern "C"
}
#endif
#include "GifTransfer.h"
/*#ifdef _MSC_VER
#define EXPORT_C_(type) extern "C" __declspec(dllexport) type CALLBACK
#else

View File

@ -26,30 +26,39 @@
using namespace std;
u32 CSRw;
GIFPath m_path[3];
bool Path3transfer;
PCSX2_ALIGNED16( u8 g_RealGSMem[0x2000] );
#define GSCSRr *((u64*)(g_RealGSMem+0x1000))
#define GSIMR *((u32*)(g_RealGSMem+0x1010))
#define GSSIGLBLID ((GSRegSIGBLID*)(g_RealGSMem+0x1080))
static void RegHandlerSIGNAL(const u32* data)
{
//MTGS_LOG("MTGS SIGNAL data %x_%x CSRw %x\n",data[0], data[1], CSRw);
//GSSIGLBLID->SIGID = (GSSIGLBLID->SIGID&~data[1])|(data[0]&data[1]);
GSSIGLBLID->SIGID = (GSSIGLBLID->SIGID&~data[1])|(data[0]&data[1]);
//if ((CSRw & 0x1)) GSCSRr |= 1; // signal
if ((CSRw & 0x1)) GSCSRr |= 1; // signal
//if (!(GSIMR&0x100) ) gsIrq();
if (!(GSIMR & 0x100) ) GSirq();
}
static void RegHandlerFINISH(const u32* data)
{
//MTGS_LOG("MTGS FINISH data %x_%x CSRw %x\n",data[0], data[1], CSRw);
//if ((CSRw & 0x2)) GSCSRr |= 2; // finish
if ((CSRw & 0x2)) GSCSRr |= 2; // finish
//if (!(GSIMR&0x200) ) gsIrq();
if (!(GSIMR & 0x200) ) GSirq();
}
static void RegHandlerLABEL(const u32* data)
{
//GSSIGLBLID->LBLID = (GSSIGLBLID->LBLID&~data[1])|(data[0]&data[1]);
GSSIGLBLID->LBLID = (GSSIGLBLID->LBLID&~data[1])|(data[0]&data[1]);
}
typedef void (*GIFRegHandler)(const u32* data);
@ -237,3 +246,30 @@ __forceinline u32 _gifTransfer( GIF_PATH pathidx, const u8* pMem, u32 size )
}
return size;
}
// This currently segfaults in the beginning of KH1 if defined.
//#define DO_GIF_TRANSFERS
void _GSgifTransfer1(u32 *pMem, u32 addr)
{
#ifdef DO_GIF_TRANSFERS
/* This needs looking at, since I quickly grabbed it from ZeroGS. */
addr &= 0x3fff;
_gifTransfer( GIF_PATH_1, ((u8*)pMem+(u8)addr), (0x4000-addr)/16);
#endif
}
void _GSgifTransfer2(u32 *pMem, u32 size)
{
#ifdef DO_GIF_TRANSFERS
_gifTransfer( GIF_PATH_2, (u8*)pMem, size);
#endif
}
void _GSgifTransfer3(u32 *pMem, u32 size)
{
#ifdef DO_GIF_TRANSFERS
_gifTransfer( GIF_PATH_3, (u8*)pMem, size);
#endif
}

View File

@ -16,6 +16,9 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __GIF_TRANSFER_H__
#define __GIF_TRANSFER_H__
#include <assert.h>
#include <algorithm>
@ -84,5 +87,11 @@ struct GIFPath
u32 GetReg();
};
GIFPath m_path[3];
bool Path3transfer;
extern GIFPath m_path[3];
extern bool Path3transfer;
extern void _GSgifTransfer1(u32 *pMem, u32 addr);
extern void _GSgifTransfer2(u32 *pMem, u32 size);
extern void _GSgifTransfer3(u32 *pMem, u32 size);
#endif

View File

@ -164,6 +164,10 @@
RelativePath="..\GS.cpp"
>
</File>
<File
RelativePath="..\GifTransfer.cpp"
>
</File>
<File
RelativePath=".\Win32.cpp"
>
@ -177,6 +181,10 @@
RelativePath="..\GS.h"
>
</File>
<File
RelativePath="..\GifTransfer.h"
>
</File>
<File
RelativePath=".\resource.h"
>