mirror of https://github.com/PCSX2/pcsx2.git
Whoops missed a file. Another small refactoring too.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2577 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
822e2a8166
commit
6730abd967
|
@ -224,14 +224,20 @@ void psxDma10(u32 madr, u32 bcr, u32 chcr)
|
||||||
// Local Declarations
|
// Local Declarations
|
||||||
|
|
||||||
// in IopSio2.cpp
|
// in IopSio2.cpp
|
||||||
extern s32 CALLBACK sio2DmaRead(s32 channel, u32* data, u32 bytesLeft, u32* bytesProcessed);
|
extern s32 CALLBACK sio2DmaStart(s32 channel, u32 madr, u32 bcr, u32 chcr);
|
||||||
extern s32 CALLBACK sio2DmaWrite(s32 channel, u32* data, u32 bytesLeft, u32* bytesProcessed);
|
extern s32 CALLBACK sio2DmaRead(s32 channel, u32* data, u32 bytesLeft, u32* bytesProcessed);
|
||||||
|
extern s32 CALLBACK sio2DmaWrite(s32 channel, u32* data, u32 bytesLeft, u32* bytesProcessed);
|
||||||
extern void CALLBACK sio2DmaInterrupt(s32 channel);
|
extern void CALLBACK sio2DmaInterrupt(s32 channel);
|
||||||
|
|
||||||
// implemented below
|
// implemented below
|
||||||
s32 CALLBACK errDmaWrite(s32 channel, u32* data, u32 bytesLeft, u32* bytesProcessed);
|
s32 CALLBACK errDmaWrite(s32 channel, u32* data, u32 bytesLeft, u32* bytesProcessed);
|
||||||
s32 CALLBACK errDmaRead(s32 channel, u32* data, u32 bytesLeft, u32* bytesProcessed);
|
s32 CALLBACK errDmaRead(s32 channel, u32* data, u32 bytesLeft, u32* bytesProcessed);
|
||||||
|
|
||||||
|
// pointer types
|
||||||
|
typedef s32 (CALLBACK * DmaHandler)(s32 channel, u32* data, u32 bytesLeft, u32* bytesProcessed);
|
||||||
|
typedef void (CALLBACK * DmaIHandler)(s32 channel);
|
||||||
|
typedef s32 (CALLBACK * DmaSHandler)(s32 channel, u32 madr, u32 bcr, u32 chcr);
|
||||||
|
|
||||||
// constants
|
// constants
|
||||||
struct DmaHandlerInfo
|
struct DmaHandlerInfo
|
||||||
{
|
{
|
||||||
|
@ -243,6 +249,7 @@ struct DmaHandlerInfo
|
||||||
DmaHandler Read;
|
DmaHandler Read;
|
||||||
DmaHandler Write;
|
DmaHandler Write;
|
||||||
DmaIHandler Interrupt;
|
DmaIHandler Interrupt;
|
||||||
|
DmaSHandler Start;
|
||||||
|
|
||||||
__forceinline u32& REG_MADR(void) const { return psxHu32(DmacRegisterBase + 0x0); }
|
__forceinline u32& REG_MADR(void) const { return psxHu32(DmacRegisterBase + 0x0); }
|
||||||
__forceinline u32& REG_BCR(void) const { return psxHu32(DmacRegisterBase + 0x4); }
|
__forceinline u32& REG_BCR(void) const { return psxHu32(DmacRegisterBase + 0x4); }
|
||||||
|
@ -308,8 +315,8 @@ const DmaHandlerInfo IopDmaHandlers[DMA_CHANNEL_MAX] =
|
||||||
{"Sif1", _D__}, //10: SIF1
|
{"Sif1", _D__}, //10: SIF1
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_NEW_IOPDMA_SIO
|
#ifdef ENABLE_NEW_IOPDMA_SIO
|
||||||
{"Sio2 (writes)", _E_W, CHANNEL_BASE2(4), errDmaRead, sio2DmaWrite, sio2DmaInterrupt}, //11: Sio2
|
{"Sio2 (writes)", _E_W, CHANNEL_BASE2(4), errDmaRead, sio2DmaWrite, sio2DmaInterrupt, sio2DmaStart}, //11: Sio2
|
||||||
{"Sio2 (reads)", _ER_, CHANNEL_BASE2(5), sio2DmaRead, errDmaWrite, sio2DmaInterrupt}, //12: Sio2
|
{"Sio2 (reads)", _ER_, CHANNEL_BASE2(5), sio2DmaRead, errDmaWrite, sio2DmaInterrupt, sio2DmaStart}, //12: Sio2
|
||||||
#else
|
#else
|
||||||
{"Sio2 (writes)", _D__}, //11: Sio2
|
{"Sio2 (writes)", _D__}, //11: Sio2
|
||||||
{"Sio2 (reads)", _D__}, //12: Sio2
|
{"Sio2 (reads)", _D__}, //12: Sio2
|
||||||
|
@ -377,11 +384,18 @@ void IopDmaStart(int channel)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// hack!
|
if(IopDmaHandlers[channel].Start)
|
||||||
extern void sio2DmaSetBs(int bs);
|
{
|
||||||
if(channel==11 || channel==12)
|
int ret = IopDmaHandlers[channel].Start(channel,
|
||||||
sio2DmaSetBs(bcr_size);
|
IopDmaHandlers[channel].REG_MADR(),
|
||||||
|
IopDmaHandlers[channel].REG_BCR(),
|
||||||
|
IopDmaHandlers[channel].REG_CHCR());
|
||||||
|
if(ret < 0)
|
||||||
|
{
|
||||||
|
IopDmaHandlers[channel].REG_CHCR() &= ~DMA_CTRL_ACTIVE;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//Console.WriteLn(Color_StrongOrange,"Starting NewDMA ch=%d, size=%d(0x%08x), dir=%d", channel, size, bcr, chcr&DMA_CTRL_DIRECTION);
|
//Console.WriteLn(Color_StrongOrange,"Starting NewDMA ch=%d, size=%d(0x%08x), dir=%d", channel, size, bcr, chcr&DMA_CTRL_DIRECTION);
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,6 @@
|
||||||
|
|
||||||
#ifdef ENABLE_NEW_IOPDMA
|
#ifdef ENABLE_NEW_IOPDMA
|
||||||
|
|
||||||
typedef s32(CALLBACK * DmaHandler)(s32 channel, u32* data, u32 bytesLeft, u32* bytesProcessed);
|
|
||||||
typedef void (CALLBACK * DmaIHandler)(s32 channel);
|
|
||||||
|
|
||||||
// unused for now
|
// unused for now
|
||||||
class DmaBcrReg
|
class DmaBcrReg
|
||||||
{
|
{
|
||||||
|
|
|
@ -212,6 +212,13 @@ void SaveStateBase::sio2Freeze()
|
||||||
/////////////////////////////////////////////////
|
/////////////////////////////////////////////////
|
||||||
#ifdef ENABLE_NEW_IOPDMA
|
#ifdef ENABLE_NEW_IOPDMA
|
||||||
|
|
||||||
|
static int dmaBlockSize = 0x24;
|
||||||
|
s32 CALLBACK sio2DmaStart(s32 channel, u32 madr, u32 bcr, u32 chcr)
|
||||||
|
{
|
||||||
|
dmaBlockSize = bcr & 0xFFFF;
|
||||||
|
return 0; // continue
|
||||||
|
}
|
||||||
|
|
||||||
s32 CALLBACK sio2DmaRead(s32 channel, u32* tdata, u32 bytesLeft, u32* bytesProcessed)
|
s32 CALLBACK sio2DmaRead(s32 channel, u32* tdata, u32 bytesLeft, u32* bytesProcessed)
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_NEW_IOPDMA_SIO
|
#ifdef ENABLE_NEW_IOPDMA_SIO
|
||||||
|
@ -244,12 +251,6 @@ s32 CALLBACK sio2DmaRead(s32 channel, u32* tdata, u32 bytesLeft, u32* bytesProce
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int sioBs = 0x24;
|
|
||||||
void sio2DmaSetBs(int bs)
|
|
||||||
{
|
|
||||||
sioBs = bs;
|
|
||||||
}
|
|
||||||
|
|
||||||
s32 CALLBACK sio2DmaWrite(s32 channel, u32* tdata, u32 bytesLeft, u32* bytesProcessed)
|
s32 CALLBACK sio2DmaWrite(s32 channel, u32* tdata, u32 bytesLeft, u32* bytesProcessed)
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_NEW_IOPDMA_SIO
|
#ifdef ENABLE_NEW_IOPDMA_SIO
|
||||||
|
@ -265,18 +266,8 @@ s32 CALLBACK sio2DmaWrite(s32 channel, u32* tdata, u32 bytesLeft, u32* bytesProc
|
||||||
|
|
||||||
int written = 0;
|
int written = 0;
|
||||||
|
|
||||||
// FIXME: temp code, might need to implement properly
|
int bs = dmaBlockSize * 4;
|
||||||
int bs = sioBs;
|
int bc = bytesLeft / bs;
|
||||||
int bc = bytesLeft / (bs*4);
|
|
||||||
int ts = bc * bs * 4;
|
|
||||||
|
|
||||||
// HACK!
|
|
||||||
if(ts != bytesLeft)
|
|
||||||
{
|
|
||||||
bs = bytesLeft;
|
|
||||||
bc = 1;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//assert(ts == bytesLeft);
|
//assert(ts == bytesLeft);
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="windows-1253"?>
|
<?xml version="1.0" encoding="windows-1253"?>
|
||||||
<VisualStudioProject
|
<VisualStudioProject
|
||||||
ProjectType="Visual C++"
|
ProjectType="Visual C++"
|
||||||
Version="9.00"
|
Version="9,00"
|
||||||
Name="pcsx2"
|
Name="pcsx2"
|
||||||
ProjectGUID="{1CEFD830-2B76-4596-A4EE-BCD7280A60BD}"
|
ProjectGUID="{1CEFD830-2B76-4596-A4EE-BCD7280A60BD}"
|
||||||
RootNamespace="pcsx2"
|
RootNamespace="pcsx2"
|
||||||
|
@ -784,6 +784,10 @@
|
||||||
RelativePath="..\..\Sif.cpp"
|
RelativePath="..\..\Sif.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\Sif.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\Sif0.cpp"
|
RelativePath="..\..\Sif0.cpp"
|
||||||
>
|
>
|
||||||
|
@ -792,10 +796,6 @@
|
||||||
RelativePath="..\..\Sif1.cpp"
|
RelativePath="..\..\Sif1.cpp"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\..\Sif.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\Sifcmd.h"
|
RelativePath="..\..\Sifcmd.h"
|
||||||
>
|
>
|
||||||
|
@ -1102,6 +1102,10 @@
|
||||||
RelativePath="..\..\IopDma.h"
|
RelativePath="..\..\IopDma.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\IopIrq.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\IopMem.cpp"
|
RelativePath="..\..\IopMem.cpp"
|
||||||
>
|
>
|
||||||
|
@ -1278,6 +1282,10 @@
|
||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\Ipu\IPU.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\Ipu\IPU_Fifo.cpp"
|
RelativePath="..\..\Ipu\IPU_Fifo.cpp"
|
||||||
>
|
>
|
||||||
|
@ -1306,10 +1314,6 @@
|
||||||
/>
|
/>
|
||||||
</FileConfiguration>
|
</FileConfiguration>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\..\Ipu\IPU.h"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\Ipu\IPU_Fifo.h"
|
RelativePath="..\..\Ipu\IPU_Fifo.h"
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in New Issue