Beispiel #1
0
static void Init() {
  CopListActivate(cp);
  EnableDMA(DMAF_BLITTER | DMAF_RASTER | DMAF_BLITHOG);

  {
    WORD i;
    LONG lines = ReadLineCounter();

#if CPULINE == 1
    CpuLineSetup(screen, 0);
#else
    BlitterLineSetup(screen, 0, LINE_OR|LINE_SOLID);
#endif

    for (i = 0; i < screen->width; i += 2) {
#if CPULINE == 1
      CpuLine(i, 0, screen->width - 1 - i, screen->height - 1);
#else
      BlitterLine(i, 0, screen->width - 1 - i, screen->height - 1);
#endif
    }

    for (i = 0; i < screen->height; i += 2) {
#if CPULINE == 1
      CpuLine(0, i, screen->width - 1, screen->height - 1 - i);
#else
      BlitterLine(0, i, screen->width - 1, screen->height - 1 - i);
#endif
    }

    Log("lines: %ld\n", ReadLineCounter() - lines);
  }
}
Beispiel #2
0
static void InitWaveScope() {
  WORD i, j;
  BitmapT *bm;

  for (i = 0; i < 4; i++) {
    memset(&wavescope.channel[i], 0, sizeof(WaveScopeChanT));
    wavescope.channel[i].bm = NewBitmap(64, 64, 1);
  }

  for (i = 0; i < 64; i++) {
    for (j = 0; j < 128; j++) {
      WORD index = (i << 8) | j;
      WORD x = (j * (i + 1)) >> 4;
      wavescope.multab[index] = x;
    }

    for (; j < 255; j++) {
      WORD index = (i << 8) | j;
      WORD x = ((255 - j) * (i + 1)) >> 4;
      wavescope.multab[index] = x;
    }
  }

  bm = NewBitmap(64, 32, 1);
  BlitterLineSetup(bm, 0, LINE_EOR, LINE_ONEDOT);
  BlitterLine(32, 0, 1, 31);
  BlitterLine(32, 0, 63, 31);
  BlitterFill(bm, 0);
  WaitBlitter();
  ((BYTE *)bm->planes[0])[4] = 0x80;
  wavescope.spans = bm;
}