From 6ac2720f9fd1cfccf3cf1a9d22fe6ec895e0e66d Mon Sep 17 00:00:00 2001 From: Lorenzooone Date: Sun, 14 Apr 2024 21:10:16 +0200 Subject: [PATCH] Fix MVSC builds --- .gitignore | 1 + include/3dscapture.hpp | 10 +++++++--- include/audio.hpp | 0 include/conversions.hpp | 0 include/frontend.hpp | 6 +++++- include/hw_defs.hpp | 0 include/utils.hpp | 6 ++++++ 7 files changed, 19 insertions(+), 4 deletions(-) mode change 100644 => 100755 .gitignore mode change 100644 => 100755 include/3dscapture.hpp mode change 100644 => 100755 include/audio.hpp mode change 100644 => 100755 include/conversions.hpp mode change 100644 => 100755 include/frontend.hpp mode change 100644 => 100755 include/hw_defs.hpp mode change 100644 => 100755 include/utils.hpp diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 index 6c99fd6..bfbc059 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Byte-compiled / optimized / DLL files *.o +openal32.dll cc3dsfs cc3dsfs.exe *.conf diff --git a/include/3dscapture.hpp b/include/3dscapture.hpp old mode 100644 new mode 100755 index c64eb45..8970647 --- a/include/3dscapture.hpp +++ b/include/3dscapture.hpp @@ -24,19 +24,23 @@ #define FIX_PARTIAL_FIRST_FRAME_NUM 3 -struct __attribute__ ((packed)) VideoInputData { +#pragma pack(push, 1) + +struct PACKED VideoInputData { uint8_t screen_data[IN_VIDEO_SIZE][3]; }; -struct __attribute__ ((packed)) CaptureReceived { +struct PACKED CaptureReceived { VideoInputData video_data; uint16_t audio_data[MAX_SAMPLES_IN]; }; +#pragma pack(pop) + struct CaptureData { FT_HANDLE handle; CaptureReceived capture_buf[NUM_CONCURRENT_DATA_BUFFERS]; - uint32_t read[NUM_CONCURRENT_DATA_BUFFERS]; + ULONG read[NUM_CONCURRENT_DATA_BUFFERS]; double time_in_buf[NUM_CONCURRENT_DATA_BUFFERS]; volatile int curr_in = 0; volatile int cooldown_curr_in = FIX_PARTIAL_FIRST_FRAME_NUM; diff --git a/include/audio.hpp b/include/audio.hpp old mode 100644 new mode 100755 diff --git a/include/conversions.hpp b/include/conversions.hpp old mode 100644 new mode 100755 diff --git a/include/frontend.hpp b/include/frontend.hpp old mode 100644 new mode 100755 index 5fa7712..c430f46 --- a/include/frontend.hpp +++ b/include/frontend.hpp @@ -31,10 +31,14 @@ struct DisplayData { bool split; }; -struct __attribute__ ((packed)) VideoOutputData { +#pragma pack(push, 1) + +struct PACKED VideoOutputData { uint8_t screen_data[IN_VIDEO_SIZE][4]; }; +#pragma pack(pop) + struct SFEvent { SFEvent(sf::Event::EventType type, sf::Keyboard::Key code, uint32_t unicode) : type(type), code(code), unicode(unicode) {} diff --git a/include/hw_defs.hpp b/include/hw_defs.hpp old mode 100644 new mode 100755 diff --git a/include/utils.hpp b/include/utils.hpp old mode 100644 new mode 100755 index 6fe7ede..9375104 --- a/include/utils.hpp +++ b/include/utils.hpp @@ -5,6 +5,12 @@ #include #include +#if _MSC_VER && !__INTEL_COMPILER +#define PACKED +#else +#define PACKED __attribute__((packed)) +#endif + #define NAME "cc3dsfs" // This isn't precise, however we can use it...