예제 #1
0
int main(void) {
    initialise_screen();
    initialise_serial();
    init_multithread();

    execute_parallel(thread1, thread2);

    return 0;
}
예제 #2
0
int main(void) {
    initialise_multithreading();
    initialise_screen();
    initialise_keys();
    enable_sound();

    for (;;) {
        pause_screen();
        die_anim(150);
        execute_parallel(play_breakmeggy, play_bgmusic);
    }

    return 0;
}
예제 #3
0
int main(void)
{
   int           c;
#ifdef ALLEGRO_H
   unsigned char ch;

   allegro_init();
   install_keyboard();
#endif
   dzcomm_init();


   /* Set up comm1 */

   if ((port1 = comm_port_init(_com1)) == NULL) {
      dz_print_comm_err();
      exit(1);
   }

   if (comm_port_load_settings(port1, "exterm1.ini") == 0) {
       dz_print_comm_err();
       exit(1);
   }

   if (!comm_port_install_handler(port1)) {
      dz_print_comm_err();
      exit(1);
   }

   cur_port = port1;

#ifdef ALLEGRO_H
   /* Set up comm2 */

   if ((port2 = comm_port_init(_com2)) == NULL) {
       dz_print_comm_err();
       exit(1);
   }

   if (comm_port_load_settings(port2, "exterm2.ini") == 0) {
       dz_print_comm_err();
       exit(1);
   }

   if (!comm_port_install_handler(port2)) {
      dz_print_comm_err();
      exit(1);
   }
#else
   port2 = port1;
#endif

#ifdef ALLEGRO_H
   initialise_screen();
#else
   printf("Press Ctrl-C for a messy quit.\n");
   printf("\nCurrent port is: %s.\n\n", cur_port->szName);
#endif

   while(1) {

#ifdef ALLEGRO_H
      if (keypressed()) {
         c  = readkey();
         ch = ascii_(c);
         if (ctrl_(c,'C'))  {
            return (0);
         }
	 else if (ctrl_(c,'B')) {
	    comm_port_send_break(cur_port, 500);
	 }
         else if (ctrl_(c,'M')) {
            if (cur_port == port2) cur_port = port1;
            else                   cur_port = port2;
	    inform_port_change();
         }
         else comm_port_out(cur_port, ch);
      }
#endif

      if ((c = comm_port_test(cur_port)) != -1) {
	 show_received_character(data_(c));
      }
   }

}