Commit b9652ca3a5c027f8bc55323e0f6010f641479255
1 parent
19221bda
Fix keyboard serial and mouse bugs
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2709 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
29 additions
and
15 deletions
hw/slavio_serial.c
... | ... | @@ -222,8 +222,6 @@ static inline void clr_rxint(ChannelState *s) |
222 | 222 | } |
223 | 223 | if (s->txint) |
224 | 224 | set_txint(s); |
225 | - else | |
226 | - s->rregs[2] = 6; | |
227 | 225 | slavio_serial_update_irq(s); |
228 | 226 | } |
229 | 227 | |
... | ... | @@ -237,30 +235,39 @@ static inline void set_rxint(ChannelState *s) |
237 | 235 | s->otherchn->rregs[2] = 0x30; |
238 | 236 | else |
239 | 237 | s->otherchn->rregs[2] = 0x0c; |
240 | - s->rregs[3] |= 0x20; | |
241 | 238 | } else { |
242 | 239 | if (s->wregs[9] & 0x10) |
243 | 240 | s->rregs[2] = 0x20; |
244 | 241 | else |
245 | 242 | s->rregs[2] = 0x04; |
246 | - s->otherchn->rregs[3] |= 4; | |
247 | 243 | } |
248 | - slavio_serial_update_irq(s); | |
249 | 244 | } |
245 | + if (s->chn == chn_a) | |
246 | + s->rregs[3] |= 0x20; | |
247 | + else | |
248 | + s->otherchn->rregs[3] |= 4; | |
249 | + slavio_serial_update_irq(s); | |
250 | 250 | } |
251 | 251 | |
252 | 252 | static inline void clr_txint(ChannelState *s) |
253 | 253 | { |
254 | 254 | s->txint = 0; |
255 | 255 | s->txint_under_svc = 0; |
256 | - if (s->chn == chn_a) | |
256 | + if (s->chn == chn_a) { | |
257 | + if (s->wregs[9] & 0x10) | |
258 | + s->otherchn->rregs[2] = 0x60; | |
259 | + else | |
260 | + s->otherchn->rregs[2] = 0x06; | |
257 | 261 | s->rregs[3] &= ~0x10; |
258 | - else | |
262 | + } else { | |
263 | + if (s->wregs[9] & 0x10) | |
264 | + s->rregs[2] = 0x60; | |
265 | + else | |
266 | + s->rregs[2] = 0x06; | |
259 | 267 | s->otherchn->rregs[3] &= ~2; |
268 | + } | |
260 | 269 | if (s->rxint) |
261 | 270 | set_rxint(s); |
262 | - else | |
263 | - s->rregs[2] = 6; | |
264 | 271 | slavio_serial_update_irq(s); |
265 | 272 | } |
266 | 273 | |
... | ... | @@ -269,13 +276,20 @@ static inline void set_txint(ChannelState *s) |
269 | 276 | s->txint = 1; |
270 | 277 | if (!s->rxint_under_svc) { |
271 | 278 | s->txint_under_svc = 1; |
272 | - if (s->chn == chn_a) | |
273 | - s->rregs[3] |= 0x10; | |
274 | - else | |
275 | - s->otherchn->rregs[3] |= 2; | |
276 | - s->rregs[2] = 0; | |
277 | - slavio_serial_update_irq(s); | |
279 | + if (s->chn == chn_a) { | |
280 | + if (s->wregs[9] & 0x10) | |
281 | + s->otherchn->rregs[2] = 0x10; | |
282 | + else | |
283 | + s->otherchn->rregs[2] = 0x08; | |
284 | + } else { | |
285 | + s->rregs[2] = 0; | |
286 | + } | |
278 | 287 | } |
288 | + if (s->chn == chn_a) | |
289 | + s->rregs[3] |= 0x10; | |
290 | + else | |
291 | + s->otherchn->rregs[3] |= 2; | |
292 | + slavio_serial_update_irq(s); | |
279 | 293 | } |
280 | 294 | |
281 | 295 | static void slavio_serial_update_parameters(ChannelState *s) | ... | ... |