mipslabwork.c
void labinit( void )
{
  kypd_init();
  disp_init();

  prog = menu_pick();
  c8_load(&vm, prog->code, prog->len);

  disp_clear();

  TRISDSET = 1 << 10;

  // 256 prescale, off
  T2CON = 7 << 4;
  T4CON = 7 << 4;

  TMR2 = 0;
  TMR4 = 0;

  // 60 Hz clock
  PR2 = (80000000 / 256) / 60;

  // Emulator clock
  PR4 = (80000000 / 256) / 800;

  IFSCLR(0) = (1 << 8) | (1 << 16);

  // prio 7, subprio 3
  IPCSET(2) = 0x1f;
  IPCSET(4) = 0x1f;

  // On
  T2CONSET = 1 << 15;
  T4CONSET = 1 << 15;
}
/* Lab-specific initialization goes here */
Lab-specific initialization goes here
Lab - specific initialization goes here
void labinit( void )
{
  kypd_init();
  disp_init();
  prog = menu_pick();
  c8_load(&vm, prog->code, prog->len);
  disp_clear();
  TRISDSET = 1 << 10;
  T2CON = 7 << 4;
  T4CON = 7 << 4;
  TMR2 = 0;
  TMR4 = 0;
  PR2 = (80000000 / 256) / 60;
  PR4 = (80000000 / 256) / 800;
  IFSCLR(0) = (1 << 8) | (1 << 16);
  IPCSET(2) = 0x1f;
  IPCSET(4) = 0x1f;
  T2CONSET = 1 << 15;
  T4CONSET = 1 << 15;
}
void labinit ( void ) { kypd_init ( ) ; disp_init ( ) ; prog = menu_pick ( ) ; c8_load ( & vm , prog -> code , prog -> len ) ; disp_clear ( ) ; TRISDSET = 1 << 10 ; T2CON = 7 << 4 ; T4CON = 7 << 4 ; TMR2 = 0 ; TMR4 = 0 ; PR2 = ( 80000000 / 256 ) / 60 ; PR4 = ( 80000000 / 256 ) / 800 ; IFSCLR ( 0 ) = ( 1 << 8 ) | ( 1 << 16 ) ; IPCSET ( 2 ) = 0x1f ; IPCSET ( 4 ) = 0x1f ; T2CONSET = 1 << 15 ; T4CONSET = 1 << 15 ; }
Lab-specific initialization goes here
Lab - specific initialization goes here
// 256 prescale, off // 60 Hz clock // Emulator clock // prio 7, subprio 3 // On