diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6afb357a..73e4bd7e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,4 +29,33 @@ jobs: with: name: spice2x-ci-${{ env.COMMIT_SHORT_SHA }} path: src/spice2x/bin - if-no-files-found: error \ No newline at end of file + if-no-files-found: error + + msvc-ci: + name: Build (MSVC ${{ matrix.arch }}-bit) + # windows-latest ships Visual Studio 2026; pin to the VS 2022 image, which is + # the toolset spice2x is actually developed against + runs-on: windows-2022 + strategy: + fail-fast: false + matrix: + include: + - arch: 32 + platform: Win32 + target: spicetools_spice spicetools_cfg + - arch: 64 + platform: x64 + target: spicetools_spice64 + defaults: + run: + working-directory: ./src/spice2x + steps: + - uses: actions/checkout@v5 + - name: Configure + run: > + cmake -S . -B cmake-build-msvc-${{ matrix.arch }} + -A ${{ matrix.platform }} + - name: Compile + run: > + cmake --build cmake-build-msvc-${{ matrix.arch }} + --config Release --target ${{ matrix.target }} diff --git a/src/spice2x/games/iidx/camera.cpp b/src/spice2x/games/iidx/camera.cpp index 68a7d48b..0e7ac7a1 100644 --- a/src/spice2x/games/iidx/camera.cpp +++ b/src/spice2x/games/iidx/camera.cpp @@ -2,6 +2,7 @@ #if SPICE64 && !SPICE_XP +#include #include #include "mf_wrappers.h" #include "avs/game.h" @@ -46,9 +47,7 @@ struct PredefinedHook { uintptr_t hook_afp_texture_offset; }; -PredefinedHook g_predefinedHooks[] = {}; - -const DWORD g_predefinedHooksLength = ARRAYSIZE(g_predefinedHooks); +std::array g_predefinedHooks = {}; namespace games::iidx { @@ -110,14 +109,14 @@ namespace games::iidx { auto pe = fmt::format("{:x}_{:x}", time_date_stamp, address_of_entry_point); log_info("iidx:camhook", "Locating predefined hook addresses for LDJ-{}", pe); - for (DWORD i = 0; i < g_predefinedHooksLength; i++) { - if (pe.compare(g_predefinedHooks[i].pe_identifier) == 0) { + for (auto &hook : g_predefinedHooks) { + if (pe.compare(hook.pe_identifier) == 0) { log_misc("iidx:camhook", "Found predefined addresses"); - addr_hook_a = g_predefinedHooks[i].hook_a; - addr_textures = g_predefinedHooks[i].hook_textures; - addr_camera_manager = g_predefinedHooks[i].hook_camera_manager; - addr_device_offset = g_predefinedHooks[i].hook_device_offset; - addr_afp_texture_offset = g_predefinedHooks[i].hook_afp_texture_offset; + addr_hook_a = hook.hook_a; + addr_textures = hook.hook_textures; + addr_camera_manager = hook.hook_camera_manager; + addr_device_offset = hook.hook_device_offset; + addr_afp_texture_offset = hook.hook_afp_texture_offset; return TRUE; } } diff --git a/src/spice2x/hooks/audio/backends/wasapi/defs.h b/src/spice2x/hooks/audio/backends/wasapi/defs.h index 7ea30804..c13c4f07 100644 --- a/src/spice2x/hooks/audio/backends/wasapi/defs.h +++ b/src/spice2x/hooks/audio/backends/wasapi/defs.h @@ -29,6 +29,10 @@ DEFINE_GUID(IID_IAudioClient, 0x1cb9ad4c, 0xdbfa, 0x4c32, 0xb1, 0x78, 0xc2, 0xf5, 0x68, 0xa7, 0x03, 0xb2); +DEFINE_GUID(IID_IAudioClient3, + 0x7ed4ee07, 0x8e67, 0x4cd4, + 0x8c, 0x1a, 0x2b, 0x7a, 0x59, 0x87, 0xad, 0x42); + DEFINE_GUID(IID_IAudioClock, 0xcd63314f, 0x3fba, 0x4a1b, 0x81, 0x2c, 0xef, 0x96, 0x35, 0x87, 0x28, 0xe7); diff --git a/src/spice2x/hooks/graphics/backends/d3d9/d3d9_gfdm.cpp b/src/spice2x/hooks/graphics/backends/d3d9/d3d9_gfdm.cpp index 89e47117..c00246d9 100644 --- a/src/spice2x/hooks/graphics/backends/d3d9/d3d9_gfdm.cpp +++ b/src/spice2x/hooks/graphics/backends/d3d9/d3d9_gfdm.cpp @@ -11,6 +11,9 @@ #include "d3d9_device.h" +// windows.h defines many stupid things +#undef small + bool gfdm_two_head_exclusive() { return games::gitadora::is_arena_model() && games::gitadora::ARENA_TWO_HEAD_EXCLUSIVE diff --git a/src/spice2x/util/nt_loader.h b/src/spice2x/util/nt_loader.h index 01fd2d32..223e7db1 100644 --- a/src/spice2x/util/nt_loader.h +++ b/src/spice2x/util/nt_loader.h @@ -1,5 +1,6 @@ #pragma once +#include #include #define LDR_DLL_NOTIFICATION_REASON_LOADED 1 @@ -43,4 +44,4 @@ NTSTATUS NTAPI LdrRegisterDllNotification( NTSTATUS NTAPI LdrUnregisterDllNotification( PVOID Cookie -); \ No newline at end of file +);