Index: trunk/XTIDE_Universal_BIOS/Inc/ATA_ID.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/ATA_ID.inc	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Inc/ATA_ID.inc	(revision 567)
@@ -86,6 +86,6 @@
 	.strModel	resb 40	; 27...46F, Model number (40 ASCII characters, 0000h=not specified)
 	.bBlckSize	resb 1	; 47[0-7]F, Maximum number of sectors that can be transferred
-						;          per interrupt on read and write multiple commands
-						;		   (00h=Read/write multiple commands not implemented)
+						;			per interrupt on read and write multiple commands
+						;			(00h=Read/write multiple commands not implemented)
 				resb 1	; 47[8-15]X
 	.wDWIO		resw 1	; 48F, Can perform doubleword I/O (boolean)
@@ -106,5 +106,5 @@
 	; Words 59-63 are always valid
 	.bBlockSel	resb 1	; 59[0-7]V, Current setting for number of sectors that
-						;           can be transferred per interrupt on R/W multiple command
+						;			can be transferred per interrupt on R/W multiple command
 	.bBlockFlgs	resb 1	; 59[8-15]VR, bit 0 set if Multiple sector setting is valid
 	.dwLBACnt	resd 1	; 60...61F, Total number of user addressable sectors (LBA mode only)
@@ -168,6 +168,6 @@
 	.strModel	resb 40	; 27...46F, Model number (40 ASCII characters, 0000h=not specified)
 	.bBlckSize	resb 1	; 47[0-7]F, Maximum number of sectors that can be transferred
-						;          per interrupt on read and write multiple commands
-						;		   (00h=Read/write multiple commands not implemented)
+						;			per interrupt on read and write multiple commands
+						;			(00h=Read/write multiple commands not implemented)
 				resb 1	; 47[8-15]X
 				resw 1	; 48R
@@ -188,5 +188,5 @@
 	; Words 59-63 are always valid
 	.bBlockSel	resb 1	; 59[0-7]V, Current setting for number of sectors that
-						;           can be transferred per interrupt on R/W multiple command
+						;			can be transferred per interrupt on R/W multiple command
 	.bBlockFlgs	resb 1	; 59[8-15]VR, bit 0 set if Multiple sector setting is valid
 	.dwLBACnt	resd 1	; 60...61F, Total number of user addressable sectors (LBA mode only)
@@ -253,6 +253,6 @@
 	.strModel	resb 40	; 27...46F, Model number (40 ASCII characters, 0000h=not specified)
 	.bBlckSize	resb 1	; 47[0-7]F, Maximum number of sectors that can be transferred
-						;           per interrupt on read and write multiple commands
-						;		    (00h=Read/write multiple commands not implemented)
+						;			per interrupt on read and write multiple commands
+						;			(00h=Read/write multiple commands not implemented)
 				resb 1	; 47[8-15]F, 80h
 				resw 1	; 48R
@@ -271,5 +271,5 @@
 	; Words 59-63 are always valid
 	.bBlockSel	resb 1	; 59[0-7]V, Current setting for number of sectors that
-						;           can be transferred per interrupt on R/W multiple command
+						;			can be transferred per interrupt on R/W multiple command
 	.bBlockFlgs	resb 1	; 59[8-15]VR, bit 0 set if Multiple sector setting is valid
 	.dwLBACnt	resd 1	; 60...61F, Total number of user addressable sectors (LBA-28)
Index: trunk/XTIDE_Universal_BIOS/Inc/Controllers/XTCF.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/Controllers/XTCF.inc	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Inc/Controllers/XTCF.inc	(revision 567)
@@ -1,4 +1,4 @@
 ; Project name	:	XTIDE Universal BIOS
-; Description	:	Lo-tech XT-CFv2 board specifications.
+; Description	:	Lo-tech XT-CF board specifications.
 ;
 ; More information at http://www.lo-tech.co.uk/XT-CF
@@ -19,7 +19,4 @@
 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 ;
-
-; Modified by JJP for XT-CFv3 support, Mar-13
-
 
 %ifndef XTCF_INC
@@ -56,5 +53,5 @@
 ; For XT-CFv3 adapter, DMA transfers are also supported via channel 3.
 ;
-; XT-CFv3 cannot be distinguised by software, so user must decide and set
+; XT-CFv3 cannot be distinguished by software, so user must decide and set
 ; the mode via a call to Int 13h function 1Eh accordingly (see AH1E_XTCF.asm).
 ;
Index: trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc	(revision 567)
@@ -61,25 +61,24 @@
 	FLGL_DPT_LBA						EQU	FLG_DRVNHEAD_LBA	; Bit 6, Drive supports LBA and so EBIOS functions can be supported
 %ifdef MODULE_EBIOS
-	FLGL_DPT_LBA48						EQU	(1<<7)				; Bit 7, Drive supports 48-bit LBA (Must be bit 7!)
+	FLGL_DPT_LBA48						EQU	(1<<7)				; Bit 7, Drive supports 48-bit LBA (must be bit 7!)
 %endif
 
 
 	; Bit definitions for DPT.bFlagsHigh
-	FLGH_DPT_USE_BLOCK_MODE_COMMANDS	EQU	(1<<1)	; Bit 1, Use block transfer commands (must be bit 1!)
+	FLGH_DPT_USE_BLOCK_MODE_COMMANDS	EQU	(1<<1)				; Bit 1, Use block transfer commands (must be bit 1!)
 %ifdef MODULE_SERIAL
-	FLGH_DPT_SERIAL_DEVICE				EQU	(1<<2)	; Bit 2, Serial Port Device
+	FLGH_DPT_SERIAL_DEVICE				EQU	(1<<2)				; Bit 2, Serial Port Device
 %endif
-%ifdef MODULE_FEATURE_SETS
-	FLGH_DPT_POWER_MANAGEMENT_SUPPORTED	EQU (1<<5)	; Bit 5, Drive supports power management
+%ifdef MODULE_POWER_MANAGEMENT
+	FLGH_DPT_POWER_MANAGEMENT_SUPPORTED	EQU (1<<3)				; Bit 3, Drive supports power management (must be bit 3!)
 %endif
 %ifdef MODULE_ADVANCED_ATA
-	FLGH_DPT_IORDY						EQU	(1<<7)	; Bit 7, Controller and Drive supports IORDY
+	FLGH_DPT_IORDY						EQU	(1<<7)				; Bit 7, Controller and Drive supports IORDY
 %endif
 
 	; Serial device only
 %ifdef MODULE_SERIAL_FLOPPY
-	FLGH_DPT_SERIAL_FLOPPY						EQU	(1<<4)
-	FLGH_DPT_SERIAL_FLOPPY_TYPE_MASK			EQU	0e0h
-	FLGH_DPT_SERIAL_FLOPPY_TYPE_FIELD_POSITION	EQU	5
+	FLGH_DPT_SERIAL_FLOPPY						EQU	(1<<4)		; Bit 4, Drive is a serial floppy drive
+	FLGH_DPT_SERIAL_FLOPPY_TYPE_FIELD_POSITION	EQU	5			; Bits 7...5, Serial floppy drive type
 %endif
 
Index: trunk/XTIDE_Universal_BIOS/Inc/DeviceIDE.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/DeviceIDE.inc	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Inc/DeviceIDE.inc	(revision 567)
@@ -31,5 +31,5 @@
 TIMEOUT_MAXIMUM			EQU		255			; We would actually want 31 seconds here but I don't think there are so slow drives
 
-%ifdef MODULE_FEATURE_SETS
+%ifdef MODULE_POWER_MANAGEMENT
 	TIMEOUT_BSY			EQU		TIMEOUT_MOTOR_STARTUP
 	TIMEOUT_DRDY		EQU		TIMEOUT_MOTOR_STARTUP
Index: trunk/XTIDE_Universal_BIOS/Inc/ModuleDependency.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/ModuleDependency.inc	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Inc/ModuleDependency.inc	(revision 567)
@@ -130,8 +130,8 @@
 %endif
 
-%ifdef MODULE_FEATURE_SETS
-	MAIN_FLG_MODULE_FEATURE_SETS	EQU	FLG_ROMVARS_MODULE_FEATURE_SETS
+%ifdef MODULE_POWER_MANAGEMENT
+	MAIN_FLG_MODULE_POWER_MANAGEMENT	EQU	FLG_ROMVARS_MODULE_POWER_MANAGEMENT
 %else
-	MAIN_FLG_MODULE_FEATURE_SETS	EQU	0
+	MAIN_FLG_MODULE_POWER_MANAGEMENT	EQU	0
 %endif
 
@@ -142,4 +142,4 @@
 %endif
 
-MASK_ROMVARS_INCLUDED_MODULES	EQU	MAIN_FLG_MODULE_8BIT_IDE | MAIN_FLG_MODULE_ADVANCED_ATA | MAIN_FLG_MODULE_BOOT_MENU | MAIN_FLG_MODULE_EBIOS | MAIN_FLG_MODULE_HOTKEYS | MAIN_FLG_MODULE_IRQ | MAIN_FLG_MODULE_SERIAL | MAIN_FLG_MODULE_SERIAL_FLOPPY | MAIN_FLG_MODULE_STRINGS_COMPRESSED | MAIN_FLG_MODULE_FEATURE_SETS | MAIN_FLG_MODULE_8BIT_IDE_ADVANCED
+MASK_ROMVARS_INCLUDED_MODULES	EQU	MAIN_FLG_MODULE_8BIT_IDE | MAIN_FLG_MODULE_ADVANCED_ATA | MAIN_FLG_MODULE_BOOT_MENU | MAIN_FLG_MODULE_EBIOS | MAIN_FLG_MODULE_HOTKEYS | MAIN_FLG_MODULE_IRQ | MAIN_FLG_MODULE_SERIAL | MAIN_FLG_MODULE_SERIAL_FLOPPY | MAIN_FLG_MODULE_STRINGS_COMPRESSED | MAIN_FLG_MODULE_POWER_MANAGEMENT | MAIN_FLG_MODULE_8BIT_IDE_ADVANCED
 
Index: trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc
===================================================================
--- trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Inc/RomVars.inc	(revision 567)
@@ -72,5 +72,5 @@
 
 ; Here in case the configuration needs to know functionality is present
-FLG_ROMVARS_MODULE_FEATURE_SETS			EQU	(1<<5)
+FLG_ROMVARS_MODULE_POWER_MANAGEMENT		EQU	(1<<5)
 FLG_ROMVARS_MODULE_8BIT_IDE				EQU	(1<<6)
 FLG_ROMVARS_MODULE_8BIT_IDE_ADVANCED	EQU (1<<7)
Index: trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeDPT.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeDPT.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeDPT.asm	(revision 567)
@@ -34,5 +34,5 @@
 IdeDPT_Finalize:
 
-%ifdef MODULE_FEATURE_SETS
+%ifdef MODULE_POWER_MANAGEMENT
 ;--------------------------------------------------------------------
 ; .DetectPowerManagementSupport
@@ -43,12 +43,11 @@
 ;		Nothing
 ;	Corrupts registers:
-;		Nothing
+;		AL
 ;--------------------------------------------------------------------
 .DetectPowerManagementSupport:
-	test	BYTE [es:si+ATA6.wSetSup82], A6_wSetSup82_POWERMAN
-	jz		SHORT .NoPowerManagementSupport
-	or		BYTE [di+DPT.bFlagsHigh], FLGH_DPT_POWER_MANAGEMENT_SUPPORTED
-.NoPowerManagementSupport:
-%endif ; MODULE_FEATURE_SETS
+	mov		al, [es:si+ATA6.wSetSup82]
+	and		al, A6_wSetSup82_POWERMAN	; A6_wSetSup82_POWERMAN (bit 3) is the same
+	or		[di+DPT.bFlagsHigh], al		; bit as FLGH_DPT_POWER_MANAGEMENT_SUPPORTED
+%endif ; MODULE_POWER_MANAGEMENT
 
 
Index: trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeDmaBlock.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeDmaBlock.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeDmaBlock.asm	(revision 567)
@@ -2,6 +2,4 @@
 ; Description	:	IDE Read/Write functions for transferring block using DMA.
 ;					These functions should only be called from IdeTransfer.asm.
-
-; Modified JJP 05-Jun-13
 
 ;
@@ -91,5 +89,5 @@
 	; Calculate bytes for first page
 	mov		ax, di
-	neg		ax			; 2s compliment
+	neg		ax			; 2s complement
 
 	; If DI was zero carry flag will be cleared (and set otherwise)
@@ -187,7 +185,17 @@
 	jz		SHORT .TransferNextBlock	; All bytes transferred?
 %else	; Fast DMA code - perform computed number of transfers, then check DMA status register to be sure
-	add		cx, BYTE 15					; We'll divide transfers in 16-byte atomic transfers,
-	eSHR_IM	cx, 4						; so include any partial block, which will be terminated
-ALIGN JUMP_ALIGN						; by the DMA controller raising T/C
+	; We'll divide transfers in 16-byte atomic transfers, so include any partial block, which will be terminated by the DMA controller raising T/C
+	add		cx, BYTE 15
+
+%ifdef USE_186
+	shr		cx, 4
+%else
+	xchg	cx, ax
+	mov		cl, 4
+	shr		ax, cl
+	xchg	cx, ax
+%endif
+
+ALIGN JUMP_ALIGN
 .TransferNextDmaBlock:
 	out		dx, al						; Transfer up to 16 bytes to/from XT-CF card
Index: trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeError.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeError.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeError.asm	(revision 567)
@@ -20,4 +20,10 @@
 ; Section containing code
 SECTION .text
+
+%ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
+	%if $ <> PollBsyOnly.End
+		%error "IdeError.asm must come immediately after IdeWait.asm (PollBsyOnly falls into IdeError_GetBiosErrorCodeToAHfromPolledStatusRegisterInAL)!"
+	%endif
+%endif
 
 ;--------------------------------------------------------------------
Index: trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdePioBlock.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdePioBlock.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdePioBlock.asm	(revision 567)
@@ -18,6 +18,4 @@
 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 ;
-
-; Modified by JJP for XT-CFv3 support, Mar-13
 
 ; Section containing code
Index: trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm	(revision 567)
@@ -228,10 +228,9 @@
 
 	; Get transfer function based on bus type
-	xchg	ax, bx								; Lookup table offset to AX
-	mov		bl, [di+DPT_ATA.bDevice]
+	mov		al, [di+DPT_ATA.bDevice]
+	add		bx, ax
 %ifdef MODULE_8BIT_IDE_ADVANCED
-	mov		dl, bl
-%endif
-	add		bx, ax
+	cmp		al, DEVICE_8BIT_XTCF_DMA
+%endif
 	mov		ax, [cs:bx]							; Load offset to transfer function
 	mov		[bp+PIOVARS.fnXfer], ax
@@ -239,9 +238,9 @@
 	; Normalize pointer for PIO-transfers and convert to physical address for DMA transfers
 %ifdef MODULE_8BIT_IDE_ADVANCED
-	cmp		dl, DEVICE_8BIT_XTCF_DMA
 	jb		SHORT IdeTransfer_NormalizePointerInESSI
 
 	; Convert ES:SI to physical address
-%ifdef USE_186			; Bytes	EU Cycles(286)
+%ifdef USE_186
+						; Bytes	EU Cycles(286)
 	mov		ax, es		; 2		2
 	rol		ax, 4		; 3		9
@@ -255,6 +254,4 @@
 						; 18	24
 %else ; 808x
-
-%if 0
 						; Bytes	EU Cycles(808x)
 	mov		al, 4		; 2		4
@@ -279,5 +276,5 @@
 ; In other words, we could use a real world test here.
 ;
-%endif ; 0
+%if 0
 						; Bytes	EU Cycles(808x/286)
 	xor		dx, dx		; 2		3/2
@@ -291,7 +288,9 @@
 	mov		es, dx		; 2		2/2
 	;------------------------------------
-%endif					; 26	29/26
-	clc
-	ret
+						; 26	29/26
+%endif ; 0
+%endif
+
+	ret		; With CF cleared (taken care of by the physical address conversion)
 %endif ; MODULE_8BIT_IDE_ADVANCED
 	; Fall to IdeTransfer_NormalizePointerInESSI if no MODULE_8BIT_IDE_ADVANCED
Index: trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeWait.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeWait.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeWait.asm	(revision 567)
@@ -130,3 +130,5 @@
 	call	Timer_SetCFifTimeout				; Update timeout counter
 	jnc		SHORT .PollLoop						; Loop if time left (sets CF on timeout)
-	jmp		SHORT IdeError_GetBiosErrorCodeToAHfromPolledStatusRegisterInAL
+.End:											; Label used for sanity check during assembly
+	; Fall to IdeError_GetBiosErrorCodeToAHfromPolledStatusRegisterInAL
+
Index: trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialCommand.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialCommand.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialCommand.asm	(revision 567)
@@ -28,7 +28,7 @@
 ;	Parameters:
 ;		BH:		Non-zero if 48-bit addressing used
-;               (ignored at present as 48-bit addressing is not supported)
+;				(ignored at present as 48-bit addressing is not supported)
 ;		BL:		IDE Status Register bit to poll after command
-;               (ignored at present, since there is no IDE status register to poll)
+;				(ignored at present, since there is no IDE status register to poll)
 ;		ES:SI:	Ptr to buffer (for data transfer commands)
 ;		DS:DI:	Ptr to DPT (in RAMVARS segment)
@@ -122,13 +122,13 @@
 ;		   wSerialPortAndBaud Non-Zero:           -> Continue with wSerialPortAndBaud (1)
 ;		   wSerialPortAndBaud Zero:
-;		       previous serial drive not found:   -> Scan (2)
-;		       previous serial drive found:       -> Continue with previous serial drive info (3)
+;			   previous serial drive not found:   -> Scan (2)
+;			   previous serial drive found:       -> Continue with previous serial drive info (3)
 ;
 ;    Slave:
 ;		   wSerialPortAndBaud Non-Zero:
-;		   	   previous serial drive not found:   -> Error - Not Found (4)
+;			   previous serial drive not found:   -> Error - Not Found (4)
 ;			   previous serial drive found:       -> Continue with wSerialPackedAndBaud (5)
-;          wSerialPortAndBaud Zero:
-;		   	   previous serial drive not found:	  -> Error - Not Found (4)
+;		   wSerialPortAndBaud Zero:
+;			   previous serial drive not found:	  -> Error - Not Found (4)
 ;			   previous serial drive found:       -> Continue with previous serial drive info (6)
 ;
Index: trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialDPT.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialDPT.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialDPT.asm	(revision 567)
@@ -28,5 +28,5 @@
 ;	Returns:
 ;		CF:		Set, indicates that this is a floppy disk
-;               Clear, indicates that this is a hard disk
+;				Clear, indicates that this is a hard disk
 ;	Corrupts registers:
 ;		AX
@@ -49,5 +49,5 @@
 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
 	%ifdef MODULE_SERIAL_FLOPPY
-		%if FLGH_DPT_SERIAL_DEVICE != 0x4 || FLGH_DPT_SERIAL_FLOPPY != 0x10 || FLGH_DPT_SERIAL_FLOPPY_TYPE_MASK != 0xe0 || FLGH_DPT_SERIAL_FLOPPY_TYPE_FIELD_POSITION != 5
+		%if FLGH_DPT_SERIAL_DEVICE != 0x4 || FLGH_DPT_SERIAL_FLOPPY != 0x10 || FLGH_DPT_SERIAL_FLOPPY_TYPE_FIELD_POSITION != 5
 			%error "The serial server passes FLGH values into SerialDPT_Finalize directly.  If the flag positions are changed, corresponding changes will need to be made in the serial server, and likely a version check put in to deal with servers talking to incompatible clients"
 		%endif
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm	(revision 567)
@@ -309,6 +309,6 @@
 ;	Returns:
 ;		Depends on function
-;       NOTE: ES:DI needs to be returned from the previous interrupt
-;		      handler, for floppy DPT in function 08h
+;		NOTE: ES:DI needs to be returned from the previous interrupt
+;			  handler, for floppy DPT in function 08h
 ;	Corrupts registers:
 ;		None
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm	(revision 567)
@@ -119,9 +119,9 @@
 	mov		dl, ROMVARS.ideVars0						; starting Idevars offset
 
-    ; Get count of ALL Idevars structures, not just the ones that are configured.  This may seem odd,
-    ; but it catches the .ideVarsSerialAuto structure, which would not be scanned if the count from
+	; Get count of ALL Idevars structures, not just the ones that are configured.  This may seem odd,
+	; but it catches the .ideVarsSerialAuto structure, which would not be scanned if the count from
 	; RamVars_GetIdeControllerCountToCX was used.  Unused controllers won't make a difference, since no DPT
 	; will point to them.  Performance isn't an issue, as this is a reset operation.
-    ;
+	;
 	mov		cx, NUMBER_OF_IDEVARS
 
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH15h_HSize.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH15h_HSize.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH15h_HSize.asm	(revision 567)
@@ -37,5 +37,5 @@
 ;		If successful:
 ;			AH:		Hard Disk: 3 (Hard disk accessible)
-;                   Floppy:    1 (Floppy disk, without change detection)
+;					Floppy:    1 (Floppy disk, without change detection)
 ;			CX:DX:	Total number of sectors
 ;			CF:		0
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1Eh_XTCF.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1Eh_XTCF.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1Eh_XTCF.asm	(revision 567)
@@ -19,6 +19,4 @@
 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 ;
-
-; Modified by JJP for XT-CFv3 support, Mar-13
 
 ; Section containing code
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH8h_HParams.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH8h_HParams.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH8h_HParams.asm	(revision 567)
@@ -31,5 +31,5 @@
 ;		SS:BP:	Ptr to IDEPACK
 ;	Returns with INTPACK:
-;       BL:     Drive Type (for floppies only)
+;		BL:		Drive Type (for serial floppies only)
 ;		CH:		Maximum cylinder number, bits 7...0
 ;		CL:		Bits 7...6: Cylinder number bits 9...8
@@ -37,5 +37,5 @@
 ;		DH:		Maximum head number (0...254)
 ;		DL:		Number of drives!!!
-;       ES:DI:  Floppy DPT (for floppies only)
+;		ES:DI:	Floppy DPT (for serial floppies only)
 ;		AH:		Int 13h/40h floppy return status
 ;		CF:		0 if successful, 1 if error
@@ -57,5 +57,5 @@
 	call	RamVars_GetCountOfKnownDrivesToAX		; assume hard disk for now, will discard if for floppies
 
-	test	byte [bp+IDEPACK.intpack+INTPACK.dl], 080h
+	test	BYTE [bp+IDEPACK.intpack+INTPACK.dl], 80h
 	jnz		SHORT .CalledForHardDrive
 
@@ -93,4 +93,5 @@
 ;		DS:DI:	Ptr to DPT (in RAMVARS segment)
 ;	Returns:
+;		BL:		Drive Type (for serial floppies only)
 ;		CH:		Maximum cylinder number, bits 7...0
 ;		CL:		Bits 7...6: Cylinder number bits 9...8
@@ -98,5 +99,5 @@
 ;		DH:		Maximum head number (0...254)
 ;	Corrupts registers:
-;		AX, BX
+;		AX, BH
 ;--------------------------------------------------------------------
 AH8h_GetDriveParameters:
@@ -115,4 +116,5 @@
 ;		DS:		RAMVARS segment
 ;	Returns:
+;		BL:		Drive Type (for serial floppies only)
 ;		CH:		Maximum cylinder number, bits 7...0
 ;		CL:		Bits 7...6: Cylinder number bits 9...8
@@ -120,5 +122,5 @@
 ;		DH:		Maximum head number (0...254)
 ;	Corrupts registers:
-;		AX, BX
+;		AX, BH
 ;--------------------------------------------------------------------
 .PackReturnValues:
@@ -172,5 +174,5 @@
 
 	db		1h << 1 | 0				; Offset 1: Typical values of 1 for head load time
-									;           DMA used (although it actually is not, but is more restrictive)
+									; 			DMA used (although it actually is not, but is more restrictive)
 	db		25h						; Offset 2: Inactivity motor turn-off delay,
 									; 			Typical value of 25h for 2 second delay
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm	(revision 567)
@@ -194,5 +194,5 @@
 
 
-%ifdef MODULE_FEATURE_SETS
+%ifdef MODULE_POWER_MANAGEMENT
 ;;;	InitStandbyTimer
 	; Initialize the standby timer (if supported)
@@ -206,5 +206,5 @@
 	STORE_ERROR_FLAG_TO_DPT		FLG_INITERROR_FAILED_TO_INITIALIZE_STANDBY_TIMER
 .NoPowerManagementSupport:
-%endif ; MODULE_FEATURE_SETS
+%endif ; MODULE_POWER_MANAGEMENT
 
 
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH41h_CheckIfExtensionsPresent.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH41h_CheckIfExtensionsPresent.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH41h_CheckIfExtensionsPresent.asm	(revision 567)
@@ -39,5 +39,9 @@
 AH41h_HandlerForCheckIfExtensionsPresent:
 	cmp		WORD [bp+IDEPACK.intpack+INTPACK.bx], 55AAh
+%ifdef USE_386
+	jne		Int13h_DirectCallToAnotherBios
+%else
 	jne		SHORT .EbiosNotSupported
+%endif
 
 	mov		BYTE [bp+IDEPACK.intpack+INTPACK.ah], EBIOS_VERSION
@@ -53,6 +57,9 @@
 	and		BYTE [bp+IDEPACK.intpack+INTPACK.flags], ~FLG_FLAGS_CF	; Return with CF cleared
 	jmp		Int13h_ReturnFromHandlerWithoutStoringErrorCode
+
+%ifndef USE_386
 .EbiosNotSupported:
 	jmp		Int13h_DirectCallToAnotherBios
+%endif
 
 
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Prepare.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Prepare.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Prepare.asm	(revision 567)
@@ -113,5 +113,5 @@
 ; Prepare_ByValidatingSectorsInALforOldInt13h
 ;	Parameters:
-;		AL:		Number of sectors to transfer
+;		AL:		Number of sectors to transfer (1...128 is valid)
 ;	Returns:
 ;		Exits INT 13h if invalid number of sectors in AL
@@ -120,13 +120,12 @@
 ;--------------------------------------------------------------------
 Prepare_ByValidatingSectorsInALforOldInt13h:
-	test	al, al
-	js		SHORT .CheckZeroOffsetFor128Sectors		; 128 or more
-	jz		SHORT InvalidNumberOfSectorsRequested	; Zero not allowed for old INT 13h
+	test	al, al								; Check if 0 < AL < 128 (Clears OF)
+	jle		SHORT .CheckIf128Sectors			; Jump if not
 	ret		; Continue with transfer
 
 ALIGN JUMP_ALIGN
-.CheckZeroOffsetFor128Sectors:
+.CheckIf128Sectors:
 	cmp		al, 128
-	ja		SHORT InvalidNumberOfSectorsRequested
+	jne		SHORT InvalidNumberOfSectorsRequested
 	test	si, si								; Offset must be zero to xfer 128 sectors
 	jnz		SHORT CannotAlignPointerProperly
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int19h.asm	(revision 567)
@@ -31,5 +31,5 @@
 	sti											; Enable interrupts
 	cld											; String instructions to increment pointers
-%ifdef MODULE_VERY_LATE_INITIALIZATION
+%ifdef MODULE_VERY_LATE_INIT
 	LOAD_BDA_SEGMENT_TO	ds, ax					; Load BDA segment (zero) to DS
 	les		ax, [TEMPORARY_VECTOR_FOR_SYSTEM_INT13h*4]
@@ -214,7 +214,7 @@
 ;	Parameters:
 ;		DL:		Drive to boot from (translated, 00h or 80h)
-;       CF:     Set for Boot Sector Boot
-;               Clear for ROM Boot
-;	   	ES:BX:	(if CF set) Ptr to boot sector
+;		CF:		Set for Boot Sector Boot
+;				Clear for ROM Boot
+;		ES:BX:	(if CF set) Ptr to boot sector
 ;
 ;	Returns:
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/AdvAtaInit.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/AdvAtaInit.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/AdvAtaInit.asm	(revision 567)
@@ -88,4 +88,5 @@
 	call	AdvAtaInit_LoadMasterDPTtoDSSIifSlaveInDSDI
 	call	Vision_InitializeWithIDinAHandConfigInAL
+	xor		ax, ax						; Success
 
 	pop		si
@@ -93,5 +94,4 @@
 
 .NoAdvancedController:
-	xor		ax, ax						; Success
 	ret
 
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm	(revision 567)
@@ -27,6 +27,6 @@
 ;		ES:SI:	Ptr to 512-byte ATA information read from the drive
 ;	Returns:
-;		CF:		Set if failed to verify ATA-ID
-;				Cleared if ATA-ID verified successfully
+;		ZF:		Set if ATA-ID verified successfully
+;				Cleared if failed to verify ATA-ID
 ;	Corrupts registers:
 ;		AX, BX, CX
@@ -41,14 +41,14 @@
 	; Verify P-CHS cylinders
 	mov		bx, ATA1.wCylCnt
-	mov		cx, MAX_VALID_PCHS_CYLINDERS
-	call	.CompareCHorSfromOffsetBXtoMaxValueInCX
+	mov		ax, MAX_VALID_PCHS_CYLINDERS
+	call	.CompareCHorSfromOffsetBXtoMaxValueInAX
 
 	mov		bl, ATA1.wHeadCnt & 0FFh
-	mov		cx, MAX_VALID_PCHS_HEADS
-	call	.CompareCHorSfromOffsetBXtoMaxValueInCX
+	mov		ax, MAX_VALID_PCHS_HEADS
+	call	.CompareCHorSfromOffsetBXtoMaxValueInAX
 
 	mov		bl, ATA1.wSPT & 0FFh
-	mov		cl, MAX_VALID_PCHS_SECTORS_PER_TRACK
-	call	.CompareCHorSfromOffsetBXtoMaxValueInCX
+	mov		al, MAX_VALID_PCHS_SECTORS_PER_TRACK
+	call	.CompareCHorSfromOffsetBXtoMaxValueInAX
 
 	; Check signature byte. It is only found on ATA-5 and later. It should be zero on
@@ -62,33 +62,27 @@
 	; Check checksum byte since signature was present
 	mov		cx, ATA6_size
-	call	Memory_SumCXbytesFromESSItoAL		; Returns with ZF set according to result
-	jnz		SHORT .FailedToVerifyAtaID
-
-	; ATA-ID is now verified to be valid
-.AtaIDverifiedSuccessfully:
-	clc
-	ret
-
-;--------------------------------------------------------------------
-; .CompareCHorSfromOffsetBXtoMaxValueInCX
-;	Parameters:
+	jmp		Memory_SumCXbytesFromESSItoAL		; Returns with ZF set according to result
+
+;--------------------------------------------------------------------
+; .CompareCHorSfromOffsetBXtoMaxValueInAX
+;	Parameters:
+;		AX:		Maximum valid C, H or S value
 ;		BX:		C, H or S offset to ATA-ID
-;		CX:		Maximum valid C, H or S value
-;		ES:SI:	Ptr to 512-byte ATA information read from the drive
-;	Returns:
-;		Exits from AtaID_VerifyFromESSI with CF set if invalid value
-;	Corrupts registers:
-;		AX
-;--------------------------------------------------------------------
-.CompareCHorSfromOffsetBXtoMaxValueInCX:
-	mov		ax, [es:bx+si]
-	test	ax, ax
-	jz		SHORT .InvalidPCHorSinOffsetBX
-	cmp		ax, cx			; Compare to max valid value
+;		ES:SI:	Ptr to 512-byte ATA information read from the drive
+;	Returns:
+;		Exits from AtaID_VerifyFromESSI with ZF cleared if invalid value
+;	Corrupts registers:
+;		CX
+;--------------------------------------------------------------------
+.CompareCHorSfromOffsetBXtoMaxValueInAX:
+	mov		cx, [es:bx+si]
+	jcxz	.InvalidPCHorSinOffsetBX
+	cmp		cx, ax			; Compare to max valid value
 	jbe		SHORT .ValidPCHorSinOffsetBX
 .InvalidPCHorSinOffsetBX:
-	add		sp, BYTE 2		; Clear return address for this function
+	pop		cx				; Clear return address for this function
+	inc		cx				; Clear ZF to indicate invalid ATA-ID (safe to do since return address in CX will never be FFFFh)
+.AtaIDverifiedSuccessfully:
 .FailedToVerifyAtaID:
-	stc						; Set carry to indicate invalid ATA-ID
 .ValidPCHorSinOffsetBX:
 	ret
@@ -97,6 +91,6 @@
 ;--------------------------------------------------------------------
 ; Writes user defined limits from ROMVARS to ATA ID read from the drive.
-; Modifying the ATA ID reduces code and possibilites for bugs since
-; only little furher checks are needed elsewhere.
+; Modifying the ATA ID reduces code and possibilities for bugs since
+; only little further checks are needed elsewhere.
 ;
 ; AtaID_ModifyESSIforUserDefinedLimitsAndReturnTranslateModeInDX
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm	(revision 567)
@@ -62,5 +62,5 @@
 ; if serial drive detected, do not scan (avoids duplicate drives and isn't needed - we already have a connection)
 ;
-	call	FindDPT_ToDSDIforSerialDevice   ; does not modify AX
+	call	FindDPT_ToDSDIforSerialDevice	; Does not modify AX
 	jnc		.AddHardDisks
 
@@ -68,5 +68,5 @@
 
 %ifdef MODULE_HOTKEYS
-	cmp		al, COM_DETECT_HOTKEY_SCANCODE  ; Set by last call to HotkeyBar_UpdateDuringDriveDetection above
+	cmp		al, COM_DETECT_HOTKEY_SCANCODE	; Set by last call to HotkeyBar_UpdateDuringDriveDetection above
 	je		.DriveDetectLoop
 %endif
@@ -134,8 +134,4 @@
 	mov		[RAMVARS.xlateVars+XLATEVARS.bFlopCntAndFirst], al
 %endif
-
-%ifdef MODULE_8BIT_IDE_ADVANCED
-NoSlaveDriveAvailable:
-%endif
 	ret
 
@@ -156,22 +152,9 @@
 ;		ES:		Zero (BDA segment)
 ;	Returns:
-;       Nothing
+;		Nothing
 ;	Corrupts registers:
 ;		AX, BL, CX, DX, SI, DI
 ;--------------------------------------------------------------------
 StartDetectionWithDriveSelectByteInBHandStringInCX:
-%ifdef MODULE_8BIT_IDE_ADVANCED
-	mov		al, [cs:bp+IDEVARS.bDevice]
-	cmp		al, DEVICE_8BIT_XTCF_PIO8
-	jb		SHORT .DoNotSkipSlaveDriveDetection
-	cmp		al, DEVICE_8BIT_XTCF_DMA
-	ja		SHORT .DoNotSkipSlaveDriveDetection
-
-	; XT-CF do not support slave drives so skip detection
-	test	bh, FLG_DRVNHEAD_DRV
-	jnz		SHORT NoSlaveDriveAvailable
-.DoNotSkipSlaveDriveDetection:
-%endif ; MODULE_8BIT_IDE_ADVANCED
-
 	call	DetectPrint_StartDetectWithMasterOrSlaveStringInCXandIdeVarsInCSBP
 
@@ -221,5 +204,5 @@
 ;		Nothing
 ;	Returns:
-;		CF:     Set (from DetectPrint_NullTerminatedStringFromCSSIandSetCF)
+;		CF:		Set (from DetectPrint_NullTerminatedStringFromCSSIandSetCF)
 ;	Corrupts registers:
 ;		AX, SI
@@ -248,5 +231,5 @@
 	call	AtaID_VerifyFromESSI
 	pop		bx
-	jc		SHORT DetectDrives_DriveNotFound
+	jnz		SHORT DetectDrives_DriveNotFound
 	call	CreateDPT_FromAtaInformation
 	jc		SHORT DetectDrives_DriveNotFound
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm	(revision 567)
@@ -60,6 +60,6 @@
 ;--------------------------------------------------------------------
 DetectPrint_StartDetectWithMasterOrSlaveStringInCXandIdeVarsInCSBP:
-	mov		ax, [cs:bp+IDEVARS.wBasePort]   ; for IDE: AX=port address, DH=.bDevice
-	; fall through to DetectPrint_StartDetectWithAutodetectedBasePortInAXandIdeVarsInCSBP
+	mov		ax, [cs:bp+IDEVARS.wBasePort]	; For IDE: AX=port address, DH=.bDevice
+	; Fall to DetectPrint_StartDetectWithAutodetectedBasePortInAXandIdeVarsInCSBP
 
 ;--------------------------------------------------------------------
@@ -75,7 +75,7 @@
 ;--------------------------------------------------------------------
 DetectPrint_StartDetectWithAutodetectedBasePortInAXandIdeVarsInCSBP:
-	mov		dx, [cs:bp+IDEVARS.bDevice-1]   ; for Serial: AL=port address>>2, AH=baud rate
+	mov		dx, [cs:bp+IDEVARS.bDevice-1]	; For Serial: AL=port address>>2, AH=baud rate
 											;			  DL=COM number character, DH=.bDevice
-	push	bp								; setup stack for call to
+	push	bp								; Setup stack for call to
 	mov		bp, sp							; BootMenuPrint_FormatCSSIfromParamsInSSBP
 
@@ -89,5 +89,5 @@
 
 %ifdef MODULE_SERIAL
-	cmp		dh, DEVICE_SERIAL_PORT		  	; Check if this is a serial device
+	cmp		dh, DEVICE_SERIAL_PORT			; Check if this is a serial device
 
 	jnz		.pushAndPrint					; CX = string to print, AX = port address, DX won't be used
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm	(revision 567)
@@ -161,10 +161,10 @@
 ;--------------------------------------------------------------------
 FloppyDrive_GetCountFromBIOS_or_BDA:
-	push	es
-
+%ifdef USE_AT
 ; Reads Floppy Drive Count from BIOS.
 ; Does not work on most XT systems. Call .GetCountFromBDA
 ; if this function fails.
-%ifdef USE_AT
+
+	push	es
 	push	di
 	push	bx
@@ -181,10 +181,14 @@
 	pop		bx
 	pop		di
-
+	pop		es
+
+%else ; ifndef USE_AT
 ; Reads Floppy Drive Count (0...4) from BIOS Data Area.
 ; This function should be used only if .GetCountFromBIOS fails.
-%else ; ifndef USE_AT
-	LOAD_BDA_SEGMENT_TO	es, ax
-	mov		al, [es:BDA.wEquipment]	; Load Equipment WORD low byte
+
+	push	ds
+	LOAD_BDA_SEGMENT_TO	ds, ax
+	mov		al, [BDA.wEquipment]	; Load Equipment WORD low byte
+	pop		ds
 
 %ifdef USE_UNDOC_INTEL
@@ -200,4 +204,3 @@
 %endif ; USE_AT
 
-	pop		es
-	ret
+	ret
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm	(revision 567)
@@ -47,7 +47,7 @@
 	mov		[BIOS_BOOT_LOADER_INTERRUPT_19h*4+2], cs
 
-%ifdef MODULE_VERY_LATE_INITIALIZATION
+%ifdef MODULE_VERY_LATE_INIT
 	push	es
-	; Install special INT 13h hander that initializes XTIDE Universal BIOS
+	; Install special INT 13h handler that initializes XTIDE Universal BIOS
 	; when our INT 19h is not called
 	les		ax, [BIOS_DISK_INTERRUPT_13h*4]	; Load system INT 13h handler
@@ -95,5 +95,5 @@
 ;		Nothing
 ;	Corrupts registers:
-;		AX, CX, DX, SI, DI
+;		AX, BX, CX, DX, SI, DI
 ;--------------------------------------------------------------------
 %ifdef MODULE_COMPATIBLE_TABLES
@@ -101,24 +101,27 @@
 %ifndef USE_AT
 	test	BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_FULLMODE
-	jz		SHORT .CompatibleDPTsCreated	; Only Full operating mode has extra RAM to spare
+	jz		SHORT .SkipToReturn				; Only Full operating mode has extra RAM to spare
 %endif
 
+	mov		bx, HD0_DPT_POINTER_41h * 4
 	mov		dl, 80h
-	call	FindDPT_ForDriveNumberInDL	; DPT to DS:DI
-	jc		SHORT .FindForDrive81h		; Store nothing if not our drive
+.FindForNextDrive:
+	call	FindDPT_ForDriveNumberInDL		; DPT to DS:DI
+	jc		SHORT .NextDrive				; Store nothing if not our drive
 
+	push	dx
 	call	CompatibleDPT_CreateToAXSIforDriveDL
-	mov		[es:HD0_DPT_POINTER_41h*4], si
-	mov		[es:HD0_DPT_POINTER_41h*4+2], ax
+	pop		dx
 
-.FindForDrive81h:
-	mov		dl, 81h
-	call	FindDPT_ForDriveNumberInDL
-	jc		SHORT .CompatibleDPTsCreated
+	mov		[es:bx], si
+	mov		[es:bx+2], ax
 
-	call	CompatibleDPT_CreateToAXSIforDriveDL
-	mov		[es:HD1_DPT_POINTER_46h*4], si
-	mov		[es:HD1_DPT_POINTER_46h*4+2], ax
-.CompatibleDPTsCreated:
+.NextDrive:
+	inc		dx
+	add		bx, (HD1_DPT_POINTER_46h - HD0_DPT_POINTER_41h) * 4
+	cmp		dl, 82h
+	jb		SHORT .FindForNextDrive
+
+.SkipToReturn:
 %endif ; MODULE_COMPATIBLE_TABLES
 	ret
Index: trunk/XTIDE_Universal_BIOS/Src/Main.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 567)
@@ -34,7 +34,7 @@
 %define	EXCLUDE_FROM_XTIDE_UNIVERSAL_BIOS	; Exclude unused library functions
 %ifdef MODULE_BOOT_MENU
-	%define MENUEVENT_INLINE_OFFSETS    	; Only one menu required, save space and inline offsets
+	%define MENUEVENT_INLINE_OFFSETS		; Only one menu required, save space and inline offsets
 	%define INCLUDE_MENU_LIBRARY
-	%define MENU_NO_ESC					    ; User cannot 'esc' out of the menu
+	%define MENU_NO_ESC						; User cannot 'esc' out of the menu
 %else	; If no boot menu included
 	%define	INCLUDE_DISPLAY_LIBRARY
@@ -128,5 +128,5 @@
 	at	ROMVARS.wBootTimeout,	dw	BOOT_MENU_DEFAULT_TIMEOUT
 %endif
-	at  ROMVARS.bIdeCnt,		db	1
+	at	ROMVARS.bIdeCnt,		db	1
 	at	ROMVARS.bBootDrv,		db	80h						; Boot Menu default drive
 	at	ROMVARS.bMinFddCnt, 	db	0						; Do not force minimum number of floppy drives
@@ -218,5 +218,5 @@
 
 	; Boot loader
-%ifdef MODULE_VERY_LATE_INITIALIZATION
+%ifdef MODULE_VERY_LATE_INIT
 	%include "Int13hBiosInit.asm"
 %endif
Index: trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenu.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenu.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenu.asm	(revision 567)
@@ -55,6 +55,6 @@
 ;	Returns:
 ;		DX:		Drive number to be used for booting
-;       CF:     Set: There is a selected menu item, DL is valid
-;               Clear: The item selected is Rom Boot, DL is not valid
+;		CF:		Set: There is a selected menu item, DL is valid
+;				Clear: The item selected is Rom Boot, DL is not valid
 ;	Corrupts registers:
 ;		AX, BX
Index: trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuEvent.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuEvent.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuEvent.asm	(revision 567)
@@ -66,12 +66,12 @@
 	ret
 
-MENUEVENT_InitializeMenuinitFromDSSI equ  (EventInitializeMenuinitFromSSBP - FirstEvent)
-MENUEVENT_ExitMenu equ  (BootMenuEvent_Completed - FirstEvent)
-MENUEVENT_ItemHighlightedFromCX equ (EventItemHighlightedFromCX - FirstEvent)
-MENUEVENT_KeyStrokeInAX equ	(EventKeyStrokeInAX - FirstEvent)
-MENUEVENT_ItemSelectedFromCX equ (EventItemSelectedFromCX - FirstEvent)
-MENUEVENT_RefreshTitle equ (BootMenuPrint_TitleStrings - FirstEvent)
-MENUEVENT_RefreshInformation equ (BootMenuPrint_RefreshInformation - FirstEvent)
-MENUEVENT_RefreshItemFromCX equ (BootMenuPrint_RefreshItem - FirstEvent)
+MENUEVENT_InitializeMenuinitFromDSSI	equ (EventInitializeMenuinitFromSSBP	- FirstEvent)
+MENUEVENT_ExitMenu						equ (BootMenuEvent_Completed			- FirstEvent)
+MENUEVENT_ItemHighlightedFromCX			equ (EventItemHighlightedFromCX			- FirstEvent)
+MENUEVENT_KeyStrokeInAX					equ (EventKeyStrokeInAX					- FirstEvent)
+MENUEVENT_ItemSelectedFromCX			equ (EventItemSelectedFromCX			- FirstEvent)
+MENUEVENT_RefreshTitle					equ (BootMenuPrint_TitleStrings			- FirstEvent)
+MENUEVENT_RefreshInformation			equ (BootMenuPrint_RefreshInformation	- FirstEvent)
+MENUEVENT_RefreshItemFromCX				equ (BootMenuPrint_RefreshItem			- FirstEvent)
 ;
 ; Note that there is no entry for MENUEVENT_IdleProcessing.  If MENUEVENT_IDLEPROCESSING_ENABLE is not %defined,
@@ -95,5 +95,5 @@
 	dw		EventNotHandled						; MENUEVENT.IdleProcessing
 	dw		EventItemHighlightedFromCX			; MENUEVENT.ItemHighlightedFromCX
-	
+
 	dw		EventItemSelectedFromCX				; MENUEVENT.ItemSelectedFromCX
 	dw		EventKeyStrokeInAX					; MENUEVENT.KeyStrokeInAX
Index: trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrint.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrint.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrint.asm	(revision 567)
@@ -125,9 +125,9 @@
 .around:
 
-	mov		ax, g_szFddSizeOr	        				; .PrintXTFloppyType
+	mov		ax, g_szFddSizeOr							; .PrintXTFloppyType
 	test	bl, bl										; Two possibilities? (FLOPPY_TYPE_525_OR_35_DD)
 	jz		SHORT .PushAXAndOutput
 
-	mov		al, (g_szFddUnknown - $$) & 0xff	        ; .PrintUnknownFloppyType
+	mov		al, (g_szFddUnknown - $$) & 0xff			; .PrintUnknownFloppyType
 	cmp		bl, FLOPPY_TYPE_35_ED
 	ja		SHORT .PushAXAndOutput
@@ -146,12 +146,12 @@
 ; Floppy Drive Types:
 ;
-;   0  Handled above
-;   1  FLOPPY_TYPE_525_DD          5 1/4   360K
-;   2  FLOPPY_TYPE_525_HD          5 1/4   1.2M
-;   3  FLOPPY_TYPE_35_DD           3 1/2   720K
-;   4  FLOPPY_TYPE_35_HD           3 1/2   1.44M
-;   5  3.5" ED on some BIOSes      3 1/2   2.88M
-;   6  FLOPPY_TYPE_35_ED		   3 1/2   2.88M
-;   >6 Unknown, handled above
+;	0  Handled above
+;	1  FLOPPY_TYPE_525_DD		   5 1/4   360K
+;	2  FLOPPY_TYPE_525_HD		   5 1/4   1.2M
+;	3  FLOPPY_TYPE_35_DD		   3 1/2   720K
+;	4  FLOPPY_TYPE_35_HD		   3 1/2   1.44M
+;	5  3.5" ED on some BIOSes	   3 1/2   2.88M
+;	6  FLOPPY_TYPE_35_ED		   3 1/2   2.88M
+;	>6 Unknown, handled above
 ;
 ;--------------------------------------------------------------------
@@ -169,5 +169,5 @@
 	xor		bh, bh
 	mov		al,FloppyTypes.rgbCapacityMultiplier
-	mul		BYTE [cs:bx+FloppyTypes.rgbCapacity - 1]    ; -1 since 0 is handled above and not in the table
+	mul		BYTE [cs:bx+FloppyTypes.rgbCapacity - 1]	; -1 since 0 is handled above and not in the table
 
 .PushAXAndOutput:
Index: trunk/XTIDE_Universal_BIOS/Src/Menus/HotkeyBar.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Menus/HotkeyBar.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/Menus/HotkeyBar.asm	(revision 567)
@@ -372,5 +372,5 @@
 ;		ES:		BDA segment (zero)
 ;	Returns:
-;       AL:     Last scancode seen
+;		AL:		Last scancode seen
 ;		CF:		Set if valid hotkey in AL
 ;				Clear if scancode in AL is not for any hotkey
Index: trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AccessDPT.asm	(revision 567)
@@ -173,6 +173,6 @@
 ;	Returns:
 ;		AX:		Translate Mode (TRANSLATEMODE_NORMAL, TRANSLATEMODE_LARGE or TRANSLATEMODE_ASSISTED_LBA)
-;               unshifted (still shifted where it is in bFlagsLow)
-;       ZF:     Set based on value in AL
+;				unshifted (still shifted where it is in bFlagsLow)
+;		ZF:		Set based on value in AL
 ;	Corrupts registers:
 ;		Nothing
Index: trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AtaGeometry.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AtaGeometry.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AtaGeometry.asm	(revision 567)
@@ -199,5 +199,5 @@
 	dec		cx		; CX = 15
 	div		cx		; AX = (Cylinders * 16) / 15
-	; Fall to ConvertPCHfromAXBXtoEnhancedCHinAXBX
+	; Fall to ConvertPCHfromAXBLtoEnhancedCHinAXBL
 
 
Index: trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm	(revision 567)
@@ -109,10 +109,10 @@
 	call	AtaGeometry_GetPCHStoAXBLBHfromAtaInfoInESSI
 	dec		dl						; Set ZF if TRANSLATEMODE_LARGE, SF if TRANSLATEMODE_NORMAL
-	js		SHORT .NothingToChange
-	jz		SHORT .LimitHeadsForLargeAddressingMode
+	jle		SHORT .JumpOverSetBitForAssistedLBA
 
 	; Set LBA bit for Assisted LBA
 	or		cl, FLGL_DPT_LBA
-	jmp		SHORT .NothingToChange
+.JumpOverSetBitForAssistedLBA:
+	jnz		SHORT .NothingToChange
 
 .LimitHeadsForLargeAddressingMode:
@@ -218,7 +218,7 @@
 ;    Since the floppy DPT's come after the hard disk DPT's, without expensive (code size) code to relocate a DPT,
 ;    this was necessary.  Now, this situation shouldn't happen in normal operation, for a couple of reasons:
-; 		A. xtidecfg always puts configured serial ports at the end of the IDEVARS list
-;       B. the auto serial code is always executed last
-;       C. the serial server always returns floppy drives last
+;		A. xtidecfg always puts configured serial ports at the end of the IDEVARS list
+;		B. the auto serial code is always executed last
+;		C. the serial server always returns floppy drives last
 ;
 	adc		byte [RAMVARS.xlateVars+XLATEVARS.bFlopCreateCnt], 0
Index: trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm	(revision 567)
@@ -75,5 +75,5 @@
 	jb		SHORT .DiskIsNotHandledByThisBIOS
 %endif
-	; fall-through to CalcDPTForDriveNumber
+	; Fall to .CalcDPTForDriveNumber
 
 ;--------------------------------------------------------------------
@@ -81,12 +81,12 @@
 ; Not intended to be called except by FindDPT_ForDriveNumberInDL
 ;
-; CalcDPTForDriveNumber
+; .CalcDPTForDriveNumber
 ;	Parameters:
 ;		DL:		Drive number
 ;		DS:		RAMVARS segment
-;       DI:     Saved copy of AX from entry at FindDPT_ForDriveNumberInDL
+;		DI:		Saved copy of AX from entry at FindDPT_ForDriveNumberInDL
 ;	Returns:
 ;		DS:DI:	Ptr to DPT
-;       CF:     Clear
+;		CF:		Clear
 ;	Corrupts registers:
 ;		Nothing
@@ -136,36 +136,4 @@
 
 ;--------------------------------------------------------------------
-; FindDPT_MasterOrSingleForIdevarsOffsetInDL
-;	Parameters:
-;		DL:		Offset to IDEVARS to search for
-;		DS:		RAMVARS segment
-;	Returns:
-;		DS:DI:		Ptr to first DPT with same IDEVARS as in DL
-;		CF:			Clear if wanted DPT found
-;					Set if DPT not found, or no DPTs present
-;	Corrupts registers:
-;		SI
-;--------------------------------------------------------------------
-FindDPT_MasterOrSingleForIdevarsOffsetInDL:
-	mov		si, IterateFindFirstDPTforIdevars			; iteration routine (see below)
-	jmp		SHORT FindDPT_IterateAllDPTs				; look for the first drive on this controller, if any
-
-;--------------------------------------------------------------------
-; FindDPT_SlaveForIdevarsOffsetInDL
-;	Parameters:
-;		DL:		Offset to IDEVARS to search for
-;		DS:		RAMVARS segment
-;	Returns:
-;		DS:DI:		Ptr to second DPT with same IDEVARS as in DL
-;		CF:			Clear if wanted DPT found
-;					Set if DPT not found, or no DPTs present
-;	Corrupts registers:
-;		SI
-;--------------------------------------------------------------------
-FindDPT_SlaveForIdevarsOffsetInDL:
-	mov		si, IterateFindSecondDPTforIdevars			; iteration routine (see below)
-	jmp		SHORT FindDPT_IterateAllDPTs				; look for the second drive on this controller, if any
-
-;--------------------------------------------------------------------
 ; Iteration routines for FindDPT_MasterOrSingleForIdevarsOffsetInDL and
 ; FindDPT_SlaveForIdevarsOffsetInDL, for use with IterateAllDPTs
@@ -175,9 +143,9 @@
 ; IterateFindSecondDPTforIdevars
 ; IterateFindFirstDPTforIdevars
-;       DL:		Offset to IDEVARS to search from DPTs
+;		DL:		Offset to IDEVARS to search from DPTs
 ;		SI:		Offset to this callback function
 ;		DS:DI:	Ptr to DPT to examine
 ;	Returns:
-;		CF:		Clear if wanted DPT found
+;		CF:		Cleared if wanted DPT found
 ;				Set if wrong DPT
 ;--------------------------------------------------------------------
@@ -192,7 +160,7 @@
 IterateFindFirstDPTforIdevars:
 	cmp		dl, [di+DPT.bIdevarsOffset]			; Clears CF if matched
-	je		.done
+	je		.Done
 	stc											; Set CF for not found
-.done:
+.Done:
 	ret
 
@@ -221,5 +189,5 @@
 %endif
 
-	jmp		short FindDPT_ForDriveNumberInDL.CalcDPTForNewDrive
+	jmp		SHORT FindDPT_ForDriveNumberInDL.CalcDPTForNewDrive
 
 ;--------------------------------------------------------------------
@@ -227,11 +195,12 @@
 ;	Parameters:
 ;		DS:DI:	Ptr to DPT to examine
-;       BL:		Bit(s) to test in DPT.bFlagsHigh
-;	Returns:
-;		CF:		Clear if wanted DPT found
+;		BL:		Bit(s) to test in DPT.bFlagsHigh
+;	Returns:
+;		CF:		Cleared if wanted DPT found
 ;				Set if wrong DPT
 ;	Corrupts registers:
 ;		Nothing
 ;--------------------------------------------------------------------
+%ifdef MODULE_SERIAL
 ALIGN JUMP_ALIGN
 IterateToDptWithFlagsHighInBL:
@@ -241,4 +210,5 @@
 .ReturnRightDPT:
 	ret
+%endif
 
 ;--------------------------------------------------------------------
@@ -248,6 +218,6 @@
 ;	Returns:
 ;		DS:DI:	Ptr to DPT
-;		CF:		Set if wanted DPT found
-;				Cleared if DPT not found
+;		CF:		Cleared if wanted DPT found
+;				Set if DPT not found, or no DPTs present
 ;	Corrupts registers:
 ;		SI
@@ -257,25 +227,59 @@
 FindDPT_ToDSDIforSerialDevice:
 	mov		bl, FLGH_DPT_SERIAL_DEVICE
-; fall-through
-%endif
-
-;--------------------------------------------------------------------
-; FindDPT_ToDSDIforFlagsHigh
-;	Parameters:
-;		DS:		RAMVARS segment
-;       BL:		Bit(s) to test in DPT.bFlagsHigh
+	; Fall to FindDPT_ToDSDIforFlagsHighInBL
+%endif
+
+;--------------------------------------------------------------------
+; FindDPT_ToDSDIforFlagsHighInBL
+;	Parameters:
+;		DS:		RAMVARS segment
+;		BL:		Bit(s) to test in DPT.bFlagsHigh
 ;	Returns:
 ;		DS:DI:	Ptr to DPT
-;		CF:		Set if wanted DPT found
-;				Cleared if DPT not found
+;		CF:		Cleared if wanted DPT found
+;				Set if DPT not found, or no DPTs present
 ;	Corrupts registers:
 ;		SI
 ;--------------------------------------------------------------------
-%ifdef MODULE_IRQ
-ALIGN JUMP_ALIGN
-FindDPT_ToDSDIforFlagsHighInBL:
-%endif
+%ifdef MODULE_SERIAL
+;%ifdef MODULE_IRQ
+;ALIGN JUMP_ALIGN
+;FindDPT_ToDSDIforFlagsHighInBL:	; This label is unused
+;%endif
 	mov		si, IterateToDptWithFlagsHighInBL
-	; Fall to IterateAllDPTs
+	jmp		SHORT FindDPT_IterateAllDPTs
+%endif
+
+;--------------------------------------------------------------------
+; FindDPT_MasterOrSingleForIdevarsOffsetInDL
+;	Parameters:
+;		DL:		Offset to IDEVARS to search for
+;		DS:		RAMVARS segment
+;	Returns:
+;		DS:DI:	Ptr to first DPT with same IDEVARS as in DL
+;		CF:		Cleared if wanted DPT found
+;				Set if DPT not found, or no DPTs present
+;	Corrupts registers:
+;		SI
+;--------------------------------------------------------------------
+FindDPT_MasterOrSingleForIdevarsOffsetInDL:
+	mov		si, IterateFindFirstDPTforIdevars
+	jmp		SHORT FindDPT_IterateAllDPTs
+
+;--------------------------------------------------------------------
+; FindDPT_SlaveForIdevarsOffsetInDL
+;	Parameters:
+;		DL:		Offset to IDEVARS to search for
+;		DS:		RAMVARS segment
+;	Returns:
+;		DS:DI:	Ptr to second DPT with same IDEVARS as in DL
+;		CF:		Cleared if wanted DPT found
+;				Set if DPT not found, or no DPTs present
+;	Corrupts registers:
+;		SI
+;--------------------------------------------------------------------
+FindDPT_SlaveForIdevarsOffsetInDL:
+	mov		si, IterateFindSecondDPTforIdevars
+	; Fall to FindDPT_IterateAllDPTs
 
 ;--------------------------------------------------------------------
@@ -286,10 +290,10 @@
 ;		AX,BX,DX:	Parameters to callback function
 ;		CS:SI:		Ptr to callback function
-;                   Callback routine should return CF=clear if found
+;					Callback routine should return CF=clear if found
 ;		DS:			RAMVARS segment
 ;	Returns:
 ;		DS:DI:		Ptr to wanted DPT (if found)
 ;					If not found, points to first empty DPT
-;		CF:			Clear if wanted DPT found
+;		CF:			Cleared if wanted DPT found
 ;					Set if DPT not found, or no DPTs present
 ;	Corrupts registers:
Index: trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm	(revision 567)
@@ -44,5 +44,5 @@
 ;		DS:		RAMVARS segment
 ;	Corrupts registers:
-;		AX
+;		AX, CL
 ;--------------------------------------------------------------------
 .StealMemoryForRAMVARS:
@@ -56,6 +56,11 @@
 	mov		al, [cs:ROMVARS.bStealSize]
 	sub		[BDA.wBaseMem], ax
-	mov		ax, [BDA.wBaseMem]			; We can save a byte here by using INT 12h instead
-	eSHL_IM	ax, 6						; Segment to first stolen kB (*=40h)
+	mov		ax, [BDA.wBaseMem]
+%ifdef USE_186
+	shl		ax, 6						; Segment to first stolen kB (*=40h)
+%else
+	mov		cl, 6
+	shl		ax, cl
+%endif
 	; Fall to .InitializeRamvars
 
@@ -186,5 +191,5 @@
 ;	Returns:
 ;		AL:		First floppy drive number supported
-;       CF:		Number of floppy drives supported (clear = 1, set = 2)
+;		CF:		Number of floppy drives supported (clear = 1, set = 2)
 ;		SF:		Emulating drives (clear = yes, set = no)
 ;	Corrupts registers:
Index: trunk/XTIDE_Universal_BIOS/makefile
===================================================================
--- trunk/XTIDE_Universal_BIOS/makefile	(revision 566)
+++ trunk/XTIDE_Universal_BIOS/makefile	(revision 567)
@@ -27,6 +27,6 @@
 # MODULE_SERIAL_FLOPPY        Virtual floppy drives using serial port (requires MODULE_SERIAL)     #
 # MODULE_STRINGS_COMPRESSED   Use compressed strings to save space                                 #
-# MODULE_VERY_LATE_INITIALIZATION Initialize on INT 13h if our INT 19h handler is not called       #
-# MODULE_FEATURE_SETS         Power Management support                                             #
+# MODULE_VERY_LATE_INIT       Initialize on INT 13h if our INT 19h handler is not called           #
+# MODULE_POWER_MANAGEMENT     Power Management support                                             #
 #                                                                                                  #
 # Not modules but these affect the assembly:                                                       #
@@ -101,8 +101,8 @@
 # Assembler preprocessor defines.                               #
 #################################################################
-DEFINES_COMMON = MODULE_STRINGS_COMPRESSED MODULE_HOTKEYS MODULE_8BIT_IDE MODULE_EBIOS MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_FEATURE_SETS RESERVE_DIAGNOSTIC_CYLINDER
+DEFINES_COMMON = MODULE_STRINGS_COMPRESSED MODULE_HOTKEYS MODULE_8BIT_IDE MODULE_EBIOS MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_POWER_MANAGEMENT RESERVE_DIAGNOSTIC_CYLINDER
 DEFINES_COMMON_LARGE = MODULE_BOOT_MENU MODULE_8BIT_IDE_ADVANCED MODULE_COMPATIBLE_TABLES
 
-DEFINES_XT = $(DEFINES_COMMON) ELIMINATE_CGA_SNOW MODULE_8BIT_IDE_ADVANCED MODULE_VERY_LATE_INITIALIZATION
+DEFINES_XT = $(DEFINES_COMMON) ELIMINATE_CGA_SNOW MODULE_8BIT_IDE_ADVANCED
 DEFINES_XTPLUS = $(DEFINES_COMMON) $(DEFINES_XT) USE_186
 DEFINES_AT = $(DEFINES_COMMON) USE_AT USE_286 MODULE_IRQ MODULE_ADVANCED_ATA MODULE_COMPATIBLE_TABLES
@@ -115,5 +115,5 @@
 DEFINES_386_8K = $(DEFINES_AT) USE_386
 
-DEFINES_ALL_FEATURES = MODULE_8BIT_IDE MODULE_8BIT_IDE_ADVANCED MODULE_ADVANCED_ATA MODULE_EBIOS MODULE_BOOT_MENU MODULE_HOTKEYS MODULE_IRQ MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_STRINGS_COMPRESSED MODULE_FEATURE_SETS MODULE_COMPATIBLE_TABLES
+DEFINES_ALL_FEATURES = MODULE_8BIT_IDE MODULE_8BIT_IDE_ADVANCED MODULE_ADVANCED_ATA MODULE_EBIOS MODULE_BOOT_MENU MODULE_HOTKEYS MODULE_IRQ MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_STRINGS_COMPRESSED MODULE_POWER_MANAGEMENT MODULE_COMPATIBLE_TABLES
 DEFINES_ALL_FEATURES += ELIMINATE_CGA_SNOW RELOCATE_INT13H_STACK RESERVE_DIAGNOSTIC_CYLINDER
 
