Commit Graph

149 Commits

Author SHA1 Message Date
maron2000
b819b65fad Fix SDL1 build error (Linux & MinGW) 2024-06-03 18:13:36 +09:00
nanshiki
f6ef1fa882 Change the area of white background drawing 2024-05-14 21:51:52 +09:00
Jaak Ristioja
4a6bcc706e Use nullptr/NULL instead of 0 for pointers, two fixes for undefined behavior
This commit fixes most -Wzero-as-null-pointer-constant warnings, except in
some places which appear to be vendored 3rd party libraries, e.g. in sdl_ttf.c,
libchdr, physfs and gmock and in 3rd party components therein. Since it might
make more sense to update this 3rd party code to some later versions instead of
fixing the warnings manually, I decided not to enable the C++ compiler flag in
configure.ac at this point.

In two functions with the return type of std::string executed `return 0;`
statements, causing std::string to be constructed from a null pointer. To avoid
undefined behavior these were changed to `return {};`.

Signed-off-by: Jaak Ristioja <jaak@ristioja.ee>
2024-05-09 14:18:10 +03:00
Jonathan Campbell
0cded2e82d XCode suddenly considers id and int different types and it is now an error to assign or return one to the other, typecast to fix 2024-03-28 12:35:58 -07:00
Jonathan Campbell
431bfd871e Fix Visual Studio project file to match recent changes to files and file arrangement, fix ne2000.h/cpp confusion in VS 2024-03-26 04:01:59 -07:00
Jonathan Campbell
8a159a59cd Prepare for release 2024-03-01 00:04:45 -08:00
Kagamiin~
cd1ec960ff Updating vcxproj files 2024-02-25 21:39:01 -03:00
Nicholas Stuart Howe
56292b82a2 Add missing quotation marks in vcxproj. 2024-02-10 09:26:51 -05:00
maron2000
030ac1c31b Refine Version strings display 2023-12-25 22:17:26 +09:00
crazii
5eb3e9e3f3 OpenCOW: dynamic call to GetLongPathNameA 2023-12-03 15:20:08 +08:00
crazii
a4617ea14f OpenCow: dynamic calls to win95+ function 2023-12-01 13:15:51 +08:00
crazii
35ea4ec567 add configure option for sdlnet (IPHLPAPI.DLL dependency removed for win95), in case that the build env has its own sdlnet installed and detected. 2023-11-29 18:49:46 +08:00
crazii
0c67df507d OpenCOW: adaption to win95 2023-11-29 18:49:46 +08:00
crazii
be16811529 adaption for MinGW legacy toolchain. 2023-11-29 18:49:46 +08:00
crazii
ea0acaf820 OpenCOW: adaption for legacy MinGW toolchain. 2023-11-29 18:49:45 +08:00
crazii
352d542177 First working version of Win9x build. 2023-11-18 17:05:23 +08:00
crazii
763b7c5f47 SDL: add -limm32 to mingw builds. 2023-11-18 17:05:10 +08:00
crazii
895fef6425 add dependency: opencow from: https://github.com/crazii/opencow 2023-11-18 17:04:52 +08:00
Jonathan Campbell
a93566b5a4 Prepare for release 2023-10-06 15:39:47 -07:00
maron2000
9c681325f6 Change permission 2023-09-10 17:12:27 +09:00
maron2000
3ef9365706 Reapply DOSBox-X specific patches to SDL2 library 2023-09-09 20:20:01 +09:00
maron2000
af69c36ee4 Bump SDL2 library to 2.28.2 2023-09-09 20:14:08 +09:00
Jonathan Campbell
33c5415305 Prepare for release 2023-09-01 14:49:48 -07:00
Jonathan Campbell
bcfde8a0c7 Prepare for release 2023-08-15 10:56:46 -07:00
Jonathan Campbell
611fd86414 Prepare for release 2023-08-11 13:21:45 -07:00
maron2000
047753fd50 Merge branch 'master' into bump_freetype 2023-07-31 22:09:25 +09:00
maron2000
867ee5f2bc Bump freetype to 2.13.1 2023-07-28 23:25:53 +09:00
Johan Mattsson
30195927cf Fix potential NULL dereference 2023-07-26 19:34:17 +02:00
Johan Mattsson
826569fdcb Add missing check for 'dstw' 2023-07-26 19:25:54 +02:00
nanshiki
3d9f431750 Fixed space key input when IME ON in SDL2 version 2023-07-22 12:24:06 +09:00
nanshiki
4dd57fb1db If wParam of WM_KEYDOWN is VK_PROCESSKEY, the key input process of SDL is not called. 2023-05-23 18:51:40 +09:00
Jonathan Campbell
ac99c34a24 Patch VS project files 2023-05-14 06:50:55 -07:00
Allofich
5f59626a11 Add IBM Music Feature Card support 2023-05-05 05:27:43 +09:00
dbjh
1edc479d4a Corrected file mode. The obvious cases. 2023-05-04 05:11:40 +09:00
dbjh
a71df02e8e Removed last references to PortTalk.
- Made hardopl.cpp use libpassthroughio, so it can now work for all platforms supported by libpassthroughio.
- Moved prototypes of interface from sblaster.cpp to new header hardopl.h.
- Made hardopl.cpp compile cleanly with Visual Studio 2019.
- Kept the functionality disabled, because I do not have access to the necessary hardware. The pass-through functionality itself has been successfully tested on Windows 10 and Linux 5.15. It can be enabled with a 1 character change to hardopl.h.
 + If it is to be officially enabled, we need a slightly more sophisticated handling of privileges on UNIX. No problem, but I will not touch that code unless OPL pass-through is actually desired. For now, either run as root (through sudo) or disable the call to dropPrivileges() in parport.cpp when running setuid root if OPL pass-through is desired.
2023-05-03 05:24:32 +09:00
Jonathan Campbell
d2d9d6b397 Update version, prepare for release 2023-05-01 07:33:27 -07:00
maron2000
2b1166bb71 Add support for Keypad Comma,F16-19 etc (Mac SDL1) 2023-04-10 21:16:30 +09:00
maron2000
8bac781324 Add support for Keypad comma/ABNT C2 (Win SDL1) 2023-04-10 20:22:28 +09:00
maron2000
b8de863094 Update dosbox-x.vcxproj
Need to compile vga_ati.cpp
2023-04-07 19:55:30 +09:00
Jonathan Campbell
2d05793a3c Move ATI emulation into a file for itself 2023-04-06 16:43:15 -07:00
dbjh
f6b8a0fe31 Fixed issue with built-in command "parallel". 2023-04-05 05:16:42 +09:00
Jonathan Campbell
7aaa67cccc I repeat: Do not error out if code would fail on a C89 compiler 2023-04-01 01:46:52 -07:00
Jonathan Campbell
edba71e696 Stop asking the compiler to error out on things that offend a C89 standard compiler... like declaring variables in the middle of a function. We do not care, and such a check is preventing DOSBox-X from compiling 2023-04-01 01:39:41 -07:00
Jonathan Campbell
10add4401b Prepare for release 2023-03-31 19:30:40 -07:00
Jonathan Campbell
ccf74541fd Fix Windows ARM/ARM64 builds not to use OpenGL or attempt to use it 2023-03-28 00:37:49 -07:00
Allofich
e7df8a3aa4 Add dynamic_alloc_common.h to VS solution 2023-03-26 23:12:05 +09:00
dbjh
0e564c9c74 Merge branch 'master' into directio 2023-03-26 01:03:06 +09:00
Jonathan Campbell
51a4dcbf7e Whoops, try again 2023-03-24 05:24:23 -07:00
Jonathan Campbell
6ba8a5faef Try to address one user complaint about Windows RT and OpenGL, and ARM-based Surface tablets seem to have non-functional OpenGL anyway 2023-03-23 21:04:04 -07:00
dbjh
757d9597b7 - Merged Windows and Linux implementation of CDirectLPT. So, code is shared code between Windows, Linux and other OSes.
- Added support for FreeBSD, OpenBSD, NetBSD and DragonFly BSD.
 + It is quite unlikely that the original Win32 implementation worked with the HX DOS extender on DOS as it required loading inpout32.dll which depends on a Windows kernel driver. This implementation is expected to work, because it supports direct I/O too. I am unable to verify that though.
- Made direct I/O available on all platforms, because it is desirable everywhere, including on Windows. On the BSDs it is the only interface available.
 + Least amount of latency. I/O through inpout32.dll/inpoutx64.dll or Linux's ppdev adds a significant amount of overhead. Measurements with inpout32.dll show that practical, real-world overhead can be as large as 400%, i.e. I/O taking 4 times longer than direct I/O.
 + For some devices, direct (read) access to the parallel port control register is needed which ppdev does not allow.
 + Not all parallel port PCI(e) cards are supported by ppdev. Perhaps most are not. Direct I/O works everywhere, because no host OS support is needed.
 + Made possible on 64-bit Windows by giveio64 and on 32-bit Windows by AllowIO (part of the PortTalk package). On Linux, FreeBSD, OpenBSD, NetBSD and DragonFly BSD on x86(_64), direct I/O will be enabled after opening a special device (/dev/io on FreeBSD & DragonFly BSD) or making a special system call (*iopl()).
- Visual Studio allows inline assembly only for x86 builds. However, the intrinsics __in{byte, word, dword}() and __out{byte, word, dword}() work for both x86 and AMD64 builds. Visual Studio versions older than 2015 have _inp{w, d}() and _outp{w, d}(). Those intrinsics also work on both x86 and AMD64 platforms. Visual Studio 2022 still has them too, but only for C (not for C++).
- Put inpout32.dll/inpoutx64.dll loading code in the new passthroughio library so that the functionality can be shared between parallel port and other pass-through code. For example, the original OPL pass-through functionality by Ralf Grillenberger ("h-a-l-9000", author of DOSBox Megabuild 6 where virtually all pass-through code in DOSBox-X originated from) could be enabled, although it looks there has not been any demand for that in DOSBox-X (the Windows-only implementation in DOSBox-X has been disabled a long time ago). Regardless, it is cleaner to separate the low-level I/O code from the parallel port pass-through code.
- Since the PortTalk interface (src/libs/porttalk) is no longer being used I removed it.
 + AllowIO can still be used on systems where the PortTalk device driver could be used.
- Direct I/O will be used if possible. Only on Linux one can actively avoid that by specifying realport instead of realbase in the configuration file.
 + On Linux and the BSDs the code will use direct I/O only if the effective user ID is 0 (root), because only then direct I/O is possible.
 + On Windows the code installs an exception handler and it will load inpout32.dll/inpoutx64.dll only if direct I/O causes an exception. Be aware that if reallpt is specified in the configuration file, when debugging with Visual Studio, that exception will be caught by the Visual Studio debugger instead (unless you start giveio64 beforehand).
- Solved issues with writing to the control register (changing I/O direction with ppdev was not implemented).
- Applied a better solution to a former issue in src/hardware/parport/parport.cpp that caused PARALLEL_Read() and PARALLEL_Write() to silently fail. See https://github.com/joncampbell123/dosbox-x/issues/2214.
- Corrected write to potentially invalid ECR address in CDirectLPT::~CDirectLPT() (ecpbase was ignored when restoring the value of the extended control register).
- Corrected code that enabled parallel port IRQ (could have caused trouble for some people as the code does not and cannot install an IRQ handler on most host OSes).
- Re-enabled code that sets the parallel port to bidirectional mode when using direct I/O and added code that does the same for Linux's ppdev.
 + Bidirectional mode is the most compatible mode.
 + Setting *a* mode is better than just relying on whatever is set in the BIOS or UEFI or whatever the state of a PCI(e) parallel port card is in after booting.
- Added code to reset the EPP Time-out state.
- Made log messages explicit about whether pass-through has been enabled, identifying the parallel port, thereby clarifying the situation to the user.
- passthroughio.cpp compiles cleanly with MinGW (GCC 9), MinGW-w64 (GCC 12 and Clang 15), Cygwin 32-bit (GCC 11), Cygwin 64-bit (GCC 11), Visual Studio 2015 (x86 & amd64), Visual Studio 2019 (x86 & amd64), Visual Studio 2022 (x86 & amd64), GCC 12 on Linux/x86_64 and GCC 8 on Linux/armv7.
 + The resulting code has been successfully tested on Windows 10 Pro, Linux/x86_64 and Linux/armv7.
- All changes compile cleanly as part of DOSBox-X v2022.12.26 with MinGW (build-mingw, build-mingw-lowend (after manual intervention because of broken build scripts), build-mingw-lowend-sdl2 (after adding "-lz -liconv" to LIBS in src/Makefile)), Visual Studio 2019 (amd64), GCC 12 on Linux/x86_64 (build-debug-sdl2) and GCC 8 on Linux/armv7 (build-sdl2).
- The resulting DOSBox-X executables (MinGW (build-mingw, build-mingw-lowend) & ones built with native GCC) have been successfully tested with actual (non-printing) hardware attached to a parallel port on:
 + Linux (Raspberry Pi OS) on Raspberry Pi 2B (with pi-parport, using ppdev)
 + Windows 2000 and Windows XP on laptops using inpout32.dll and AllowIO (tested on Windows 2000 only) (thanks to Mystic_Merlin)
 + Linux (Debian) on HP Thin Client T510 using ppdev (thanks to NorQue).
 The executable produced with build-mingw-lowend-sdl2 failed on a DirectSound issue during start up (on Windows XP and Windows 10).
2023-03-21 01:34:57 +09:00