home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 1: Amiga
/
FrozenFish-Apr94.iso
/
bbs
/
alib
/
d7xx
/
d761
/
blitt.lha
/
Blitt
/
manual
< prev
next >
Wrap
Text File
|
1992-11-21
|
11KB
|
280 lines
/*________________________________________________________________________
| |
| blitter.c v1.0 - © 1992 Paul Juhasz |
| |
| Started: July, 92 |
|________________________________________________________________________*/
General:
--------
Blitt © 92, is a utility to help programmers to experimentally find
Mask / MinTerm values for the BlitBitMap() / BlitMaskBitMapRastPort()
commands in 'C' or their equivalents in assembler. It can equally be
used for some graphic effects that may not be available otherwise.
Blitt was written on a ½-meg A1000 with one external drive, using the
Lattice C V3.03 compiler. It is entirely independent, just copy the
program, both pictures ( scribble/usascrib ) and Manual, NO other
support-files, fonts or libraries are needed.
Blitt is Copyright of P.Juhasz and is placed into the Public Domain
for unrestricted use by any individual at his or her own leisure. Any
possible damage arising from the use or misuse of this program is the
responsibility of the user. Non-commercial copying or distribution - as
part of a PD-collection - HAS to include at least this Manual from this
directory. It is prohibited to copy or distribute Blitt for commercial
gain, be it on it's own or as part of any other package or application
without the prior consent of the Author. Any breach of this restriction,
whether out of ignorance or intentional, will cost the peace of mind of
the perpetrator - bringing with it BAD karma.
Contents of directory:
----------------------
Blitt Blitt.info - The program itself
Manual Manual.info - This text file
USAScrib USAScrib.info - NTSC Picture for U.S.A.
Scribble Scribble.info - PAL Picture for the rest
The Panel:
----------
All the gadgets on the panel should be self-explanatory, so there
is no need for lengthy explanations. Here is a list as they appear from
left to right:
red ON gadget - will 'switch off' the program - exit
Screen resolution - not implemented
Disk - save the screen as a IFF ILBM
Brush - define source for blit
BitMap/Mask - straight or masked blit
UNDO - ah, right...
BLITT © - some help
Mask - more help
Minterm - even more help
Wheels ( 4 ) - these turn the numbers up/down ( 0 to F )
Black/White - the screen depth gadget ( one-way only )
Usage:
------
-Click on `brush' icon - mouse-pointer will change to `Srce'
-Define outline on display - mouse-pointer will change to `Blitt'
-Set Mask and Minterm - FF/C0 = straight copy
-Put the brush anywhere
-Click on `brush' icon - mouse-pointer will change back to arrow
Clicking on the `disk' icon opens a requester with a string gadget to
save the screen in standard IFF ILBM format, compatible with DPaint.
- to get rid of the panel, press RMB at any time ( except requester up )
- on the help-pages RMB will take you back a page, while LMB or
any key will advance a page
Key shortcuts:
--------------
q - quits u - undo
p - panel up/down b - start/stop brush
m - toggle mask
h - this help page
`C' specifics:
--------------
The syntax of the commands should be available from any good book,
but here is a quick recap:
planecnt = BltBitMap( srcBM, srcX, srcY, dstBM,
D0 A0 D0:16 D1:16 A1
ULONG = BltBitMap( struct BitMap *, WORD, WORD, struct BitMap *,
dstX, dstY, sizX, sizY, Minterm, Mask [, TempA ] )
D2:16 D3:16 D4:16 D5:16 D6:8 D7:8 [ A7 ]
WORD, WORD, WORD, WORD, UBYTE, UBYTE [, UWORD * ] )
Most of the parameters are self-explanatory, all coordinates as well
as width/height are pixel values.
Minterm specifies the way the source is treated as it is copied to
the destination, whether it is a straight copy ($C0) or whether it is
logically combined with the destination.
Mask specifies the bitplanes that are to be affected by the copy.
TempA is a temporary buffer for blits where source and destination
overlap. It can be left out altogether.
void BltMaskBitMapRastPort( srcBM, srcX, srcY,
A0 D0 D1
( struct BitMap *, WORD, WORD,
dstRP, dstX, dstY, sizX, sizY, minterm, bltmask )
A1 D2 D3 D4 D5 D6 A2
struct RastPort *, WORD, WORD, WORD, WORD, UBYTE, APTR )
In this case minterm is restricted by software to $e0 if you set
the dial to >= $a0, otherwise the program uses a minterm value of $20.
The mask used in this operation, pointed to by bltmask, is a single
bitplane from the display-bitmap - its top left corner defined by
clicking on the display. This can be easily selected with the right wheel
of the mask-dial. The Mask will be the same size as the brush that is
subsequently defined.
Normally the Mask parameter specifies the bitplanes that are affected
by the blit operation.
In the case of blitting through a mask, whatever value is set, will
be logically AND`ed with $07 and limited to the number of bitplanes of
the display to get a single bit-plane to act as the mask.
The mask is selected by clicking on the icon that looks like rows
of red, green and blue dots and changes to a `mask' when selected.
The mouse-pointer changes to `Mask' and you can click the top-left
corner of where your mask is located, after which the mouse-pointer
changes to the usual `Srce' to let you cut out the brush.
Tutorial:
---------
To start with, you can either use one of the sample pictures ( PAL
and NTSC should both be present in this same directory ), or take the
more individual route, much more artistic...
Load up DPaint or any other grafix tool and write some coloured
text down the left hand side, each line a different colour and any
font you like. Into the right hand side, place a part of a picture,
one of your own brushes or one taken from the public domain.
Once the picture is saved, remember to make sure it's got an icon,
click on this, hold shift and double-click on the Blitt icon. CLI
users please shut up - you know what to do. There are no switches etc..
Once Blitt is up, it will display your picture. This, for the time,
has to be a low resolution ( 320 x 256/200 ) IFF ILBM screen. The panel
comes up with Mask & Minterm values set for a straight copy.
To start, click on the brush gadget - the mouse-pointer will change
to `Srce' - and drag the pointer from the top left of the area you want
to copy (the block of text in this case) to the bottom right. This, on
releasing LMB, defines the size of the brush. This is limited to ¼-screen
size if there is insufficient memory, otherwise the entire display can
be picked up - what would anyone need that for...
Once the source is defined, the mouse-pointer changes to `Blitt'.
Now we can set up a minterm value - if we have not already done so.
Respective values for mask/minterm FF/E0 is quite allright for this
example. After this we can put the brush down on the destination, in
this case on the picture in the right half of the screen.
If the result is not quite as expected, there is the Undo gadget and
many possibilities with different mask/minterm values. Blitting through
a mask can also give interesting results or try to use different types
of pictures with different colours.
Credits:
--------
Paul Juhasz - Design, Gfx and coding
Janice Bailey - Crash testing and lots of moral support
Special thanks also go to:
Anders Bjerin - the Amiga C Club and Intuition examples
Robert Muszinsky - for the copy-parties ( PD only! )
And the F-19 Crew:
Baggy Undercarriage - "Mavericks! Mavericks!"
Johnny Ace - "Steady on - flaps down..."
Hippy Warrior - "Sneak up on Pechenga..."
TROJAN - "How about a game of Golf?"
History:
--------
The original version of Blitt was written for my own convenience, it
took two weeks using `nasty' low-level graphics, took over the system and
was about as friendly as a side-winder at close range. It was fast, but
it only worked for ME, and then only when I was threatening it with
everything in my tools: directory.
Since there still must be people with less patience than myself, it
was soon decided that Blitt needs to get civilized to be useful to anyone
who just wants to click and go. That's why it now uses WorkBench icons,
the Intuition library, allows any other task to get on with its business,
doesn't trash or steal memory on exiting and works happily on ECS/V2.0
or even NTSC systems. The latter I am only hoping it does, since I could
only test it with the help of my trusty old ½meg A1000, which sometimes
(mostly after it's been thoroughly confused!) boots up into NTSC.
The brush movement is still far too slow with large brushes, but on
the other hand, all gadgets are available at any time, including the
depth-gadget, which will put both display and panel to the back. If a
brush is active when you need to re-activate Blitt, click on the panel
first so the brush does not get copied to the display.
Since I think the Amiga is beautiful, I tried to take as much care
in writing this program as I could, but as humans are quite fallible,
I would appreciate any feedback on the program's usage, features and
possibilities.
If you find any bugs or can think of any improvements, please get
in touch with:
P. Juhasz Tel.: 081 677 9425
28 Ellora Road
Streatham Common
London SW16 6JF
* * * * *