Index: trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/AutoConfigure.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/AutoConfigure.asm	(revision 620)
+++ trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/AutoConfigure.asm	(revision 621)
@@ -118,16 +118,24 @@
 	xor		dh, al
 	mov		bl, dh
-	rol		bx, 1
-	rol		bx, 1
-	rol		bx, 1
-	rol		bx, 1
+%ifdef USE_186
+	rol		bx, 4
+%else
+	rol		bx, 1
+	rol		bx, 1
+	rol		bx, 1
+	rol		bx, 1
+%endif
 	xor		dx, bx
 	rol		bx, 1
 	xchg	dh, dl
 	xor		dx, bx
-	ror		bx, 1
-	ror		bx, 1
-	ror		bx, 1
-	ror		bx, 1
+%ifdef USE_186
+	ror		bx, 4
+%else
+	ror		bx, 1
+	ror		bx, 1
+	ror		bx, 1
+	ror		bx, 1
+%endif
 	and		bl, ah
 	xor		dx, bx
@@ -156,9 +164,9 @@
 	inc		ch			; Hours changed?
 	jz		SHORT .ThisIsNotAnOlivettiM24
-	mov		BYTE [cs:IsOlivettiM24], 1
+	mov		BYTE [cs:bIsOlivettiM24], 1
 .ThisIsNotAnOlivettiM24:
 	ret
 
-IsOlivettiM24:
+bIsOlivettiM24:
 	db		0
 
@@ -249,4 +257,6 @@
 EnableInterruptsForAllStandardControllers:
 	jcxz	.NoControllersDetected
+	test	BYTE [ROMVARS.wFlags+1], FLG_ROMVARS_MODULE_IRQ >> 8
+	jz		SHORT .NoModuleIrq
 	call	Buffers_IsXTbuildLoaded
 	je		SHORT .DoNotEnableIRQforXTbuilds
@@ -285,4 +295,5 @@
 	pop		di
 .DoNotEnableIRQforXTbuilds:
+.NoModuleIrq:
 .NoControllersDetected:
 	ret
Index: trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/BiosFile.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/BiosFile.asm	(revision 620)
+++ trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/BiosFile.asm	(revision 621)
@@ -33,58 +33,39 @@
 ALIGN JUMP_ALIGN
 BiosFile_LoadFileFromDSSItoRamBuffer:
-	push	ds
-
-	call	.OpenFileForLoadingFromDSSIandGetSizeToDXCX
+	mov		al, FILE_ACCESS.ReadOnly
+	call	FileIO_OpenWithPathInDSSIandFileAccessInAL
 	jc		SHORT .DisplayErrorMessage
+
+	call	FileIO_GetFileSizeToDXAXusingHandleFromBXandResetFilePosition
+	jc		SHORT .CloseUsingHandleFromBXandDisplayErrorMessage
+
+	cmp		dx, MAX_EEPROM_SIZE_IN_BYTES >> 16
+	jb		SHORT .FileNotTooBig
+	ja		SHORT .FileTooBig
+%if (MAX_EEPROM_SIZE_IN_BYTES & 0FFFFh) = 0
+	test	ax, ax
+	jnz		SHORT .FileTooBig
+%else
+	cmp		ax, MAX_EEPROM_SIZE_IN_BYTES & 0FFFFh
+	ja		SHORT .FileTooBig
+%endif
+.FileNotTooBig:
+	xchg	cx, ax
+
 	call	.LoadFileWithNameInDSSIhandleInBXandSizeInDXCXtoRamBuffer
-	jc		SHORT .DisplayErrorMessage
+	jc		SHORT .CloseUsingHandleFromBXandDisplayErrorMessage
 
 	mov		al, FLG_CFGVARS_FILELOADED
 	call	Buffers_NewBiosWithSizeInDXCXandSourceInALhasBeenLoadedForConfiguration
 	call	FileIO_CloseUsingHandleFromBX
-	call	DisplayFileLoadedSuccessfully
-	pop		ds
-	ret
-
-.DisplayErrorMessage:
-	call	FileIO_CloseUsingHandleFromBX
-	call	DisplayFailedToLoadFile
-	pop		ds
-	ret
-
-;--------------------------------------------------------------------
-; .OpenFileForLoadingFromDSSIandGetSizeInBytesToDXCX
-;	Parameters:
-;		DS:SI:	Name of file to open
-;	Returns:
-;		BX:		File handle (if successful)
-;		DX:CX:	File size (if successful)
-;		CF:		Clear if successful
-;				Set if error
-;	Corrupts registers:
-;		AX
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-.OpenFileForLoadingFromDSSIandGetSizeToDXCX:
-	mov		al, FILE_ACCESS.ReadOnly
-	call	FileIO_OpenWithPathInDSSIandFileAccessInAL
-	jc		SHORT .FileError
-	call	FileIO_GetFileSizeToDXAXusingHandleFromBXandResetFilePosition
-	jc		SHORT .FileError
-
-	cmp		dx, MAX_EEPROM_SIZE_IN_BYTES >> 16
-	jb		SHORT .FileNotTooBig
-	ja		SHORT .FileTooBig
-	cmp		ax, MAX_EEPROM_SIZE_IN_BYTES & 0FFFFh
-	ja		SHORT .FileTooBig
-.FileNotTooBig:
-	xchg	cx, ax
-	clc
-	ret
+	jmp		SHORT DisplayFileLoadedSuccessfully
+
 .FileTooBig:
 	call	DisplayFileTooBig
-	stc
-.FileError:
-	ret
+.CloseUsingHandleFromBXandDisplayErrorMessage:
+	call	FileIO_CloseUsingHandleFromBX
+.DisplayErrorMessage:
+	jmp		SHORT DisplayFailedToLoadFile
+
 
 ;--------------------------------------------------------------------
@@ -112,5 +93,5 @@
 	push	cx
 
-	call	Registers_CopyESDItoDSSI	; File name in DS:SI
+	call	Registers_CopyESDItoDSSI				; File name in DS:SI
 	push	cs
 	pop		es
@@ -119,6 +100,5 @@
 	cld
 %endif
-	call	String_CopyDSSItoESDIandGetLengthToCX
-	clc
+	call	String_CopyDSSItoESDIandGetLengthToCX	; Returns with CF cleared
 
 	pop		cx
@@ -164,5 +144,4 @@
 BiosFile_SaveRamBufferToFileInDSSI:
 	push	es
-	push	ds
 
 	call	Buffers_GenerateChecksum
@@ -174,21 +153,20 @@
 	jc		SHORT .DisplayErrorMessage
 
+	push	ds
 	call	Registers_CopyESDItoDSSI
 	call	FileIO_WriteDXCXbytesFromDSSIusingHandleFromBX
+	pop		ds
+	pushf
+	call	FileIO_CloseUsingHandleFromBX
+	popf
 	jc		SHORT .DisplayErrorMessage
 
-	call	FileIO_CloseUsingHandleFromBX
 	call	Buffers_ClearUnsavedChanges
-	call	DisplayFileSavedSuccessfully
-	jmp		SHORT .Return
+	pop		es
+	jmp		SHORT DisplayFileSavedSuccessfully
 
 .DisplayErrorMessage:
-	call	FileIO_CloseUsingHandleFromBX
-	call	DisplayFailedToSaveFile
-ALIGN JUMP_ALIGN
-.Return:
-	pop		ds
-	pop		es
-	ret
+	pop		es
+	jmp		SHORT DisplayFailedToSaveFile
 
 
Index: trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Buffers.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Buffers.asm	(revision 620)
+++ trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Buffers.asm	(revision 621)
@@ -49,5 +49,5 @@
 ALIGN JUMP_ALIGN
 Buffers_IsXtideUniversalBiosLoaded:
-	test	BYTE [cs:g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_FILELOADED | FLG_CFGVARS_ROMLOADED
+	test	BYTE [g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_FILELOADED | FLG_CFGVARS_ROMLOADED
 	jnz		SHORT .FileOrBiosLoaded
 	test	sp, sp		; Clear ZF
@@ -120,10 +120,10 @@
 ALIGN JUMP_ALIGN
 Buffers_NewBiosWithSizeInDXCXandSourceInALhasBeenLoadedForConfiguration:
-	and		BYTE [cs:g_cfgVars+CFGVARS.wFlags], ~(FLG_CFGVARS_FILELOADED | FLG_CFGVARS_ROMLOADED | FLG_CFGVARS_UNSAVED)
-	or		[cs:g_cfgVars+CFGVARS.wFlags], al
+	and		BYTE [g_cfgVars+CFGVARS.wFlags], ~(FLG_CFGVARS_FILELOADED | FLG_CFGVARS_ROMLOADED | FLG_CFGVARS_UNSAVED)
+	or		[g_cfgVars+CFGVARS.wFlags], al
 	shr		dx, 1
 	rcr		cx, 1
 	adc		cx, BYTE 0		; Round up to next WORD
-	mov		[cs:g_cfgVars+CFGVARS.wImageSizeInWords], cx
+	mov		[g_cfgVars+CFGVARS.wImageSizeInWords], cx
 	ret
 
@@ -141,10 +141,10 @@
 ALIGN JUMP_ALIGN
 Buffers_SetUnsavedChanges:
-	or		BYTE [cs:g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_UNSAVED
+	or		BYTE [g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_UNSAVED
 	ret
 
 ALIGN JUMP_ALIGN
 Buffers_ClearUnsavedChanges:
-	and		BYTE [cs:g_cfgVars+CFGVARS.wFlags], ~FLG_CFGVARS_UNSAVED
+	and		BYTE [g_cfgVars+CFGVARS.wFlags], ~FLG_CFGVARS_UNSAVED
 	ret
 
@@ -161,6 +161,5 @@
 ALIGN JUMP_ALIGN
 Buffers_SaveChangesIfFileLoaded:
-	mov		al, [cs:g_cfgVars+CFGVARS.wFlags]
-	and		al, FLG_CFGVARS_FILELOADED | FLG_CFGVARS_UNSAVED
+	test	BYTE [g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_FILELOADED | FLG_CFGVARS_UNSAVED
 	jz		SHORT .NothingToSave
 	jpo		SHORT .NothingToSave
@@ -184,12 +183,12 @@
 ALIGN JUMP_ALIGN
 Buffers_GetSelectedEepromSizeInWordsToAX:
-	eMOVZX	bx, [cs:g_cfgVars+CFGVARS.bEepromType]
-	mov		ax, [cs:bx+g_rgwEepromTypeToSizeInWords]
+	eMOVZX	bx, [g_cfgVars+CFGVARS.bEepromType]
+	mov		ax, [bx+g_rgwEepromTypeToSizeInWords]
 
 	cmp		bl, EEPROM_TYPE.SST_39SF
-	jnz		SHORT .HaveEepromSize
-	cmp		ax, [cs:g_cfgVars+CFGVARS.wImageSizeInWords]
-	jae		SHORT .HaveEepromSize		
-	shl		ax, 1	; Auto-double SST size when too small.
+	jne		SHORT .HaveEepromSize
+	cmp		ax, [g_cfgVars+CFGVARS.wImageSizeInWords]
+	jae		SHORT .HaveEepromSize
+	eSHL_IM	ax, 1			; Auto-double SST size when too small.
 .HaveEepromSize:
 	ret
@@ -206,23 +205,21 @@
 ALIGN JUMP_ALIGN
 Buffers_AppendZeroesIfNeeded:
+	call	Buffers_GetSelectedEepromSizeInWordsToAX
+	mov		cx, [g_cfgVars+CFGVARS.wImageSizeInWords]
+	sub		ax, cx			; AX = WORDs to append
+	jbe		SHORT .NoNeedToAppendZeroes
+
+	eSHL_IM	cx, 1
 	push	es
-
-	call	Buffers_GetSelectedEepromSizeInWordsToAX
-	mov		cx, ax
-	sub		cx, [cs:g_cfgVars+CFGVARS.wImageSizeInWords]	; CX = WORDs to append
-	jbe		SHORT .NoNeedToAppendZeroes
-
-	call	Buffers_GetFileBufferToESDI
-	mov		ax, [cs:g_cfgVars+CFGVARS.wImageSizeInWords]
-	eSHL_IM	ax, 1
-	add		di, ax			; ES:DI now point first unused image byte
-	xor		ax, ax
+	call	Buffers_GetFileBufferToESDI
+	add		di, cx			; ES:DI now point first unused image byte
+	xor		cx, cx
+	xchg	cx, ax
 %ifdef CLD_NEEDED
 	cld
 %endif
 	rep stosw
-ALIGN JUMP_ALIGN
+	pop		es
 .NoNeedToAppendZeroes:
-	pop		es
 	ret
 
Index: trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Dialogs.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Dialogs.asm	(revision 620)
+++ trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Dialogs.asm	(revision 621)
@@ -29,5 +29,5 @@
 ;		SS:BP:	Menu handle
 ;	Returns:
-;		Nothing
+;		ZF:		Cleared
 ;	Corrupts registers:
 ;		AX
@@ -53,5 +53,5 @@
 ;		SS:BP:	Menu handle
 ;	Returns:
-;		Nothing
+;		ZF:		Cleared
 ;	Corrupts registers:
 ;		AX
@@ -72,5 +72,5 @@
 	CALL_MENU_LIBRARY DisplayMessageWithInputInDSSI
 
-	add		sp, BYTE DIALOG_INPUT_size
+	add		sp, BYTE DIALOG_INPUT_size	; Clears ZF
 	pop		cx
 	pop		si
Index: trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/EEPROM.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/EEPROM.asm	(revision 620)
+++ trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/EEPROM.asm	(revision 621)
@@ -99,6 +99,6 @@
 ALIGN JUMP_ALIGN
 EEPROM_LoadOldSettingsFromRomToRamBuffer:
-	mov		cx, ROMVARS_size - ROMVARS.wFlags	; Number of bytes to load
-	mov		si, ROMVARS.wFlags					; Offset where to start loading
+	mov		cx, ROMVARS_size - ROMVARS.wFlags - 2	; Number of bytes to load
+	mov		si, ROMVARS.wFlags + 2					; Offset where to start loading
 	; Fall to LoadBytesFromRomToRamBuffer
 
@@ -123,13 +123,13 @@
 	jc		SHORT .XtideUniversalBiosNotFound
 	push	es
-	pop		ds											; DS:SI points to ROM
+	pop		ds										; DS:SI points to ROM
 
 	call	Buffers_GetFileBufferToESDI
-	mov		di, si										; ES:DI points to RAM buffer
+	mov		di, si									; ES:DI points to RAM buffer
 
 %ifdef CLD_NEEDED
 	cld
 %endif
-	call	Memory_CopyCXbytesFromDSSItoESDI			; Clears CF
+	call	Memory_CopyCXbytesFromDSSItoESDI		; Clears CF
 
 .XtideUniversalBiosNotFound:
@@ -163,6 +163,7 @@
 	call	Buffers_IsXtideUniversalBiosSignatureInESDI
 	je		SHORT .RomFound			; If equal, CF=0
-	add		bx, 80h					; Increment by 2kB (minimum possible distance from the beginning of one option ROM to the next)
-	jnc		SHORT .SegmentLoop		; Loop until segment overflows
+	sub		bx, -80h				; Increment by 2kB (minimum possible distance from the beginning of one option ROM to the next)
+	jc		SHORT .SegmentLoop		; Loop until segment overflows
+	stc
 .RomFound:
 	pop		cx
@@ -185,12 +186,12 @@
 	push	ds
 
-	mov		ds, [cs:g_cfgVars+CFGVARS.wEepromSegment]
+	eMOVZX	bx, [g_cfgVars+CFGVARS.bEepromType]
+	mov		cx, [bx+g_rgwEepromTypeToSizeInWords]
+	mov		ds, [g_cfgVars+CFGVARS.wEepromSegment]
 	xor		si, si
 	call	Buffers_GetFlashComparisonBufferToESDI
-	eMOVZX	bx, [cs:g_cfgVars+CFGVARS.bEepromType]
 %ifdef CLD_NEEDED
 	cld
 %endif
-	mov		cx, [cs:bx+g_rgwEepromTypeToSizeInWords]
 	rep movsw
 
Index: trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/FlashSST.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/FlashSST.asm	(revision 620)
+++ trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/FlashSST.asm	(revision 621)
@@ -3,6 +3,17 @@
 
 ;
-; Created by Jayeson Lee-Steere
-; Hereby placed into the public domain.
+; XTIDE Universal BIOS and Associated Tools
+; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2021 by XTIDE Universal BIOS Team.
+;
+; This program is free software; you can redistribute it and/or modify
+; it under the terms of the GNU General Public License as published by
+; the Free Software Foundation; either version 2 of the License, or
+; (at your option) any later version.
+;
+; This program is distributed in the hope that it will be useful,
+; but WITHOUT ANY WARRANTY; without even the implied warranty of
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+; GNU General Public License for more details.
+; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 ;
 
@@ -27,5 +38,5 @@
 	push	si
 	push	bp
-	mov		bp, bx					; Flashvars now in SS:BP.
+	mov		bp, bx					; Flashvars now in SS:BP (Assumes SS=DS)
 
 	mov		BYTE [bp+FLASHVARS.flashResult], FLASH_RESULT.DeviceNotDetected
@@ -34,9 +45,10 @@
 
 	call	CalibrateSstTimeout
-	
+
 	mov		BYTE [bp+FLASHVARS.flashResult], FLASH_RESULT.PollingTimeoutError
 	mov		cx, [bp+FLASHVARS.wPagesToFlash]
-	lds		si, [bp+FLASHVARS.fpNextSourcePage]
-	les		di, [bp+FLASHVARS.fpNextDestinationPage]
+	mov		dx, [bp+FLASHVARS.wEepromPageSize]
+	les		di, [bp+FLASHVARS.fpNextSourcePage]
+	lds		si, [bp+FLASHVARS.fpNextDestinationPage]
 %ifdef CLD_NEEDED
 	cld
@@ -49,13 +61,12 @@
 	push	di
 	push	cx
-	mov		cx, [bp+FLASHVARS.wEepromPageSize]
-	mov		bx, cx
+	mov		cx, dx
 	repe cmpsb
 	pop		cx
 	pop		di
 	pop		si
-	jnz		SHORT .FlashThisPage
-	add		si, bx
-	add		di, bx
+	jne		SHORT .FlashThisPage
+	add		si, dx
+	add		di, dx
 	jmp		SHORT .ContinueLoop
 
@@ -69,15 +80,20 @@
 
 	; The write process has already confirmed the results one byte at a time.
-	; Here we do an additional verify check just in case there was some 
+	; Here we do an additional verify check just in case there was some
 	; kind of oddity with pages / addresses.
 	mov		BYTE [bp+FLASHVARS.flashResult], FLASH_RESULT.DataVerifyError
+%ifndef USE_186
 	mov		ax, [bp+FLASHVARS.wPagesToFlash]
-	mov		cl, SST_PAGE_SIZE_SHIFT
+	mov		cl, SST_PAGE_SIZE_SHIFT - 1		; -1 because we compare WORDs (verifying 64 KB won't work otherwise)
 	shl		ax, cl
-	mov		cx, ax
+	xchg	cx, ax
+%else
+	mov		cx, [bp+FLASHVARS.wPagesToFlash]
+	shl		cx, SST_PAGE_SIZE_SHIFT - 1
+%endif
 	lds		si, [bp+FLASHVARS.fpNextSourcePage]
 	les		di, [bp+FLASHVARS.fpNextDestinationPage]
-	repe cmpsb
-	jnz		SHORT .ExitOnError
+	repe cmpsw
+	jne		SHORT .ExitOnError
 
 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
@@ -106,34 +122,32 @@
 ;			Set if supported SST device not found
 ;	Corrupts registers:
-;		AX, DI, ES
+;		AX, BX, SI, DS
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
 DetectSstDevice:
-	les		di, [bp+FLASHVARS.fpNextDestinationPage]
+	lds		si, [bp+FLASHVARS.fpNextDestinationPage]
+	mov		bx, 5555h
 
 	cli
-	mov		BYTE [es:05555h], 0AAh	; Enter software ID sequence.
-	mov		BYTE [es:02AAAh], 055h
-	mov		BYTE [es:05555h], 090h
-	mov		al, [es:di]				; Extra reads to be sure device
-	mov		al, [es:di]				; has time to respond.
-	mov		al, [es:di]
-	mov		ah, [es:di]				; Vendor ID in AH.
-	mov		al, [es:di + 1]			; Device ID in AL.
-	mov		BYTE [es:05555h], 0F0h	; Exit software ID.
+	mov		BYTE [bx], 0AAh			; Enter software ID sequence.
+	shr		bx, 1					; BX=2AAAh, CF=1
+	mov		BYTE [bx], 55h
+	eRCL_IM	bx, 1					; BX=5555h
+	mov		BYTE [bx], 90h
+	mov		al, [si]				; Extra reads to be sure device
+	mov		al, [si]				; has time to respond.
+	mov		al, [si]
+	mov		ah, [si]				; Vendor ID in AH.
+	mov		al, [si+1]				; Device ID in AL.
+	mov		BYTE [bx], 0F0h			; Exit software ID.
 	sti
 
-	cmp		al, 0B4h
+	cmp		ax, 0BFB4h
 	jb		SHORT .NotValidDevice
-	cmp		al, 0B7h
-	ja		SHORT .NotValidDevice
-	cmp		ah, 0BFh
-	jne		SHORT .NotValidDevice
-	ret
-
+	cmp		ax, 0BFB7h+1
+	cmc
 .NotValidDevice:
-	stc
-	ret
-	
+	ret
+
 ;--------------------------------------------------------------------
 ; CalibrateSstTimeout
@@ -147,38 +161,31 @@
 ALIGN JUMP_ALIGN
 CalibrateSstTimeout:
-	LOAD_BDA_SEGMENT_TO	ds, ax
-	les		di, [bp+FLASHVARS.fpNextDestinationPage]
-	xor		cx, cx
+	LOAD_BDA_SEGMENT_TO	es, cx, !
+	mov		ds, [bp+FLASHVARS.fpNextDestinationPage+2]
+	mov		bx, BDA.dwTimerTicks
 	mov		si, cx
 	mov		di, cx
-	mov		al, [es:di]
-	not		al							; Forces poll to fail.
-
-	mov		bx, [BDA.dwTimerTicks]		; Read low word only.
-	inc		bx
+	mov		al, [di]
+	inc		ax						; Forces poll to fail
+
+	mov		ah, [es:bx]				; Read low byte only
+	inc		ah
 .WaitForFirstIncrement:
-	cmp		bx, [BDA.dwTimerTicks]
-	jnz		SHORT .WaitForFirstIncrement
-
-	inc		bx
+	cmp		ah, [es:bx]
+	jne		SHORT .WaitForFirstIncrement
+
+	inc		ah
 
 .WaitForSecondIncrement:
-	inc		ch							; cx now 0x0100
-.PollLoop:								; Identical to poll loop used 
-	cmp		[es:di], al					; during programming
-	jz		SHORT .PollComplete			; Will never branch in this case
-	loop	.PollLoop
-.PollComplete:
-	add		si, 1						; number of poll loops completed
-	jc		SHORT .countOverflow
-	cmp		bx, [BDA.dwTimerTicks]
-	jnz		SHORT .WaitForSecondIncrement
-
-.CalComplete:
-	; SI ~= number of polling loops in 215us.
-	mov		[bp+FLASHVARS.wTimeoutCounter], si
-	ret
-		
-.countOverflow:
+	inc		ch						; CX now 0x0100
+.PollLoop:							; Identical to poll loop used
+	cmp		[di], al				; during programming
+	loopne	.PollLoop				; Will never be equal in this case
+	inc		si						; Number of poll loops completed
+	jz		SHORT .CountOverflow
+	cmp		ah, [es:bx]
+	jne		SHORT .WaitForSecondIncrement
+	SKIP1B	al
+.CountOverflow:
 	; Clamp on overflow, although it should not be possible on
 	; real hardware. In principle SI could overflow on a very
@@ -187,14 +194,17 @@
 	; the device, SI can not overflow.
 	dec		si
-	jmp		SHORT .CalComplete
+
+	; SI ~= number of polling loops in 215us.
+	mov		[bp+FLASHVARS.wTimeoutCounter], si
+	ret
 
 ;--------------------------------------------------------------------
 ; EraseSstPage
 ;	Parameters:
-;		ES:DI:	Destination ptr.
+;		DS:SI:	Destination ptr
 ;	Returns:
 ;		CF:		Set on error.
 ;	Corrupts registers:
-;		AX
+;		AX, BX
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
@@ -202,22 +212,30 @@
 	push	cx
 
-	mov		BYTE [es:05555h], 0AAh	; Sector erase sequence.
-	mov		BYTE [es:02AAAh], 055h
-	mov		BYTE [es:05555h], 080h
-	mov		BYTE [es:05555h], 0AAh
-	mov		BYTE [es:02AAAh], 055h
-	mov		BYTE [es:di], 030h
-
+	mov		bx, 5555h
+	mov		ax, 2AAAh
+
+	; Sector erase sequence.
+	mov		[bx], al				; [5555h] <- AAh
+	xchg	bx, ax
+	mov		[bx], al				; [2AAAh] <- 55h
+	xchg	bx, ax
+	mov		BYTE [bx], 80h			; [5555h] <- 80h
+	mov		[bx], al				; [5555h] <- AAh
+	xchg	bx, ax
+	mov		[bx], al				; [2AAAh] <- 55h
+	mov		BYTE [si], 30h
+
+	or		bl, al					; BL = 0FFh
 	mov		ax, 1163				; 1163 x ~215us = 250ms = 10x datasheet max
 .TimeoutOuterLoop:
 	mov		cx, [bp+FLASHVARS.wTimeoutCounter]
 .TimeoutInnerLoop:
-	cmp		BYTE [es:di], 0FFh		; Will return 0FFh when erase complete.
-	jz		SHORT .Exit
-	loop	.TimeoutInnerLoop
+	cmp		[si], bl				; Will return 0FFh when erase complete
+	loopne	.TimeoutInnerLoop
+	je		SHORT .Return
 	dec		ax
 	jnz		SHORT .TimeoutOuterLoop
-	stc								; Timed out.
-.Exit:
+	; Timed out (CF=1)
+.Return:
 	pop		cx
 	ret
@@ -226,43 +244,44 @@
 ; WriteSstPage
 ;	Parameters:
-;		DS:SI:	Source ptr.
-;		ES:DI:	Destination ptr.
+;		DX:		EEPROM page size
+;		DS:SI:	Destination ptr
+;		ES:DI:	Source ptr
 ;	Returns:
 ;		SI, DI:	Each advanced forward 1 page.
 ;		CF:		Set on error.
 ;	Corrupts registers:
-;		AL, BX, DX
+;		AL, BX
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
 WriteSstPage:
 	push	cx
+	push	dx
 
 	mov		bx, [bp+FLASHVARS.wTimeoutCounter]
-	mov		dx, [bp+FLASHVARS.wEepromPageSize]
+	xchg	si, di
 	cli
 
 .NextByte:
-	lodsb
-	mov		BYTE [es:05555h], 0AAh	; Byte program sequence.
-	mov		BYTE [es:02AAAh], 055h
-	mov		BYTE [es:05555h], 0A0h
-	mov		[es:di], al
+	es lodsb						; Read byte from ES:SI
+	mov		BYTE [5555h], 0AAh		; Byte program sequence.
+	mov		BYTE [2AAAh], 55h
+	mov		BYTE [5555h], 0A0h
+	mov		[di], al				; Write byte to DS:DI
 
 	mov		cx, bx
 .WaitLoop:
-	cmp		[es:di], al				; Device won't return actual data until 
-	jz		SHORT .ByteFinished		; write complete. Timeout ~215us, or 
-	loop	.WaitLoop				; ~10x 20us max program time from datasheet.
-
-	stc								; Write timeout.
-	jmp		SHORT .Exit
-
-.ByteFinished:
+	cmp		[di], al				; Device won't return actual data until write complete.
+	loopne	.WaitLoop				; Timeout ~215us, or ~10x 20us max program time from datasheet.
+	jne		SHORT .WriteTimeout
+
 	inc		di
 	dec		dx
 	jnz		SHORT .NextByte
-	clc
-.Exit:
+	SKIP1B	al
+.WriteTimeout:
+	stc
 	sti
-	pop		cx
-	ret
+	xchg	si, di
+	pop		dx
+	pop		cx
+	ret
Index: trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/IdeAutodetect.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/IdeAutodetect.asm	(revision 620)
+++ trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/IdeAutodetect.asm	(revision 621)
@@ -141,5 +141,5 @@
 	jc		SHORT .ContinueDetection
 	mov		al, DEVICE_8BIT_XTCF_PIO8_WITH_BIU_OFFLOAD
-	cmp		BYTE [cs:IsOlivettiM24], 1
+	cmp		BYTE [cs:bIsOlivettiM24], 1
 	jne		SHORT .IdeDeviceFound
 	mov		al, DEVICE_8BIT_XTCF_PIO8
@@ -172,5 +172,5 @@
 	cmp		al, DEVICE_8BIT_XTIDE_REV2
 	jne		SHORT .XtideRev1
-	cmp		BYTE [cs:IsOlivettiM24], 1
+	cmp		BYTE [cs:bIsOlivettiM24], 1
 	jne		SHORT .IdeDeviceFound
 	mov		al, DEVICE_8BIT_XTIDE_REV2_OLIVETTI
Index: trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/BootMenuSettingsMenu.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/BootMenuSettingsMenu.asm	(revision 620)
+++ trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/BootMenuSettingsMenu.asm	(revision 621)
@@ -185,4 +185,6 @@
 
 ColorThemeTable:
+; Note! If there's ever a need to remove a theme or change a theme or reorder the themes then the ROMVARS version must be incremented.
+; This is for backwards compatibility. Adding new themes (at the bottom) however should work with no change to the ROMVARS version.
 	; Classic (default)
 	db	COLOR_ATTRIBUTE(COLOR_YELLOW, COLOR_BLUE)							; .cBordersAndBackground
Index: trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm	(revision 620)
+++ trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/FlashMenu.asm	(revision 621)
@@ -205,39 +205,25 @@
 	mov		si, g_MenupageForFlashMenu
 	ePUSH_T	bx, Menupage_ChangeToNewMenupageInDSSI
-	cmp		WORD [g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF
-	jz		SHORT .DisableMenuitemsUnusedBySstFlash
-	; Fall to .EnableMenuitemsUnusedBySstFlash
-
-;--------------------------------------------------------------------
-; .EnableMenuitemsUnusedBySstFlash
-;	Parameters:
+	cmp		BYTE [g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF
+	mov		ax, DisableMenuitemFromCSBX
+	je		SHORT .EnableOrDisableMenuitemsUnusedBySstFlash
+	mov		ax, EnableMenuitemFromCSBX
+	; Fall to .EnableOrDisableMenuitemsUnusedBySstFlash
+
+;--------------------------------------------------------------------
+; .EnableOrDisableMenuitemsUnusedBySstFlash
+;	Parameters:
+;		AX:		Offset to EnableMenuitemFromCSBX / DisableMenuitemFromCSBX
 ;		SS:BP:	Menu handle
 ;	Returns:
 ;		Nothing
 ;	Corrupts registers:
-;		AX, BX
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-.EnableMenuitemsUnusedBySstFlash:
+;		BX
+;--------------------------------------------------------------------
+.EnableOrDisableMenuitemsUnusedBySstFlash:
 	mov		bx, g_MenuitemFlashSdpCommand
-	call	EnableMenuitemFromCSBX
+	call	ax
 	mov		bx, g_MenuitemFlashPageSize
-	jmp		EnableMenuitemFromCSBX
-
-;--------------------------------------------------------------------
-; .DisableMenuitemsUnusedBySstFlash
-;	Parameters:
-;		SS:BP:	Menu handle
-;	Returns:
-;		Nothing
-;	Corrupts registers:
-;		AX, BX
-;--------------------------------------------------------------------
-ALIGN JUMP_ALIGN
-.DisableMenuitemsUnusedBySstFlash:
-	mov		bx, g_MenuitemFlashSdpCommand
-	call	DisableMenuitemFromCSBX
-	mov		bx, g_MenuitemFlashPageSize
-	jmp		DisableMenuitemFromCSBX
+	jmp		ax
 
 ;--------------------------------------------------------------------
@@ -254,8 +240,8 @@
 	call	.MakeSureThatImageFitsInEeprom
 	jc		SHORT .InvalidFlashingParameters
-	cmp		WORD [cs:g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF
-	jnz		SHORT .SkipAlignmentCheck
+	cmp		BYTE [g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF
+	jne		SHORT .SkipAlignmentCheck
 	call	.MakeSureAddress32KAligned
-	jc		SHORT .InvalidFlashingParameters
+	jnz		SHORT .InvalidFlashingParameters
 .SkipAlignmentCheck:
 	push	es
@@ -267,6 +253,6 @@
 	call	.InitializeFlashvarsFromDSSI
 	mov		bx, si							; DS:BX now points to FLASHVARS
-	cmp		WORD [cs:g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF
-	jz		SHORT .FlashWithoutProgressBar
+	cmp		BYTE [g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF
+	je		SHORT .FlashWithoutProgressBar
 	add		si, BYTE FLASHVARS_size			; DS:SI now points to PROGRESS_DIALOG_IO
 	call	Dialogs_DisplayProgressDialogForFlashingWithDialogIoInDSSIandFlashvarsInDSBX
@@ -282,5 +268,5 @@
 .FlashWithoutProgressBar:					; Worst case. SST devices will
 	call	FlashSst_WithFlashvarsInDSBX	; either complete flashing
-	jmp		SHORT .FlashComplete			; or timeout within 2 seconds. 
+	jmp		SHORT .FlashComplete			; or timeout within 2 seconds.
 
 ;--------------------------------------------------------------------
@@ -296,5 +282,5 @@
 .MakeSureThatImageFitsInEeprom:
 	call	Buffers_GetSelectedEepromSizeInWordsToAX
-	cmp		ax, [cs:g_cfgVars+CFGVARS.wImageSizeInWords]
+	cmp		ax, [g_cfgVars+CFGVARS.wImageSizeInWords]
 	jae		SHORT .ImageFitsInSelectedEeprom
 	mov		dx, g_szErrEepromTooSmall
@@ -312,17 +298,14 @@
 ;		SS:BP:	Ptr to MENU
 ;	Returns:
-;		CF:		Set if EEPROM segment is not 32K aligned
-;	Corrupts registers:
-;		AX, BX, DX
+;		ZF:		Cleared if EEPROM segment is not 32K aligned
+;	Corrupts registers:
+;		AX, DX
 ;--------------------------------------------------------------------
 ALIGN JUMP_ALIGN
 .MakeSureAddress32KAligned:
-	mov		ax, [cs:g_cfgVars+CFGVARS.wEepromSegment]
-	and		ax, 007FFh
+	test	WORD [g_cfgVars+CFGVARS.wEepromSegment], 07FFh
 	jz		SHORT .AlignmentIs32K
 	mov		dx, g_szErrAddrNot32KAligned
-	call	Dialogs_DisplayErrorFromCSDX
-	stc
-	ret
+	jmp		Dialogs_DisplayErrorFromCSDX
 
 ;--------------------------------------------------------------------
@@ -339,5 +322,5 @@
 	call	EEPROM_LoadFromRomToRamComparisonBuffer
 	call	Buffers_AppendZeroesIfNeeded
-	test	BYTE [cs:g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_CHECKSUM
+	test	BYTE [g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_CHECKSUM
 	jz		SHORT .DoNotGenerateChecksumByte
 	jmp		Buffers_GenerateChecksum
@@ -363,20 +346,20 @@
 	mov		[si+FLASHVARS.fpNextComparisonPage+2], es
 
-	mov		ax, [cs:g_cfgVars+CFGVARS.wEepromSegment]
+	mov		ax, [g_cfgVars+CFGVARS.wEepromSegment]
 	mov		WORD [si+FLASHVARS.fpNextDestinationPage], 0
 	mov		[si+FLASHVARS.fpNextDestinationPage+2], ax
 
-	mov		al, [cs:g_cfgVars+CFGVARS.bEepromType]
+	mov		al, [g_cfgVars+CFGVARS.bEepromType]
 	mov		[si+FLASHVARS.bEepromType], al
 
-	mov		al, [cs:g_cfgVars+CFGVARS.bSdpCommand]
+	mov		al, [g_cfgVars+CFGVARS.bSdpCommand]
 	mov		[si+FLASHVARS.bEepromSdpCommand], al
 
 	mov		ax, SST_PAGE_SIZE
-	cmp		WORD [g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF
-	jz		SHORT .UseSstPageSize
-
-	eMOVZX	bx, [cs:g_cfgVars+CFGVARS.bEepromPage]
-	mov		ax, [cs:bx+g_rgwEepromPageToSizeInBytes]
+	cmp		BYTE [g_cfgVars+CFGVARS.bEepromType], EEPROM_TYPE.SST_39SF
+	je		SHORT .UseSstPageSize
+
+	eMOVZX	bx, [g_cfgVars+CFGVARS.bEepromPage]
+	mov		ax, [bx+g_rgwEepromPageToSizeInBytes]
 .UseSstPageSize:
 	mov		[si+FLASHVARS.wEepromPageSize], ax
Index: trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm	(revision 620)
+++ trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm	(revision 621)
@@ -300,40 +300,40 @@
 IdeControllerMenu_InitializeToIdevarsOffsetInBX:
 	lea		ax, [bx+IDEVARS.drvParamsMaster]
-	mov		[cs:g_MenuitemIdeControllerMasterDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
+	mov		[g_MenuitemIdeControllerMasterDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
 
 	lea		ax, [bx+IDEVARS.drvParamsSlave]
-	mov		[cs:g_MenuitemIdeControllerSlaveDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
+	mov		[g_MenuitemIdeControllerSlaveDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
 
 	lea		ax, [bx+IDEVARS.bDevice]
-	mov		[cs:g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
+	mov		[g_MenuitemIdeControllerDevice+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
 
 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS
 %if IDEVARS.wBasePort = 0
-	mov		[cs:g_MenuitemIdeControllerCommandBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], bx
+	mov		[g_MenuitemIdeControllerCommandBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], bx
 %else
 	lea		ax, [bx+IDEVARS.wBasePort]
-	mov		[cs:g_MenuitemIdeControllerCommandBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
+	mov		[g_MenuitemIdeControllerCommandBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
 %endif
 
 %if IDEVARS.bSerialPort = 0
-	mov		[cs:g_MenuitemIdeControllerSerialPort+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], bx
+	mov		[g_MenuitemIdeControllerSerialPort+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], bx
 %else
 	lea		ax, [bx+IDEVARS.bSerialPort]
-	mov		[cs:g_MenuitemIdeControllerSerialPort+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
+	mov		[g_MenuitemIdeControllerSerialPort+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
 %endif
 %endif
 
 	lea		ax, [bx+IDEVARS.bSerialBaud]
-	mov		[cs:g_MenuitemIdeControllerSerialBaud+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
+	mov		[g_MenuitemIdeControllerSerialBaud+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
 
 	lea		ax, [bx+IDEVARS.wControlBlockPort]
-	mov		[cs:g_MenuitemIdeControllerControlBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
+	mov		[g_MenuitemIdeControllerControlBlockAddress+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
 
 	lea		ax, [bx+IDEVARS.bSerialCOMPortChar]
-	mov		[cs:g_MenuitemIdeControllerSerialCOM+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
+	mov		[g_MenuitemIdeControllerSerialCOM+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
 
 	lea		ax, [bx+IDEVARS.bIRQ]
-	mov		[cs:g_MenuitemIdeControllerEnableInterrupt+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
-	mov		[cs:g_MenuitemIdeControllerIdeIRQ+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
+	mov		[g_MenuitemIdeControllerEnableInterrupt+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
+	mov		[g_MenuitemIdeControllerIdeIRQ+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset], ax
 
 	ret
@@ -512,5 +512,5 @@
 	mov		bx, g_MenuitemMasterSlaveDisableDetection
 	call	DisableMenuitemFromCSBX
-	mov		bx, [cs:g_MenuitemIdeControllerMasterDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
+	mov		bx, [g_MenuitemIdeControllerMasterDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
 	jmp		SHORT DisplayMasterSlaveMenu
 
@@ -519,5 +519,5 @@
 	mov		bx, g_MenuitemMasterSlaveDisableDetection
 	call	EnableMenuitemFromCSBX
-	mov		bx, [cs:g_MenuitemIdeControllerSlaveDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
+	mov		bx, [g_MenuitemIdeControllerSlaveDrive+MENUITEM.itemValue+ITEM_VALUE.wRomvarsValueOffset]
 	; Fall to DisplayMasterSlaveMenu
 
@@ -566,16 +566,22 @@
 	; Standard ATA controllers, including 8-bit mode
 .StandardIdeDevice:
-	; Enable IRQ for standard ATA
+	; Enable IRQ for standard ATA, but only if MODULE_IRQ is included
 
 	lea		ax, [di-ROMVARS.ideVars0+IDEVARS.wBasePort]
 	mov		bl, IDEVARS_size
 	div		bl
+
+	test	BYTE [es:ROMVARS.wFlags+1], FLG_ROMVARS_MODULE_IRQ >> 8
+	jz		SHORT .DoNotEnableIrq
+
+	mov		bx, .rgbDefaultIrqForStdIde			; Enable interrupt for primary and secondary IDE
 	push	ax
-	mov		bx, .rgbDefaultIrqForStdIde			; Enable interrupt for primary and secondary IDE
 	xlat
 	mov		[es:di+IDEVARS.bIRQ-IDEVARS.wBasePort], al
 	pop		ax
-	sub		bx, BYTE .rgbDefaultIrqForStdIde - .rgbLowByteOfStdIdeInterfacePorts
-	xlat										; DS=CS so no segment override needed
+
+.DoNotEnableIrq:
+	mov		bx, .rgbLowByteOfStdIdeInterfacePorts
+	xlat
 	mov		ah, 1								; DEVICE_ATA_*_PORT >> 8
 	mov		bh, 3								; DEVICE_ATA_*_PORTCTRL >> 8
Index: trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MainMenu.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MainMenu.asm	(revision 620)
+++ trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/MainMenu.asm	(revision 621)
@@ -285,5 +285,12 @@
 	call	Dialogs_DisplayNotificationFromCSDX
 	call	EEPROM_FindXtideUniversalBiosROMtoESDI
-	call	LoadColorTheme.FromROM
+	call	LoadColorTheme.FromROM			; Returns the color theme index in AX
+	test	BYTE [g_cfgVars+CFGVARS.wFlags], FLG_CFGVARS_FILELOADED
+	jz		SHORT .FileNotLoaded
+	; A file has been loaded so we need to copy the theme to that as well
+	call	Buffers_GetFileBufferToESDI
+	add		di, ROMVARS.pColorTheme
+	call	WriteColorTheme
+.FileNotLoaded:
 	jmp		MainMenu_EnterMenuOrModifyItemVisibility
 
Index: trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm
===================================================================
--- trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm	(revision 620)
+++ trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm	(revision 621)
@@ -55,6 +55,6 @@
 g_szFlashTitle:				db	"Flashing EEPROM, please wait.",NULL
 g_szErrEepromTooSmall:		db	"Image is too large for selected EEPROM type!",NULL
-g_szErrAddrNot32KAligned:	db	"The selected EEPROM type requires the address to be 32 "
-							db	"kiB aligned (C800, D000, D800, E000, etc.)",NULL
+g_szErrAddrNot32KAligned:	db	"The selected EEPROM type requires the address to be 32"
+							db	" kiB aligned (C800, D000, D800, E000, etc.)",NULL
 g_szErrEepromDetection:		db	"EEPROM of type not found.",LF
 							db	"EEPROM was not flashed properly!",NULL
@@ -123,6 +123,6 @@
 						db	" controllers.",NULL
 g_szDlgBadBiosFound:	db	"This computer has been identified as being one of the following models:",LF,LF
-						db	"Zenith Z-171",LF
-						db	"Zenith Z-161",LF,LF
+						db	"Zenith Data Systems Z-171",LF
+						db	"Zenith Data Systems Z-161",LF,LF
 						db	"The Boot settings menu option 'Remove other hard drives' has been set to YES for this reason.",NULL
 g_szDlgCfgFullMode:		db	"Enable full operating mode?",NULL
@@ -479,8 +479,8 @@
 								db	" of normal drive detection. Note that if any serial drives are detected during the normal drive detection,"
 								db	" no scan will take place (to avoid finding the same drive twice).",NULL
-g_szHelpClearBdaDriveCount:		db	"Set to NO for normal operation. Set to YES to get Windows 9x protected mode drivers to work when"
-								db	" MODULE_WIN9X_CMOS_HACK is not included (dummy drive needs to be defined in system BIOS setup). This option must"
-								db	" also be set to YES on computers where the system BIOS does not initialize RAM properly. Zenith models Z-171 and"
-								db	" Z-161 are known examples of such machines.",NULL
+g_szHelpClearBdaDriveCount:		db	"Set to NO for normal operation. Set to YES to get the built-in protected mode driver in Windows 9x to work when a"
+								db	" dummy drive has been added in system BIOS setup or when using a BIOS built with MODULE_WIN9X_CMOS_HACK included."
+								db	" This option must also be set to YES on computers where the system BIOS does not initialize RAM properly."
+								db	" Zenith Data Systems models Z-171 and Z-161 are known examples of such machines.",NULL
 
 g_szMultichoiceBootDispMode:	db	"Default",LF
