Loader : Deduplicate code via new CreateSettings()
This commit is contained in:
parent
254e666bfe
commit
f283dff3b6
|
@ -369,11 +369,11 @@ file (GLOB CXBXR_SOURCE_EMU
|
|||
|
||||
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/projects/cxbx")
|
||||
|
||||
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/projects/CxbxLoader")
|
||||
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/projects/cxbxr-ldr")
|
||||
|
||||
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/projects/CxbxEmulator")
|
||||
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/projects/cxbxr-emu")
|
||||
|
||||
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/projects/CxbxGUI")
|
||||
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/projects/cxbxr")
|
||||
|
||||
# Issues with compile (the same with develop branch) and
|
||||
# for some reason did not put the files into virtual folder?
|
||||
|
@ -404,6 +404,6 @@ if(${CMAKE_GENERATOR} MATCHES "Visual Studio ([^9]|[9][0-9])")
|
|||
endif()
|
||||
|
||||
# Cxbx-Reloaded project with third-party libraries
|
||||
set_target_properties(cxbx CxbxGUI CxbxLoader CxbxEmulator subhook XbSymbolDatabase libtommath libtomcrypt
|
||||
set_target_properties(cxbx cxbxr cxbxr-ldr cxbxr-emu subhook XbSymbolDatabase libtommath libtomcrypt
|
||||
PROPERTIES FOLDER Cxbx-Reloaded
|
||||
)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
cmake_minimum_required (VERSION 3.12)
|
||||
project(CxbxEmulator)
|
||||
project(cxbxr-emu)
|
||||
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
@ -61,7 +61,7 @@ endif()
|
|||
|
||||
add_compile_definitions(
|
||||
NOMINMAX
|
||||
CXBXEMULATOR_EXPORTS
|
||||
CXBXR_EMU_EXPORTS
|
||||
)
|
||||
|
||||
file (GLOB RESOURCES
|
||||
|
@ -81,27 +81,27 @@ source_group(TREE ${CXBXR_ROOT_DIR}/src PREFIX source FILES
|
|||
${CXBXR_SOURCE_GUIv1}
|
||||
${CXBXR_SOURCE_COMMON}
|
||||
${CXBXR_SOURCE_EMU}
|
||||
"${CXBXR_ROOT_DIR}/src/emulator/CxbxEmulator.cpp"
|
||||
"${CXBXR_ROOT_DIR}/src/emulator/cxbxr-emu.cpp"
|
||||
"${CXBXR_ROOT_DIR}/src/emulator/dllmain.cpp"
|
||||
)
|
||||
|
||||
source_group(TREE ${CXBXR_ROOT_DIR} FILES ${RESOURCES})
|
||||
|
||||
add_library(CxbxEmulator SHARED ${RESOURCES}
|
||||
add_library(cxbxr-emu SHARED ${RESOURCES}
|
||||
${CXBXR_HEADER_COMMON}
|
||||
${CXBXR_HEADER_EMU}
|
||||
"${CXBXR_ROOT_DIR}/src/emulator/targetver.h"
|
||||
${CXBXR_SOURCE_COMMON}
|
||||
${CXBXR_SOURCE_EMU}
|
||||
${CXBXR_GIT_VERSION_H}
|
||||
"${CXBXR_ROOT_DIR}/src/emulator/CxbxEmulator.cpp"
|
||||
"${CXBXR_ROOT_DIR}/src/emulator/cxbxr-emu.cpp"
|
||||
"${CXBXR_ROOT_DIR}/src/emulator/dllmain.cpp"
|
||||
)
|
||||
|
||||
# Link and compile flags
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||
|
||||
set_target_properties(CxbxEmulator PROPERTIES
|
||||
set_target_properties(cxbxr-emu PROPERTIES
|
||||
LINK_FLAGS "
|
||||
/INCREMENTAL:NO
|
||||
/LARGEADDRESSAWARE
|
||||
|
@ -154,7 +154,7 @@ set(WINS_LIB
|
|||
wpcap
|
||||
)
|
||||
|
||||
target_link_libraries(CxbxEmulator
|
||||
target_link_libraries(cxbxr-emu
|
||||
PUBLIC XbSymbolDatabase
|
||||
subhook
|
||||
libtomcrypt
|
||||
|
@ -163,11 +163,11 @@ target_link_libraries(CxbxEmulator
|
|||
${WINS_LIB}
|
||||
)
|
||||
|
||||
add_dependencies(CxbxEmulator CxbxLoader)
|
||||
add_dependencies(cxbxr-emu cxbxr-ldr)
|
||||
|
||||
set(CXBXR_GLEW_DLL "${CXBXR_ROOT_DIR}/import/glew-2.0.0/bin/Release/Win32/glew32.dll")
|
||||
|
||||
# Copy glew32.dll to build type's folder after build.
|
||||
add_custom_command(TARGET CxbxEmulator POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CXBXR_GLEW_DLL} $<TARGET_FILE_DIR:CxbxEmulator>
|
||||
add_custom_command(TARGET cxbxr-emu POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${CXBXR_GLEW_DLL} $<TARGET_FILE_DIR:cxbxr-emu>
|
||||
)
|
|
@ -1,5 +1,5 @@
|
|||
cmake_minimum_required (VERSION 3.12)
|
||||
project(CxbxLoader)
|
||||
project(cxbxr-ldr)
|
||||
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
@ -30,19 +30,19 @@ file (GLOB HEADERS
|
|||
file (GLOB SOURCES
|
||||
"${CXBXR_ROOT_DIR}/src/common/AddressRanges.cpp"
|
||||
"${CXBXR_ROOT_DIR}/src/common/ReserveAddressRanges.cpp"
|
||||
"${CXBXR_ROOT_DIR}/src/loader/loader.cpp"
|
||||
"${CXBXR_ROOT_DIR}/src/loader/cxbxr-ldr.cpp"
|
||||
)
|
||||
|
||||
source_group(TREE ${CXBXR_ROOT_DIR}/src PREFIX header FILES ${HEADERS})
|
||||
|
||||
source_group(TREE ${CXBXR_ROOT_DIR}/src PREFIX source FILES ${SOURCES})
|
||||
|
||||
add_executable(CxbxLoader ${HEADERS} ${SOURCES})
|
||||
add_executable(cxbxr-ldr ${HEADERS} ${SOURCES})
|
||||
|
||||
# Link and compile flags
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||
|
||||
set_target_properties(CxbxLoader PROPERTIES
|
||||
set_target_properties(cxbxr-ldr PROPERTIES
|
||||
LINK_FLAGS "
|
||||
/LARGEADDRESSAWARE
|
||||
/FIXED
|
||||
|
@ -61,6 +61,6 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
|||
)
|
||||
endif()
|
||||
|
||||
target_link_libraries(CxbxLoader
|
||||
target_link_libraries(cxbxr-ldr
|
||||
PUBLIC kernel32.lib
|
||||
)
|
|
@ -1,5 +1,5 @@
|
|||
cmake_minimum_required (VERSION 3.12)
|
||||
project(CxbxGUI)
|
||||
project(cxbxr)
|
||||
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
@ -56,7 +56,7 @@ file (GLOB RESOURCES
|
|||
"${CXBXR_ROOT_DIR}/COPYING"
|
||||
"${CXBXR_ROOT_DIR}/README.md"
|
||||
"${CXBXR_ROOT_DIR}/src/gui/resource/.editorconfig"
|
||||
"${CXBXR_ROOT_DIR}/src/gui/resource/CxbxGUI.rc"
|
||||
"${CXBXR_ROOT_DIR}/src/gui/resource/cxbxr.rc"
|
||||
"${CXBXR_ROOT_DIR}/src/gui/resource/Cxbx-R.ico"
|
||||
"${CXBXR_ROOT_DIR}/src/gui/resource/resource.h"
|
||||
"${CXBXR_ROOT_DIR}/src/gui/resource/stdafx.h"
|
||||
|
@ -69,33 +69,33 @@ file (GLOB RESOURCES
|
|||
source_group(TREE ${CXBXR_ROOT_DIR}/src PREFIX header FILES
|
||||
${CXBXR_HEADER_GUIv1}
|
||||
${CXBXR_HEADER_COMMON}
|
||||
"${CXBXR_ROOT_DIR}/src/gui/CxbxGUI.h"
|
||||
"${CXBXR_ROOT_DIR}/src/gui/cxbxr.h"
|
||||
)
|
||||
|
||||
source_group(TREE ${CXBXR_ROOT_DIR}/src PREFIX source FILES
|
||||
${CXBXR_SOURCE_GUIv1}
|
||||
${CXBXR_SOURCE_COMMON}
|
||||
"${CXBXR_ROOT_DIR}/src/gui/CxbxGUI.cpp"
|
||||
"${CXBXR_ROOT_DIR}/src/gui/cxbxr.cpp"
|
||||
"${CXBXR_ROOT_DIR}/src/gui/stdafx.cpp"
|
||||
)
|
||||
|
||||
source_group(TREE ${CXBXR_ROOT_DIR} FILES ${RESOURCES})
|
||||
|
||||
add_executable(CxbxGUI WIN32 ${RESOURCES}
|
||||
add_executable(cxbxr WIN32 ${RESOURCES}
|
||||
# ${CXBXR_HEADER_GUIv1}
|
||||
# ${CXBXR_HEADER_COMMON}
|
||||
# ${CXBXR_SOURCE_GUIv1}
|
||||
# ${CXBXR_SOURCE_COMMON}
|
||||
${CXBXR_GIT_VERSION_H}
|
||||
"${CXBXR_ROOT_DIR}/src/gui/CxbxGUI.h"
|
||||
"${CXBXR_ROOT_DIR}/src/gui/CxbxGUI.cpp"
|
||||
"${CXBXR_ROOT_DIR}/src/gui/cxbxr.h"
|
||||
"${CXBXR_ROOT_DIR}/src/gui/cxbxr.cpp"
|
||||
"${CXBXR_ROOT_DIR}/src/gui/stdafx.cpp"
|
||||
)
|
||||
|
||||
# Link and compile flags
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||
|
||||
set_target_properties(CxbxGUI PROPERTIES
|
||||
set_target_properties(cxbxr PROPERTIES
|
||||
LINK_FLAGS "
|
||||
/INCREMENTAL:NO
|
||||
/LARGEADDRESSAWARE
|
||||
|
@ -142,11 +142,11 @@ set(WINS_LIB
|
|||
XINPUT9_1_0
|
||||
)
|
||||
|
||||
target_link_libraries(CxbxGUI
|
||||
target_link_libraries(cxbxr
|
||||
PUBLIC XbSymbolDatabase
|
||||
libtomcrypt
|
||||
|
||||
${WINS_LIB}
|
||||
)
|
||||
|
||||
add_dependencies(CxbxGUI CxbxEmulator cxbxr-debugger)
|
||||
add_dependencies(cxbxr cxbxr-emu cxbxr-debugger)
|
|
@ -2,18 +2,9 @@
|
|||
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
// ******************************************************************
|
||||
// *
|
||||
// * .,-::::: .,:: .::::::::. .,:: .:
|
||||
// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;;
|
||||
// * [[[ '[[,,[[' [[[__[[\. '[[,,[['
|
||||
// * $$$ Y$$$P $$""""Y$$ Y$$$P
|
||||
// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo,
|
||||
// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm,
|
||||
// * This file is part of Cxbx-Reloaded.
|
||||
// *
|
||||
// * Common->AddressRanges.cpp
|
||||
// *
|
||||
// * This file is part of the Cxbx project.
|
||||
// *
|
||||
// * Cxbx is free software; you can redistribute it
|
||||
// * Cxbx-Reloaded 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.
|
||||
|
|
|
@ -2,18 +2,9 @@
|
|||
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
// ******************************************************************
|
||||
// *
|
||||
// * .,-::::: .,:: .::::::::. .,:: .:
|
||||
// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;;
|
||||
// * [[[ '[[,,[[' [[[__[[\. '[[,,[['
|
||||
// * $$$ Y$$$P $$""""Y$$ Y$$$P
|
||||
// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo,
|
||||
// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm,
|
||||
// * This file is part of Cxbx-Reloaded.
|
||||
// *
|
||||
// * Common->AddressRanges.h
|
||||
// *
|
||||
// * This file is part of the Cxbx project.
|
||||
// *
|
||||
// * Cxbx is free software; you can redistribute it
|
||||
// * Cxbx-Reloaded 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.
|
||||
|
@ -35,10 +26,10 @@
|
|||
// ******************************************************************
|
||||
#pragma once
|
||||
|
||||
#ifndef CXBXEMULATOR_EXPORTS // Only trim Windows symbols CxbxLoader, not in CxbxEmulator
|
||||
#ifndef CXBXR_EMU_EXPORTS // Only trim Windows symbols CxbxLoader, not in cxbxr-emu
|
||||
#include <SDKDDKVer.h>
|
||||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
|
||||
#endif // CXBXEMULATOR_EXPORTS
|
||||
#endif // CXBXR_EMU_EXPORTS
|
||||
|
||||
#undef FIELD_OFFSET // prevent macro redefinition warnings
|
||||
#include <windows.h> // For DWORD, CALLBACK, VirtualAlloc, LPVOID, SIZE_T, HMODULE
|
||||
|
|
|
@ -2,18 +2,9 @@
|
|||
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
// ******************************************************************
|
||||
// *
|
||||
// * .,-::::: .,:: .::::::::. .,:: .:
|
||||
// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;;
|
||||
// * [[[ '[[,,[[' [[[__[[\. '[[,,[['
|
||||
// * $$$ Y$$$P $$""""Y$$ Y$$$P
|
||||
// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo,
|
||||
// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm,
|
||||
// * This file is part of Cxbx-Reloaded.
|
||||
// *
|
||||
// * Common->ReserveAddressRanges.cpp
|
||||
// *
|
||||
// * This file is part of the Cxbx project.
|
||||
// *
|
||||
// * Cxbx is free software; you can redistribute it
|
||||
// * Cxbx-Reloaded 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.
|
||||
|
|
|
@ -2,18 +2,9 @@
|
|||
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
// ******************************************************************
|
||||
// *
|
||||
// * .,-::::: .,:: .::::::::. .,:: .:
|
||||
// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;;
|
||||
// * [[[ '[[,,[[' [[[__[[\. '[[,,[['
|
||||
// * $$$ Y$$$P $$""""Y$$ Y$$$P
|
||||
// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo,
|
||||
// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm,
|
||||
// * This file is part of Cxbx-Reloaded.
|
||||
// *
|
||||
// * Common->ReserveAddressRanges.h
|
||||
// *
|
||||
// * This file is part of the Cxbx project.
|
||||
// *
|
||||
// * Cxbx is free software; you can redistribute it
|
||||
// * Cxbx-Reloaded 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.
|
||||
|
|
|
@ -2,18 +2,9 @@
|
|||
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
// ******************************************************************
|
||||
// *
|
||||
// * .,-::::: .,:: .::::::::. .,:: .:
|
||||
// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;;
|
||||
// * [[[ '[[,,[[' [[[__[[\. '[[,,[['
|
||||
// * $$$ Y$$$P $$""""Y$$ Y$$$P
|
||||
// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo,
|
||||
// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm,
|
||||
// * This file is part of Cxbx-Reloaded.
|
||||
// *
|
||||
// * Common->VerifyAddressRanges.cpp
|
||||
// *
|
||||
// * This file is part of the Cxbx project.
|
||||
// *
|
||||
// * Cxbx is free software; you can redistribute it
|
||||
// * Cxbx-Reloaded 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.
|
||||
|
|
|
@ -2,18 +2,9 @@
|
|||
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
// ******************************************************************
|
||||
// *
|
||||
// * .,-::::: .,:: .::::::::. .,:: .:
|
||||
// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;;
|
||||
// * [[[ '[[,,[[' [[[__[[\. '[[,,[['
|
||||
// * $$$ Y$$$P $$""""Y$$ Y$$$P
|
||||
// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo,
|
||||
// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm,
|
||||
// * This file is part of Cxbx-Reloaded.
|
||||
// *
|
||||
// * Common->VerifyAddressRanges.h
|
||||
// *
|
||||
// * This file is part of the Cxbx project.
|
||||
// *
|
||||
// * Cxbx is free software; you can redistribute it
|
||||
// * Cxbx-Reloaded 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.
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
// ******************************************************************
|
||||
#define LOG_PREFIX CXBXR_MODULE::D3D8
|
||||
|
||||
#ifdef CXBXEMULATOR_EXPORTS // DbgConsole only in Cxbx, not in CxbxEmulator
|
||||
#ifdef CXBXR_EMU_EXPORTS // DbgConsole only in Cxbx/cxbxr, not in cxbxr-emu
|
||||
#undef INCLUDE_DBG_CONSOLE
|
||||
#else
|
||||
#define INCLUDE_DBG_CONSOLE
|
||||
|
|
|
@ -2,16 +2,9 @@
|
|||
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
// ******************************************************************
|
||||
// *
|
||||
// * .,-::::: .,:: .::::::::. .,:: .:
|
||||
// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;;
|
||||
// * [[[ '[[,,[[' [[[__[[\. '[[,,[['
|
||||
// * $$$ Y$$$P $$""""Y$$ Y$$$P
|
||||
// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo,
|
||||
// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm,
|
||||
// * This file is part of Cxbx-Reloaded.
|
||||
// *
|
||||
// * This file is part of the Cxbx project.
|
||||
// *
|
||||
// * Cxbx is free software; you can redistribute it
|
||||
// * Cxbx-Reloaded 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.
|
||||
|
@ -32,7 +25,7 @@
|
|||
// *
|
||||
// ******************************************************************
|
||||
|
||||
// CxbxEmulator.cpp : Defines the exported functions for the DLL application.
|
||||
// cxbxr-emu.cpp : Defines the exported functions for the DLL application.
|
||||
|
||||
#include "Cxbx.h" // For FUNC_EXPORTS
|
||||
#include "VerifyAddressRanges.h" // For VerifyBaseAddr() and VerifyAddressRanges()
|
||||
|
@ -182,3 +175,4 @@ DWORD WINAPI Emulate(int system)
|
|||
// This line will never be reached:
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
|
@ -2,16 +2,9 @@
|
|||
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
// ******************************************************************
|
||||
// *
|
||||
// * .,-::::: .,:: .::::::::. .,:: .:
|
||||
// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;;
|
||||
// * [[[ '[[,,[[' [[[__[[\. '[[,,[['
|
||||
// * $$$ Y$$$P $$""""Y$$ Y$$$P
|
||||
// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo,
|
||||
// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm,
|
||||
// * This file is part of Cxbx-Reloaded.
|
||||
// *
|
||||
// * This file is part of the Cxbx project.
|
||||
// *
|
||||
// * Cxbx is free software; you can redistribute it
|
||||
// * Cxbx-Reloaded 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.
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "CxbxGUI.h"
|
||||
#include "cxbxr.h"
|
||||
|
||||
#define MAX_LOADSTRING 100
|
||||
|
||||
|
@ -29,7 +29,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
|||
|
||||
// Initialize global strings
|
||||
LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
|
||||
LoadStringW(hInstance, IDC_CXBXGUI, szWindowClass, MAX_LOADSTRING);
|
||||
LoadStringW(hInstance, IDC_CXBXR, szWindowClass, MAX_LOADSTRING);
|
||||
MyRegisterClass(hInstance);
|
||||
|
||||
// Perform application initialization:
|
||||
|
@ -38,7 +38,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_CXBXGUI));
|
||||
HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_CXBXR));
|
||||
|
||||
MSG msg;
|
||||
|
||||
|
@ -73,10 +73,10 @@ ATOM MyRegisterClass(HINSTANCE hInstance)
|
|||
wcex.cbClsExtra = 0;
|
||||
wcex.cbWndExtra = 0;
|
||||
wcex.hInstance = hInstance;
|
||||
wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_CXBXGUI));
|
||||
wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_CXBXR));
|
||||
wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);
|
||||
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
|
||||
wcex.lpszMenuName = MAKEINTRESOURCEW(IDC_CXBXGUI);
|
||||
wcex.lpszMenuName = MAKEINTRESOURCEW(IDC_CXBXR);
|
||||
wcex.lpszClassName = szWindowClass;
|
||||
wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
|
||||
|
|
@ -27,14 +27,14 @@ LANGUAGE 9, 1
|
|||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
|
||||
IDI_CXBXGUI ICON "Cxbx-R.ico"
|
||||
IDI_CXBXR ICON "Cxbx-R.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Menu
|
||||
//
|
||||
|
||||
IDC_CXBXGUI MENU
|
||||
IDC_CXBXR MENU
|
||||
BEGIN
|
||||
POPUP "&File"
|
||||
BEGIN
|
||||
|
@ -52,7 +52,7 @@ END
|
|||
// Accelerator
|
||||
//
|
||||
|
||||
IDC_CXBXGUI ACCELERATORS
|
||||
IDC_CXBXR ACCELERATORS
|
||||
BEGIN
|
||||
"?", IDM_ABOUT, ASCII, ALT
|
||||
"/", IDM_ABOUT, ASCII, ALT
|
||||
|
@ -129,8 +129,8 @@ END
|
|||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDC_CXBXGUI "CXBXGUI"
|
||||
IDS_APP_TITLE "CxbxGUI"
|
||||
IDC_CXBXR "CXBXR"
|
||||
IDS_APP_TITLE "Cxbx-Reloaded"
|
||||
END
|
||||
|
||||
#endif
|
|
@ -1,18 +1,18 @@
|
|||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by CxbxGUI.rc
|
||||
// Used by cxbxr.rc
|
||||
//
|
||||
|
||||
#define IDS_APP_TITLE 103
|
||||
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDD_CXBXGUI_DIALOG 102
|
||||
#define IDD_CXBXR_DIALOG 102
|
||||
#define IDD_ABOUTBOX 103
|
||||
#define IDM_ABOUT 104
|
||||
#define IDM_EXIT 105
|
||||
#define IDI_CXBXGUI 107
|
||||
#define IDI_CXBXR 107
|
||||
#define IDI_SMALL 108
|
||||
#define IDC_CXBXGUI 109
|
||||
#define IDC_CXBXR 109
|
||||
#define IDC_MYICON 2
|
||||
#ifndef IDC_STATIC
|
||||
#define IDC_STATIC -1
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
// stdafx.cpp : source file that includes just the standard includes
|
||||
// CxbxGUI.pch will be the pre-compiled header
|
||||
// cxbxr.pch will be the pre-compiled header
|
||||
// stdafx.obj will contain the pre-compiled type information
|
||||
|
||||
#include "stdafx.h"
|
||||
|
|
|
@ -2,18 +2,9 @@
|
|||
// PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
|
||||
// ******************************************************************
|
||||
// *
|
||||
// * .,-::::: .,:: .::::::::. .,:: .:
|
||||
// * ,;;;'````' `;;;, .,;; ;;;'';;' `;;;, .,;;
|
||||
// * [[[ '[[,,[[' [[[__[[\. '[[,,[['
|
||||
// * $$$ Y$$$P $$""""Y$$ Y$$$P
|
||||
// * `88bo,__,o, oP"``"Yo, _88o,,od8P oP"``"Yo,
|
||||
// * "YUMMMMMP",m" "Mm,""YUMMMP" ,m" "Mm,
|
||||
// * This file is part of Cxbx-Reloaded.
|
||||
// *
|
||||
// * Cxbx-Loader->loader.cpp
|
||||
// *
|
||||
// * This file is part of the Cxbx project.
|
||||
// *
|
||||
// * Cxbx is free software; you can redistribute it
|
||||
// * Cxbx-Reloaded 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.
|
||||
|
@ -113,6 +104,8 @@ void OutputMessage(const char *msg)
|
|||
}
|
||||
}
|
||||
|
||||
#define EMULATION_DLL "cxbxr-emu.dll"
|
||||
|
||||
DWORD CALLBACK rawMain()
|
||||
{
|
||||
(void)virtual_memory_placeholder; // prevent optimization removing this data
|
||||
|
@ -164,9 +157,9 @@ DWORD CALLBACK rawMain()
|
|||
}
|
||||
|
||||
// Only after the required memory ranges are reserved, load our emulation DLL
|
||||
HMODULE hEmulationDLL = LoadLibrary(TEXT("CxbxEmulator.dll"));
|
||||
HMODULE hEmulationDLL = LoadLibrary(TEXT(EMULATION_DLL));
|
||||
if (!hEmulationDLL) {
|
||||
OutputMessage("Error loading CxbxEmulator.dll\n");
|
||||
OutputMessage("Error loading " EMULATION_DLL "\n");
|
||||
LPTSTR Error = GetLastErrorString();
|
||||
if (Error) {
|
||||
OutputMessage(Error);
|
Loading…
Reference in New Issue