Revision 323
more stuff
proj.c | ||
---|---|---|
38 | 38 |
|
39 | 39 |
lcf_set_language("EN-US"); |
40 | 40 |
|
41 |
//lcf_trace_calls("/home/lcom/labs/proj/trace.txt");
|
|
41 |
lcf_trace_calls("/home/lcom/labs/proj/trace.txt"); |
|
42 | 42 |
|
43 |
//lcf_log_output("/home/lcom/labs/proj/output.txt");
|
|
43 |
lcf_log_output("/home/lcom/labs/proj/output.txt"); |
|
44 | 44 |
|
45 | 45 |
if (lcf_start(argc, argv)) return 1; |
46 | 46 |
|
... | ... | |
113 | 113 |
|
114 | 114 |
/// loop stuff |
115 | 115 |
int click = 0; |
116 |
uint32_t int_vector = 0;
|
|
116 |
uint64_t int_vector = 0;
|
|
117 | 117 |
int good = true; |
118 | 118 |
while (good) { |
119 | 119 |
/* Get a request message. */ |
... | ... | |
145 | 145 |
case KBC_IRQ: |
146 | 146 |
if (keyboard_get_scancode()[0] == ESC_BREAK_CODE) good = false; |
147 | 147 |
case MOUSE_IRQ: |
148 |
if (counter_mouse_ih >= 3) {
|
|
149 |
mouse_parse_packet(packet_mouse_ih, &pp);
|
|
148 |
if (mouse_get_counter_mouse_ih() >= 3) {
|
|
149 |
mouse_parse_packet(mouse_get_packet_mouse_ih(), &pp);
|
|
150 | 150 |
update_mouse(&pp); |
151 | 151 |
if (!click) click = last_lb ^ keys->lb_pressed && keys->lb_pressed; |
152 | 152 |
last_lb = keys->lb_pressed; |
153 |
counter_mouse_ih = 0;
|
|
153 |
mouse_set_counter_mouse_ih(0);
|
|
154 | 154 |
} |
155 | 155 |
break; |
156 | 156 |
case COM1_IRQ: nctp_ih(); break; |
... | ... | |
224 | 224 |
|
225 | 225 |
/// loop stuff |
226 | 226 |
int click = 0; |
227 |
uint32_t int_vector = 0;
|
|
227 |
uint64_t int_vector = 0;
|
|
228 | 228 |
int good = true; |
229 | 229 |
while (good) { |
230 | 230 |
/* Get a request message. */ |
... | ... | |
255 | 255 |
case KBC_IRQ: |
256 | 256 |
if (keyboard_get_scancode()[0] == ESC_BREAK_CODE) good = false; |
257 | 257 |
case MOUSE_IRQ: |
258 |
if (counter_mouse_ih >= 3) {
|
|
259 |
mouse_parse_packet(packet_mouse_ih, &pp);
|
|
258 |
if (mouse_get_counter_mouse_ih() >= 3) {
|
|
259 |
mouse_parse_packet(mouse_get_packet_mouse_ih(), &pp);
|
|
260 | 260 |
update_mouse(&pp); |
261 | 261 |
if (!click) click = last_lb ^ keys->lb_pressed && keys->lb_pressed; |
262 | 262 |
last_lb = keys->lb_pressed; |
263 |
counter_mouse_ih = 0;
|
|
263 |
mouse_set_counter_mouse_ih(0);
|
|
264 | 264 |
} |
265 | 265 |
break; |
266 | 266 |
case COM1_IRQ: nctp_ih(); break; |
... | ... | |
310 | 310 |
struct packet pp; |
311 | 311 |
keys_t *keys = get_key_presses(); |
312 | 312 |
/// loop stuff |
313 |
uint32_t int_vector = 0;
|
|
313 |
uint64_t int_vector = 0;
|
|
314 | 314 |
int good = true; |
315 | 315 |
int state = 0; // -1 for remote win, 0 for draw, 1 for host win |
316 | 316 |
list_node_t *p1, *p2; // player states |
... | ... | |
369 | 369 |
} |
370 | 370 |
break; |
371 | 371 |
case MOUSE_IRQ: |
372 |
if (counter_mouse_ih >= 3) {
|
|
373 |
mouse_parse_packet(packet_mouse_ih, &pp);
|
|
372 |
if (mouse_get_counter_mouse_ih() >= 3) {
|
|
373 |
mouse_parse_packet(mouse_get_packet_mouse_ih(), &pp);
|
|
374 | 374 |
update_mouse(&pp); |
375 | 375 |
if (last_lb ^ keys->lb_pressed && keys->lb_pressed) |
376 | 376 |
shoot_bullet(shooter1, bullet_list, bsp_bullet); |
377 | 377 |
last_lb = keys->lb_pressed; |
378 |
counter_mouse_ih = 0;
|
|
378 |
mouse_set_counter_mouse_ih(0);
|
|
379 | 379 |
} |
380 | 380 |
break; |
381 | 381 |
|
... | ... | |
446 | 446 |
keys_t *keys = get_key_presses(); |
447 | 447 |
|
448 | 448 |
/// loop stuff |
449 |
uint32_t int_vector = 0;
|
|
449 |
uint64_t int_vector = 0;
|
|
450 | 450 |
int good = true; |
451 | 451 |
while (good) { |
452 | 452 |
if ((r = get_interrupts_vector(&int_vector))) return r; |
... | ... | |
510 | 510 |
} |
511 | 511 |
break; |
512 | 512 |
case MOUSE_IRQ: |
513 |
if (counter_mouse_ih >= 3) {
|
|
514 |
mouse_parse_packet(packet_mouse_ih, &pp);
|
|
513 |
if (mouse_get_counter_mouse_ih() >= 3) {
|
|
514 |
mouse_parse_packet(mouse_get_packet_mouse_ih(), &pp);
|
|
515 | 515 |
update_mouse(&pp); |
516 | 516 |
if (last_lb ^ keys->lb_pressed && keys->lb_pressed) { |
517 | 517 |
bullet_info->new_bullet = true; |
518 | 518 |
hltp_send_bullet_info(bullet_info); |
519 | 519 |
} |
520 | 520 |
last_lb = keys->lb_pressed; |
521 |
counter_mouse_ih = 0;
|
|
521 |
mouse_set_counter_mouse_ih(0);
|
|
522 | 522 |
} |
523 | 523 |
break; |
524 | 524 |
|
... | ... | |
567 | 567 |
|
568 | 568 |
/// loop stuff |
569 | 569 |
int click = 0; |
570 |
uint32_t int_vector = 0;
|
|
570 |
uint64_t int_vector = 0;
|
|
571 | 571 |
int good = true; |
572 | 572 |
while (good) { |
573 | 573 |
/* Get a request message. */ |
... | ... | |
598 | 598 |
case KBC_IRQ: |
599 | 599 |
if (keyboard_get_scancode()[0] == ESC_BREAK_CODE) good = false; |
600 | 600 |
case MOUSE_IRQ: |
601 |
if (counter_mouse_ih >= 3) {
|
|
602 |
mouse_parse_packet(packet_mouse_ih, &pp);
|
|
601 |
if (mouse_get_counter_mouse_ih() >= 3) {
|
|
602 |
mouse_parse_packet(mouse_get_packet_mouse_ih(), &pp);
|
|
603 | 603 |
update_mouse(&pp); |
604 | 604 |
if (!click) click = last_lb ^ keys->lb_pressed && keys->lb_pressed; |
605 | 605 |
last_lb = keys->lb_pressed; |
606 |
counter_mouse_ih = 0;
|
|
606 |
mouse_set_counter_mouse_ih(0);
|
|
607 | 607 |
} |
608 | 608 |
break; |
609 | 609 |
case COM1_IRQ: nctp_ih(); break; |
... | ... | |
646 | 646 |
keys_t *keys = get_key_presses(); |
647 | 647 |
|
648 | 648 |
/// loop stuff |
649 |
uint32_t int_vector = 0;
|
|
649 |
uint64_t int_vector = 0;
|
|
650 | 650 |
int good = true; |
651 | 651 |
while (good) { |
652 | 652 |
/* Get a request message. */ |
... | ... | |
689 | 689 |
} |
690 | 690 |
break; |
691 | 691 |
case MOUSE_IRQ: |
692 |
if (counter_mouse_ih >= 3) {
|
|
693 |
mouse_parse_packet(packet_mouse_ih, &pp);
|
|
692 |
if (mouse_get_counter_mouse_ih() >= 3) {
|
|
693 |
mouse_parse_packet(mouse_get_packet_mouse_ih(), &pp);
|
|
694 | 694 |
update_mouse(&pp); |
695 | 695 |
if (last_lb ^ keys->lb_pressed && keys->lb_pressed) |
696 | 696 |
shoot_bullet(shooter1, bullet_list, bsp_bullet); |
697 | 697 |
last_lb = keys->lb_pressed; |
698 |
counter_mouse_ih = 0;
|
|
698 |
mouse_set_counter_mouse_ih(0);
|
|
699 | 699 |
|
700 | 700 |
} |
701 | 701 |
break; |
... | ... | |
750 | 750 |
keys_t *keys = get_key_presses(); |
751 | 751 |
|
752 | 752 |
/// loop stuff |
753 |
uint32_t int_vector = 0;
|
|
753 |
uint64_t int_vector = 0;
|
|
754 | 754 |
int good = true; |
755 | 755 |
int dead = false; |
756 | 756 |
|
... | ... | |
816 | 816 |
} |
817 | 817 |
break; |
818 | 818 |
case MOUSE_IRQ: |
819 |
if (counter_mouse_ih >= 3) {
|
|
820 |
mouse_parse_packet(packet_mouse_ih, &pp);
|
|
819 |
if (mouse_get_counter_mouse_ih() >= 3) {
|
|
820 |
mouse_parse_packet(mouse_get_packet_mouse_ih(), &pp);
|
|
821 | 821 |
update_mouse(&pp); |
822 | 822 |
if (last_lb ^ keys->lb_pressed && keys->lb_pressed) |
823 | 823 |
shoot_bullet(shooter1, bullet_list, bsp_bullet); |
824 | 824 |
last_lb = keys->lb_pressed; |
825 |
counter_mouse_ih = 0;
|
|
825 |
mouse_set_counter_mouse_ih(0);
|
|
826 | 826 |
|
827 | 827 |
} |
828 | 828 |
break; |
... | ... | |
944 | 944 |
} |
945 | 945 |
|
946 | 946 |
/// loop stuff |
947 |
uint32_t int_vector = 0;
|
|
947 |
uint64_t int_vector = 0;
|
|
948 | 948 |
int good = true; |
949 | 949 |
while (good) { |
950 | 950 |
/* Get a request message. */ |
... | ... | |
999 | 999 |
sprintf(buffer2, "%d/%d", strlen(buffer), CHAT_MAX_SIZE); |
1000 | 1000 |
text_set_string(t_size, buffer2); |
1001 | 1001 |
case MOUSE_IRQ: |
1002 |
if (counter_mouse_ih >= 3) {
|
|
1003 |
mouse_parse_packet(packet_mouse_ih, &pp);
|
|
1002 |
if (mouse_get_counter_mouse_ih() >= 3) {
|
|
1003 |
mouse_parse_packet(mouse_get_packet_mouse_ih(), &pp);
|
|
1004 | 1004 |
update_mouse(&pp); |
1005 |
counter_mouse_ih = 0;
|
|
1005 |
mouse_set_counter_mouse_ih(0);
|
|
1006 | 1006 |
} |
1007 | 1007 |
break; |
1008 | 1008 |
case COM1_IRQ: nctp_ih(); break; |
Also available in: Unified diff