 *********************************************************************************

 Flash Eprom routines for writing Z88 File Eprom format data structures.
 
 All routines are "Open Source" as designed by the GPL.

 This text describes a reference of all the basic routines to manipulate the
 Flash Eprom Card for File Eprom handling and their interface arguments. 
 For further information, please refer to the actual source file.
 
 All routines may be executed in slot 3 on a Flash Eprom.
 This is possible since they all copy a small subroutine of their own on the
 Z80 stack to be executed there while the Flash Eprom is in non-read-array-mode.
 
 Design & programming by:
	Gunther Strube, InterLogic, Dec 1997 - Apr 1998
	Thierry Peycru, Zlab, Dec 1997

 *********************************************************************************

 Filename:			Library name:				Description:
 ---------------------------------------------------------------------------------
 FepEpr				library project file to be used for compiling
 FepEpr.lib			object file library 

 FepFdel.asm			XLIB FlashEprFileDelete		Mark File Entry as deleted
 FepFsave.asm			XLIB FlashEprFileSave		Save single file to Flash Eprom 
 FepStdHd.asm			XLIB FlashEprStdFileHeader	Blow File Eprom header 
 FepType.asm			XLIB FlashEprType			Validate File Eprom status in slot x



; ********************************************************************************
;
;	XLIB FlashEprType
;
; Return (Flash) File Eprom Area status in slot x (1, 2 or 3), 
; with top of area at bank B (00h - 3Fh).
;
; In:
;		C = slot number (1, 2 or 3)
;		B = bank of "oz" header (slot relative, 00 - $3F)
;
; Out:
;	Success:
;		Fc = 0,
;		Fz = 1, Flash Eprom Card recognized
;			(only possible if card was in slot 3)
;			A = Intel Device Code
;				fe_i016 ($AA), an INTEL 28F016S5 (2048K)
;				fe_i008 ($A2), an INTEL 28F008SA (1024K)
;				fe_i8s5 ($A6), an INTEL 28F008S5 (1024K)
;				fe_i004 ($A7), an INTEL 28F004S5 (512K)
;				fe_i020 ($BD), an INTEL 28F020 (256K)
;		Fz = 0, Standard 32K, 128K, 256K Eprom or 1MB Eprom
;			(Flash Eprom might be in slot 1 or 2)
;			A = Sub type of Eprom
;		B = size of File Eprom Area in 16K banks
;
;	Failure:
;		Fc = 1, RC_ONF, "oz" File Eprom not found
;
; Registers changed after return:
;	...CDEHL/IXIY same
;	AFB...../.... different
;
; ********************************************************************************


; ********************************************************************************
;
;	XLIB FlashEprStdFileHeader
;
; Standard Z88 File Eprom Format (using Flash Eprom Card).
;
; Blow File Eprom "oz" header on Flash Eprom in specified bank.
; Traditional File Eprom's use the whole card with header in bank $3F.
;
; Pseudo File Eproms might be part of Application cards below the 
; reserved application area (as specified by the ROM Front DOR), but
; in separated 64K block boundary.
;
; This routine will temporarily set the Vpp pin while the "oz" header
; is being blown to the Flash Eprom.
;
; In:
;	B = Bank (slot relative) where to blow header (at offset $3FC0)
;
; Out:
;	Success:
;		Fc = 0, File Eprom Header successfully blown to Flash Eprom
;
;	Failure:
;		Fc = 1,
;			A = RC_BWR
;
; Registers changed after return:
;	..BCDEHL/IXIY same
;	AF....../.... different
;
; ********************************************************************************


; ********************************************************************************
;
;	XLIB FlashEprFileSave
;
; Standard Z88 File Eprom Format (using Flash Eprom Card).
;
; Save single file to Flash Eprom (in slot 3).
;
; The routine does NOT handle automatical "deletion" of existing files
; that matches the filename (excl. device). This must be used by a call
; to <FlashEprFileDelete>.
;
; Should the actual process of blowing the file image fail, the new 
; File Entry will be marked as deleted (if possible).
;
; This routine will temporarily set the Vpp pin while blowing the file
; to the Flash Eprom.
;
; IN:
;		DE = pointer to I/O buffer, in segment 0.
;		BC = size of I/O buffer.
;
;		HL = pointer to filename string (null-terminated), in segment 0.
;			Filename may contain wildcards (to find first match)
;
; OUT:
;		Fc = 0, File successfully saved to Flash File Eprom.
;			BHL = pointer to created File Entry in slot 3.
;
;		Fc = 1,
;			File (Flash) Eprom not available in slot 3:
;				A = RC_Onf (Object not found)
;			Not sufficient space to store file (and File Entry Header):
;				A = RC_Room
;			Flash Eprom Write Errors:
;				If possible, the new File Entry is marked as deleted.
;				A = RC_VPL, RC_BWR (see "flashepr.def" for details)
;				A = RC_Wp (Write-protected - batteries are low...)
;
;			RAM File was not found, or other filename related problems:
;				A = RC_Onf
;				A = RC_Ivf
;				A = RC_use
;
; Registers changed on return:
;	...CDE../IXIY same
;	AFB...HL/.... different
;
; ********************************************************************************


; ********************************************************************************
;
;	XLIB FlashEprFileDelete
;
; Standard Z88 File Eprom Format (using Flash Eprom Card).
;
; Mark File Entry as deleted on File Eprom (in slot 3), identified
; by BHL pointer (B=00h-3Fh, HL=0000h-3FFFh).
;
; This routine will temporarily set the Vpp pin while marking the
; file as deleted.
;
; IN:
;		BHL = pointer to File Entry
;
; OUT:
;		Fc = 0,
;			Marked as deleted.
;
;		Fc = 1,
;			A = RC_Onf, File (Flash) Eprom or File Entry not found in slot 3
;			A = RC_VPL, RC_BWR, Flash Eprom Write Error
;
; Registers changed on return:
;	A.BCDEHL/IXIY same
;	.F....../.... different
;
; ********************************************************************************
