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; }
static void Load() { screen = NewBitmap(WIDTH, HEIGHT, DEPTH); cp = NewCopList(100); CopInit(cp); CopSetupGfxSimple(cp, MODE_LORES, DEPTH, X(0), Y(0), WIDTH, HEIGHT); CopSetupBitplanes(cp, NULL, screen, DEPTH); CopSetRGB(cp, 0, 0x000); CopSetRGB(cp, 1, 0xfff); CopEnd(cp); }
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; }
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); }
static void Load() { screen = NewBitmap(WIDTH, HEIGHT, DEPTH); bitmap = LoadILBM("data/sprites4.ilbm"); cp = NewCopList(100); CopInit(cp); CopSetupGfxSimple(cp, MODE_LORES, DEPTH, X(0), Y(0), WIDTH, HEIGHT); CopSetupBitplanes(cp, NULL, screen, DEPTH); CopLoadPal(cp, bitmap->palette, 16); CopSetupSprites(cp, sprptr); CopEnd(cp); sprite[0] = NewSpriteFromBitmap(19, bitmap, 0, 0); sprite[1] = NewSpriteFromBitmap(24, bitmap, 0, 19); sprite[2] = NewSpriteFromBitmap(42, bitmap, 0, 43); UpdateSprite(sprite[0], X(0), Y(113)); UpdateSprite(sprite[1], X(0), Y(110)); UpdateSprite(sprite[2], X(0), Y(101)); }
static CopListT *MakeCopperList(WORD n) { CopListT *cp = NewCopList(100 + 3 * HEIGHT); CopInit(cp); CopSetupGfxSimple(cp, MODE_HIRES, DEPTH, X(0), Y(0), WIDTH, HEIGHT); CopSetupBitplanes(cp, NULL, scroll, DEPTH); CopLoadPal(cp, font->palette, 0); { UWORD i; APTR ptr = scroll->planes[0]; for (i = 0; i < HEIGHT; i++, ptr += scroll->bytesPerRow) { CopWait(cp, Y(i), 0); linebpl[n][i] = CopMove32(cp, bplpt[0], ptr); } } CopEnd(cp); return cp; }
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); }
static void MakeCopperList(CopListT **ptr, WORD n) { CopListT *cp = NewCopList(100 + HEIGHT * 5 + (31 * HEIGHT / 3)); WORD *pixels = texture->pixels; WORD i, j, k; CopInit(cp); CopSetupGfxSimple(cp, MODE_LORES, DEPTH, X(STARTX), Y(0), WIDTH, HEIGHT); CopSetupBitplanes(cp, bplptr[n], twister, DEPTH); CopSetupSprites(cp, sprptr[n]); CopMove16(cp, dmacon, DMAF_SETCLR|DMAF_RASTER); CopMove16(cp, diwstrt, 0x2c81); CopMove16(cp, diwstop, 0x2bc1); CopSetColor(cp, 0, &gradient->colors[0]); for (i = 0, k = 0; i < HEIGHT; i++) { CopWait(cp, Y(i), 0); bplmod[n][i] = CopMove16(cp, bpl1mod, -32); CopMove16(cp, bpl2mod, -32); CopMove16(cp, bpldat[0], 0); CopSetColor(cp, 0, &gradient->colors[i]); if ((i % 3) == 0) { colors[n][k++] = CopSetRGB(cp, 1, *pixels++); for (j = 2; j < 32; j++) CopSetRGB(cp, j, *pixels++); } } CopEnd(cp); CopInsSet32(sprptr[n][4], left[0]->data); CopInsSet32(sprptr[n][5], left[1]->data); CopInsSet32(sprptr[n][6], right[0]->data); CopInsSet32(sprptr[n][7], right[1]->data); *ptr = cp; }
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); } }