From 91d8e5e1bd92351fc0b3d4f781d7f59683d5bef1 Mon Sep 17 00:00:00 2001 From: jarmonik Date: Thu, 28 Dec 2023 04:53:19 +0200 Subject: [PATCH 1/4] Changed calling place of clbkInitialise(), can't be called from DllMain() --- Src/Orbiter/Orbiter.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Src/Orbiter/Orbiter.cpp b/Src/Orbiter/Orbiter.cpp index 76766ed6b..c70c8eb4d 100644 --- a/Src/Orbiter/Orbiter.cpp +++ b/Src/Orbiter/Orbiter.cpp @@ -631,6 +631,9 @@ HINSTANCE Orbiter::LoadModule (const char *path, const char *name) } if (hDLL) { + // Can't initialize DirectX in DllMain(), let's do it over here (jarmonik 28.12.2023) + if (register_module == gclient && gclient != NULL) gclient->clbkInitialise(); + DLLModule module = { hDLL, register_module ? register_module : new oapi::Module(hDLL), std::string(name), !register_module }; // If the DLL doesn't provide a Module interface, create a default one which provides the legacy callbacks LOGOUT(register_module ? "Loading module %s" : "Loading module %s (legacy interface)", name); @@ -2874,7 +2877,7 @@ bool Orbiter::AttachGraphicsClient (oapi::GraphicsClient *gc) if (gclient) return false; // another client is already attached register_module = gc; gclient = gc; - gclient->clbkInitialise(); + //gclient->clbkInitialise(); // Cannot initialize with-in DllMain() will result DirectX device failure. return true; } From f344154a3fdbc4f8cc5af8a0d28301478c2f6ae1 Mon Sep 17 00:00:00 2001 From: jarmonik Date: Thu, 28 Dec 2023 16:47:25 +0200 Subject: [PATCH 2/4] Further startup cleanup and error detection. --- OVP/D3D9Client/D3D9Client.cpp | 5 +++-- OVP/D3D9Client/VideoTab.cpp | 29 +++++++++++++++-------------- OVP/D3D9Client/VideoTab.h | 7 +++---- Src/Orbiter/Orbiter.cpp | 17 +++++++++++++++-- 4 files changed, 36 insertions(+), 22 deletions(-) diff --git a/OVP/D3D9Client/D3D9Client.cpp b/OVP/D3D9Client/D3D9Client.cpp index c73c3d587..dbdc78bc9 100644 --- a/OVP/D3D9Client/D3D9Client.cpp +++ b/OVP/D3D9Client/D3D9Client.cpp @@ -195,6 +195,7 @@ DLLCLBK void ExitModule(HINSTANCE hDLL) delete TileCatalog; delete Config; delete g_pConst; + delete g_client; DebugControls::Release(); AtmoControls::Release(); @@ -334,11 +335,11 @@ bool D3D9Client::clbkInitialise() // Perform default setup if (GraphicsClient::clbkInitialise()==false) return false; + //Create the Launchpad video tab interface oapiWriteLog("[D3D9] Initialize VideoTab..."); vtab = new VideoTab(this, ModuleInstance(), OrbiterInstance(), LaunchpadVideoTab()); - oapiWriteLog("[D3D9] VideoTab Created..."); - return true; + return vtab->Initialise(); } diff --git a/OVP/D3D9Client/VideoTab.cpp b/OVP/D3D9Client/VideoTab.cpp index ffb6c0ec8..3fa9e411b 100644 --- a/OVP/D3D9Client/VideoTab.cpp +++ b/OVP/D3D9Client/VideoTab.cpp @@ -47,8 +47,6 @@ VideoTab::VideoTab(D3D9Client *gc, HINSTANCE _hInst, HINSTANCE _hOrbiterInst, HW hTab = hVideoTab; aspect_idx = 0; SelectedAdapterIdx = 0; - - Initialise(); } VideoTab::~VideoTab() @@ -160,7 +158,7 @@ BOOL VideoTab::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) // ============================================================== // Initialise the Launchpad "video" tab -void VideoTab::Initialise() +bool VideoTab::Initialise() { D3DDISPLAYMODE mode, curMode; D3DADAPTER_IDENTIFIER9 info; @@ -181,7 +179,7 @@ void VideoTab::Initialise() if (nAdapter == 0) { LogErr("VideoTab::Initialize() No DirectX9 Adapters Found"); - return; + return false; } if (data->deviceidx < 0 || (data->deviceidx)>=nAdapter) data->deviceidx = 0; @@ -242,13 +240,15 @@ void VideoTab::Initialise() SendDlgItemMessage(hTab, IDC_VID_ENUM, BM_SETCHECK, data->forceenum, 0); SendDlgItemMessage(hTab, IDC_VID_PAGEFLIP, BM_SETCHECK, data->pageflip, 0); // Full scrren Window - SelectAdapter(data->deviceidx); + bool bRet = SelectAdapter(data->deviceidx); SelectFullscreen(data->fullscreen); ShowWindow (GetDlgItem (hTab, IDC_VID_INFO), SW_SHOW); - SetWindowText(GetDlgItem(hTab, IDC_VID_INFO), "Advanced"); + SetWindowText(GetDlgItem(hTab, IDC_VID_INFO), "Advanced"); + + return bRet; } @@ -265,17 +265,17 @@ void VideoTab::SelectMode(DWORD index) // ============================================================== // Respond to user adapter selection // -void VideoTab::SelectAdapter(DWORD index) +bool VideoTab::SelectAdapter(DWORD index) { SelectedAdapterIdx = index; GraphicsClient::VIDEODATA *data = gclient->GetVideoData(); - // Create the Direct3D9 --------------------------------------------- - // - - if (g_pD3DObject == NULL) LogErr("VideoTab::SelectAdapter(%u) Direct3DCreate9 Failed",index); + if (g_pD3DObject == NULL) { + LogErr("VideoTab::SelectAdapter(%u) Direct3DCreate9 Failed", index); + return false; + } else { char cbuf[32]; @@ -283,7 +283,7 @@ void VideoTab::SelectAdapter(DWORD index) if (g_pD3DObject->GetAdapterCount()<=index) { LogErr("Adapter Index out of range"); - return; + return false; } HR(g_pD3DObject->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &curMode)); @@ -293,8 +293,7 @@ void VideoTab::SelectAdapter(DWORD index) DWORD nModes = g_pD3DObject->GetAdapterModeCount(index, D3DFMT_X8R8G8B8); if (nModes == 0) { - LogErr("VideoTab::SelectAdapter() No Display Modes Available"); - return; + LogErr("VideoTab::SelectAdapter() No Display Modes Available"); } for (DWORD k=0;kmodeidx&0xFF, 0); } + + return true; } diff --git a/OVP/D3D9Client/VideoTab.h b/OVP/D3D9Client/VideoTab.h index 5e4a9d43c..4ef007625 100644 --- a/OVP/D3D9Client/VideoTab.h +++ b/OVP/D3D9Client/VideoTab.h @@ -25,14 +25,13 @@ class VideoTab { void UpdateConfigData(); // copy dialog state back to parameter structure -protected: - - void Initialise(); + bool Initialise(); // Initialise dialog elements +protected: void SelectFullscreen(bool); void SelectMode(DWORD index); - void SelectAdapter(DWORD index); + bool SelectAdapter(DWORD index); // Update dialog after user device selection void SelectWidth(); diff --git a/Src/Orbiter/Orbiter.cpp b/Src/Orbiter/Orbiter.cpp index c70c8eb4d..ee13cf477 100644 --- a/Src/Orbiter/Orbiter.cpp +++ b/Src/Orbiter/Orbiter.cpp @@ -630,10 +630,23 @@ HINSTANCE Orbiter::LoadModule (const char *path, const char *name) } } +#ifndef INLINEGRAPHICS + // Can't initialize DirectX in DllMain(), let's do it over here (jarmonik 28.12.2023) if (hDLL) { - // Can't initialize DirectX in DllMain(), let's do it over here (jarmonik 28.12.2023) - if (register_module == gclient && gclient != NULL) gclient->clbkInitialise(); + if (register_module == gclient && gclient != NULL) { + if (gclient->clbkInitialise() == false) { + // If graphics initialization fails remove client + RemoveGraphicsClient(gclient); + FreeLibrary(hDLL); + LOGOUT_ERR("Client Initialization Failed. Unloading %s", name); + hDLL = NULL; + return NULL; + } + } + } +#endif + if (hDLL) { DLLModule module = { hDLL, register_module ? register_module : new oapi::Module(hDLL), std::string(name), !register_module }; // If the DLL doesn't provide a Module interface, create a default one which provides the legacy callbacks LOGOUT(register_module ? "Loading module %s" : "Loading module %s (legacy interface)", name); From eb8e1c04219444d24c45ed59ba9de4d2f58c58ed Mon Sep 17 00:00:00 2001 From: jarmonik Date: Tue, 9 Jan 2024 11:10:05 +0200 Subject: [PATCH 3/4] Cleaned up video configuration, added message box for failed device creation. --- OVP/D3D9Client/D3D9Client.cpp | 9 +++++---- OVP/D3D9Client/D3D9Frame.cpp | 4 ++-- OVP/D3D9Client/Log.cpp | 9 +++++++++ OVP/D3D9Client/Log.h | 1 + OVP/D3D9Client/VideoTab.cpp | 17 ++++++++++------- OVP/D3D9Client/VideoTab.h | 1 - Orbitersdk/include/GraphicsAPI.h | 10 ++++++---- Src/Orbiter/Config.cpp | 7 +++++++ Src/Orbiter/Config.h | 2 ++ Src/Orbiter/GraphicsAPI.cpp | 4 ++++ Src/Orbiter/TabVideo.cpp | 4 ++++ 11 files changed, 50 insertions(+), 18 deletions(-) diff --git a/OVP/D3D9Client/D3D9Client.cpp b/OVP/D3D9Client/D3D9Client.cpp index dbdc78bc9..4a459431f 100644 --- a/OVP/D3D9Client/D3D9Client.cpp +++ b/OVP/D3D9Client/D3D9Client.cpp @@ -195,16 +195,16 @@ DLLCLBK void ExitModule(HINSTANCE hDLL) delete TileCatalog; delete Config; delete g_pConst; - delete g_client; - - DebugControls::Release(); - AtmoControls::Release(); if (g_client) { oapiUnregisterGraphicsClient(g_client); + delete g_client; g_client = 0; } + DebugControls::Release(); + AtmoControls::Release(); + #ifdef _NVAPI_H if (bNVAPI) if (NvAPI_Unload()==NVAPI_OK) LogAlw("[nVidia API Unloaded]"); #endif @@ -330,6 +330,7 @@ bool D3D9Client::clbkInitialise() } else { oapiWriteLog("[D3D9][ERROR] Failed to create DirectX9"); + FailedDeviceError(); return false; } diff --git a/OVP/D3D9Client/D3D9Frame.cpp b/OVP/D3D9Client/D3D9Frame.cpp index d61333fb8..d31bc5a83 100644 --- a/OVP/D3D9Client/D3D9Frame.cpp +++ b/OVP/D3D9Client/D3D9Frame.cpp @@ -156,10 +156,10 @@ HRESULT CD3DFramework9::Initialize(HWND _hWnd, GraphicsClient::VIDEODATA *vData) bAAEnabled = (Config->SceneAntialias != 0); bIsFullscreen = vData->fullscreen; bNoVSync = vData->novsync; - dwFSMode = (vData->modeidx>>8)&0xFF; + dwFSMode = vData->style; bGDIBB = vData->trystencil; Adapter = vData->deviceidx; - Mode = vData->modeidx&0xFF; + Mode = vData->modeidx; LogAlw("[VideoConfiguration] Adapter=%u, ModeIndex=%u", Adapter, Mode); diff --git a/OVP/D3D9Client/Log.cpp b/OVP/D3D9Client/Log.cpp index ac8e1152b..2a8a9f86d 100644 --- a/OVP/D3D9Client/Log.cpp +++ b/OVP/D3D9Client/Log.cpp @@ -59,6 +59,15 @@ void MissingRuntimeError() "D3D9Client Initialization Failed", MB_OK); } +//------------------------------------------------------------------------------------------- +// +void FailedDeviceError() +{ + MessageBoxA(NULL, + "DirectX9 Device Failed. Try to enable EnableDX12Wrapper from D3D9Client.cfg", + "D3D9Client Initialization Failed", MB_OK); +} + //------------------------------------------------------------------------------------------- // void RuntimeError(const char* File, const char* Fnc, UINT Line) diff --git a/OVP/D3D9Client/Log.h b/OVP/D3D9Client/Log.h index ad115f36d..9b8b325fd 100644 --- a/OVP/D3D9Client/Log.h +++ b/OVP/D3D9Client/Log.h @@ -64,6 +64,7 @@ double D3D9GetTime(); void D3D9SetTime(D3D9Time &inout, double ref); void MissingRuntimeError(); +void FailedDeviceError(); void LogAttribs(DWORD attrib, DWORD w, DWORD h, LPCSTR origin); #define HALT() { RuntimeError(__FILE__,__FUNCTION__,__LINE__); } diff --git a/OVP/D3D9Client/VideoTab.cpp b/OVP/D3D9Client/VideoTab.cpp index 3fa9e411b..265dc2dcc 100644 --- a/OVP/D3D9Client/VideoTab.cpp +++ b/OVP/D3D9Client/VideoTab.cpp @@ -169,7 +169,7 @@ bool VideoTab::Initialise() data->trystencil = false; SendDlgItemMessage(hTab, IDC_VID_DEVICE, CB_RESETCONTENT, 0, 0); - SendDlgItemMessageA(hTab, IDC_VID_MODE, CB_RESETCONTENT, 0, 0); + SendDlgItemMessage(hTab, IDC_VID_MODE, CB_RESETCONTENT, 0, 0); SendDlgItemMessage(hTab, IDC_VID_BPP, CB_RESETCONTENT, 0, 0); ScanAtmoCfgs(); @@ -179,6 +179,7 @@ bool VideoTab::Initialise() if (nAdapter == 0) { LogErr("VideoTab::Initialize() No DirectX9 Adapters Found"); + FailedDeviceError(); return false; } @@ -201,6 +202,7 @@ bool VideoTab::Initialise() if (nModes == 0) { LogErr("VideoTab::Initialize() No Display Modes Available"); + FailedDeviceError(); } for (UINT k=0;kmodeidx>>8)&0xFF, 0); + SendDlgItemMessageA(hTab, IDC_VID_BPP, CB_SETCURSEL, data->style, 0); //SetWindowText(GetDlgItem(hTab, IDC_VID_STATIC5), "Resolution"); SetWindowText(GetDlgItem(hTab, IDC_VID_STATIC6), "Full Screen Mode"); - SendDlgItemMessage(hTab, IDC_VID_MODE, CB_SETCURSEL, data->modeidx&0xFF, 0); + SendDlgItemMessage(hTab, IDC_VID_MODE, CB_SETCURSEL, data->modeidx, 0); SendDlgItemMessage(hTab, IDC_VID_VSYNC, BM_SETCHECK, data->novsync ? BST_CHECKED : BST_UNCHECKED, 0); SetWindowText(GetDlgItem(hTab, IDC_VID_WIDTH), std::to_string(data->winw).c_str()); @@ -258,7 +260,7 @@ void VideoTab::SelectMode(DWORD index) { GraphicsClient::VIDEODATA *data = gclient->GetVideoData(); SendDlgItemMessage(hTab, IDC_VID_MODE, CB_GETITEMDATA, index, 0); - data->modeidx = index + data->modeidx&0xFF00; + data->modeidx = index; } @@ -303,7 +305,7 @@ bool VideoTab::SelectAdapter(DWORD index) SendDlgItemMessageA(hTab, IDC_VID_MODE, CB_SETITEMDATA, k, (LPARAM)(mode.Height<<16 | mode.Width)); } - SendDlgItemMessage(hTab, IDC_VID_MODE, CB_SETCURSEL, data->modeidx&0xFF, 0); + SendDlgItemMessage(hTab, IDC_VID_MODE, CB_SETCURSEL, data->modeidx, 0); } return true; @@ -395,8 +397,9 @@ void VideoTab::UpdateConfigData() GraphicsClient::VIDEODATA *data = gclient->GetVideoData(); // device parameters - data->deviceidx = (int)SendDlgItemMessageA(hTab, IDC_VID_DEVICE, CB_GETCURSEL, 0, 0); - data->modeidx = (int)SendDlgItemMessage(hTab, IDC_VID_MODE, CB_GETCURSEL, 0, 0) + ((int)SendDlgItemMessageA(hTab, IDC_VID_BPP, CB_GETCURSEL, 0, 0)<<8); + data->deviceidx = (int)SendDlgItemMessage (hTab, IDC_VID_DEVICE, CB_GETCURSEL, 0, 0); + data->modeidx = (int)SendDlgItemMessage (hTab, IDC_VID_MODE, CB_GETCURSEL, 0, 0); + data->style = SendDlgItemMessage (hTab, IDC_VID_BPP, CB_GETCURSEL, 0, 0); data->fullscreen = (SendDlgItemMessage (hTab, IDC_VID_FULL, BM_GETCHECK, 0, 0) == BST_CHECKED); data->novsync = (SendDlgItemMessage (hTab, IDC_VID_VSYNC, BM_GETCHECK, 0, 0) == BST_CHECKED); data->pageflip = (SendDlgItemMessage (hTab, IDC_VID_PAGEFLIP, BM_GETCHECK, 0, 0) == BST_CHECKED); diff --git a/OVP/D3D9Client/VideoTab.h b/OVP/D3D9Client/VideoTab.h index 4ef007625..db101440b 100644 --- a/OVP/D3D9Client/VideoTab.h +++ b/OVP/D3D9Client/VideoTab.h @@ -51,7 +51,6 @@ class VideoTab { void SaveSetupState(HWND hWnd); void ScanAtmoCfgs(); bool GetConfigName(const char* file, string& cfg, string& planet); - void LoadAtmoCfg(); oapi::D3D9Client *gclient; HINSTANCE hOrbiterInst; // orbiter instance handle diff --git a/Orbitersdk/include/GraphicsAPI.h b/Orbitersdk/include/GraphicsAPI.h index cbe6bcad3..114436b34 100644 --- a/Orbitersdk/include/GraphicsAPI.h +++ b/Orbitersdk/include/GraphicsAPI.h @@ -836,10 +836,12 @@ class OAPIFUNC GraphicsClient: public Module { bool trystencil; ///< stencil buffer flag bool novsync; ///< no vsync flag bool pageflip; ///< allow page flipping in fullscreen - int deviceidx; ///< video device index - int modeidx; ///< video mode index - int winw; ///< window width - int winh; ///< window height + int deviceidx; ///< video device (adapter) index + int modeidx; ///< video mode index (fullscreen resolution) + int winw; ///< window/screen width + int winh; ///< window/screen height + int outputidx; ///< video output + int style; ///< true fullscreen, fulscreen window, window with taskbar }; /** diff --git a/Src/Orbiter/Config.cpp b/Src/Orbiter/Config.cpp index a9218226d..c03b7312d 100644 --- a/Src/Orbiter/Config.cpp +++ b/Src/Orbiter/Config.cpp @@ -180,6 +180,8 @@ CFG_RECPLAYPRM CfgRecPlayPrm_default = { CFG_DEVPRM CfgDevPrm_default = { -1, // Device_idx (-1=undefined) 0, // Device_mode + 0, + 0, true, // bForceEnum (enumerate devices at each simulation start) false, // bFullscreen (default to window mode) false, // bStereo (no stereo support) @@ -515,6 +517,8 @@ bool Config::Load(const char *fname) // Device information GetInt (ifs, "DeviceIndex", CfgDevPrm.Device_idx); if (GetInt (ifs, "ModeIndex", i)) CfgDevPrm.Device_mode = (DWORD)i; + if (GetInt(ifs, "OutputIndex", i)) CfgDevPrm.Device_out = (DWORD)i; + if (GetInt(ifs, "Style", i)) CfgDevPrm.Device_style = (DWORD)i; GetBool (ifs, "DeviceForceEnum", CfgDevPrm.bForceEnum); GetBool (ifs, "Fullscreen", CfgDevPrm.bFullscreen); GetBool (ifs, "Stereo", CfgDevPrm.bStereo); @@ -1219,6 +1223,9 @@ BOOL Config::Write (const char *fname) const ofs << "\n; === Device settings ===\n"; ofs << "DeviceIndex = " << CfgDevPrm.Device_idx << '\n'; ofs << "ModeIndex = " << CfgDevPrm.Device_mode << '\n'; + ofs << "OutputIndex" << CfgDevPrm.Device_out << '\n'; + ofs << "Style" << CfgDevPrm.Device_style << '\n'; + if (CfgDevPrm.bForceEnum != CfgDevPrm_default.bForceEnum || bEchoAll) ofs << "DeviceForceEnum = " << BoolStr (CfgDevPrm.bForceEnum) << '\n'; if (CfgDevPrm.bFullscreen != CfgDevPrm_default.bFullscreen || bEchoAll) diff --git a/Src/Orbiter/Config.h b/Src/Orbiter/Config.h index bc1a2f22c..2796610f5 100644 --- a/Src/Orbiter/Config.h +++ b/Src/Orbiter/Config.h @@ -205,6 +205,8 @@ struct CFG_RECPLAYPRM { struct CFG_DEVPRM { int Device_idx; // index of default device DWORD Device_mode; // index of default fullscreen mode + DWORD Device_out; // device output + DWORD Device_style; // Rendering layout bool bForceEnum; // force enumeration, bypass device.dat bool bFullscreen; // use window mode bool bStereo; // use stereo mode diff --git a/Src/Orbiter/GraphicsAPI.cpp b/Src/Orbiter/GraphicsAPI.cpp index 8fd818197..f9a6d9921 100644 --- a/Src/Orbiter/GraphicsAPI.cpp +++ b/Src/Orbiter/GraphicsAPI.cpp @@ -48,6 +48,8 @@ GraphicsClient::GraphicsClient (HINSTANCE hInstance): Module (hInstance) VideoData.pageflip = true; VideoData.deviceidx = -1; VideoData.modeidx = 0; + VideoData.outputidx = 0; + VideoData.style = 1; VideoData.winw = 1024; VideoData.winh = 768; surfBltTgt = RENDERTGT_NONE; @@ -98,6 +100,8 @@ bool GraphicsClient::clbkInitialise () VideoData.novsync = cfg->CfgDevPrm.bNoVsync; VideoData.pageflip = cfg->CfgDevPrm.bPageflip; VideoData.deviceidx = cfg->CfgDevPrm.Device_idx; + VideoData.outputidx = cfg->CfgDevPrm.Device_out; + VideoData.style = cfg->CfgDevPrm.Device_style; VideoData.modeidx = (int)cfg->CfgDevPrm.Device_mode; VideoData.winw = (int)cfg->CfgDevPrm.WinW; VideoData.winh = (int)cfg->CfgDevPrm.WinH; diff --git a/Src/Orbiter/TabVideo.cpp b/Src/Orbiter/TabVideo.cpp index b6e6acbd6..3e56f8b9d 100644 --- a/Src/Orbiter/TabVideo.cpp +++ b/Src/Orbiter/TabVideo.cpp @@ -127,6 +127,8 @@ void orbiter::DefVideoTab::SetConfig (Config *cfg) cfg->CfgDevPrm.WinH = data->winh; cfg->CfgDevPrm.Device_idx = data->deviceidx; cfg->CfgDevPrm.Device_mode = data->modeidx; + cfg->CfgDevPrm.Device_out = data->outputidx; + cfg->CfgDevPrm.Device_style= data->style; } else { // should not be required cfg->CfgDevPrm.bFullscreen = false; @@ -138,6 +140,8 @@ void orbiter::DefVideoTab::SetConfig (Config *cfg) cfg->CfgDevPrm.WinH = 300; cfg->CfgDevPrm.Device_idx = 0; cfg->CfgDevPrm.Device_mode = 0; + cfg->CfgDevPrm.Device_out = 0; + cfg->CfgDevPrm.Device_style= 1; } cfg->CfgDevPrm.bStereo = false; // not currently set } From 1d922a84bbb3b9ae2286b673c5a6590fb0bac2c3 Mon Sep 17 00:00:00 2001 From: jarmonik Date: Tue, 9 Jan 2024 11:51:00 +0200 Subject: [PATCH 4/4] Fixed config file write error --- Src/Orbiter/Config.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/Orbiter/Config.cpp b/Src/Orbiter/Config.cpp index c03b7312d..e0f243ac2 100644 --- a/Src/Orbiter/Config.cpp +++ b/Src/Orbiter/Config.cpp @@ -1223,8 +1223,8 @@ BOOL Config::Write (const char *fname) const ofs << "\n; === Device settings ===\n"; ofs << "DeviceIndex = " << CfgDevPrm.Device_idx << '\n'; ofs << "ModeIndex = " << CfgDevPrm.Device_mode << '\n'; - ofs << "OutputIndex" << CfgDevPrm.Device_out << '\n'; - ofs << "Style" << CfgDevPrm.Device_style << '\n'; + ofs << "OutputIndex = " << CfgDevPrm.Device_out << '\n'; + ofs << "Style = " << CfgDevPrm.Device_style << '\n'; if (CfgDevPrm.bForceEnum != CfgDevPrm_default.bForceEnum || bEchoAll) ofs << "DeviceForceEnum = " << BoolStr (CfgDevPrm.bForceEnum) << '\n';