Hackfix a problem with sio2 in the new dmac. It needs some changes to the dmac system (possibly a dmaStart function with more accurate information) to be implemented properly but for now, this will do.

Also make the autodma messages work like before so they are configurable again.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2555 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gigaherz 2010-02-03 03:59:21 +00:00
parent 9ae807134e
commit 06db5bba38
3 changed files with 26 additions and 5 deletions

View File

@ -375,7 +375,7 @@ const DmaHandlerInfo IopDmaHandlers[DMA_CHANNEL_MAX] =
// runtime variables
struct DmaChannelInfo
{
u32 ByteCount;
s32 ByteCount;
s32 NextUpdate;
} IopDmaChannels[DMA_CHANNEL_MAX] = {0};
@ -426,6 +426,12 @@ void IopDmaStart(int channel)
}
}
// hack!
extern void sio2DmaSetBs(int bs);
if(channel==11 || channel==12)
sio2DmaSetBs(bcr_size);
//Console.WriteLn(Color_StrongOrange,"Starting NewDMA ch=%d, size=%d(0x%08x), dir=%d", channel, size, bcr, chcr&DMA_CTRL_DIRECTION);
IopDmaHandlers[channel].REG_CHCR() |= DMA_CTRL_ACTIVE;
@ -477,7 +483,7 @@ static void __releaseinline IopDmaProcessChannel(int elapsed, int& MinDelay)
u32 ProcessedBytes = 0;
s32 RequestedDelay = (handler) ? handler(channel, (u32*)iopPhysMem(hh->REG_MADR()), ch->ByteCount, &ProcessedBytes) : 0;
if(ProcessedBytes>0)
if(ProcessedBytes>0 && (!(chcr & DMA_CTRL_DIRECTION)))
{
psxCpu->Clear(hh->REG_MADR(), ProcessedBytes/4);
}

View File

@ -244,6 +244,12 @@ s32 sio2DmaRead(s32 channel, u32* tdata, u32 bytesLeft, u32* bytesProcessed)
return 0;
}
int sioBs = 0x24;
void sio2DmaSetBs(int bs)
{
sioBs = bs;
}
s32 sio2DmaWrite(s32 channel, u32* tdata, u32 bytesLeft, u32* bytesProcessed)
{
#ifdef ENABLE_NEW_IOPDMA_SIO
@ -260,11 +266,19 @@ s32 sio2DmaWrite(s32 channel, u32* tdata, u32 bytesLeft, u32* bytesProcessed)
int written = 0;
// FIXME: temp code, might need to implement properly
int bs = 0x24;
int bs = sioBs;
int bc = bytesLeft / (bs*4);
int ts = bc * bs * 4;
assert(ts == bytesLeft);
// HACK!
if(ts != bytesLeft)
{
bs = bytesLeft;
bc = 1;
}
//assert(ts == bytesLeft);
for(int j=0;j<bc;j++)
{

View File

@ -535,7 +535,8 @@ s32 V_Core::NewDmaWrite(u32* data, u32 bytesLeft, u32* bytesProcessed)
if(DmaStarting)
{
ConLog(" * SPU2: AutoDMA transfer starting on core %d: %d bytes\n", Index, bytesLeft);
if(MsgAutoDMA()) ConLog(" * SPU2: DMA%c AutoDMA Transfer of %d bytes to %x (%02x %x %04x).\n",
GetDmaIndexChar(), bytesLeft<<1, TSA, DMABits, AutoDMACtrl, (~Regs.ATTR)&0x7fff);
}
u32 processed = 0;