diff --git a/FullScreenToggle.c b/FullScreenToggle.c deleted file mode 100644 index 80425c70..00000000 --- a/FullScreenToggle.c +++ /dev/null @@ -1,26 +0,0 @@ -#include "library/VCC.h" -#include "library/Audio.h" -#include "library/Graphics.h" -#include "library/PAKInterface.h" -#include "library/DirectDraw.h" - -void FullScreenToggle(WNDPROC WndProc) -{ - VccState* vccState = GetVccState(); - - PauseAudio(true); - - if (!CreateDirectDrawWindow(&(vccState->EmuState), WndProc)) - { - MessageBox(0, "Can't rebuild primary Window", "Error", 0); - - exit(0); - } - - InvalidateBorder(); - RefreshDynamicMenu(&(vccState->EmuState)); - - vccState->EmuState.ConfigDialog = NULL; - - PauseAudio(false); -} diff --git a/FullScreenToggle.h b/FullScreenToggle.h deleted file mode 100644 index 31bfe1c2..00000000 --- a/FullScreenToggle.h +++ /dev/null @@ -1,3 +0,0 @@ -#pragma once - -void FullScreenToggle(WNDPROC); diff --git a/InitBasicWindowInstance.c b/InitBasicWindowInstance.c deleted file mode 100644 index 3f8611a2..00000000 --- a/InitBasicWindowInstance.c +++ /dev/null @@ -1,16 +0,0 @@ -#include "resources/resource.h" - -#include "library/DirectDraw.h" - -BOOL InitInstance(HINSTANCE hInstance, HINSTANCE hResources, int nCmdShow) -{ - DirectDrawState* ddState = GetDirectDrawState(); - - ddState->hInstance = hInstance; - ddState->CmdShow = nCmdShow; - - LoadString(hResources, IDS_APP_TITLE, ddState->TitleBarText, MAX_LOADSTRING); - LoadString(hResources, IDS_APP_TITLE, ddState->AppNameText, MAX_LOADSTRING); - - return TRUE; -} diff --git a/InitBasicWindowInstance.h b/InitBasicWindowInstance.h deleted file mode 100644 index ff729165..00000000 --- a/InitBasicWindowInstance.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once - -#include - -BOOL InitInstance(HINSTANCE, HINSTANCE, int); diff --git a/Vcc.vcxproj b/Vcc.vcxproj index 04d93147..1bf05763 100644 --- a/Vcc.vcxproj +++ b/Vcc.vcxproj @@ -168,8 +168,6 @@ - - @@ -178,8 +176,6 @@ - - diff --git a/library/DirectDraw.c b/library/DirectDraw.c index 411a21c6..7305c0ba 100644 --- a/library/DirectDraw.c +++ b/library/DirectDraw.c @@ -8,6 +8,9 @@ #include "DirectDraw.h" #include "Throttle.h" #include "Config.h" +#include "PAKInterface.h" +#include "VCC.h" +#include "Graphics.h" #include "systemstate.h" @@ -754,4 +757,42 @@ extern "C" { return TRUE; } -} \ No newline at end of file +} + +extern "C" { + __declspec(dllexport) BOOL __cdecl InitInstance(HINSTANCE hInstance, HINSTANCE hResources, int nCmdShow) + { + DirectDrawState* ddState = GetDirectDrawState(); + + ddState->hInstance = hInstance; + ddState->CmdShow = nCmdShow; + + LoadString(hResources, IDS_APP_TITLE, ddState->TitleBarText, MAX_LOADSTRING); + LoadString(hResources, IDS_APP_TITLE, ddState->AppNameText, MAX_LOADSTRING); + + return TRUE; + } +} + +extern "C" { + __declspec(dllexport) void __cdecl FullScreenToggle(WNDPROC WndProc) + { + VccState* vccState = GetVccState(); + + PauseAudio(true); + + if (!CreateDirectDrawWindow(&(vccState->EmuState), WndProc)) + { + MessageBox(0, "Can't rebuild primary Window", "Error", 0); + + exit(0); + } + + InvalidateBorder(); + RefreshDynamicMenu(&(vccState->EmuState)); + + vccState->EmuState.ConfigDialog = NULL; + + PauseAudio(false); + } +} diff --git a/library/DirectDraw.h b/library/DirectDraw.h index 9b5c7999..7f96dcd6 100644 --- a/library/DirectDraw.h +++ b/library/DirectDraw.h @@ -50,3 +50,5 @@ extern "C" __declspec(dllexport) void __cdecl DoCls(SystemState* systemState); extern "C" __declspec(dllexport) float __cdecl Static(SystemState* systemState); extern "C" __declspec(dllexport) bool __cdecl CreateDirectDrawWindow(SystemState* systemState, WNDPROC WndProc); +extern "C" __declspec(dllexport) BOOL __cdecl InitInstance(HINSTANCE hInstance, HINSTANCE hResources, int nCmdShow); +extern "C" __declspec(dllexport) void __cdecl FullScreenToggle(WNDPROC WndProc); diff --git a/main.c b/main.c index 84479402..d2024adb 100644 --- a/main.c +++ b/main.c @@ -20,8 +20,6 @@ #include "library/Callbacks.h" #include "EmuLoop.h" -#include "FullScreenToggle.h" -#include "InitBasicWindowInstance.h" LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);