Esempio n. 1
0
void main()
{
  BITMAP bmp;
  int i;

  load_bmp("mset.bmp",&bmp);          /* open the file */

  set_mode(VGA_256_COLOR_MODE);       /* set the video mode. */

  set_palette(bmp.palette);           /* set the palette */

  draw_bitmap(&bmp,                   /* draw the bitmap centered */
    (SCREEN_WIDTH-bmp.width) >>1,
    (SCREEN_HEIGHT-bmp.height) >>1);

  wait(25);

  for(i=0;i<510;i++)                  /* rotate the palette at 30hz */
  {
    wait_for_retrace();
    wait_for_retrace();
    rotate_palette(bmp.palette);
  }

  wait(25);

  free(bmp.data);                     /* free up memory used */

  set_mode(TEXT_MODE);                /* set the video mode back to
                                         text mode. */

  return;
}
Esempio n. 2
0
int main(int argc, char *argv[]) {
    union REGS regs;
    byte breakout = 0;
    int i,j,f,k=0;
    long oldCount = 0;
    int width = 320;
    int height = 200;
    int comp = 0;
    int req_comp = 0;
    int pixel_pos = 0;

    char str1[] = "hello, synctracker!\n";
    byte *image_pixelbuffer = malloc(320 * 200);
    byte *image_palettebuffer = malloc(256 * 3);


    /* Unbuffer stdout: */
    setbuf(stdout, NULL);

    /* Prevent warnings: */
    argc = argc;
    argv = argv;

    start = *my_clock;

    system("cls");
    printf("Please wait...");
    connectToCOM1();

    loader();

    /* Play the tune */
    if ( (playHandle = MIDASplayModule(module, TRUE)) == 0 ) {
        MIDASerror();
    }
    startTime = 0;
    currentTime = 0;
    prevTime = 0;
    passedTime = 0;

    set_mode(VGA_256_COLOR_MODE);
    while ( !kbhit() ) {
        currentTime = frameCount / 60.0f;
        passedTime = frameCount - prevTime;
        prevTime = currentTime;

        displayImage(background);
        demo();
        wait_for_retrace();
        UpdateInfo();
    }

    midasMagicDies();
    set_mode(TEXT_MODE);
    return 0;
}