LINK: Don't assume the data we want to send is the first to be written to SIOMLT_SEND since last transfer.

But rather the one present in SIOMLT_SEND when master sets the start transfert bit.
Fixes Advance Wars


git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@1115 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
bgk 2012-09-02 17:26:08 +00:00
parent 8ee689b96c
commit 0af6a10271
3 changed files with 1 additions and 43 deletions

View File

@ -2828,8 +2828,6 @@ void CPUUpdateRegister(u32 address, u16 value)
break; break;
case COMM_SIODATA8: case COMM_SIODATA8:
if (gba_link_enabled)
LinkSSend(value);
UPDATE_REG(COMM_SIODATA8, value); UPDATE_REG(COMM_SIODATA8, value);
break; break;

View File

@ -484,10 +484,8 @@ void LinkUpdate(int ticks)
{ {
linkdata[linkid] = READ16LE(&ioMem[COMM_SIODATA8]); linkdata[linkid] = READ16LE(&ioMem[COMM_SIODATA8]);
if (!lc.oncesend) lc.Send();
lc.Send();
lc.oncesend = false;
UPDATE_REG(COMM_SIODATA32_L, linkdata[0]); UPDATE_REG(COMM_SIODATA32_L, linkdata[0]);
UPDATE_REG(COMM_SIOCNT, READ16LE(&ioMem[COMM_SIOCNT]) | 0x80); UPDATE_REG(COMM_SIOCNT, READ16LE(&ioMem[COMM_SIOCNT]) | 0x80);
transfer = 1; transfer = 1;
@ -1350,7 +1348,6 @@ lclient::lclient(void){
intoutbuffer = (s32*)outbuffer; intoutbuffer = (s32*)outbuffer;
u16outbuffer = (u16*)outbuffer; u16outbuffer = (u16*)outbuffer;
numtransfers = 0; numtransfers = 0;
oncesend = false;
return; return;
} }
@ -1467,7 +1464,6 @@ void lclient::CheckConn(void){
} }
after = false; after = false;
oncewait = true; oncewait = true;
oncesend = true;
} }
return; return;
} }
@ -1516,31 +1512,4 @@ void lclient::Send(){
lanlink.tcpsocket.Send(outbuffer, 4); lanlink.tcpsocket.Send(outbuffer, 4);
return; return;
} }
// Uncalled
void LinkSStop(void){
if(!oncewait){
if(linkid){
if(lanlink.numslaves==1) return;
lc.Recv();
}
else ls.Recv();
oncewait = true;
UPDATE_REG(COMM_SIOMULTI1, linkdata[1]);
UPDATE_REG(COMM_SIOMULTI2, linkdata[2]);
UPDATE_REG(COMM_SIOMULTI3, linkdata[3]);
}
return;
}
// ??? Called when COMM_SIODATA8 written
void LinkSSend(u16 value){
if(linkid&&!lc.oncesend){
linkdata[linkid] = value;
lc.Send();
lc.oncesend = true;
}
}
#endif #endif

View File

@ -120,7 +120,6 @@ class lclient{
u16 *u16outbuffer; u16 *u16outbuffer;
int numbytes; int numbytes;
public: public:
bool oncesend;
sf::IPAddress serveraddr; sf::IPAddress serveraddr;
unsigned short serverport; unsigned short serverport;
sf::SocketTCP noblock; sf::SocketTCP noblock;
@ -157,11 +156,7 @@ extern bool InitLink();
extern void CloseLink(); extern void CloseLink();
extern void StartLink(u16); extern void StartLink(u16);
extern void StartGPLink(u16); extern void StartGPLink(u16);
extern void LinkSSend(u16);
extern void LinkUpdate(int); extern void LinkUpdate(int);
extern void LinkChildStop();
extern void LinkChildSend(u16);
extern void CloseLanLink();
extern void CleanLocalLink(); extern void CleanLocalLink();
extern LANLINKDATA lanlink; extern LANLINKDATA lanlink;
extern int vbaid; extern int vbaid;
@ -185,11 +180,7 @@ inline bool InitLink() { return true; }
inline void CloseLink() { } inline void CloseLink() { }
inline void StartLink(u16) { } inline void StartLink(u16) { }
inline void StartGPLink(u16) { } inline void StartGPLink(u16) { }
inline void LinkSSend(u16) { }
inline void LinkUpdate(int) { } inline void LinkUpdate(int) { }
inline void LinkChildStop() { }
inline void LinkChildSend(u16) { }
inline void CloseLanLink() { }
inline void CleanLocalLink() { } inline void CleanLocalLink() { }
#endif #endif