🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #10077

BltMaskBitMapRastPort() HELP!!! Simple minterm source included..

#10077
From: Jon Wesener
Date: Thu, 20 Oct 1988 15:22
103 lines
3501 bytes
    1st, where is the documentation for this routine because I can't find
it in any of the manuals?  What I did find was a function call and
parameter list in a description of the amiga library calls that came
with my MANX compiler.

    I'm trying to use BltMaskBitMapRastPort() to blitter a source A,
through a Mask B into a destination C.  I'd like the minterm to do
the equivalent of D = AB | (~B)C where I'm assuming the destination is
C.  Thing is, all I can seem to get happen is C = ~A. 

	To make things easier for myself, I wrote a program which uses longs
as the bitmaps so that I can feed the program a few numbers (really bit 
patterns) and see what the results are by printing the value of the longs
out after the operation.

	What follows is the simple code (about a page) which should compile
without a problem.  I use a precompiled header file so there aren't any
include files mentioned.  Anyway, can someone tell me what I'm doing
wrong, and or explain how the above function is used/called?  Or
show me another way of doing what I'm trying to do?

thanx in advance,
--j

#------------< Cut here for minterm.c >----------------------------------#

/*
 * Minterm.c -- this file test the blitter mask routine.
 */

#include "stdio.h"

#define DEPTH 1L      
#define WIDTH 4*8L   
#define HEIGHT 1L

struct RastPort crast;
struct BitMap amap, bmap, cmap;
long * al, * bl, * cl;

struct GfxBase *GfxBase;

main(ac, av)
	int ac;
	char *av[];
{
	int minterm;

	if( ac != 5 ) {
		printf("usage: %s a b c minterm\n",av[0]);
		exit( 1 );
	}

	/* Open the graphics library. */
	GfxBase = (struct GfxBase *)OpenLibrary("graphics.library",0L);
	if( GfxBase == NULL ) 
		exit( 1 );

	/* Init bit map (for rasinfo and rastport). */
	InitBitMap(&amap, DEPTH, WIDTH, HEIGHT);
	InitBitMap(&bmap, DEPTH, WIDTH, HEIGHT);
	InitBitMap(&cmap, DEPTH, WIDTH, HEIGHT);

	amap.Planes[0] = (PLANEPTR) AllocRaster(WIDTH, HEIGHT);
	bmap.Planes[0] = (PLANEPTR) AllocRaster(WIDTH, HEIGHT);
	cmap.Planes[0] = (PLANEPTR) AllocRaster(WIDTH, HEIGHT);

	InitRastPort(&crast);
	crast.BitMap = &cmap;

	al = (long *)amap.Planes[0];
	bl = (long *)bmap.Planes[0];
	cl = (long *)cmap.Planes[0];

	*al = atol( av[1] );
	*bl = atol( av[2] );
	*cl = atol( av[3] );
	minterm = atol( av[4] );

	printf("a = 0x%x b = 0x%x c = 0x%x minterm = 0x%x.\n",
		*al, *bl, *cl, minterm);

	(void)BltMaskBitMapRastPort( &amap, 0, 0, &crast, 
		0, 0, WIDTH, HEIGHT, minterm, &bmap );

	printf("a = 0x%x b = 0x%x c = 0x%x minterm = 0x%x.\n",
		*al, *bl, *cl, minterm);

	FreeRaster(amap.Planes[0], WIDTH, HEIGHT);
	FreeRaster(bmap.Planes[0], WIDTH, HEIGHT);
	FreeRaster(cmap.Planes[0], WIDTH, HEIGHT);

	CloseLibrary(GfxBase);

	exit( 0 );
}   

#-------------------------< end of minterm.c >----------------------#
-- 
... {seismo | harvard } ! {uwvax | cs.wisc.edu} ! astroatc!jojo
"And when the sky is blue, there'll be no cocktails for you.
 But when the sky is black, you can have your bottle back..."
Technical Details
Message-ID: <1232@astroatc.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!haven!mimsy!tank!oddjob!uwvax!astroatc!jojo

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!haven!mimsy!tank!oddjob!uwvax!astroatc!jojo
From: jojo@astroatc.UUCP (Jon Wesener)
Newsgroups: comp.sys.amiga.tech
Subject: BltMaskBitMapRastPort() HELP!!!  Simple minterm source included..
Keywords: Help
Message-ID: <1232@astroatc.UUCP>
Date: 20 Oct 88 15:22:10 GMT
Organization: Astronautics Technology Cntr, Madison, WI
Lines: 103