Project

General

Profile

Revision 139

minor change

View differences:

lab5.c
463 463
        if (is_ipc_notify(ipc_status)) { /* received notification */
464 464
            switch (_ENDPOINT_P(msg.m_source)) {
465 465
                case HARDWARE: /* hardware interrupt notification */
466
                    if (msg.m_notify.interrupts & kbc_irq) { /* subscribed interrupt */
467
                        kbc_ih();
468
                        if (scancode[0] == ESC_BREAK_CODE) good = 0;
469
                    }
470 466
                    if (msg.m_notify.interrupts & timer_irq) { /* subscribed interrupt */
471 467
                        if(no_interrupts == 0){
472 468
                            i = (i+1)%Nt;
473 469
                            if(i == 0){
474
                                if(vx) draw_rectangle(min(x-v,x),y         , abs(v)         , sprite_get_h(sp), 0);
475
                                if(vy) draw_rectangle(x         ,min(y-v,y),sprite_get_w(sp), abs(v)          , 0);
470
                                //if(vx) draw_rectangle(min(x-v,x),y         , abs(v)         , sprite_get_h(sp), 0);
471
                                //if(vy) draw_rectangle(x         ,min(y-v,y),sprite_get_w(sp), abs(v)          , 0);
472
                                clear_screen();
476 473
                                sprite_set_pos(sp,x,y);
477
                                sprite_draw(sp);
474
                                sprite_draw(sp); printf("\nnew frame");
478 475
                                vx = (vx > 0 ? min(vx, xf-x) : max(vx, xf-x) );
479 476
                                vy = (vy > 0 ? min(vy, yf-y) : max(vy, yf-y) );
480 477
                                x += vx;
......
484 481
                        timer_int_handler();
485 482
                        no_interrupts %= ticks_per_frame;
486 483
                    }
484
                    if (msg.m_notify.interrupts & kbc_irq) { /* subscribed interrupt */
485
                        kbc_ih();
486
                        if (scancode[0] == ESC_BREAK_CODE) good = 0;
487
                    }
487 488
                    break;
488 489
                default:
489 490
                    break; /* no other notifications expected: do nothing */

Also available in: Unified diff