about summary refs log tree commit diff stats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to 'source')
-rw-r--r--source/link.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/source/link.c b/source/link.c index 1091576..f63f4a5 100644 --- a/source/link.c +++ b/source/link.c
@@ -86,11 +86,10 @@ u32 getMsg()
86 while (val == 0) 86 while (val == 0)
87 { 87 {
88 val = __builtin_bswap32(recv()); 88 val = __builtin_bswap32(recv());
89 sleep(1);
90 } 89 }
91 90
92 send(0); 91 send(0);
93 while (recv()!=0) {sleep(1);} 92 while (recv()!=0);
94 send(0); 93 send(0);
95 94
96 return val; 95 return val;
@@ -101,15 +100,14 @@ void getMsgArr(u32* arr, int len)
101 for (int i=0; i<len; i++) 100 for (int i=0; i<len; i++)
102 { 101 {
103 *(vu32*)(arr+i) = __builtin_bswap32(recv()); 102 *(vu32*)(arr+i) = __builtin_bswap32(recv());
104 usleep(500000);
105 } 103 }
106} 104}
107 105
108void sendMsg(u32 msg) 106void sendMsg(u32 msg)
109{ 107{
110 while (recv()==0) {sleep(1);} 108 while (recv()==0);
111 send(msg); 109 send(msg);
112 while (recv()!=0) {sleep(1);} 110 while (recv()!=0);
113 send(0); 111 send(0);
114} 112}
115 113
@@ -158,6 +156,6 @@ void waitForGame()
158 156
159void waitForAck() 157void waitForAck()
160{ 158{
161 while (recv() != 0) {sleep(1);}; 159 while (recv() != 0) {sleep(1);}
162 send(0); 160 send(0);
163} 161}