Linux/OSX compile fix, tiny bit of work of BBA

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3291 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Sonicadvance1 2009-05-29 01:54:24 +00:00
parent 0259cc388e
commit 9d97335721
3 changed files with 17 additions and 13 deletions

View File

@ -53,7 +53,7 @@ bool CEXIETHERNET::activate() {
#if !defined(__APPLE__)
int err;
memset(&ifr, 0, sizeof(ifr));
ifr.ifr_flags = IFF_TAP;
ifr.ifr_flags = IFF_TAP | IFF_NO_PI;
strncpy(ifr.ifr_name, "Dolphin", IFNAMSIZ);
@ -136,7 +136,9 @@ bool CEXIETHERNET::startRecv() {
u8 B[1514];
if((BytesRead = read(fd, B, 1500)) > 0)
{
strncpy((char*)mRecvBuffer.p(), (const char*)B, BytesRead);
//mRecvBuffer.write(B, BytesRead);
//strncat(mRecvBuffer.p(), B, BytesRead);
memcpy((char*)mRecvBuffer.p(), (const char*)B, BytesRead);
}
DEBUGPRINT("Read %d bytes\n", BytesRead);
mRecvBufferLength = BytesRead;
@ -186,7 +188,7 @@ bool CEXIETHERNET::handleRecvdPacket()
if(available_bytes_in_cb != CB_SIZE)//< mRecvBufferLength + SIZEOF_RECV_DESCRIPTOR)
return true;
cbwriteDescriptor(mRecvBufferLength);
mCbw.write(mRecvBuffer.p(), mRecvBufferLength);
mCbw.write(mRecvBuffer, mRecvBufferLength);
mCbw.align();
rbwpp = mCbw.p_write() + CB_OFFSET;
//DUMPWORD(rbwpp);

View File

@ -215,7 +215,8 @@ void CEXIETHERNET::ImmWrite(u32 _uData, u32 _uSize)
DEBUGPRINT( "\t\t[INFO]BBA Start Recieve\n");
//exit(0);
// TODO: Need to make our virtual network device start receiving
startRecv();
if(CheckRecieved())
startRecv();
}
if (RISE(BBA_NCRA_ST1))
{
@ -255,7 +256,8 @@ void CEXIETHERNET::ImmWrite(u32 _uData, u32 _uSize)
DEBUGPRINT( "\t\t[INFO]RWP\n");
//exit(0);
assert(_uSize == 2 || _uSize == 1);
assert(Common::swap32(_uData) == (u32)((u16)mCbw.p_write() + CB_OFFSET) >> 8);
DEBUGPRINT("\t\t\tThing is 0x%0X\n", (u32)((u16)mCbw.p_write() + CB_OFFSET) >> 8);
//assert(Common::swap32(_uData) == (u32)((u16)mCbw.p_write() + CB_OFFSET) >> 8);
break;
case BBA_NWAYS:
DEBUGPRINT("[ERR]Call to BBA_NWAYS directly!\n");
@ -364,10 +366,10 @@ void CEXIETHERNET::ImmWrite(u32 _uData, u32 _uSize)
case 0x01: //Revision ID
break;
case 0x16: //RWP - Receive Buffer Write Page Pointer
DEBUGPRINT( "\t\t[INFO]RWP!\n");
DEBUGPRINT( "\t\t[INFO]RWP! 0x%04x Swapped 0x%04x\n", (((u16)mCbw.p_write() + CB_OFFSET) >> 8), Common::swap16(((u16)mCbw.p_write() + CB_OFFSET) >> 8));
//exit(0);
// TODO: Dunno if correct
MAKE(u16, mBbaMem[mReadP]) = ((u16)mCbw.p_write() + CB_OFFSET) >> 8;
MAKE(u16, mBbaMem[mReadP]) = (((u16)mCbw.p_write() + CB_OFFSET) >> 8);
break;
case 0x18: //RRP - Receive Buffer Read Page Pointer
DEBUGPRINT( "\t\t[INFO]RRP!\n");
@ -426,8 +428,8 @@ u32 CEXIETHERNET::ImmRead(u32 _uSize)
//DEBUGPRINT("Mem spot is 0x%02x uResult is 0x%x\n", mBbaMem[mReadP], uResult);
#ifndef _WIN32
if(CheckRecieved())
startRecv();
//if(CheckRecieved())
//startRecv();
#endif
DEBUGPRINT( "\t[INFO]Read from BBA address 0x%0*X, %i byte%s: 0x%0*X\n",mReadP >= CB_OFFSET ? 4 : 2, mReadP, _uSize, (_uSize==1?"":"s"),_uSize*2, getbitsw(uResult, 0, _uSize * 8 - 1));
mReadP = mReadP + _uSize;

View File

@ -122,13 +122,13 @@ else:
if sys.platform == 'win32':
files += [ "stdafx.cpp",
"HW/BBA-Tap/TAP_Win32.cpp"
"HW/BBA-TAP/TAP_Win32.cpp"
]
else:
if sys.platform == 'darwine':
files += [ "HW/BBA-Tap/TAP_Apple.cpp"]
if sys.platform == 'darwin':
files += [ "HW/BBA-TAP/TAP_Apple.cpp"]
else:
files += [ "HW/BBA-Tap/TAP_Unix.cpp"]
files += [ "HW/BBA-TAP/TAP_Unix.cpp"]
libs = [
'bdisasm',