예제 #1
0
파일: lines.c 프로젝트: cahirwpz/demoscene
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);
  }
}
예제 #2
0
static void Init() {
  WORD i;

  screen[0] = NewBitmap(WIDTH, HEIGHT, DEPTH);
  screen[1] = NewBitmap(WIDTH, HEIGHT, DEPTH);

  custom->dmacon = DMAF_SETCLR | DMAF_BLITTER;

  for (i = 0; i < 8; i++) {
    Area2D flare_area = { 0, i * SIZE, SIZE, SIZE };
    flare[i] = NewBitmap(SIZE, SIZE, DEPTH);
    BitmapCopyArea(flare[i], 0, 0, flares, &flare_area);
  }

  carry = NewBitmap(SIZE + 16, SIZE, 2);
  cp = NewCopList(50);

  for (i = 0; i < 2; i++)
    BitmapClear(screen[i]);

  CopInit(cp);
  CopSetupGfxSimple(cp, MODE_LORES, DEPTH, X(0), Y(0), WIDTH, HEIGHT);
  CopSetupBitplanes(cp, bplptr, screen[active], DEPTH);
  CopLoadPal(cp, flares->palette, 0);
  CopEnd(cp);
  CopListActivate(cp);
  custom->dmacon = DMAF_SETCLR | DMAF_RASTER;
}
예제 #3
0
파일: uvmap.c 프로젝트: frost242/demoscene
static void Init() {
  static PixmapT recycled[2];

  chunky[0] = &recycled[0];
  chunky[1] = &recycled[1];

  InitSharedPixmap(chunky[0], WIDTH, HEIGHT, PM_GRAY4, screen[0]->planes[1]);
  InitSharedPixmap(chunky[1], WIDTH, HEIGHT, PM_GRAY4, screen[1]->planes[1]);

  UVMapRender = MemAlloc(UVMapRenderSize, MEMF_PUBLIC);
  textureHi = NewPixmap(texture->width, texture->height * 2,
                        PM_CMAP, MEMF_PUBLIC);
  textureLo = NewPixmap(texture->width, texture->height * 2,
                        PM_CMAP, MEMF_PUBLIC);

  MakeUVMapRenderCode();
  PixmapScramble(texture, textureHi, textureLo);

  custom->dmacon = DMAF_SETCLR | DMAF_BLITTER;

  ITER(i, 0, 4, BlitterClearSync(screen[0], i));
  ITER(i, 0, 4, BlitterClearSync(screen[1], i));

  memset(screen[0]->planes[4], 0x55, WIDTH * HEIGHT * 4 / 8);
  memset(screen[1]->planes[4], 0x55, WIDTH * HEIGHT * 4 / 8);

  cp = NewCopList(1024);

  MakeCopperList(cp);
  CopListActivate(cp);
  custom->dmacon = DMAF_SETCLR | DMAF_RASTER;
  custom->intena = INTF_SETCLR | INTF_BLIT;
}
예제 #4
0
파일: mouse.c 프로젝트: frost242/demoscene
static void Init() {
  KeyboardInit();
  MouseInit(0, 0, WIDTH - 1, HEIGHT - 1);

  CopListActivate(cp);
  custom->dmacon = DMAF_SETCLR | DMAF_RASTER | DMAF_SPRITE;
}
예제 #5
0
static void Render() {
  SetupLinePointers();
  RenderNextLineIfNeeded();

  WaitVBlank();
  CopListActivate(cp[active]);
  active ^= 1;
}
예제 #6
0
static void Render() {
  // LONG lines = ReadLineCounter();
  SetupLines(frameCount * 16);
  SetupTexture(colors[active], frameCount);
  // Log("twister: %ld\n", ReadLineCounter() - lines);

  WaitVBlank();
  CopListActivate(cp[active]);
  active ^= 1;
}
예제 #7
0
파일: circles.c 프로젝트: argasek/morphine
static void Init() {
  CopListActivate(cp);
  custom->dmacon = DMAF_SETCLR | DMAF_RASTER;

  {
    LONG lines = ReadLineCounter();
    WORD r;

    for (r = 2; r < screen->height / 2 - 2; r += 2)
      Circle(screen, 0, screen->width / 2, screen->height / 2, r);

    Log("circles: %ld\n", ReadLineCounter() - lines);
  }
}
예제 #8
0
static void Init() {
  custom->dmacon = DMAF_SETCLR | DMAF_BLITTER;

  MakeCopperList(&cp[0], 0);
  MakeCopperList(&cp[1], 1);

  UpdateSprite(left[0], X(0), Y(0));
  UpdateSprite(left[1], X(16), Y(0));
  UpdateSprite(right[0], X(320 - 32), Y(0));
  UpdateSprite(right[1], X(320 - 16), Y(0));

  CopListActivate(cp[1]);
  custom->dmacon = DMAF_SETCLR | DMAF_RASTER | DMAF_SPRITE;
}
예제 #9
0
static void Init() {
  custom->dmacon = DMAF_SETCLR | DMAF_BLITTER;
  BitmapClear(screen);

  cp = NewCopList(100);
  CopInit(cp);
  CopSetupGfxSimple(cp, MODE_LORES, DEPTH, X(0), Y(0), WIDTH, HEIGHT);
  CopSetupBitplanes(cp, bplptr, screen, DEPTH);
  CopLoadPal(cp, palette, 0);
  CopEnd(cp);

  CopListActivate(cp);
  custom->dmacon = DMAF_SETCLR | DMAF_RASTER;
}
예제 #10
0
파일: anim.c 프로젝트: cahirwpz/demoscene
static void Init() {
  EnableDMA(DMAF_BLITTER);
  BitmapClear(screen);

  cp = NewCopList(100);
  CopInit(cp);
  CopSetupGfxSimple(cp, MODE_LORES, DEPTH, X(0), Y(0), WIDTH, HEIGHT);
  CopSetupBitplanes(cp, bplptr, screen, DEPTH);
  CopLoadPal(cp, palette, 0);
  CopEnd(cp);

  CopListActivate(cp);
  EnableDMA(DMAF_RASTER);
}
예제 #11
0
static void Init() {
  scroll = NewBitmap(WIDTH, HEIGHT + 16, 1);

  custom->dmacon = DMAF_SETCLR | DMAF_BLITTER;
  BitmapClear(scroll);

  line_start = text;

  cp[0] = MakeCopperList(0);
  cp[1] = MakeCopperList(1);

  CopListActivate(cp[active]);

  custom->dmacon = DMAF_SETCLR | DMAF_RASTER;
}
예제 #12
0
static void Init() {
  WORD w = bitmap->width;
  WORD h = bitmap->height;
  WORD xs = X((320 - w) / 2);
  WORD ys = Y((256 - h) / 2);

  {
    LONG lines = ReadLineCounter();
    BitmapUnpack(bitmap, BM_DISPLAYABLE);
    lines = ReadLineCounter() - lines;
    Log("Bitmap unpacking took %ld raster lines.\n", (LONG)lines);
  }

  CopInit(cp);
  CopSetupGfxSimple(cp, MODE_LORES, bitmap->depth, xs, ys, w, h);
  CopSetupBitplanes(cp, NULL, bitmap, bitmap->depth);
  CopLoadPal(cp, bitmap->palette, 0);
  CopEnd(cp);

  CopListActivate(cp);
  EnableDMA(DMAF_RASTER);
}
예제 #13
0
파일: neons.c 프로젝트: argasek/morphine
static void Init() {
  custom->dmacon = DMAF_SETCLR | DMAF_BLITTER;

  BitmapCopy(screen[0], 0, 0, background);
  BitmapCopy(screen[1], 0, 0, background);

  BlitterClearSync(screen[0], 4);
  BlitterClearSync(screen[1], 4);

  cp = NewCopList(100);

  CopInit(cp);
  CopMakePlayfield(cp, bplptr, screen[active], DEPTH);
  CopMakeDispWin(cp, X(0), Y(0), WIDTH, HEIGHT);
  pal = CopLoadPal(cp, palette[0], 0);
  CopLoadPal(cp, palette[1], 16);
  CopLoadPal(cp, palette[2], 24);
  CopEnd(cp);

  CopListActivate(cp);
  custom->dmacon = DMAF_SETCLR | DMAF_RASTER;
  custom->intena = INTF_SETCLR | INTF_VERTB;
}
예제 #14
0
static void Init() {
  {
    LONG lines = ReadLineCounter();
    pixmap = PixmapFromPNG(image, MEMF_PUBLIC);
    lines = ReadLineCounter() - lines;
    Log("Png decoding took %ld raster lines.\n", (LONG)lines);
  }

  bitmap = NewBitmap(pixmap->width, pixmap->height, 4);
  bitmap->palette = PaletteFromPNG(image);

  {
    LONG lines = ReadLineCounter();
    c2p_1x1_4(pixmap->pixels, bitmap->planes[0], 
              pixmap->width, pixmap->height, bitmap->bplSize);
    lines = ReadLineCounter() - lines;
    Log("Chunky to planar took %ld raster lines.\n", (LONG)lines);
  }

  cp = NewCopList(100);

  {
    WORD w = bitmap->width;
    WORD h = bitmap->height;
    WORD xs = X((320 - w) / 2);
    WORD ys = Y((256 - h) / 2);

    CopInit(cp);
    CopSetupGfxSimple(cp, MODE_LORES, bitmap->depth, xs, ys, w, h);
    CopSetupBitplanes(cp, NULL, bitmap, bitmap->depth);
    CopLoadPal(cp, bitmap->palette, 0);
    CopEnd(cp);

    CopListActivate(cp);
    EnableDMA(DMAF_RASTER);
  }
}
예제 #15
0
static void Init() {
  CopListActivate(cp);
  EnableDMA(DMAF_RASTER | DMAF_SPRITE);
}
예제 #16
0
static void Init() {
  CopListActivate(cp);
  custom->dmacon = DMAF_SETCLR | DMAF_RASTER | DMAF_SPRITE;
}