Some more minor work on BBA, Seems I need a virtual network device sooner than I thought. Such a pain.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1561 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Sonicadvance1 2008-12-17 09:11:03 +00:00
parent 4a5d9ded94
commit 0944564cf0
1 changed files with 14 additions and 9 deletions

View File

@ -118,17 +118,21 @@ void CEXIETHERNET::ImmWrite(u32 _uData, u32 _uSize)
exit(0); exit(0);
break; break;
case BBA_NCRA: case BBA_NCRA:
{
u32 SwappedData = Common::swap32(_uData);
// TODO: Should we swap our data? // TODO: Should we swap our data?
#define RISE(flags) ((_uData & (flags)) && !(mBbaMem[0x00] & (flags))) #define RISE(flags) ((SwappedData & (flags)) && !(mBbaMem[0x00] & (flags)))
if(RISE(BBA_NCRA_RESET)) if(RISE(BBA_NCRA_RESET))
{ {
// Normal
// Whinecube did nothing else as well
printf("BBA Reset\n"); printf("BBA Reset\n");
exit(0);
} }
if(RISE(BBA_NCRA_SR) )/*&& isActivated()) */ if(RISE(BBA_NCRA_SR) )/*&& isActivated()) */
{ {
printf("BBA Start Recieve\n"); printf("BBA Start Recieve\n");
exit(0); //exit(0);
// TODO: Need to make our virtual network device start receiving
//HWGLE(startRecv()); //HWGLE(startRecv());
} }
if(RISE(BBA_NCRA_ST1)) if(RISE(BBA_NCRA_ST1))
@ -138,15 +142,15 @@ void CEXIETHERNET::ImmWrite(u32 _uData, u32 _uSize)
{ {
printf("Not ready to send!\n"); printf("Not ready to send!\n");
exit(0); exit(0);
}
//throw hardware_fatal_exception("BBA Transmit without a packet!"); //throw hardware_fatal_exception("BBA Transmit without a packet!");
}
// TODO: Actually Make it send a packet
//HWGLE(sendPacket(mWriteBuffer.p(), mWriteBuffer.size())); //HWGLE(sendPacket(mWriteBuffer.p(), mWriteBuffer.size()));
mReadyToSend = false; mReadyToSend = false;
exit(0); //exit(0);
} };
// TODO: Swap here? mBbaMem[0x00] = MAKE(u8, SwappedData);
_uData = Common::swap32(_uData); }
mBbaMem[0x00] = MAKE(u8, _uData);
break; break;
case BBA_NWAYC: case BBA_NWAYC:
printf("mWriteP is %x\n", mWriteP); printf("mWriteP is %x\n", mWriteP);
@ -254,6 +258,7 @@ void CEXIETHERNET::ImmWrite(u32 _uData, u32 _uSize)
//mBbaMem[mReadP] = !mRBEmpty; //mBbaMem[mReadP] = !mRBEmpty;
break; break;
case 0x00: case 0x00:
// These Two lines were commented out in Whinecube
//mBbaMem[mReadP] = 0x00; //mBbaMem[mReadP] = 0x00;
//if(!sendInProgress()) //if(!sendInProgress())
mBbaMem[mReadP] &= ~(0x06); mBbaMem[mReadP] &= ~(0x06);