Bad Seal source code
-
-
-

These files are Bad Seal 0.54 source code. They 're better than preview 1 but
almost anything is unfinished.

Licence:
--------
All source code taken from Michal Stencl's SEAL is licenced under GNU Public
Licence (read the file 'copying'). Bad Seal source code (anything but Michal's)
isn't GPL, but just free and i'm releasing it's source code.

Here is a list with what the archive contain except SEAL improved sources:

* Bad Controls with Bad Editor control (unfinished)
* Bad Clock
* Bad Editor (buggy)
* Control Panel for Bad Seal (buggy)
* Unfinished (and buggy) DataBaseFiles (DBF) Editor
* Digital Clock for Bad Seal
* DLX Installer and Extension Installer for DOS
* Bad Seal Help System (HELP) v0.1 and HELP Compiler including HLP sources
* Help Panel and Help Studio
* Bad Seal Registry Functions 0.3
* Registry Editor for DOS version 0.1
* Registry Editor for Bad Seal (just started and buggy)
* Application executor (Run...) for Bad Seal
* Seal Installable Packages generator
* Seal Installable Packages (SIP) (little buggy)
* Bad Sector's SNAKE (unfinished version 2)
* Space monitoring program
* SPlorer 0.53
* SealScript library 0.1
* Strings list functions (strings.c and strings.h)
* TeleBOOK application, improved for use with Bad Seal 0.54
* Source code from "Creating a SEAL application step-by-step"
* TXT to Registry converter (see below on how to build registry)
* Volume configuring application


How to build registry
-
-
-

 I'm not including Bad Seal registry with this package. Anyway,  you can
built registry using the TXT2REG.C utility. In this package i have some TXT
files that end with "...reg.txt". Compile the TXT2REG.C and REGISTRY.C (open
them in RHIDE and make an EXE file) and then execute it. Enter the filename
for the .TXT file and wait until creates the keys. Do the same for every
.TXT file.


JDH additions 9/6/2001

The registry is now optional - and is compiled out in this version.
(see registry.h to see how)
You can use the seal.ini file enclosed instead. Translation between registry
and .ini file is obvious enough, I think, from that example. The full tree-
structure is not really neccessary - most functions assume the tree exists down
to some level but since others may want to search its worth keeping it fully
expanded the way I have indicated. The seal.ini file is read just once and cached, 
unlike the registry database which, apart from being 10 times the size, is opened 
and closed hundreds of times during startup.

I'm afraid I hate binary configuration files - you can't fix them if(when) they 
go wrong - which is my excuse for the modification.
I haven't written the macros to implement write functionality so Bad Sector's
control panel will not compile.

I have removed the (flashy) BadSeal startup bits detailing which extensions were
being loaded because there was a bug in them somewhere (sorry). I have also removed
the code overriding allegro's exception handling - I just wanted to be sure the
new allegro library had all it needs. Quite probably it can be reinstated.

Sane defaults have been added so Seal will run (a mininimal app that can load dlx's
and run progs) without any seal.ini file whatsoever and gives a satisfactory system with
even the most minimal version.

I have undone certain of Bad Sector's additions to the app struct to allow
it to run unmodified standard apps. Sadly we loose the ability to maximise
windows and the application specific icon in the top left of the windows.
I hope to impliment a mechanism that will allow adding to the libraries in a way
that is both supportible and extensible in the near future at which point I will
undoubtedly give him back those.

The sources now use the current WIP allegro libraries, (unmodified - unlike Mr 
Stencl's original) and the latest allegttf library from Doug Eleveld 
(D.J.Eleveld@anest.azg.nl deleveld@dds.nl)
The only externally visible sign is that our startup.cfg file is no longer used,
the standard allegro.cfg file will be used instead. Sorry about this, its a problem
in the new allegro libraries (to do with supporting dlls) which appears to mean we
can't have our own allegro config - at least not the way it used to.

The seal.dbg file is no longer kept open once the initial phase of startup is complete.
The debugging information that used to be written there (specifying what extension is
used to run a file) is now written to the standard error stream. It gets lost when
seal exits of course but you can use one of the available send_standard_error_to_file
redirectors if you have a problem. The mss library is no longer used either, meaning
that once started, say from a floppy, it makes no disk access and you can remove its
disk without problems.

I removed the right-mouse to move a window code, my move window code doesnt look good
with partially obscured windows. I also altered the code for drag-n-drop from 
ctrl-left-mouse to left+right+mouse buttons (middle-mouse-button if you have a 
three-button mouse). It seemed more friendly (key+mouse is awkward) and also happens
to be compatible with unix conventions.

A tad controvertially I suppose, I merged all the source files, lists.c, screen.c etc
together into one humongus prog.c. The compiler does that anyway since they were all
#included from the main file which makes their separation irrelevant. Why? It makes the
line numbers for symify and in gdb sane (for debugging).

The .bat files enclosed all have -mpentium specified, you will have to remove that if you
want your ancient 286 to run this, I know some of you like utilising these fossils
but, look, this is the 21st century. Everything now compiles cleanly with -Wall -
all the things that produced compiler warnings having been fixed. Full optimisation -O3
with all the other goodies also helps speed thing up somewhat.

There is a memory trashing bug somewhere in hpage which I have alleviated but haven't
(yet) fully tracked down. It does stay in the air for a reasonable length of time now 
but I still wouldn't trust it much.

Apps will probably need recompilation to pick up the various changes in the allegro
library from their headers. One or two even seem to work right out of the box. Sadly
the changes to the allegro keyboard code means keys wont work though - a shame since I 
tried very hard to make the port run unmodified old code.

JDH additions 01-7-01
Additions to the above. 

I have fixed things so Seal now works in 8 bit mode, default in the seal.ini file here and 
written the code to simulate BadSector's registry write functions using the base Seal source 
which now allows his cpanel app to run. The items "move context" and "accelerated move" in 
the windows menu there are no longer functional since they relate to code that went away
in the port to the new allegro library. 

I have re-enabled the startup function that displays what was going on during startup.
Sadly BadSector's startwin.bmp looks terrible in 8 bits - those fine lines interact badly
with the dithering needed to reduce it to 8 bits. Because the console is shared in 8 bit
mode I have also removed the debugging printouts mentioned earlier totally. 

There is a fair attempt to allow extensibility of the library structures, as alluded to above.
This version therefore restores the minimise, maximise and other things related to BadSector's
incompatible app.dlx. I believe this brings back all the functionality I removed for the
porting.

A rather nasty hidden problem in dlxload.cc, to do with loading appended datafiles, has been 
fixed which means that, with the seal.dbg file stuff compiled out as in this version, Seal 
now boots successfully from a write-protected floppy. You can even take the disk away & its
perfectly happy. 

You'll have something marginally usable by just putting cwsdpmi.exe seal.exe & mouse.com 
(or ctmouse.com) onto a (sytem-files formatted) floppy. You can type in the paths for dlx 
libraries and then use splorer or run dos programs. Even a minimal .ini file helps lots 
though, miniseal.ini being an example. It really needs the stuff in system and desktop to
begin working well though. Seal and a reasonable number of dlxs and programs will fit onto
a single floppy if you (download &) use upx to pack the main seal.exe file.

Please note first though that, as a convenience for those who do not wish to download, 
compile and install the WIP allegro and the new allegttf distributions, I have included 
the neccessary parts in this directory. allegttf.h allegro.h and the allegro subdirectory 
itself should all be moved into the include directory where your djgpp is installed. Similarly 
liballeg.a and libalttf.a should to be in the lib directory. These are the standard 
places their distribution installs place them.

Incidentally, for those who (sensibly) only want to compile and run the thing, running
the !makeall.bat file compiles everything, then seal.exe runs it.