/*
22-Nov-97 - Ver 1.0a ----------------------------------------------------------
    1. Default sample rates modified: 22kHz FM, 9.6kHz AM
    2. Default window modified: 0.35ms
    3. Added numeric 'centre frequency' display in tuning scope
	4. Fixed FAX TX start & stop tone generator precision

13-Dec-97 - Ver 1.0b (Beta) ---------------------------------------------------
    1. Open File Dialog
        a. Sorting by name
    2. SSTV specific issues
        a. Default sync level modified from 1150-1250 to 1150-1350 Hz.
        b. Added automatic determination of Sync Level after processing
           Frame Sync.
        c. Retransmission of colour SSTV image triggers auto-conversion
    3. Mode analysis issues
        a. Correlation threshold in Line Rate Analysis modified to allow
           analysis of noisier signals
    4. Display
        a. RGB assignment followed by screen redraw
        b. Colour images displayed using 4x4 ordered dithering
    5. Title screen
	a. Fixed message (... uncommercial...)
        b. Added reference to 'ftv.doc'
    6. Miscellaneous
        a. Fixed memory leak in 'decode.cpp' and added hidden
           shortcut '?' for checking free memory status.

31-Jan-98 - Ver 1.0c (Beta) --------------------------------------------------
    1. Open File Dialog
        a. Change drive
    2. Baudot/Morse
        a. Added FFT demodulator
	b. Modified center frequency calculation & added red marker on tuning
           scope.
        c. Morse center frequency selection
        d. Silenced Baudot BELL
        e. Removed some bugs from rate calculations
    3. SSTV specific issues
        a. In order to allow manual adjustment of the horizontal
           position of SSTV images, automatic adjustment occurs only
           under the following conditions:
             F8 shortcut (Analyse mode)
            ^F8 shortcut (Phase/sync lock)
    4. Mode analysis issues
	a. Manual Mode setting cancels Automatic Mode Analysis,
           while F8 (Analyse mode) enables it.
    5. Display
        a. Unused display filled with pattern
	b. Zoom out possible
        c. Aspect ratio controls X & Y.
        d. ^Home preserves aspect ratio, and ^End fits to screen.
    6. Miscellaneous
        a. Fixed bug that left invalid palette after saving TGA file.
        b. Sked time '*' denotes current time, for continuous monitoring.
        c. F10 (Monitor on/off) in Tuning Scope.
        d. AM demodulator modified to use 19.2kHz sampling rate.
                
10-Feb-98 - Ver 1.0d (Beta) --------------------------------------------------
    1. Morse
        a. Improved FFT AGC.
        b. Last received character now displayed before an extended space
           terminates.
        c. Seperate log file "FTV-CW.LOG"
    2. Help file
        a. Displayed internally to avoid stopping Rx Mode under Windows.
    3. Scope & input level
	a. Red marker limits fixed (left remnants on extremes of scale)
        b. Decaying display on analyzer
        c. Audio input level control (+/-)
        d. Audio monitor & audio input level work in Tuning Scope
    4. Mode selection
        a. 'Mode analysis' is no longer invoked automatically.
    5. Display
	a. Ctrl-Home didn't work when image was zoomed out.
        b. Default orientation for AM with X/Y flipped.
        c. Orientation, pan & zoom work in all modes.
    6. Registration & program validation
        a. Integrity of 'ftv.txt' no longer checked.

14-Feb-98 - Ver 1.0e (Release) -----------------------------------------------

07-Mar-98 - Ver 1.0f (Beta) --------------------------------------------------
    1. Audio I/O
	a. Auto-initialize DMA modes, resulting in phase continuous
	   transmission & reception (on Hardware Version 2.00 and above),
	   dispensing with the need for Grid Filter splicing.
	b. Significant improvement in real-time feel due to smaller buffers.
	c. Sample Rate limited according to hardware version.
	d. External mixer control (command line option X) using two user
	   batch files 'ftv-rx.bat' & 'ftv-tx.bat'.
    2. Tuning scope
	a. Direct audio monitor.
	b. Holdoff & restart functions.
	c. Mixer control panel (-/+ shortcuts introduced in V1.0d
	   are now disabled).
    3. Auto Rx
	a. Support for 650 Hz start tone (for IOC=288).
	b. Aware of non-compatible sound cards
    4. Extended memory (XMS) support
	a. Eliminates awkward EMS requirement & problems related to
	   configuring EMM386 driver.
	b. XMS usage brought out inefficiency in Mode Analysis,
	   local buffers fixed it.
    5. Transmit banner
	a. Improved text rendering
	b. Added test pattern with gray scale / colour bars & grating
	c. Added menu items to Text Banner menu:
		Bars        - inserts test pattern (without text)
		Callsign    - inserts user's callsign + test pattern
		Edit        - inserts custom text
		QSO message - as, above, but appends trailer 'de Call'
	d. Text Banner menu commands are also directly accessible
	   from the main Transmit menu.

21-Mar-98 - Ver 1.0g (Beta) --------------------------------------------------
    1. Configuration file
	a. Many parameters are saved to disk:
		DvsCatPort
		Mixer data
		Scope settings
		Demodulator settings
		Calibration data
		Standard mode
		Working path
		Screen mode & orientation
		Registration information
	b. Clock calibration parameter calculated internally using any mode.
		(Setup->Demodulator->ClockCal)
	c. The follwoing command line options have been removed, and are now
	   stored in the CFG file: ClockCal, DvsCatPort, ScreenMode.
    2. Independent Rx & Tx windows (F4 to toggle)
	a. It is possible to load & modify a file while receiving another,
	   to prepare it for transmission.
    3. Transmit
	a. Reorganised Tx menu to accomodate 'Banner' & 'Text Overlay'
	   functions, with control over the position, size (+/-) and colour
	   of the text & background.
	b. Colour SSTV clicks eliminated.
    4. Audio I/O
	a. Restored compatibility with Hardware Version 1.xx, except on RTTY.
    5. Baudot/Morse
	a. CW log file has word wrap (set at 70 characters).
	b. RTTY tuning indicator works smoother & better.
    6. Miscellaneous
	a. Fixed problem in 'Auto SSTV Sync' (Ctrl-F8). Analysis now starts
	   mid-frame and moves towards the top, to derive the initial phase.
	b. Fixed problem which resulted in trailing garbage when a frame
	   was flipped and zoomed out.

9-Apr-98 - Ver 1.0h (Beta) --------------------------------------------------
    1. Fax Colour Tx/Rx mode
	a. HamColour 240 & 360 lpm (with 200 Hz start tone).
	       Note that phasing singal is purposely non-standard to facilitate
	       identification of the first segment of each line. The colour
	       sequence is R-G-B.
    2. Wefax
	a. FTV locks to the burst and removes the doppler distortion.
		SSTV controls such as Sync Lock (Ctrl-F8) & Sync Response
		(Shift-F8) work as expected.
	b. Demodulator improved, beat patterns suppressed.
    3. Tab functions
	a. Mode selection removed from this menu
	b. The function of the Left/Right & Up/Down arrows is distinct:
		LineRate/Phase	- left/right
		FrameStart/End  - up/down
		Panning         - left/right/up/down
	c. Coarse adjustment is possible using the Ctrl key.
	d. X-mirror & Y-flip taken into account when adjusting.
    4. Changes to Mode Selection procedure
	a. The F2 key displays the Mode Select menu.
	b. The main mode is changed with the Up/Down arrow keys. The main
	   categories are: Wefax,FaxBw,FaxClr,SstvBw,SstvClr,Baudot,Morse.
	c. The actual mode is changed using the	Left/Right arrow keys.
	d. The F3 key toggles between the current Mode & FaxBw without
	   changing the line rate. This is handy for making sense
	   and recovering badly synchronized pictures manually.
	e. The Mode menu has been modified.
    5. Changes to View menu
	a. View->Orientation menu items Vertical & Horizontal replaced by
	   one Rotateclockwise function.
	b. Added Left & Right for rapid selection of Wefax VIS/IR channel.
    6. Processing menu
	a. Histogram equalization. Operates on the displayed region of the
	   image (e.g. a specific Wefax channel)
	b. Filters
		Impulse noise reduction, Median (noise reduction),
		Soften (LPF), Sharpen (HPF), Edge enhance, Edge detect
	c. Channel arithmetic (for aligned NOAA images only)
    7. Tuning scope
	a. Clipping indicator
	b. Memory usage indicator for Rx/Tx
	c. Mixer reset function (F12)
    8. Sound Blaster Pro Mixer (Hardware Version 3.xx)
	a. Automatic selection of Mic i/p & Line i/p source when the
	   respective level is adjusted.
	b. There is no control on the input level on the original
	   SbPro card. Only the output to the speaker is affected.
	c. The sound card mixer chip is no longer reset by default, so that
	   auxilliary registers, such as input and output gain, are
	   preserved.
   9. Miscellaneous
	a. Fixed bug that interfered with allocation of all available XMS.
	b. Fixed minor bug affecting the duration of the FAX TX phasing pulse.
	c. Fixed minor bug in File Load Dialog when changing Drive
	d. Shortcut keys also work from within the main menu.
	e. Categorised text panels & standardised the background colours.

			Category	Background
			---------------	----------
			Alert messages	Red
			Menus		Blue
			File I/O	Cyan
			Processing	Magenta
			Status messages	Gray
			User input	Green

	f. Extended RAW header to include the main & sub-mode settings,
	   precise line rate, sync parameters, RGB order, brightness,
	   contrast, invert, and orientation settings.
	g. Included Wave File Import facility (Mode->Decoder->Waveimport).

29-Apr-98 - Ver 1.0h (Release) -----------------------------------------------

2-May-98 - Ver 1.0i (Beta) ---------------------------------------------------
    1. Minor bug fixes
	a. Fixed palette problems when loading TGA files. Top 16 colours
	   are reserved for use by FTV. When preparing TGA files for
	   transmission, reduce colours to 240.
	b. Warnings when Rx overlaps into Tx image, when when loading a file,
	   if Rx is overwritten or Tx truncated due to insufficient memory.
	c. Error trapping when processing blank images.
	d. Adder critical error handler (drive not ready, write protect, etc.)
	e. Fixed problem when a diskette has no matching files or directories.
	f. Fixed picture shifting problem which sometimes occurs when the
	   FrameEnd of a loaded SSTV image was adjusted.
	g. Increased SSTV sync sensitivity during initial lock procedure.
	h. During Scheduled reception, the Lpm parameter was not set
	   according to *.SKD file.
	i. 32 bit registers saved during audio interrupts, to eliminate
	   some infrequent problems during reception, such as:
		Files aborted prematurely during Auto Scheduled Rx Dump
		Abnormal program termination during Histogram Equalization
    2. Logging
	a. Files are automatically named & logged in FTV-AUTO.LOG when
	   saved using ? as a filename.
	b. Time in FTV-AUTO.LOG is now in UTC: YYYY.MM.DD HH.MMz

2-May-98 - Ver 1.0i (Release) ------------------------------------------------

7-May-98 - Ver 1.0j (Beta) ---------------------------------------------------
    1. Minor bug fixes
	a. Warnings issued when changing demodulator type during Rx.
	b. Yes/No prompt - bleeps if wrong key is pressed.
	c. F1-Help text attributes now set.
    2. Polished menu structure
	a. Rx is now a sub-menu. RxStart & RxStop commands are in this
	   sub-menu to prevent accidental loss of the received image.
	b. Added Help in main menu.
    3. AutoRx
	a. Added squelch mode
		AM triggered by presence of 2.4kHz carrier
		FM triggered by audio level > 50%
		Available through Rx menu & supported in SKD file
    4. Usability improvements
	a. Pop-Up help windows added to:
		1x Main menu
		1x Reception
		2x Auto-Rx menus
		1x Tab menu
		1x Mode menu
		1x Filter menu
		1x Tx menu
		1x Tx banner menu
		3x Overlay menus
	b. Special menus no longer disappear by themselves,
	   except for APT sub-menus which would otherwise block Auto-Rx.
	c. RAW to TGA file conversion warning.
	d. F2 key now shows 3 distinct conditions:
		 RX 	 - when in Rx window, to set rx & display modes,
		 DISPLAY - when in Tx window, to set local display mode,
		 TX 	 - when in Tx menu, to set tx mode.

20-Jun-98 - Ver 1.0j (Release) -----------------------------------------------

21-Jun-98 - Ver 1.0k (Beta) --------------------------------------------------
    1. Minor bug fixes
	a. Phase/sync lock during AutoRx now works on WEFAX & SSTV too.
	b. Histogram equalisation automatically applied when left/right
	   view is selected.
	c. Composite (A+B) & (A-B) did not work properly.
    2. Process->Palette
	a. Cloud/land/sea edit mode
	b. False colour palette
    3. External commands
	a. Support for Alt-Number keys.
	b. Commands are read from the file FTV.KEY
        c. After execution, original path is restored.
    4. Documentation
        a. Added appendices, listing Shortcuts and Menu functions.
    5. Miscelleaneous
	a. Added standard Alt-X shortcut to quit to DOS.
	b. Added Ctrl-U shortcut to rotate 180 (upside down)
	c. Shortcuts work during AutoRx, and corresponding Lpm/Phase
	   functions removed

11-Jul-98 - Ver 1.0k (Release) -----------------------------------------------

18-Jul-98 - Ver 1.0l (Beta) --------------------------------------------------
    1. Menus
        a. Capital letter of menu functions highlighted using different
		   colour.
    2. File dialog
        a. File mask is displayed on top
        b. Direct key-in of filename is possible. Default extension is added
           if none is specified.
    3. Help screen
        a. Multiple pages are supported:
                F1 goes through each page, and loops,
                Other keys go through each page and exit,
                Escape exits.

16-Aug-98 - Ver 1.0l (Release) -----------------------------------------------

06-Sep-98 - Ver 1.0m (Beta) --------------------------------------------------
    1. AutoRx WEFAX squelch mode
        a. AM triggered by presence of 2.4kHz carrier plus a mean input level
           exceeding 10%
    2. Mixer Mute
        a. Complete muting on SB16/16ASP/AWE32/AWE64
    3. Shortcuts
        a. Added Stop shortcut (Ctrl-F9)

10-Oct-98 - Ver 1.0m (Release) -----------------------------------------------

06-Dec-98 - Ver 1.0n (Beta) --------------------------------------------------
    1. Bug fixes
        a. XMS memory indicator overflow bug.
        b. Display mode was not set after loading a RAW file.
    2. Enhancements
        a. Spectrum facility in tuning scope.
        b. Inbuilt support for most common technical questions regarding
             sound card and 'dead scope' problems.
        c. Warning issued when BLASTER environment variable is not set.
        d. Phase correction replaces Slant correction as default function
             of left/right arrow keys.
        e. When loading a series of SSTV pictures in one RAW file:
             Contents may be browsed using Ctrl-PageUp/Down.
             Current image may be shifted up & down by using PageUp/Down.
             To revert to full view, use View->reVert command.
        f. On loss of sync, a lock-on attempt is made automatically, as long
             as the sync mode is not set to 'free running'.

18-Dec-98 - Ver 1.0n (Release) -----------------------------------------------

10-Feb-00 - Ver 1.1a (Beta) --------------------------------------------------
    1. Bug fixes
        a. Recording source not set on SB16/32/64
        b. Fixed FFT demodulator offset
        c. Fixed rate accuracy in data modes (DataCal parameter in Cfg file)
        d. Fixed tuning scope center frequency accuracy in all modes

    2. Enhancements
        a. Improved RTTY decoding
        b. Added Sitor-A and Sitor-B decoding
        c. Added data analysis screen with symbol width & ACF graphs
        d. Loading, saving and offline processing of raw data streams
        e. Added band markers in tuning scope
        
6-Apr-00 - Ver 1.1a (Release) ------------------------------------------------

18-Oct-00 - Ver 1.1b (Beta) --------------------------------------------------
    1. Enhancements
        a. Offline image processing using command line option Pnnn:<file>
            aimed primarily at users of unattended FAX operation.

           Loads a RAW file, applies filters, and saves it as a TGA file.

           The nnn parameter is a decimal number corresponding to the
           filter or combination of filters to be applied:
               1=Impulse
               2=Median
               4=Soften
               8=Sharpen
              16=Edge enhance
              32=Edge detect

           Example 1: To convert a file from RAW to TGA without applying a
           filter, in this case a file called TEST in the TMP folder, use:
               FTV P0:tmp\test

           Example 2: To convert the above mentioned file from RAW to TGA
           and applying the Median filter, use:
               FTV P2:tmp\test

           Example 3: To convert the above mentioned file from RAW to TGA
           and applying the Impulse and Median filters, use:
               FTV P3:tmp\test

18-Oct-00 - Ver 1.1b (Beta) --------------------------------------------------
