Index: trunk/XTIDE_Universal_BIOS/Inc/BootVars.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/BootVars.inc	(revision 89)
+++ trunk/XTIDE_Universal_BIOS/Inc/BootVars.inc	(revision 90)
@@ -20,7 +20,6 @@
 struc BOOTVARS
 					resb	800h
-	.dwSys18h		resb	4		;  800h, System INT 18h handler (Diskless boot, Boot failure)
 	.dwPostStack	resb	4		;  804h, POST stack when entering INT 19h
-					resb	4
+					resb	8
 	.rgBootNfo		resb	73F4h	;  80Ch, Array containing BOOTNFO structs
 	.rgbMnuStack:					; 7C00h and below, Boot Menu stack
Index: trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc	(revision 89)
+++ trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc	(revision 90)
@@ -1,7 +1,3 @@
-; File name		:	RomVars.inc
-; Project name	:	IDE BIOS
-; Created date	:	23.3.2010
-; Last update	:	1.5.2010
-; Author		:	Tomi Tilli
+; Project name	:	XTIDE Universal BIOS
 ; Description	:	Defines for ROMVARS struct containing variables stored
 ;					in BIOS ROM.
@@ -13,42 +9,28 @@
 	.wRomSign		resb	2	; ROM Signature (AA55h)
 	.bRomSize		resb	1	; ROM size in 512 byte blocks
-	.rgbJump		resb	5	; First instruction to ROM init (jmp)
-	; Offset 8 (8h) starts here
-	.rgbDate		resb	8	; BIOS build date string (mm/dd/yy)
-	; Offset 16 (10h) starts here
+	.rgbJump		resb	3	; First instruction to ROM init (jmp)
+
 	.rgbSign		resb	8	; Signature for XTIDE Configurator Program
 	.szTitle		resb	31	; BIOS title string
-	.szVersion		resb	25	; BIOS version string
-	; Offset 80 (50h) starts here
+	.szVersion		resb	23	; BIOS version string
+
 	.wFlags			resb	2	; Word for ROM flags
-	.bIdeCnt		resb	1	; Number of supported IDE controllers
+	.bIdeCnt		resb	1	; Number of available IDE controllers
 	.bBootDrv		resb	1	; Boot Menu default drive
-					resb	1	; (Was boot menu maximum height)
 	.bBootDelay		resb	1	; Boot Menu selection delay in seconds
-	.bBootLdrType	resb	1	; Boot Loader type
 	.bMinFddCnt		resb	1	; Minimum number of Floppy Drives
 	.bStealSize		resb	1	; Number of 1kB blocks stolen from 640kB base RAM
-					resb	7
-	; Offset 96 (60h) starts here
-	; Last IDEVARS must not start after offset FFh.
+
 	.ideVars0		resb	IDEVARS_size
 	.ideVars1		resb	IDEVARS_size
 	.ideVars2		resb	IDEVARS_size
 	.ideVars3		resb	IDEVARS_size
-	.ideVars4		resb	IDEVARS_size
 endstruc
 
 ; Bit defines for ROMVARS.wFlags
 FLG_ROMVARS_FULLMODE	EQU	(1<<0)	; Full operating mode (steals base RAM, supports EBIOS etc.)
-FLG_ROMVARS_LATE		EQU	(1<<1)	; Late initialization
 FLG_ROMVARS_DRVXLAT		EQU	(1<<2)	; Enable drive number translation
 FLG_ROMVARS_ROMBOOT		EQU	(1<<3)	; Include ROMBOOT to boot menu
-FLG_ROMVARS_DRVNFO		EQU	(1<<4)	; Display drive info on boot menu
 FLG_ROMVARS_MAXSIZE		EQU	(1<<5)	; Maximize size by sacrificing compatibility with some old BIOSes
-
-; Bootloader types for ROMVARS.bBootLdrType
-BOOTLOADER_TYPE_MENU	EQU	(0<<1)	; Display boot menu on boot loader
-BOOTLOADER_TYPE_SIMPLE	EQU	(1<<1)	; Simple bootloader without menu
-BOOTLOADER_TYPE_NONE	EQU	(3<<1)	; Do not install boot loader
 
 
@@ -59,5 +41,4 @@
 	.bBusType			resb	1	; Bus type
 	.bIRQ				resb	1	; Interrupt Request Number
-						resb	4	; Reserved
 	.drvParamsMaster	resb	DRVPARAMS_size
 	.drvParamsSlave		resb	DRVPARAMS_size
@@ -74,5 +55,4 @@
 struc DRVPARAMS
 	.wFlags			resb	2	; Drive flags
-					resb	2	; Reserved
 	.wCylinders		resb	2	; User specified cylinders (1...16383)
 	.wSectAndHeads:
Index: trunk/XTIDE_Universal_BIOS/Src/Boot/BootVars.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Boot/BootVars.asm	(revision 89)
+++ trunk/XTIDE_Universal_BIOS/Src/Boot/BootVars.asm	(revision 90)
@@ -1,8 +1,3 @@
-; File name		:	BootVars.asm
-; Project name	:	IDE BIOS
-; Created date	:	1.4.2010
-; Last update	:	14.1.2011
-; Author		:	Tomi Tilli,
-;				:	Krister Nordvall (optimizations)
+; Project name	:	XTIDE Universal BIOS
 ; Description	:	Functions to access BOOTVARS struct.
 
@@ -77,45 +72,2 @@
 	sti									; Enable interrupts
 	jmp		ax
-
-
-;--------------------------------------------------------------------
-; Backups system INT 18h ROM Boot / Boot Failure handler and
-; installs our own for boot menu INT 18h callbacks.
-;
-; BootVars_StoreSystemInt18hAndInstallOurs
-;	Parameters:
-;		DS:		BDA and Interrupt Vector segment (zero)
-;	Returns:
-;		Nothing
-;	Corrupts registers:
-;		AX, BX, ES
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-BootVars_StoreSystemInt18hAndInstallOurs:
-	mov		bx, INTV_BOOT_FAILURE*4		; Offset to INT 18h vector
-	les		ax, [bx]					; Load system INT 18h
-	mov		[BOOTVARS.dwSys18h], ax
-	mov		[BOOTVARS.dwSys18h+2], es
-	mov		WORD [bx], Int18h_BootError	; Install our INT 18h
-	mov		WORD [bx+2], cs
-	ret
-
-
-;--------------------------------------------------------------------
-; Restores system INT 18h ROM Boot or Boot Error handler.
-;
-; BootVars_RestoreSystemInt18h
-;	Parameters:
-;		Nothing
-;	Returns:
-;		Nothing
-;	Corrupts registers:
-;		AX, DS, ES
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-BootVars_RestoreSystemInt18h:
-	LOAD_BDA_SEGMENT_TO	ds, ax
-	les		ax, [BOOTVARS.dwSys18h]
-	mov		[INTV_BOOT_FAILURE*4], ax
-	mov		[INTV_BOOT_FAILURE*4+2], es
-	ret
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm	(revision 89)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm	(revision 90)
@@ -1,8 +1,3 @@
-; File name		:	Int13h_Jump.asm
-; Project name	:	IDE BIOS
-; Created date	:	21.9.2007
-; Last update	:	14.1.2011
-; Author		:	Tomi Tilli,
-;				:	Krister Nordvall (optimizations)
+; Project name	:	XTIDE Universal BIOS
 ; Description	:	Int 13h BIOS functions (Floppy and Hard disk).
 
@@ -227,5 +222,5 @@
 	dw	AH3h_HandlerForWriteDiskSectors					; 03h, Write Disk Sectors (All)
 	dw	AH4h_HandlerForVerifyDiskSectors				; 04h, Verify Disk Sectors (All)
-	dw	AH5h_HandlerForFormatDiskTrack					; 05h, Format Disk Track (XT, AT, EISA)
+	dw	Int13h_UnsupportedFunction						; 05h, Format Disk Track (XT, AT, EISA)
 	dw	Int13h_UnsupportedFunction						; 06h, Format Disk Track with Bad Sectors (XT)
 	dw	Int13h_UnsupportedFunction						; 07h, Format Multiple Cylinders (XT)
@@ -242,5 +237,5 @@
 	dw	Int13h_UnsupportedFunction						; 12h, Controller RAM Diagnostic (XT)
 	dw	Int13h_UnsupportedFunction						; 13h, Drive Diagnostic (XT)
-	dw	AH14h_HandlerForControllerInternalDiagnostic	; 14h, Controller Internal Diagnostic (All)
+	dw	Int13h_UnsupportedFunction						; 14h, Controller Internal Diagnostic (All)
 	dw	AH15h_HandlerForReadDiskDriveSize				; 15h, Read Disk Drive Size (AT+)
 	dw	Int13h_UnsupportedFunction						; 16h, 
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH14h_HDiag.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH14h_HDiag.asm	(revision 89)
+++ 	(revision )
@@ -1,39 +1,0 @@
-; File name		:	AH14h_HDiag.asm
-; Project name	:	IDE BIOS
-; Created date	:	28.9.2007
-; Last update	:	14.1.2011
-; Author		:	Tomi Tilli,
-;				:	Krister Nordvall (optimizations)
-; Description	:	Int 13h function AH=14h, Controller Internal Diagnostic.
-
-; Section containing code
-SECTION .text
-
-;--------------------------------------------------------------------
-; Int 13h function AH=14h, Controller Internal Diagnostic.
-;
-; AH14h_HandlerForControllerInternalDiagnostic
-;	Parameters:
-;		AH:		Bios function 14h
-;		DL:		Drive number (8xh)
-;	Parameters loaded by Int13h_Jump:
-;		DS:		RAMVARS segment
-;	Returns:
-;		AH:		BIOS Error code
-;		AL:		0 (custom for this BIOS: .bReset byte from DPT)
-;		CF:		0 if succesfull, 1 if error
-;		IF:		1
-;	Corrupts registers:
-;		Flags
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-AH14h_HandlerForControllerInternalDiagnostic:
-	call	FindDPT_ForDriveNumber		; DS:DI now points to DPT
-	mov		al, [di+DPT.bReset]			; Load reset byte to AL
-	test	al, al						; Any error?
-	mov		ah, RET_HD_RESETFAIL		; Assume there was an error
-	stc
-	jnz		SHORT .Return
-	xor		ah, ah						; Zero AH and CF since success
-.Return:
-	jmp		Int13h_PopDiDsAndReturn
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH5h_HFormat.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH5h_HFormat.asm	(revision 89)
+++ 	(revision )
@@ -1,44 +1,0 @@
-; File name		:	AH5h_HFormat.asm
-; Project name	:	IDE BIOS
-; Created date	:	2.11.2007
-; Last update	:	12.4.2010
-; Author		:	Tomi Tilli
-; Description	:	Int 13h function AH=5h, Format Disk Track.
-
-; Section containing code
-SECTION .text
-
-;--------------------------------------------------------------------
-; Int 13h function AH=5h, Format Disk Track.
-;
-; AH5h_HandlerForFormatDiskTrack
-;	Parameters:
-;		AH:		Bios function 5h
-;		CH:		Cylinder number, bits 7...0
-;		CL:		Bits 7...6: Cylinder number bits 9 and 8
-;				Bits 5...0:	Starting sector number (1...63)
-;		DH:		Starting head number (0...255)
-;		DL:		Drive number
-;		ES:BX:	Pointer to address table
-;	Parameters loaded by Int13h_Jump:
-;		DS:		RAMVARS segment
-;	Returns:
-;		AH:		Int 13h/40h floppy return status
-;		CF:		0 if successfull, 1 if error
-;		IF:		1
-;	Corrupts registers:
-;		Flags
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-AH5h_HandlerForFormatDiskTrack:
-	push	dx
-	push	cx
-	push	bx
-	push	ax
-
-	; Format command is vendor specific on IDE drives.
-	; Let's do verify instead.
-	call	FindDPT_ForDriveNumber		; DS:DI now points to DPT
-	mov		al, [di+DPT.bPSect]			; Load Sectors per Track to AL
-	call	AH4h_VerifySectors
-	jmp		Int13h_PopXRegsAndReturn
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int18h.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int18h.asm	(revision 89)
+++ 	(revision )
@@ -1,23 +1,0 @@
-; Project name	:	XTIDE Universal BIOS
-; Description	:	Int 18h BIOS functions (ROM boot and Boot error).
-
-; Section containing code
-SECTION .text
-
-;--------------------------------------------------------------------
-; Int 18h software interrupt handler.
-; Enters boot menu again after displaying callback message.
-;
-; Int18h_BootError
-;	Parameters:
-;		Nothing
-;	Returns:
-;		Nothing (jumps to Int19hMenu_Display)
-;	Corrupts registers:
-;		Doesn't matter
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-Int18h_BootError:
-	mov		si, g_sz18hCallback
-	call	PrintNullTerminatedStringFromCSSIandSetCF
-	jmp		Int19hMenu_Display		; Return to boot menu
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm	(revision 89)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm	(revision 90)
@@ -1,8 +1,3 @@
-; File name		:	Int19h.asm
-; Project name	:	IDE BIOS
-; Created date	:	3.8.2007
-; Last update	:	14.1.2011
-; Author		:	Tomi Tilli,
-;				:	Krister Nordvall (optimizations)
+; Project name	:	XTIDE Universal BIOS
 ; Description	:	Int 19h BIOS functions (Boot Strap Loader).
 
@@ -12,47 +7,4 @@
 B_READ_RETRY_TIMES	EQU	3	; Number of times to retry
 
-
-;--------------------------------------------------------------------
-; Int 19h software interrupt handler for late initialization.
-; Calls actual Int 19h after initialization is complete.
-;
-; Int19h_LateInitialization
-;	Parameters:
-;		Nothing
-;	Returns:
-;		Never returns
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-Int19h_LateInitialization:
-	call	Initialize_ShouldSkip			; Skip initialization?
-	jc		SHORT .SkipInitialization
-	call	Initialize_AndDetectDrives
-	int		INTV_BOOTSTRAP					; Call actual boot loader
-.SkipInitialization:
-	call	RamVars_Initialize				; RAMVARS must be initialized even for simple boot loader
-	; Fall to Int19h_SimpleBootLoader
-
-;--------------------------------------------------------------------
-; Simple boot loader.
-; Boot sequence is fixed to 00h, 80h and INT 18h.
-;
-; Int19h_SimpleBootLoader
-;	Parameters:
-;		Nothing
-;	Returns:
-;		Never returns
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-Int19h_SimpleBootLoader:
-	sti										; Enable interrupts
-	call	RamVars_GetSegmentToDS
-	xor		dx, dx
-	call	Int19h_TryToLoadBootSectorFromDL
-	jc		SHORT Int19h_JumpToBootSector
-	mov		dl, 80h
-	call	Int19h_TryToLoadBootSectorFromDL
-	jc		SHORT Int19h_JumpToBootSector
-	call	Int19h_BootFailure				; Should never return		
-	jmp		SHORT Int19h_SimpleBootLoader
 
 ;--------------------------------------------------------------------
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19hLate.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19hLate.asm	(revision 90)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19hLate.asm	(revision 90)
@@ -0,0 +1,39 @@
+; Project name	:	XTIDE Universal BIOS
+; Description	:	Late initialization for XT builds.
+
+; Section containing code
+SECTION .text
+
+;--------------------------------------------------------------------
+; Int19hLate_InitializeInt19h
+;	Parameters:
+;		ES:		BDA segment
+;	Returns:
+;		Nothing
+;	Corrupts registers:
+;		BX, SI
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+Int19hLate_InitializeInt19h:
+	mov		bx, INTV_BOOTSTRAP
+	mov		si, HandlerForLateInitialization
+	jmp		Interrupts_InstallHandlerToVectorInBXFromCSSI
+
+
+;--------------------------------------------------------------------
+; HandlerForLateInitialization
+;	Parameters:
+;		Nothing
+;	Returns:
+;		Never returns
+;--------------------------------------------------------------------
+ALIGN JUMP_ALIGN
+HandlerForLateInitialization:
+	LOAD_BDA_SEGMENT_TO	es, ax
+	call	Initialize_ShouldSkip		; Skip initialization?
+	jnz		SHORT .SkipInitialization
+	call	Initialize_AndDetectDrives	; Installs boot menu loader
+	int		INTV_BOOTSTRAP
+.SkipInitialization:
+	call	RamVars_Initialize			; RAMVARS must be initialized even for simple boot loader
+	int		INTV_BOOTSTRAP				; Call default system boot loader
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19hMenu.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19hMenu.asm	(revision 89)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19hMenu.asm	(revision 90)
@@ -1,7 +1,3 @@
-; File name		:	Int19hMenu.asm
-; Project name	:	IDE BIOS
-; Created date	:	25.3.2010
-; Last update	:	12.4.2010
-; Author		:	Tomi Tilli
+; Project name	:	XTIDE Universal BIOS
 ; Description	:	Int 19h BIOS functions for Boot Menu.
 
@@ -24,5 +20,4 @@
 	LOAD_BDA_SEGMENT_TO	ds, ax
 	call	BootVars_StorePostStackPointer
-	call	BootVars_StoreSystemInt18hAndInstallOurs
 
 	; Install new INT 19h handler now that BOOTVARS has been initialized
@@ -111,6 +106,4 @@
 ALIGN JUMP_ALIGN
 .Int18hRomBoot:
-	call	BootVars_RestoreSystemInt18h
 	call	BootVars_SwitchBackToPostStack
-	call	Int19h_BootFailure			; Should never return
-	jmp		SHORT Int19hMenu_BootLoader	; Status unknown so reinitialize boot loader
+	jmp		Int19h_BootFailure			; Never returns
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm	(revision 89)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm	(revision 90)
@@ -1,7 +1,3 @@
-; File name		:	Initialize.asm
-; Project name	:	IDE BIOS
-; Created date	:	23.3.2010
-; Last update	:	23.8.2010
-; Author		:	Tomi Tilli
+; Project name	:	XTIDE Universal BIOS
 ; Description	:	Functions for initializing the BIOS.
 
@@ -28,14 +24,14 @@
 	ePUSHA
 
+	LOAD_BDA_SEGMENT_TO	es, ax
 	call	Initialize_ShouldSkip
-	jc		SHORT .ReturnFromRomInit
+	jnz		SHORT .SkipRomInitialization
 
-	ePUSH_T	ax, .ReturnFromRomInit		; Push return address
-	test	BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_LATE
-	jnz		SHORT Initialize_PrepareLateInitialization
-	jmp		SHORT Initialize_AndDetectDrives
-
-ALIGN JUMP_ALIGN
-.ReturnFromRomInit:
+%ifdef USE_AT	; Early initialization on AT build
+	call	Initialize_AndDetectDrives
+%else			; Late initialization on XT builds
+	call	Int19hLate_InitializeInt19h
+%endif
+.SkipRomInitialization:
 	ePOPA
 	pop		ds
@@ -50,37 +46,16 @@
 ; Initialize_ShouldSkip
 ;	Parameters:
+;		ES:		BDA segment
+;	Returns:
+;		ZF:		Cleared if ROM initialization is to be skipped
+;				Set to continue ROM initialization
+;	Corrupts registers:
 ;		Nothing
-;	Returns:
-;		CF:		Set if ROM initialization is to be skipped
-;				Cleared to continue ROM initialization
-;	Corrupts registers:
-;		AX, DS
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
 Initialize_ShouldSkip:
-	sti							; Enable interrupts
-	LOAD_BDA_SEGMENT_TO	ds, ax
-	mov		al, [BDA.bKBFlgs1]	; Load shift flags
-	eSHR_IM	al, 3				; Set CF if CTRL is held down
+	sti										; Enable interrupts
+	test	BYTE [es:BDA.bKBFlgs1], (1<<2)	; Clear ZF if CTRL is held down
 	ret
-
-
-;--------------------------------------------------------------------
-; Installs INT 19h boot loader handler for late initialization.
-;
-; Initialize_PrepareLateInitialization
-;	Parameters:
-;		Nothing
-;	Returns:
-;		Nothing
-;	Corrupts registers:
-;		BX, SI, ES
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-Initialize_PrepareLateInitialization:
-	LOAD_BDA_SEGMENT_TO	es, bx
-	mov		bl, INTV_BOOTSTRAP
-	mov		si, Int19h_LateInitialization
-	jmp		Interrupts_InstallHandlerToVectorInBXFromCSSI
 
 
@@ -90,5 +65,5 @@
 ; Initialize_AndDetectDrives
 ;	Parameters:
-;		Nothing
+;		ES:		BDA Segment
 ;	Returns:
 ;		Nothing
@@ -101,5 +76,4 @@
 	call	RamVars_Initialize
 	call	RamVars_GetSegmentToDS
-	LOAD_BDA_SEGMENT_TO	es, ax
 	call	Interrupts_InitializeInterruptVectors
 	call	DetectDrives_FromAllIDEControllers
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm	(revision 89)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm	(revision 90)
@@ -1,3 +1,3 @@
-; Project name	:	IDE BIOS
+; Project name	:	XTIDE Universal BIOS
 ; Description	:	Functions for initializing the BIOS.
 
@@ -66,26 +66,5 @@
 ALIGN JUMP_ALIGN
 Interrupts_InitializeInt19h:
-	eMOVZX	bx, [cs:ROMVARS.bBootLdrType]	; Load boot loader type
-	mov		si, INTV_BOOTSTRAP				; 19h
-	xchg	bx, si							; SI=Loader type, BX=19h
-	jmp		[cs:si+.rgwSetupBootLoader]		; Jump to install selected loader
-ALIGN WORD_ALIGN
-.rgwSetupBootLoader:
-	dw		.SetupBootMenuLoader		; BOOTLOADER_TYPE_MENU
-	dw		.SetupSimpleLoader			; BOOTLOADER_TYPE_SIMPLE
-	dw		.SetupBootMenuLoader		; reserved
-	dw		.NoBootLoader				; BOOTLOADER_TYPE_NONE
-
-ALIGN JUMP_ALIGN
-.NoBootLoader:
-	test	BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_LATE
-	jnz		SHORT .SetupSimpleLoader	; Boot loader required for late initialization
-	ret
-ALIGN JUMP_ALIGN
-.SetupSimpleLoader:
-	mov		si, Int19h_SimpleBootLoader
-	jmp		Interrupts_InstallHandlerToVectorInBXFromCSSI
-ALIGN JUMP_ALIGN
-.SetupBootMenuLoader:
+	mov		bx, INTV_BOOTSTRAP
 	mov		si, Int19hMenu_BootLoader
 	jmp		Interrupts_InstallHandlerToVectorInBXFromCSSI
Index: trunk/XTIDE_Universal_BIOS/Src/Main.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 89)
+++ trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 90)
@@ -38,5 +38,4 @@
 	at	ROMVARS.bRomSize,	db	CNT_ROM_BLOCKS	; ROM size in 512B blocks
 	at	ROMVARS.rgbJump, 	jmp	Initialize_FromMainBiosRomSearch
-	at	ROMVARS.rgbDate,	db	"01/27/11"		; Build data (mm/dd/yy)
 	at	ROMVARS.rgbSign,	db	"XTIDE120"		; Signature for flash program
 	at	ROMVARS.szTitle
@@ -49,5 +48,5 @@
 		db	" (XT)=-",NULL
 %endif
-	at	ROMVARS.szVersion,	db	"v1.2.0_wip (01/27/11)",NULL
+	at	ROMVARS.szVersion,	db	"v1.2.0_wip (01/27/11)",NULL	; mm/dd/yy
 
 ;---------------------------;
@@ -55,9 +54,8 @@
 ;---------------------------;
 %ifdef USE_AT
-	at	ROMVARS.wFlags,			dw	FLG_ROMVARS_FULLMODE | FLG_ROMVARS_DRVXLAT | FLG_ROMVARS_DRVNFO | FLG_ROMVARS_MAXSIZE
+	at	ROMVARS.wFlags,			dw	FLG_ROMVARS_FULLMODE | FLG_ROMVARS_DRVXLAT | FLG_ROMVARS_MAXSIZE
 	at	ROMVARS.bIdeCnt,		db	3						; Number of supported controllers
 	at	ROMVARS.bBootDrv,		db	80h						; Boot Menu default drive
 	at	ROMVARS.bBootDelay,		db	30						; Boot Menu selection delay (secs)
-	at	ROMVARS.bBootLdrType,	db	BOOTLOADER_TYPE_MENU	; Boot loader type
 	at	ROMVARS.bMinFddCnt, 	db	0						; Do not force minimum number of floppy drives
 	at	ROMVARS.bStealSize,		db	1						; Steal 1kB from base memory
@@ -87,9 +85,8 @@
 ; XT and XT+ Build default settings ;
 ;-----------------------------------;
-	at	ROMVARS.wFlags,			dw	FLG_ROMVARS_LATE | FLG_ROMVARS_DRVXLAT | FLG_ROMVARS_ROMBOOT | FLG_ROMVARS_DRVNFO | FLG_ROMVARS_MAXSIZE
+	at	ROMVARS.wFlags,			dw	FLG_ROMVARS_DRVXLAT | FLG_ROMVARS_ROMBOOT | FLG_ROMVARS_MAXSIZE
 	at	ROMVARS.bIdeCnt,		db	1						; Number of supported controllers
 	at	ROMVARS.bBootDrv,		db	80h						; Boot Menu default drive
 	at	ROMVARS.bBootDelay,		db	30						; Boot Menu selection delay (secs)
-	at	ROMVARS.bBootLdrType,	db	BOOTLOADER_TYPE_MENU	; Boot loader type
 	at	ROMVARS.bMinFddCnt, 	db	1						; Assume at least 1 floppy drive present if autodetect fails
 	at	ROMVARS.bStealSize,		db	1						; Steal 1kB from base memory in full mode
@@ -143,6 +140,8 @@
 ; Include .asm files (Interrupt handlers)
 %include "Int13h.asm"			; For Int 13h, Disk functions
-%include "Int18h.asm"			; For Int 18h, ROM Boot and Boot error
 %include "Int19h.asm"			; For Int 19h, Boot Loader
+%ifndef USE_AT
+	%include "Int19hLate.asm"	; For late initialization
+%endif
 %include "Int19hMenu.asm"		; For Int 19h, Boot Loader for Boot Menu
 %include "BootPrint.asm"		; For printing boot information
@@ -154,5 +153,4 @@
 %include "AH3h_HWrite.asm"		; Required by Int13h_Jump.asm
 %include "AH4h_HVerify.asm"		; Required by Int13h_Jump.asm
-%include "AH5h_HFormat.asm"		; Required by Int13h_Jump.asm
 %include "AH8h_HParams.asm"		; Required by Int13h_Jump.asm
 %include "AH9h_HInit.asm"		; Required by Int13h_Jump.asm
@@ -161,5 +159,4 @@
 %include "AH10h_HReady.asm"		; Required by Int13h_Jump.asm
 %include "AH11h_HRecal.asm"		; Required by Int13h_Jump.asm
-%include "AH14h_HDiag.asm"		; Required by Int13h_Jump.asm
 %include "AH15h_HSize.asm"		; Required by Int13h_Jump.asm
 %include "AH23h_HFeatures.asm"	; Required by Int13h_Jump.asm
Index: trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm	(revision 89)
+++ trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm	(revision 90)
@@ -1,7 +1,3 @@
-; File name		:	RamVars.asm
-; Project name	:	IDE BIOS
-; Created date	:	14.3.2010
-; Last update	:	23.8.2010
-; Author		:	Tomi Tilli
+; Project name	:	XTIDE Universal BIOS
 ; Description	:	Functions for accessings RAMVARS.
 
@@ -19,10 +15,12 @@
 ;		Nothing
 ;	Corrupts registers:
-;		AX, CX, DI, DS, ES
+;		AX, CX, DI, DS
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
 RamVars_Initialize:
+	push	es
 	call	.StealMemoryForRAMVARS	; Get RAMVARS segment to DS even if no stealing
 	call	.ClearRamvarsFromDS
+	pop		es
 	jmp		DriveXlate_Reset
 
