// Called by:
// . LoadConfiguration() - Done at each restart
// . DiskDlg_OK() - When HD is enabled/disabled on UI
void HD_SetEnabled(const bool bEnabled)
{
	if(g_bHD_Enabled == false && bEnabled == false) return;
	if(g_bHD_Enabled == true  && bEnabled == true) return;
	if(g_bHD_Enabled == true  && bEnabled == false) {
	g_bHD_Enabled = false; 
	return;
	}

	if(g_bHD_Enabled == false && bEnabled == true) {
		
		
		g_bHD_Enabled = bEnabled;

		SLOT7_SetType(SL7_HDD);

		// FIXME: For LoadConfiguration(), g_uSlot=7 (see definition at start of file)
		// . g_uSlot is only really setup by HD_Load_Rom(), later on
		RegisterIoHandler(g_uSlot, HD_IO_EMUL, HD_IO_EMUL, NULL, NULL, NULL, NULL);

		LPBYTE pCxRomPeripheral = MemGetCxRomPeripheral();
		if(pCxRomPeripheral == NULL)	// This will be NULL when called after loading value from Registry
			return;

	//

		if(g_bHD_Enabled)
			HD_Load_Rom(pCxRomPeripheral, g_uSlot);
		else
			memset(pCxRomPeripheral + g_uSlot*256, 0, HD_SLOT_FW_SIZE);
	}
}
void CMouseInterface::SetSlotRom()
{
	LPBYTE pCxRomPeripheral = MemGetCxRomPeripheral();
	if (pCxRomPeripheral == NULL)
		return;

	UINT uOffset = (m_by6821B << 7) & 0x0700;
	memcpy(pCxRomPeripheral+m_uSlot*256, m_pSlotRom+uOffset, 256);
	if (mem)
		memcpy(mem+0xC000+m_uSlot*256, m_pSlotRom+uOffset, 256);
}
void HD_SetEnabled(bool bEnabled)
{
	if(g_bHD_Enabled == bEnabled)
		return;

	g_bHD_Enabled = bEnabled;

	LPBYTE pCxRomPeripheral = MemGetCxRomPeripheral();
	if(pCxRomPeripheral == NULL)	// This will be NULL when called after loading value from Registry
		return;

	if(g_bHD_Enabled)
		HD_Load_Rom(pCxRomPeripheral, g_uSlot);
	else
		memset(pCxRomPeripheral + g_uSlot*256, 0, HDDRVR_SIZE);

	RegisterIoHandler(g_uSlot, HD_IO_EMUL, HD_IO_EMUL, NULL, NULL, NULL, NULL);
}