

	SCEDIT v1.0             7/25/91 George Christopher Thomas
			       	Copyright (c) 1991, George Christopher Thomas



	***** disclaimer *** disclaimer *** disclaimer *** disclaimer ******
	*                                                                  *
        * Some monitors are not capable of dealing with all of the modes   *
        * that the driving display card is capable of.  This can result in *
        * damage to the monitor.  SCEDIT does not attempt to prohibit	   *
        * any video modes.  Do not knowingly select a video mode that your *
        * monitor can not deal with!   					   *
	*                                                                  *
	***** disclaimer *** disclaimer *** disclaimer *** disclaimer ******




	File Viewing and Screen Editing Utility
        -----------------------------------------

	SCEDIT is a utility for the display and editing of images.  Currently
it can show images in the GIF (Compuserve), TGA (Targa - TrueVision), 
BMP (Windows 3),  and PCX (PC Paintbrush) formats.  You control where to 
place the image on the screen and what kind of color conversion to use.

        A true-color (16,24,32 bits/pixel) image will always be displayed
using the Uniform Palette capability.  Color mapped images (1,4,8 bits/pixel) 
can be displayed using either a Uniform Palette or the palette encoded with 
the image.



        Required Environment
        -----------------------------------------

	SCEDIT can use either the Vesa or Tiga environments.  It will try
to use Vesa first, then Tiga.  If either are found, it aborts.
            1. Vesa  - tested with several Tseng ET4000 based VGAs.
                       Supports Tseng HiColor 16bit color modes, if 
                       available.  Since I determine a Tseng board by
		       searching for the Tseng copyright in the VGA bios,
		       it may have some problems with some Tseng based
		       boards.  Never tried with an ET3000 based VGA.

		       Does not work with non Vesa modes - only Vesa 
                       defined modes, 640x400 and above.  Standard VGA mode
                       0x13 (320x200) and its variations are for the birds.		

                       Using Vesa, SCEDIT MUST BE RUN FROM THE VGA SCREEN.  
                       It will not work when executed from the Monochrome 
                       Adapter screen.

		       7/15/91 - tested with more boards:
	    	         Tseng ET4000 based (STB, Boca, Speedstar, Vermont
			  Microsystem's Design Master),  Video Seven
                          VRAM II (1MB),  ATI VGA Wonder.

            2. Tiga - tested with Vermont Microsystem's boards, Hercules
		      Graphics Station,  TI 34020 SDB boards.  Supports
		      Hercules Graphics Station at 24-bits, and Vermont
		      Microsystem's Cobra Elite at 24-bits (somewhat of a 
		      hack to get Tiga to work with 24bit Elite).  Will not 
		      work correctly on a 4-bit/pixel Tiga board.

		      Notes: 1) On stock Hercules Graphics Station card (with
                             just the 1Mb VRAM), the 16-bit (32,768 color)
                             modes and the 640x480x8x2 double buffered mode
			     (the last mode listed) do not work.
			     This is due to lack of memory for Tiga download
                             primitives.  Note that the 512x480x24bit mode
                             is also memory deficient - but more importantly
                             the TI34010 GSP's graphics instructions can't 
			     deal with more than 16 bits per pixel.  Therefore,
                             the 512x480x24bit mode is done completely on the
			     host.  It is conceivable that the 16-bit (32k color)
			     and the 640x480x8x2 modes will work on versions
                             of the Hercules card which have the DRAM
		             populated - this is uncharted territory.
			     So DO NOT SELECT THESE MODES UNDER TIGA!!!!

		             2) Under Tiga, SCEDIT prints out a bunch of 
                             status messages to the DOS screen.  If run from
                             the Monochome Adapter screen you will see these
                             messages.  If run from the VGA screen, you will
                             not see them.  This will be removed in later
                             versions.
		 	     
	              Support for Hercules Graphics Station at 16-bits/pixel
                      is forthcoming.

	SCEDIT requires an expanded memory driver.  It will try to allocate
2MB, but will take whatever is available.  The 800x600x16bit or 
512x480x32bit modes will require about 550K to do the largest saveunder.
If you use the save/restore screen functions, you will need much more memory.
The 550K figure also is with the default fonts.  Under Tiga, if you load a 
huge font (say above 30 pts), you will need much more memory.  EMS is used 
only for saving/restoring under menus ("saveunders").  Lack of EMS will simply
mean that menus are not restored.  SCEDIT is still quite usable - just use one
part of the screen for menus and the rest for images.  The biggest hog of 
EMS (besides the save/restore screen) is the "about" dialog box.  If you
save a screen, then exit SCEDIT without restoring it,  SCEDIT may not 
restore the EMS memory to the system.  

	It also requires a Microsoft or compatible mouse driver.

	SCEDIT needs most of the lower 640K of memory to function correctly.
I use it with about 470K free (as CHKDSK reports).  I have had problems
in machines with less memory.  SCEDIT will recognize network disks and 
floppies.  I recommend not loading images off of floppies, as it is 
deathly slow.

	SCEDIT runs on all 386/486 machines.  It should run on 286s, but I
have never tried it.

	Under Tiga, SCEDIT will try to download the RealTime fatbits
extension, tigafbit.rlm.  This file should either be in the current directory,
or in the directory specified in the TIGA environment variable (in the
-l<path> spot).  Under Tiga, SCEDIT will create a configuration file, 
SCEDIT.CFG, in the directory where SCEDIT.EXE was executed from.  This 
is to speed up the Tiga initialization.  It sometimes does strange things.
This is due to an unfathomable bug in SCEDIT.  I am trying to nail this one.
If you have lot of problems, run scedit with the -n switch:
		SCEDIT -n
This will force a rebuild of the configuration.	

	If SCEDIT really screws up, and your video is all screwed up, you can
get back to DOS by clicking on the right mouse button, then hitting any key.
This usually works, but may not if SCEDIT is really lost (SCEDIT has been 
very stable, so this should be a rare, if not totally unknown, event).
	

	Philosophy
        -----------------------------------------

	SCEDIT was originally written to address the need for a simple
screen editing and file viewing facility.  As it evolved,  more emphasis
has been place on file viewing.  As a result, the screen editing functions
have atrophied - they are still there, but not nearly as functional as a
real "paint" program.  I will probably not be enhancing these drawing 
functions - unless there is a Great Public Outcry!

	The left mouse button is wired to control "actions", such as
the drawing features.  The right mouse button is wired to control menus.

	Because of the disparity between the Vesa and Tiga environments, 
there are several features which work only in particular environment.		
These are enumerated in a later section.



        How to Use - File Viewing Tutorial
        -----------------------------------------

        Type SCEDIT and hit return.  A cursor will appear.  Click on the
right button to pop up a menu.  Menu entries with a little right arrow
denote submenus - simply move cursor over the arrow to bring up the submenu.
At anytime, moving the cursor outside of a menu will close that menu.
The exception to this is the Load menu.  The load menu will not go away
until OK or Cancel is pressed.  The load menu is not considered a submenu,
and therefore the envoking menu does not have a right arrow next to the
"Load" entry.

        Try clicking on the Load entry.  You will see the load menu pop-up.
Note the field for the Drive, Directory, and Filename.  Note that wild
cards are supported for the Filename.   If you click on one of these fields
the arrow cursor will disappear and a text cursor will appear.  You can
use the backspace key to delete characters.  Hitting the return or a mouse
button when finished will update the file box, using the new information.

        Look at the file box.  You will see a list of files, one of which
having a highlight bar.  Clicking on a highlight bar will:
                - if the bar is over a file, try to load that file,
                - if the bar is over a directory, switch to that directory,
                - if the bar is over a drive, switch to that drive.
        Clicking on another file with move the highlight bar.  Clicking on
an already highlighted file name is a short cut for clicking on OK.

        Beware switching to drive A or B - if your disk is out of the 
drive, and DOS issues a "Abort, Retry, Ignore?" message, you will NOT SEE
THAT MESSAGE because you are on the hi-res screen!

        You can also use the scroll bars to navigate through the file box.

        After clicking on a legal file (recognized format),  SCEDIT will close
the load menu and display a box depicting the image's size.   You can 
position the box anywhere, even clipped, on the screen.  Clicking the right
button will cancel the image, clicking the left will start displaying it.

        There are a few other things - you can turn on/off the Uniform
Palette, and if your board supports multiple modes you can
switch back and forth between them, etc.

        Just try it.



        How to Use - Other Features Tutorial
        -----------------------------------------
	
	Here is an enumeration of the various menus.  If an arrow is 
after a menu entry, that entry has a submenu.   If an * is before a 
menu entry, that entry is merely a toggling switch.  The main menu is popped 
up with the right mouse button.

	Notes: after loading an image using the uniform palette capability,
		you must explicitly load the uniform palette (using the 
		palette submenu).

	main menu:
		draw  ->        drawing functions, assigned to left button
		state ->	state changes - colors, rops, clipping, etc
		mark  -> 	area mark stuff - boxes, polys
		edit  ->	fatbits, palette editing
		load		file loading submenu
		save		file saving submenu
		about		a little message
		quit		exit back to DOS


	draw:  - these are assigned to the left mouse button.  Once 
		 selected they stay attached to left mouse button until
		 another is selected.  Subject to current color, fill flag,
		 ROP, clipping (all set from states submenu):

		line		draws vectors.  click on left to anchor
				first point, click on left to anchor and
				draw each line.  click on right to stop.
		cline		same as line, but connects first point
				with last, when right button is pressed.
		sketch		click on left button, move mouse to draw
				points, click either button to stop.
		area		move cursor to desired point, click on left
				button to seed fill from there.  Tiga only.
		circle		move cursor to desired center point, click
				on left button, move mouse to move circle,
				click on left to accept, right to abort.
				Tiga only.
		ellipse		move cursor to desired center point, click
				on left button, move mouse to move circle,
				click on left to accept, right to abort.
				Tiga only.
		rect		move cursor to desired point, click on left
				to start, drag rubber rect to desired point,
				click on left to accept, right to abort.
		flood		move cursor to desired point, click on left
				to flood screen
		point		move cursor to desired point, click on left
				to draw a point.
		blkmov		must have previously marked an area using the
				mark submenu.  click on left button, move
				box to desired location, click on left to
				accept, right to abort.  copy box from marked
				area to destination area.
		zoom		must have previously marked an area using the
				mark submenu.  click on left button, stretch
				box to desired location, click on left to
				accept, right to abort.  Will do a "stretch
				blit" from marked area to destination area.
				Tiga only.
		zoomout		must have previously marked an area using the
				mark submenu.  click on left button, stretch
				box to desired location, click on left to
				accept, right to abort.  Will do a "stretch
				blit" from marked area to destination area.
				Variation of zoom. Tiga only.
		poly		don't work.
		copy poly	must have previously marked a poly using the
				mark submenu.  click on left button, position
				poly's bounding box to desired location,
				click on left to accept, right to abort. Will
				copy poly from marked area to destination area.
		rgb mesh	this is a complicated one.  basically, you
				move the cursor to a desired vertex, click
				on left, select the RGB color you want, click
				on right to confirm RGB color.  Keep moving
			        and selecting new vertices (with RGB colors).
				Keeps a "running" triangle mesh.  Click on
				right to stop.


	states:  - these are for setting the drawing states - colors, ROPs,
		   clipping,  palettes, video modes, fill flag, color 
		   conversion:

		color		brings up a 16x16 grid of all 256 colors.
				the current color has a X over it.  If you
				click on left button inside of the color
				grid, the color you were over becomes the
				new drawing color.  if you click outside the
				color grid, the current color remains
				unchanged.
		rop ->		bring up the rop submenu.  these are all the 
				Tiga Rops.  Vesa supports only 
					s
					s NOT d
					s XOR d
				at the moment.  selecting others under
				Vesa will result in strange things.
				Under Tiga, Rops apply to most everything-
				all of the drawing stuff, including blkmovs,
				but not RGB mesh.
		fill ->		brings up fill submenu.  for setting the fill
				flag.  affects drawing stuff - rects, circle,
				ellipse, poly (when implemented).
		palette ->	palette selection submenu.
		modes ->	all available video modes.  just pick the
				one you want and away you go.
		clipping ->	clipping submenu.
		* Uniform Palette    if on, all images are loaded into
				a uniform palette.  Not all that great for
				24-bit images, but fine for previewing.
				if off, all images are loading using their
				"native" palettes.  Exception: 16,24,32 bit
				"true color" images ignore this flag and
				are always loaded using the uniform palette.
		* transparency  does not draw pixels of color 0.  used
				to "overlay" images with black areas over
				previous images.  Not implemented yet.
		pick color 	move cursor to pixel whose color you want
				to be the current drawing color, then click
				left button.  Not implemented yet.
		nearest color	brings up the palette editing menu.  pick
				the RGB values you want for the current 
				drawing color,  will set the current drawing
				color to the nearest available color in the
				palette.
		* verbose	if on, gives information about files being
				viewing, etc.  For my debugging purposes,
				as it either prints to the monochrome
				adaptor screen, or in Vesa, prints right
				onto the graphics screen, screwing everything
				up.  I will eventually have this work with
				nice graphical text boxes.  But, stay away
				for the moment.


	palette:  - for setting current display palette, saving/restoring
		   palettes, and palette cycling.

		* uniform	palette used for uniform color conversion.
		* cone distribution    palette with lots of colors/shades.
				good for drawing stuff.
		* grey scale    an approximation to a real grey scale.
				Fun to load an image using the uniform
				palette capability, then selecting this
				palette for a cool grey scale image.
		* acad 16	why?
		* acad 256         - because we can.
		* last image's palette    loads the palette which the 
				previous image had.  has bugs.
		push		push current palette onto a stack
		pop		pop palette from stack and make current.
		cycle		cycles the current palette.  Use -,+ to
				control direction, 0-9 for speed, space bar
				to pause (until another key press).  Use
				left mouse button to stop at current cycle,
				right mouse button to stop and restore to
				original, uncycled, palette.


	clipping:  - for setting the clipping window.
			respected by file loads and drawing stuff.

		set to box	much like the rectangle draw.  allows you	
				to select the position and size of the 
				clipping window.
		set to full screen	resets clipping window
		edit box	allows you to edit size/position of window.
				described below.


	mark:  - for marking areas of the image for later manipulation.

		box		much like rectangle draw.  allows you to
				select the position and size of the mark
				box
		edit box	allows you to edit size/position of window.
				described below.
		line poly	mark an area bounded by line segments
		sketch poly	mark an area bounded by an arbitrary polygon.
				has some bugs.
		push box	push the image in the box onto a stack
		pop box		pop an image from the stack, allowing you
				to place box anywhere.
		push poly       similar to push/pop box, but operates on the
		pop poly	   polygon mark.  Not implemented yet.
		save screen	saves entire screen to EMS.
		restore screen	restore entire screen from EMS.



	edit:  - for editing areas of the image, and for editing the 
		 current color's RGB.

		edit fatbits	brings up the fatbits box. Works by capturing
				what is under the cursor when the left button
				is pressed.  This is blown up in the fatbits
				box.  You can then move the cursor into the
				fatbits box and draw individual pixels using
				the current color and rop.  click on right
				button to stop.
		edit palette	brings up the palette box.  adjust the 
				current color's RGB using the RGB and HSV
				sliders (using left button).  click on right
				within the box to select the changed color, 
				outside	the box to abort any changes.
		set fatbits size ->		brings up size submenu.  You
				can pick 2,4,8,16,32,64 as the fatbits size.
				The size of the total fatbits box can't be 
				changed.  This changes the size of the blown
				up pixels within the box.  Also applies to
			        the RealTime fatbits.
		* grid		turns off/on the fatbits grid
		* antialias filter	when on, editing fatbits will try
				to smooth the selected pixel with it's 
				surrounding pixels (averages RGBs, then picks
				nearest color).  Doesn't work all that well.
		* RealTime fatbits 	Turns on/off the Tiga realtime 
				fatbits display.  This blows up the pixels
				under the cursor, every vertical retrace, 
				using the Tiga download interrupt extensions.
				for display only.
		resize/move realtime	lets you resize/move the realtime
				fatbits box.  See the edit box description
				below.
		reset realtime fatbits	resets the fatbits box to the upper
				left of the screen.

		Notes: the realtime fatbits are for Tiga only.  It does not
			save what is under the box (not yet...).  It respects
			the fatbits size, but not the grid or antialias
			features.

	
					
	load:  - self explanatory.  Loads TGA, GIF, BMP, PCX, FNT, PAL
		files, with the following restrictions:

                GIF   - only 87a format, single images.
                TGA   - not known if SCEDIT supports Black&White format.
			(no test images).
                PCX   - bugs with certain images - when a scanline is 
                        run length encoded across scanlines.
                BMP   - uncompressed only, no OS/2 bitmaps.
		FNT   - Tiga only.  works Great.
		PAL   - ascii palette list. first line is "PAL", second
			line is # of colors, rest of lines are Red Green 
			Blue values.
		RAW   - SCEDIT format for a raw bitmap.  First word of
			file is x size, second word is y size, subsequent
			bytes are image data.  no palette info included.


	save:  - self explanatory.  Saves GIF, RAW, PAL files.
		You must have a box marked to save an image.

		GIF   - there is a bug in SCEDIT.  After saving the first
			GIF file, subsequent saves are screwed up.
			I am working on this.
		PAL   - same as above.
		RAW   - same as above.

		Notes:  bug when trying to over-write an existing file.	
					


	edit box - all things that have an "edit box" entry use the same
		routine.  When you pick edit box, the box will be displayed
		with 9 "handles".  There is one at each corner, one at
		each edge midpoint, and one in the center.  Move the cursor
		to the handle you wish to grab, and hold the left button down
		while you drag.  Repeat until box is the size and position
		that you want.  The center handle moves the box, the other
		handles resize the box.  Then click on the right button to
		indicate you are done.  


	Notes:
	    Most of this stuff works in 16/24 bit modes.  The exceptions
are the fatbits, palette editing, and palette menu functions.



	
	Configuration File
        -----------------------------------------

	In Tiga, SCEDIT creates a configuration file which lists all of
the Tiga modes.  The first time this may take a moment or two.  Subsequent
executions of SCEDIT use this file to get the default font, default palette,
and the available modes.  The file is SCEDIT.CFG and will be in the
same directory as SCEDIT.EXE (SCEDIT looks at the execution string at the
end of it's PSP to determine this -- DOS 5.0 should work...I have used it 
with DOS 3.3 and DOS 4.01).

There is an example configuration file:

SCEDIT v1.0
device TIGA
font none
palette none
reserved *** this line is RESERVED! ***
current mode 0
number of modes 5
mode 1024 768 8 8192 8 1
mode 1024 384 8 8192 8 1
mode 800 600 8 8192 8 1
mode 640 480 8 8192 8 1
mode 512 480 32 16384 8 1

	SCEDIT's parser is really stupid -- everything must be in the exact 
place. If you want to add a default Tiga font, replace the font line with:

font <drive:path\fontfile.fnt>

with exactly 1 space between the font and drive/path.  This font will be
loaded when SCEDIT starts up and after each mode switch.  The Tiga font
austin20.fnt is a cool font.

	The same goes for the palette line.  The palette file is a standard 
SCEDIT .PAL file.

	If you switch Tiga boards (which have different modes, etc), you 
will want to either delete the old config file, or use the -n flag:
	SCEDIT -n
which will force a configuration rebuild.

	In VESA, SCEDIT will ignore the configuration file.  It will not 
check for one, read one, or write one out.  This makes it relatively easy
to switch back and forth between Vesa and Tiga.



        
        Limitations and Known Bugs
        -----------------------------------------

        The input fields in the Load menu will overflow if too many
characters are entered.

	There are some cursor bugs under Vesa.

	The fatbits, when used with a size of 2 or 4, will sometimes
screw up.

	The connected line, cline, does not work correctly.  The next to
last line segment is not drawn.        




        Future Support
        -----------------------------------------

        The input field overflow problem in the Load menu will be fixed.
	
	Cursor bugs will be fixed.

        The following file formats will have the following enhancements:
                GIF   - 89 format, multiple images, etc.
                FLI   - small format, Autodesk Animator.
                FLC   - large format, Autodesk Animator Professional.
                TGA   - Black&White, if I can find a test image...
                BMP   - compressed format.  No plans for OS/Who? format.
                PCX   - fix stupid bug
		FNT   - for Vesa.  I have this code ready to roll.

        I hear the distant baying of TIF supporters.  It would be a 
tremendous task to write a TIF decoder which could handle all the TIF 
formats, but I am considering adding support for the commonest formats.
The main obstacle is the lack of a copy of the TIF spec.

	Better Tseng detection.

	Flesh out the drawing functions for Vesa (circles, etc).

	Some of the functions in SCEDIT will probably be removed or
drastically altered.  I am not happy with the save screen, restore screen,
push box, pop box, push poly, pop poly features.  I might axe them.  I 
might rewrite to eliminate the stack metaphor, perhaps moving away from
expanded memory, perhaps using the hard drive for storage.  Who knows - 
certainly not me!  I think the drawing functions are quite primitive and
are really useless for anything other than hacking around, but after all
SCEDIT is not a paint program.

	Eliminate the need for expanded memory, at least under Vesa.  On
1Mb VGAs there is a fair amount of non-displayed memory to use instead of
using expanded memory.



	Cool Things
        -----------------------------------------

	As always, I am on the hunt for the following devices -
            these should work with v1.0 SCEDIT:
		* 1280x1024x256color Vesa VGA (packed pixel), 
		* 1024x768 16bit HiColor Vesa VGA (Yeah!),
		* 1024x768 16bit or 24bit Tiga (Yeah! Preferrably a 34020!),

             will not work with v1.0, but I am curious:
		* any Vesa VGAs with non-chain 4 modes.  Non-chain 4 is why
	          SCEDIT is so fast on Tseng ET4000 based boards.  Although
                  the Vesa spec allows for "non-chain 4" video modes, SCEDIT
		  currently ignores any non-chain 4 VESA mode.  It selectively
		  uses non-chain 4, for rectangles only. In my experience, non-
		  chain 4 mode, in high resolution modes (>64K), works only on 
		  a Tseng ET4000.  Video Seven and ATI both fail (others may
		  too - I have tested just these).  This is understandable, 
                  as non-chain 4 seems to be directly descended from the old 
	 	  EGA 16 color planar architecture, with its 64K memory
                  limitation.   Non-chain 4 lets you write 4 8-bit pixels
		  at once.  The Great Clone Maker, whose name begins with
 		  a 'c' and ends with a 'q', from the Lone Star state,  has
		  advertized their new accelerated VGA (goes up to 640x480x
		  256 colors - boy they're really out on a limb this time...
		  yah...) as having both packed pixel and "multiple plane" 
		  modes.  I suspect that the multiple plane modes are really 
		  nothing more than non-chain 4 in disguise, but who knows.  
		  I digress.  Anyhow, Bravo Tseng!  



	Disclaimer
	--------------------------------------
	SCEDIT is freeware.  You are granted the right to use SCEDIT for as
long as you like, provided it is not used for commercial purposes or for any
profit.  SCEDIT may be freely copied and distributed but may not be sold.
You may not reverse-engineer, disassemble, modify, alter, rename, contaminate
with a virus, or otherwise muck with SCEDIT.  Just use it.

	SCEDIT is distributed without warranties of any kind, either expressed
or implied, including but not limited to implied warranties of merchantability
and fitness for a particular purpose.

	In no event shall I, George Christopher Thomas, be liable for any 
errors contained herein or for incidental or consequential damages in 
connection with the furnishing, performance, or use of the SCEDIT product or 
documentation.

Nasty copyright stuff:
'GIF' and 'Graphics Interchange Format' are trademarks of CompuServe
Incorporated, an H&R Block company.



	Epilogue
	--------------------------------------

	Trademarks are property of their respective companies.  This
document is by no means intended as a brand or product endorsement.

	Many thanks to Tom Haviland for his exhaustive testing of SCEDIT
with the Hercules Graphics Station card.

	I am not charging for this utility.  Feel free to distribute it,
provided it is distributed intact, as SCEDIT10.ZIP:
		scedit.exe
		scedit.doc
		tigafbit.rlm
        If you do upload SCEDIT10.ZIP somewhere, this is what the description 
should say: "file viewing utility, Tiga & Vesa VGA".

        Note that the distribution name is SCEDITxx.ZIP, where xx is the
version number (i.e.,  10 for version 1.0,  11 for version 1.1, etc...)


	If you really like the program,  you might consider sending me
a few bucks to support further development and bug fixes.  Donators will,
of course, receive the latest version.

	Lastly, let me know if you have a Tseng HiColor VGA which is not
detected correctly (my bios "Tseng" search may let a few implementations
fall through the cracks...).

	Send bug reports, suggestions, etc, to (at least until May 1992):
		G. Chris Thomas
		221 Pine St, Apt 3
		Burlington, VT 05401

	I hope you find this utility a useful one.
	
