Index: trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm	(revision 284)
+++ trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm	(revision 285)
@@ -129,7 +129,9 @@
 
 	; Output Sector Address High (only used by LBA48)
+%ifdef MODULE_EBIOS
 	eMOVZX	ax, BYTE [bp+IDEPACK.bLbaLowExt]	; Zero sector count
 	mov		cx, [bp+IDEPACK.wLbaMiddleAndHighExt]
 	call	IDEDEVICE%+OutputSectorCountAndAddress
+%endif
 
 	; Output Sector Address Low
@@ -186,14 +188,12 @@
 	eCMOVE	bh, TIMEOUT_IDENTIFY_DEVICE
 	call	IDEDEVICE%+Wait_PollStatusFlagInBLwithTimeoutInBH
-	jc		SHORT .ErrorWhenSelectingMasterOrSlave
-	ret
 
 	; Ignore errors from IDE Error Register (set by previous command)
-.ErrorWhenSelectingMasterOrSlave:
-	cmp		ah, RET_HD_TIMEOUT		; Do not ignore timeout
+	cmp		ah, RET_HD_TIMEOUT
+	je		SHORT .FailedToSelectDrive
+	xor		ax, ax					; Always success unless timeout
+	ret
+.FailedToSelectDrive:
 	stc
-	je		SHORT .ReturnWithErrorCodeInAHandCF
-	xor		ah, ah					; No errors
-.ReturnWithErrorCodeInAHandCF:
 	ret
 
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH15h_HSize.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH15h_HSize.asm	(revision 284)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH15h_HSize.asm	(revision 285)
@@ -77,12 +77,9 @@
 ConvertAH08hReturnValuesToSectorCount:
 	call	Address_ExtractLCHSparametersFromOldInt13hAddress
-
-	mov		al, bl		; Get sector value
-	mul		bh			; Multiply by heads-1 (since bh is zero based, and could be 255 and overflow)
-	xor		bh, bh		; Clear upper byte for following addition...
-	add		ax, bx		; Add in one more sector value, since heads was off by one
-	inc		cx			; Max cylinder number to cylinder count (again, zero based)
-	mul		cx			; Multiply in cylinders
-	xor		bx, bx		; Zero upper 16-bits, sector count will not be that large
-		
+	mov		al, bh		; AL = Max head number
+	inc		cx			; Max cylinder number to cylinder count
+	inc		ax			; Max head number to head count (AH=8h returns max 254 so no overflow to AH)
+	mul		bl			; AX = Head count * Sectors per track
+	mul		cx			; DX:AX = Total sector count for AH=0xh transfer functions
+	xor		bx, bx
 	ret
Index: trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH8h_HParams.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH8h_HParams.asm	(revision 284)
+++ trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH8h_HParams.asm	(revision 285)
@@ -18,5 +18,5 @@
 ;		CL:		Bits 7...6: Cylinder number bits 9...8
 ;				Bits 5...0:	Maximum sector number (1...63)
-;		DH:		Maximum head number (0...255)
+;		DH:		Maximum head number (0...254)
 ;		DL:		Number of drives
 ;       ES:DI:  Floppy DPT (for floppies only)
@@ -79,5 +79,5 @@
 ;		CL:		Bits 7...6: Cylinder number bits 9...8
 ;				Bits 5...0:	Maximum sector number (1...63)
-;		DH:		Maximum head number (0...255)
+;		DH:		Maximum head number (0...254)
 ;	Corrupts registers:
 ;		AX, BX
@@ -93,5 +93,5 @@
 ;	Parameters:
 ;		AX:		Number of L-CHS cylinders available (1...1024)
-;		BL:		Number of L-CHS heads (1...256)
+;		BL:		Number of L-CHS heads (1...255)
 ;		BH:		Number of L-CHS sectors per track (1...63)
 ;		DS:		RAMVARS segment
@@ -100,5 +100,5 @@
 ;		CL:		Bits 7...6: Cylinder number bits 9...8
 ;				Bits 5...0:	Maximum sector number (1...63)
-;		DH:		Maximum head number (0...255)
+;		DH:		Maximum head number (0...254)
 ;	Corrupts registers:
 ;		AX, BX
@@ -112,5 +112,5 @@
 	or		cl, bh					; CL bits 0...5 = Sectors per track
 	mov		dh, bl					; DH = Maximum head number
-		
+
 %ifdef MODULE_SERIAL_FLOPPY
 	mov		bl,[di+DPT.bFlagsHigh]
Index: trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm	(revision 284)
+++ trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm	(revision 285)
@@ -39,9 +39,12 @@
 ;--------------------------------------------------------------------
 DetectPrint_StartDetectWithMasterOrSlaveStringInAXandIdeVarsInCSBP:
-
 	mov		ax, [cs:bp+IDEVARS.wPort]    	; for IDE: AX=port address, DH=.bDevice
 	mov		dx, [cs:bp+IDEVARS.bDevice-1]   ; for Serial: AL=port address>>2, AH=baud rate
 											;			  DL=COM number character, DH=.bDevice
-		
+%ifdef MODULE_JRIDE
+	cmp		dh, DEVICE_JRIDE_ISA
+	eCMOVE	ax, cs							; Use segment address for JR-IDE/ISA
+%endif
+
 	mov		si, g_szDetectOuter				; Load SI with default wrapper string "IDE %s at %s: "
 		
Index: trunk/XTIDE_Universal_BIOS/Src/Main.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 284)
+++ trunk/XTIDE_Universal_BIOS/Src/Main.asm	(revision 285)
@@ -136,9 +136,9 @@
 	at	ROMVARS.bStealSize,		db	1						; Steal 1kB from base memory in full mode
 
+	at	ROMVARS.ideVars0+IDEVARS.wPort,			dw	DEVICE_XTIDE_DEFAULT_PORT			; Controller Command Block base port
+	at	ROMVARS.ideVars0+IDEVARS.wPortCtrl,		dw	DEVICE_XTIDE_DEFAULT_PORTCTRL		; Controller Control Block base port
 %ifdef MODULE_JRIDE
 	at	ROMVARS.ideVars0+IDEVARS.bDevice,		db	DEVICE_JRIDE_ISA
 %else
-	at	ROMVARS.ideVars0+IDEVARS.wPort,			dw	DEVICE_XTIDE_DEFAULT_PORT			; Controller Command Block base port
-	at	ROMVARS.ideVars0+IDEVARS.wPortCtrl,		dw	DEVICE_XTIDE_DEFAULT_PORTCTRL		; Controller Control Block base port
 	at	ROMVARS.ideVars0+IDEVARS.bDevice,		db	DEVICE_8BIT_DUAL_PORT_XTIDE
 %endif
@@ -167,4 +167,6 @@
 	%include "Interrupts.asm"		; For Interrupt initialization
 	%include "RamVars.asm"			; For RAMVARS initialization and access
+	%include "CreateDPT.asm"		; For creating DPTs
+	%include "FindDPT.asm"			; For finding DPTs
 %ifdef MODULE_STRINGS_COMPRESSED
 	%include "StringsCompressed.asm"
@@ -172,6 +174,4 @@
 	%include "Strings.asm"			; For BIOS message strings
 %endif
-	%include "CreateDPT.asm"		; For creating DPTs
-	%include "FindDPT.asm"			; For finding DPTs
 	%include "AccessDPT.asm"		; For accessing DPTs
 	%include "BootMenuInfo.asm"		; For creating BOOTMENUINFO structs
Index: trunk/XTIDE_Universal_BIOS/Src/Strings.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/Strings.asm	(revision 284)
+++ trunk/XTIDE_Universal_BIOS/Src/Strings.asm	(revision 285)
@@ -49,4 +49,5 @@
 g_szBusTypeValues_32:			db		" 32",NULL
 g_szBusTypeValues_Serial:		db		"SER",NULL
+g_szBusTypeValues_8MemMapped:	db		"M8 ",NULL
 g_szBusTypeValues_Displacement equ (g_szBusTypeValues_8Reversed - g_szBusTypeValues)
 ;
@@ -71,4 +72,7 @@
 	%if g_szBusTypeValues_Serial <> g_szBusTypeValues_32 + g_szBusTypeValues_Displacement
 		%error "g_szBusTypeValues Displacement Incorrect 6"
+	%endif
+	%if g_szBusTypeValues_8MemMapped <> g_szBusTypeValues_Serial + g_szBusTypeValues_Displacement
+		%error "g_szBusTypeValues Displacement Incorrect 7"
 	%endif
 %endif
Index: trunk/XTIDE_Universal_BIOS/Src/StringsCompressed.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS/Src/StringsCompressed.asm	(revision 284)
+++ trunk/XTIDE_Universal_BIOS/Src/StringsCompressed.asm	(revision 285)
@@ -102,4 +102,8 @@
                          		  db		 59h,  4bh,  98h          ; compressed
 
+g_szBusTypeValues_8MemMapped:	; db		"M8 ",NULL
+                             	; db		 4dh,  38h,  20h,  00h    ; uncompressed
+                             	  db		 53h,  31h,  00h          ; compressed
+
 g_szBusTypeValues_Displacement equ (g_szBusTypeValues_8Reversed - g_szBusTypeValues)
 ;
@@ -124,4 +128,7 @@
 %if g_szBusTypeValues_Serial <> g_szBusTypeValues_32 + g_szBusTypeValues_Displacement
 %error "g_szBusTypeValues Displacement Incorrect 6"
+%endif
+%if g_szBusTypeValues_8MemMapped <> g_szBusTypeValues_Serial + g_szBusTypeValues_Displacement
+%error "g_szBusTypeValues Displacement Incorrect 7"
 %endif
 %endif
@@ -189,5 +196,5 @@
                 		  db	 4fh,  4ah, 0cbh,  3eh,  20h,  67h, 0fah,  3eh,  40h,  00h                                  ; compressed
 
-%ifdef MODULE_SERIAL		;%%; is stripped off after string compression, %ifdef won't compress properly
+;%%; %ifdef MODULE_SERIAL		;%%; is stripped off after string compression, %ifdef won't compress properly
 g_szDetectOuterSerial:	; db	"Serial %s on %s: ",NULL
                       	; db	 53h,  65h,  72h,  69h,  61h,  6ch,  20h,  25h,  73h,  20h,  6fh,  6eh,  20h,  25h,  73h,  3ah,  20h,  00h    ; uncompressed
@@ -210,5 +217,5 @@
                    		  db	 2ah,  37h,  29h,  37h,  91h                      ; compressed
 
-%endif						;%%; is stripped off after string compression, %ifdef won't compress properly
+;%%; %endif						;%%; is stripped off after string compression, %ifdef won't compress properly
 g_szDetectEnd:
 g_szDetectPort:			; db	"%x",NULL					   	; IDE Master at 1F0h:
@@ -426,5 +433,5 @@
 ;; translated usage stats
 ;; 33:1
-;; 32:32
+;; 32:33
 ;; 181:1
 ;; 53:2
@@ -441,5 +448,5 @@
 ;; 34:3
 ;; 49:1
-;; 56:5
+;; 56:6
 ;; 45:3
 ;; 175:1
@@ -482,5 +489,5 @@
 ;; 75,K:1
 ;; 76,L:3
-;; 77,M:3
+;; 77,M:4
 ;; 78,N:
 ;; 79,O:2
