*-----------------------------------------------------------------------*
*	   Falcon MC68040 CPU ToolKit configuration tool		* 
*-----------------------------------------------------------------------*


CONFIG.PRG
----------


Operation:
----------

To configure the 68040 driver, simply run CONFIG.PRG from the desktop and
select 'open' from the dropdown menu. Choose the 'AUTO/TKROMDRV.PRG' file 
with the fileselector and you are ready to start making changes to the
driver's stored configuration. 

Alternatively, you can drag TKROMDRV.PRG onto CONFIG.PRG and it will work
just as well.

When you are happy with the changes you have made, select 'save' from the
menu and your driver is ready to use. See TKROMDRV.TXT for information on
how to install the driver and any other patches and utilities you intend
to use.


Processor options:
------------------

The options available on this dialog affect mainly the on-chip caches and
other some CPU-related issues such as cache modes and software patching.

* Enable <D> cache

  This enables the data cache, which helps speed up access to memory. It
  is compatible with most things, except *some* types of hardware like
  the I/O registers of Nova video cards, which should *never* be cached by
  the CPU. Fortunately however, The Nova interface option allows you to
  avoid these problems without turning the data cache off.

  It is also important to remember that the data cache can interfere with
  SCSI and other DMA based operations, so there will be situations where
  it may be safer (or even necessary) to turn this off before using some
  kinds of software. Hard disk driver configuration programs spring to
  mind, since they tend to access SCSI devices directly. If you are using
  something like HDDriver from the auto folder, and you have SCSI drives
  connected then you may be forced to leave this option turned off until
  HDDriver has logged the SCSI partitions. You can then turn the cache on
  using one of the utilities supplied with this package (BCACHE40.PRG).

* Enable <I> cache

  This enables the instruction cache, which the processor relies on for
  it's very high performance. This option may be incompatible with some
  of the less cleanly written programs - especially packed executables.

  If you use a lot of packed executables (things packed with Pack-ICE or
  Atomic or PFX or whatever) and you really don't want to unpack them
  (it would be a good idea if you are able) then you may have to lock the
  instruction cache off when executables are launched. You can do this
  with the 'Pexec locks cache' option described below.

* Pexec locks cache

  This simply increases compatibility with dirty software - particularly
  packed executables. If you are experiencing crashes when you double-
  click on specific programs then they are probably packed, and the
  depack routines can't cope with the fancy instruction cache. Turning
  this option on will disable the cache when you run an executable, and
  it *should* turn the cache back on again after the program has loaded.

  The cache will still appear to be on, but it won't start working until
  the program has loaded and has finished unpacking. It may slow some
  things down, as the cache could take it's time to turn back on again
  after loading or unpacking the program. With some very nasty programs,
  the cache may not come back on until you quit back out again, so don't
  use this unless you know you need it.

* TOS Superstack (Writethrough/Copyback)

  This popup lets you choose how the TOS supervisor stack is cached by
  the processor datacache. The TOS supervisor stack is an area of low
  memory hardwired for use by TOS v4.04, mainly for handling exceptions,
  interrupts and other very low-level fast-response operations. Since
  the 68040 -> 68882 FPU emulation routines are exception-based, and
  depend on significant data throughput, then it makes sense to help it
  go as fast as possible. This option does just that.

  'Writethrough' mode means any data written to memory during a special
  exception (like FPU emulation) is written to both the cache AND to real
  memory at the same time. This is the default mode of operation and is
  quite safe in all respects.
  
  'Copyback' mode allows memory-writes to be deferred, or delayed until
  some unspecified point in the future where no more writes are likely
  to take place to that same location. The data is written to the cache
  as normal, but rarely to memory until the CPU decides it is necessary.
  This reduced memory activity can lead to some significant performance 
  benefits - particularly during heavy (off-chip) FPU work. The effect
  is something very similar to a harddisk cache with a delayed-write
  feature, except there is no time limit. Data can be held on-chip for
  an indefinite length of time!

  Copyback mode is safe for use with most software, but there are bound
  to be exceptions. Some software might have trouble dealing with some
  of it's memory working in copyback mode - especially hard disk drivers
  which tend to load very low down in ST-RAM, where the TOS superstack is
  located. If you have problems with it then just turn it off.

  Only ever use the copyback option with plain TOS.

* TOS Superstack (Use ST-RAM/Use FastRAM)

  This popup lets you choose what kind of memory is placed at the area of
  ram where the TOS superstack is located. The reasoning behind this is
  exactly the same as before - speeding up exception processing. Check
  the previous section for more details.

  'Use ST-RAM' just means that normal 16-bit (slow) ram is used for the
  TOS superstack. When an exception has to read or write some local data, 
  or use some variables, this ram is used for that purpose. This setting
  is the default mode of operation and is completely safe.

  'Use FastRAM' replaces the normal TOS superstack memory with 32-bit
  FastRAM, speeding up memory operations within exceptions or interrupts.
  Even with copyback mode active (see above), the processor has to return
  the contents of the cache to memory at *some* point (even if it is a
  lot later than usual) so it's better to be quick about it if possible!
  For the same reasons as described before, this option is capable of
  interfering with some software in extreme circumstances. If you have
  any trouble with it, turn it off.

  Only ever use the fastram option with plain TOS.


Memory options:
---------------
  
* Allocate FastRAM

  FastRAM is required to make the ToolKit driver work, but that doesn't
  mean you have to hand it over to the operating system as well! Turning
  this option on will make FastRAM available to the operating system for
  use by other software. Turning it off will keep FastRAM away from the
  operating system, leaving you with ST-RAM only. This does not stop the
  driver from using FastRAM for storing the ROM, or anything else. It is
  purely for turning FastRAM on or off from the system's point of view.

* Enable second bank

  The Afterburner has two 32MB memory banks, one for each SIMM slot. You
  can turn the second bank on or off with this button, disabling the
  second SIMM completely for compatiblity with some versions of MiNT,
  which has some trouble with split TT-memory layouts like this one.

* Perform RAM-check

  This option enables a rudimentary memory test which will appear each
  time the machine cold-boots the ToolKit driver. The memory test is
  quite fast, so you don't have to hang about waiting for it to finish.

General options:
----------------

* Emulate GEMRAM

  If you use WINX, you normally have to copy ROM into RAM before WINX can
  patch the AES calls. That means running GEMRAM or something rather less
  safe than that (like ROMSPEED). Since the ToolKit already does this, it
  seems like a waste of ram doing it twice. This option fools WINX into
  believing GEMRAM is already installed, and lets WINX run without it.

  Just remember not to write-protect the ROM (see elsewhere) or WINX will
  not be able to install it's patches!

* Nemesis 40MHz

  For Nemesis users, this lets you warm-boot at 20/40MHz without needing
  any auto folder switches. Since it lets you boot straight from 40MHz,
  it helps cut boot sequences by a small but significant amount time.

* Replace bootlogo

  Just a gimmick. Replaces the Fuji with a Scorpion. Don't enable this if
  you are short on ST-RAM because it reduces the amount available by a
  nominal, but possibly costly amount (for annoying technical reasons).

* Write-protect ROM

  Normally, with the ToolKit driver installed, the ROM image is not real
  ROM - it is actually FastRAM and is therefore not write-protected. If
  you want to make it appear like real ROM, you can enable this option.
  It doesn't make much difference with any sensibly written program, but
  there may be some point where it comes in useful.



Display options:
----------------

* Mode: (Writethough/Copyback/Serialized/Nonserialized)

  This lets you select how the display memory is treated on your machine
  when the processor reads or writes to display RAM. This applies to the
  basic Videl display system *and* the Nova interface, so make sure you
  get it right because otherwise weird things can happen.

  'Writethrough' mode is the default cache mode for standard machines,
  although it's not a particularly good idea for Nova users. With this
  mode enabled, the CPU is able to cache the display memory, but it
  will treat writes in the normal way - data goes both to RAM and into
  the cache at the same time. There are many situations where you don't
  want good cache space wasted on cacheing (mostly) useless pixel data,
  so this mode is not always the fastest mode available - even if it
  sounds like it might be! Again, for Nova users this is best avoided
  because the Nova card doesn't like things getting cached.

  'Copyback' mode is implemented for the sake of completeness, but it's
  not necessarily a good idea to use it. With this mode selected, the
  datacache is able to defer memory writes for an indefinite length of
  time - a bit like a delayed-write cache for a harddisk. This means
  bits of the screen don't get drawn because the CPU doesn't transfer
  all of the data to the screen when it is supposed to. The data is kept
  inside the CPU instead (i.e. it's not lost - it just arrives late,
  sometimes seconds or minutes late depending on what's going on at the
  time). A special flushing routine is implemented in this mode to make
  sure the data is returned to the screen before you notice the gaps,
  but you will still see weird effects from time to time. In this mode,
  some things will be faster and many will be slower. It's a try-it-and
  see feature. Final note - don't try to use it on Nova. Bad move. ;)

  'Serialized' is the safest mode you could possibly choose for either
  Nova or anything else. It prevents all cache activity in display RAM,
  and forces reads and writes to take place in the exact order they are
  issued by the processor. Strictly safe, but not necessarily fast!

  'Nonserialized' is often the fastest mode for standard users, and it
  can be used with Nova as well (although the performance is not know
  at the time of writing). It is the same as 'Serialized' mode in that
  it doesn't allow cacheing of the screen - but it allows the processor
  to perform memory reads & writes in pretty much any order it likes.
  This means the CPU can interleave and rearrange memory references to
  suit itself, making it faster than Serialized mode. It's a good idea
  to choose this mode if you are not interested in any of these options
  because it's quick, fast and compatible with all systems.

* Videl layout: (4MB/14MB)

  In order for the display cache mode feature (see above) to work, it
  needs to know what sort of memory layout you have. This *only* applies
  to standard (Videl) users because the Nova interface option (see below)
  doesn't need it.

* Nova interface mode

  If you have a Nova video card, you will need to enable this button or
  the processor will not access the card properly. With this mode enabled
  you will have to select a 'Serialized' or 'Nonserialized' display mode
  to make it compatible with the Nova hardware. The Videl layout option
  is also ignored when this button is enabled.

* Nova Videl blanker

  The Nova card has it's own video ram, so there's no point in wasting
  good bus cycles on sustaining Videl modes you don't really need! With
  this button enabled, the Videl is turned off and you get your display
  refresh cycles back. This means a *slightly* faster computer, but it
  also means a black screen if you try to use the Videl monitor port on
  the back of the Falcon!

*-----------------------------------------------------------------------*

Configuration tool copyright Magnus Kollberg, April 1997

