Commit Graph

7011 Commits

Author SHA1 Message Date
rofl0r 48d4330b7d windows: add Makefile for mingw 2025-06-24 12:41:15 +02:00
rofl0r 687340d776 aviout.cpp: fix constructor use gcc dislikes
gcc chokes on this with:
aviout.cpp: In constructor 'NDSCaptureObject::NDSCaptureObject(size_t, size_t, const WAVEFORMATEX*)':
aviout.cpp:564:26: error: cannot call constructor 'NDSCaptureObject::NDSCaptureObject' directly
  this->NDSCaptureObject::NDSCaptureObject();
2025-06-24 12:41:15 +02:00
rofl0r 0bb15e2df8 inputdx.h: make compatible with mingw
we need to use the mingw-provided headers, otherwise we'll run into
linker errors later on.
2025-06-24 12:41:15 +02:00
rofl0r a44a1fcedb XAudio2.h: make compatible with mingw
mingw doesn't ship this header, so to make it compatible we have
to create the uuid symbols, otherwise we get the following link
errors:

sndxa2.o:sndxa2.cpp:(.text+0x35f): undefined reference to `_GUID const& __mingw_uuidof<IXAudio2>()'
sndxa2.o:sndxa2.cpp:(.text+0x366): undefined reference to `_GUID const& __mingw_uuidof<XAudio2>()'
2025-06-24 12:41:15 +02:00
rofl0r aaf73a711d snddx.cpp: use mingw-provided directx headers if applicable
otherwise we get link errors like:
snddx.o:snddx.cpp:(.text+0x556): undefined reference to `DXGetErrorDescription8A(long)@4'
snddx.o:snddx.cpp:(.text+0x563): undefined reference to `DXGetErrorString8A(long)@4'

this also gets rid of the previous workaround.
2025-06-24 12:41:15 +02:00
rofl0r 1e640464ee gdbstub_internal.h: fix build error with mingw
../../gdbstub/gdbstub_internal.h:36:25: fatal error: sys/socket.h: No such file or directory
2025-06-24 12:41:15 +02:00
rofl0r 763d42a4cb fatdir: fix build error with mingw
../../utils/libfat/fatdir.cpp:37:21: fatal error: sys/dir.h: No such file or directory
 #include <sys/dir.h>
                     ^
2025-06-24 12:41:15 +02:00
rofl0r 6727a633b8 ROMReader: fix build error with mingw
../../ROMReader.cpp: In function 'void* STDROMReaderInit(const char*)':
../../ROMReader.cpp:31:36: error: cannot convert 'stat*' to '_stat32*' for argument '2' to 'int _stat32(const char*, _stat32*)'
 #define stat(...) _stat(__VA_ARGS__)
                                    ^
2025-06-24 12:41:15 +02:00
rofl0r 5e5cd8971c resources.rc: use unix-style path names
mingw's windres chokes on backslashed path names, a CI run will show
whether MSVC's rc builder can deal with forward slashes, but typically
windows tools support both styles.
2025-06-24 12:41:15 +02:00
rofl0r bdea57936f resources.rc: fix build error with mingw-windres
i686-w64-mingw32-windres: resources.rc:2140: syntax error
i686-w64-mingw32-windres: preprocessing failed.
2025-06-24 12:41:15 +02:00
rofl0r ed4bed3899 unrar/strfn.cpp: fix build error with mingw
File_Extractor/unrar/strfn.cpp: In function 'wchar etoupperw(wchar)':
File_Extractor/unrar/strfn.cpp:135:21: error: 'toupperw' was not declared in this scope
   return(toupperw(ch));
                     ^
File_Extractor/unrar/strfn.cpp: In function 'int wcsicompc(const wchar*, const wchar*)':
File_Extractor/unrar/strfn.cpp:240:28: error: 'wcsicomp' was not declared in this scope
   return wcsicomp(Str1,Str2);
                            ^
2025-06-24 12:41:15 +02:00
rofl0r 5f9817a387 lua-engine.cpp: fix build error with mingw
../../lua-engine.cpp:1552:31: error: 'vscprintf' was not declared in this scope
  int len = vscprintf(fmt, list);
                               ^
2025-06-24 12:41:15 +02:00
rofl0r 34712c4faf ImageOut.cpp: add missing header
../../frontend/modules/ImageOut.cpp:30:56: error: 'malloc' was not declared in this scope
2025-06-24 12:41:15 +02:00
rofl0r 200590b8dc XAudio2.h: likewise 2025-06-24 12:41:15 +02:00
rofl0r 73c903f17e xma2defs.h: macro hack for mingw's lack of __out etc
directx/xma2defs.h:406:5: error: '__out' has not been declared

note that we have to undef the macros on leaving the header,
as these names are also used for some arguments in stdlibc++
headers.
2025-06-24 12:41:15 +02:00
rofl0r 5293890772 replay: fix use of anonymous struct members
this apparently is an extension of MSVC, and gcc disallows it.

replay.cpp: In function 'INT_PTR RecordDialogProc(HWND, UINT, WPARAM, LPARAM)':
replay.cpp:285:4: error: anonymous struct not inside named type
    };
    ^
In file included from /opt/mingw-w64/libexec/i686-w64-mingw32/include/minwindef.h:163:0,
                 from /opt/mingw-w64/libexec/i686-w64-mingw32/include/windef.h:,
                 from /opt/mingw-w64/libexec/i686-w64-mingw32/include/windows.h:69,
                 from replay.cpp:20:
replay.cpp:286:16: error: 'rtcMin' was not declared in this scope
    ZeroMemory(&rtcMin, sizeof(SYSTEMTIME));
                ^
replay.cpp:287:16: error: 'rtcMax' was not declared in this scope
    ZeroMemory(&rtcMax, sizeof(SYSTEMTIME));
                ^
2025-06-24 12:41:15 +02:00
rofl0r 2fe5ec51ef types.h: don't undef WINAPI for mingw
the undef leads to the __stdcall attribute being stripped from all
functions, which in turn causes the symbols to not be found at link
time, as stdcall symbols have different name mangling.
2025-06-24 12:41:15 +02:00
rofl0r 62f43c01b1 path.h: add mkdir macro for mingw
mingw only supports the one-argument form of old windows.

fsnitroView.cpp: In function 'BOOL ViewFSNitroProc(HWND, UINT, WPARAM, LPARAM)':
fsnitroView.cpp:285:31: error: too many arguments to function 'int mkdir(const char*)'
         mkdir(tmp.c_str(),0777);
                               ^
2025-06-24 12:41:15 +02:00
rofl0r 0706a32138 CWindow.h: fix build error with gcc
In file included from CWindow.cpp:19:0:
CWindow.h:288:33: error: invalid pure specifier (only '= 0' is allowed) before ' token
  virtual DWORD ThreadFunc()=NULL;
                                 ^
2025-06-24 12:41:15 +02:00
rogerman fe84b11d51 Fix building on Windows. (Regression from commit 03cca3a.) 2025-06-24 02:29:22 -07:00
rogerman 03cca3a800 Move initialization code and method body code out of the headers and into the cpp files where appropriate. (Related to commits 39bd7fa, bf208df, and 665cd2a.)
- Not only does this clean up the headers and (marginally) improve compile times, it also gets rid of any C++11 requirements.
- Update the copyright template in metaspu.cpp to match that of metaspu.h.
- Also silence a few compiler warnings here and there.
2025-06-24 01:56:38 -07:00
Link Mauve 665cd2a3bf Fix one more -Wreorder warning 2025-06-24 03:59:38 +02:00
Link Mauve bf208df81f Fix MSVC build in _ShowGpu initializers
“A default member initializer is not allowed for a member of an
anonymous struct within a union.”
2025-06-24 03:39:26 +02:00
rogerman 472fe89165 Fix building for the Cocoa port. (Regression from commit 38f6313.) 2025-06-23 17:19:10 -07:00
rogerman a9e86e68be Partially revert commit ecd4c16. types.h has never assumed the presence of cstdint. Let's remove this dependency to ensure compatibility regardless of compiler. 2025-06-23 17:16:45 -07:00
Link Mauve 39bd7fac68 Fix some -Wreorder warnings
Use C++11 member initialization, to avoid having to pointlessly reorder
initializations in the constructor.
2025-06-24 01:59:09 +02:00
rogerman 36ad64c79b Revert "AsmJit: Remove unused/standard features"
This reverts commit 56a8801575.

Let’s avoid modifying our vendored libraries unless absolutely necessary.

Signed-off-by: rogerman <rogerman@users.noreply.github.com>
2025-06-23 16:45:10 -07:00
Link Mauve ff5113f5ac Remove executable bit from source files 2025-06-24 01:27:20 +02:00
Link Mauve 02f3c32974 GTK frontend: Remove OSX support
The cocoa frontend is apparently much better, and the GTK one obviously
hasn’t even been built on maxOS in years.
2025-06-24 00:55:04 +02:00
Link Mauve ecd4c1642c Simplify integer type aliases
Always alias them from cstdint, as all compilers should support them.
2025-06-24 00:50:49 +02:00
Link Mauve 56a8801575 AsmJit: Remove unused/standard features
The casts through union were undefined behaviour (memcpy() should be
used instead), but they were unused so nothing bad happened.

_min() and _max() could be replaced with std::min() and std::max(),
whereas maxValue() could be replaced with std::numeric_limits<T>::max().

Once we migrate to C++20, bitCount() could also be replaced with
std::popcount() from <bits>.
2025-06-23 23:50:50 +02:00
Link Mauve 38f63130e2 Use explicit std:: prefix
Using `using std::*` made me wonder whether these types and functions
were from std, libc symbols, or custom ones.
2025-06-23 23:15:23 +02:00
zeromus 96805d7c27 winport - fix mojibake bug in configured path usage (mainly screenshots, fixes #910) 2025-05-28 00:35:27 -04:00
zeromus cdb9acdc4d fflush after printing ideas and nocash messages 2025-05-11 17:42:07 -04:00
zeromus 48fcb850de winport: fiddle with stdio redirection buffering 2025-05-11 17:40:24 -04:00
Link Mauve 1754c1851b Remove unused automake files
No idea why it hadn’t been removed yet.
2025-05-10 15:02:00 +02:00
Link Mauve ca272488c2 Remove the last remnants of the glade frontend
This one has never been full-fledged, but was still referenced in the
autotools build system.
2025-05-10 13:54:39 +02:00
thesource 8a26c971f2 Make enum for joystick input type for convenience 2025-04-21 13:27:47 +02:00
thesource e706f0a4de Fix windows build 2025-04-21 13:27:47 +02:00
thesource d2627ffbe5 Fix coords on finger touch/lift 2025-04-21 13:27:47 +02:00
thesource 07c444eb0c Linux/GTK: add support for gamepad touchpad -> touch screen input
translation
2025-04-21 13:27:47 +02:00
rogerman 6f1a63fe89 Cocoa Port: Support Automatic Graphics Switching, allowing the use of the integrated GPU to run video display windows. (Requires a dual-GPU MacBook Pro with Metal-capable GPUs.)
- While this results in a 20% performance loss for video display window functions (like video filters), this also dramatically extends battery life. To return to the old way of using the discrete GPU for video display windows, the user must disable Automatic Graphics Switching in their System Preferences.
- The Troubleshooting Window now correctly reports the emulated 3D renderer that is currently active, rather than the one that is selected in the GUI.
- Also fix a bug where creating a OpenGL 3D renderer's context would immediately fall back to Apple Software Renderer if context creation failed. Now, context creation falls back to Apple Software Renderer as the last resort, only after all other Core Profile contexts have failed.
2025-03-26 16:55:25 -07:00
rogerman 25356b70f1 GPU: Add some more optimizations hints in CopyLineExpand() for SSSE3. 2025-03-26 13:26:42 -07:00
rogerman 75766495f9 Cocoa Port: Add some missing file references to the Xcode 3 project. 2025-03-20 22:55:40 -07:00
rogerman 1091e69726 Cocoa Port: Fix a bunch of bugs related to moving windows between Retina and non-Retina displays. (Related to commit 2bc5b0d.) 2025-03-19 03:11:16 -07:00
rogerman f6e0feb13e Cocoa Port: Report which OpenGL renderer is actually selected for 3D rendering. (Debug mode only.) 2025-03-18 15:55:01 -07:00
rogerman 33754b706e Cocoa Port: Add support for performing OpenGL 3D rendering on the 2013 Mac Pro's second GPU.
- For OpenGL 3D rendering, this yields a performance improvement of 2% - 4%.
2025-03-17 17:03:35 -07:00
rogerman 50e39989f7 GPU: Do some small optimizations to SSE2 and AVX2. 2025-03-16 23:15:46 -07:00
rogerman c73a7ffe53 GPU: Add NEON-accelerated functions for 2D layer compositing. (For 64-bit ARM CPUs only.)
- This improves GPU performance by up to 20% on the Raspberry Pi 5, and up to 50% on Apple Silicon CPUs.
2025-03-16 16:23:21 -07:00
rogerman e2379a66d6 matrix.h: Fix const-correctness for some *_fast function parameters.
- In practice, this only affected compiling for NEON on certain compilers. Other SIMD ISAs should remain unaffected.
2025-03-16 16:13:12 -07:00