#include #include #include #include #include #include #include #include #include #include #include "api/modules/capture.h" #include "acio/acio.h" #include "acio/icca/icca.h" #include "acio/mdxf/mdxf.h" #include "api/controller.h" #include "avs/automap.h" #include "avs/core.h" #include "avs/ea3.h" #include "avs/game.h" #include "build/defs.h" #include "cfg/spicecfg.h" #include "cfg/config.h" #include "cfg/screen_resize.h" #include "easrv/easrv.h" #include "external/cardio/cardio_runner.h" #ifndef NO_SCARD #include "external/scard/scard.h" #endif #include "games/game.h" #include "games/io.h" #include "games/bbc/bbc.h" #include "games/bs/bs.h" #include "games/ddr/ddr.h" #include "games/dea/dea.h" #include "games/drs/drs.h" #include "games/gitadora/gitadora.h" #include "games/hpm/hpm.h" #include "games/iidx/iidx.h" #ifdef SPICE64 #include "games/iidx/camera.h" #endif #include "games/iidx/poke.h" #include "games/jb/jb.h" #include "games/mga/mga.h" #include "games/nost/nost.h" #include "games/nost/poke.h" #include "games/popn/popn.h" #include "games/qma/qma.h" #include "games/rb/rb.h" #include "games/rf3d/rf3d.h" #include "games/sc/sc.h" #include "games/scotto/scotto.h" #include "games/sdvx/sdvx.h" #include "games/shared/printer.h" #include "games/silentscope/silentscope.h" #include "games/mfc/mfc.h" #include "games/ftt/ftt.h" #include "games/loveplus/loveplus.h" #include "games/we/we.h" #include "games/otoca/otoca.h" #include "games/shogikai/shogikai.h" #include "games/pcm/pcm.h" #include "games/onpara/onpara.h" #include "games/bc/bc.h" #include "games/ccj/ccj.h" #include "games/ccj/trackball.h" #include "games/qks/qks.h" #include "games/mfg/mfg.h" #include "games/pc/pc.h" #include "games/museca/museca.h" #include "hooks/avshook.h" #include "hooks/audio/audio.h" #include "hooks/audio/asio_proxy.h" #include "hooks/audio/backends/wasapi/downmix.h" #include "hooks/debughook.h" #include "hooks/devicehook.h" #include "hooks/graphics/nvenc_hook.h" #include "hooks/input/dinput8/hook.h" #include "hooks/graphics/graphics.h" #include "hooks/lang.h" #include "hooks/networkhook.h" #include "hooks/icmphook_net.h" #include "hooks/unisintrhook.h" #include "launcher/launcher.h" #include "launcher/logger.h" #include "launcher/signal.h" #include "launcher/superexit.h" #include "launcher/richpresence.h" #include "launcher/shutdown.h" #include "launcher/options.h" #include "misc/bt5api.h" #include "misc/device.h" #include "misc/eamuse.h" #include "misc/extdev.h" #include "misc/ami2000.h" #include "misc/sciunit.h" #include "misc/sde.h" #include "misc/wintouchemu.h" #include "overlay/overlay.h" #include "overlay/notifications.h" #include "overlay/windows/patch_manager.h" #include "overlay/windows/iidx_seg.h" #include "rawinput/rawinput.h" #include "rawinput/touch.h" #include "reader/reader.h" #include "sdk/sdk.h" #include "stubs/stubs.h" #include "touch/touch.h" #include "util/cpuutils.h" #include "util/crypt.h" #include "util/deferlog.h" #include "util/fileutils.h" #include "util/libutils.h" #include "util/logging.h" #include "util/peb.h" #include "util/precise_timer.h" #include "util/socd_cleaner.h" #include "util/sysutils.h" #include "util/tapeled.h" #include "util/time.h" #include "util/utils.h" #include "avs/ssl.h" #include "nvapi/nvapi.h" #include "hooks/graphics/nvapi_hook.h" // std::max #ifdef max #undef max #endif // constants static const char *STUBS[] = {"kbt.dll", "kld.dll"}; // general settings static std::vector game_hooks; static std::vector early_hooks; std::filesystem::path MODULE_PATH; HANDLE LOG_FILE = INVALID_HANDLE_VALUE; std::string LOG_FILE_PATH = ""; int LAUNCHER_ARGC = 0; char **LAUNCHER_ARGV = nullptr; std::unique_ptr> LAUNCHER_OPTIONS; std::mutex CARD_OVERRIDES_LOCK; std::string CARD_OVERRIDES[2]; // sub-systems std::unique_ptr API_CONTROLLER; std::unique_ptr RI_MGR; // trigger NVIDIA Optimus & AMD Enduro High Performance Graphics extern "C" { __declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001; __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; } static bool CHECK_DLL_IGNORE_ARCH = false; static bool check_dll(const std::string &model) { if (cfg::CONFIGURATOR_STANDALONE || CHECK_DLL_IGNORE_ARCH) { return fileutils::file_exists(MODULE_PATH / model); } else { return fileutils::verify_header_pe(MODULE_PATH / model); } } void update_msvcrt_args(int argc, char *argv[]); void dump_button_bindings(std::vector