-
Notifications
You must be signed in to change notification settings - Fork 2.4k
SDL2 port for DOS (DJGPP and VBE 2.0+) #13906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
glebm
wants to merge
51
commits into
libsdl-org:SDL2
Choose a base branch
from
diasurgical:dos-vbe-rebase
base: SDL2
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+2,235
−25
Draft
Changes from all commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
dbf7d2b
Add DJGPP to configure scripts
jayschwa 593979d
Do not use MMX or SSE on x86 hosts by default
jayschwa 8c297b5
djgpp: Get testfile (mostly) passing
jayschwa 63f0003
dos: Add support for basic timing functions
jayschwa 1ae45fe
Create SVGA video driver (cloned from dummy driver)
jayschwa 3d40fe7
svga: Add VBE types
jayschwa 0b4fd9d
svga: Tweak file names
jayschwa a55ec2b
svga: Read VBE info and require VBE 2.0
jayschwa 773715c
svga: Use structs for special VBE fields
jayschwa 8236e8a
svga: Assert VBE struct sizes at compile time
jayschwa 58edca8
svga: Implement `GetVBEModeInfo`
jayschwa 7906114
svga: Add `GetCurrentVBEMode`
jayschwa 4e0797a
svga: Implement `GetDisplayModes`
jayschwa 3d99753
svga: Remove `SDL` prefix from VBE functions
jayschwa 3dcab18
svga: Only use color graphics modes with linear memory
jayschwa b6943f3
svga: Convert from VBE to SDL pixel format
jayschwa c65fdad
svga: Add SetVBEMode
jayschwa c070749
WIP: svga: Implement framebuffer functions
jayschwa 63c27e8
svga: Use color masks to derive pixel format
jayschwa c01008a
svga: Calculate surface size with pitch field
jayschwa e10b1f2
svga: Save framebuffer ptr in device data
jayschwa d8b2e85
svga: Add `VBE_FLAT_PTR` macro function
jayschwa 58df679
svga: Add window functions and data
jayschwa 0ff763e
svga: Modes must have 4-byte aligned scan lines
jayschwa 56f214a
svga: Use safer form of memory mapping for framebuffer
jayschwa 6b21e8a
svga: Implement double buffering
jayschwa 630ef22
WIP: svga: Support indexed color formats
jayschwa 6fe697e
svga: Naively generate key press events
jayschwa 8689844
svga: Restore original video state on quit
jayschwa dbe5c10
dos: Write logs to a file
jayschwa 88d8427
svga: Invalidate window surface after freeing it
jayschwa bd0280e
dos: Move keyboard handling out of svga
jayschwa 1c3335b
dos: Use interrupt service routine for keyboard events
jayschwa cd0e976
dos: Use PS/2 status register to poll keyboard
jayschwa 360dddd
dos: Do not set `pm_selector`
jayschwa e8c6797
svga: Add some debug logs
jayschwa 58863eb
svga: Remove obsolete SVGA_Available
jayschwa 0dca333
WIP: dos: Add mouse support
jayschwa 0a8e2bc
Add SDL_mouse.h include to SDL_svga_framebuffer.c
AJenbo 643bd9b
dos: fix functions for latest SDL2
glebm 5f92a76
dos: Do not bother attempting framebuffer texture
glebm 8048fa3
dos: #if SDL_VIDEO_DRIVER_SVGA -> #ifdef
glebm 6a87741
dos: Add CMake configuration
glebm 6529694
dos: implement some extended keys
glebm d9cf906
dos: handle text input events
glebm 027fb04
dos: modernize fullscreen-only handling
glebm b55cac0
dos: Implement palette support
glebm 6e5751f
dos: Only draw the cursor if it is enabled
glebm 4862825
Change return to continue on SVGA mode info error
AJenbo 4764588
dos: Use protected-mode interface to set palette
glebm 20b47a6
dos: Use protected-mode interface to request flip
glebm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -359,7 +359,17 @@ dnl Checks for library functions. | |
AC_DEFINE(HAVE_MPROTECT, 1, [ ]) | ||
],[]), | ||
) | ||
AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv bsearch qsort abs bcopy memset memcmp memcpy memmove wcslen wcslcpy wcslcat _wcsdup wcsdup wcsstr wcscmp wcsncmp wcscasecmp _wcsicmp wcsncasecmp _wcsnicmp strlen strlcpy strlcat _strrev _strupr _strlwr index rindex strchr strrchr strstr strtok_r itoa _ltoa _uitoa _ultoa strtod strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp strcasestr vsscanf vsnprintf fopen64 fseeko fseeko64 sigaction sigtimedwait setjmp nanosleep sysconf sysctlbyname getauxval elf_aux_info poll memfd_create posix_fallocate _Exit) | ||
|
||
case "$host" in | ||
*-*-msdosdjgpp*) | ||
AC_MSG_NOTICE(skipping unfinished fseeko64 in DJGPP) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this apply when building with CMake as well? |
||
;; | ||
*) | ||
AC_CHECK_FUNCS(fseeko64) | ||
;; | ||
esac | ||
|
||
AC_CHECK_FUNCS(malloc calloc realloc free getenv setenv putenv unsetenv bsearch qsort abs bcopy memset memcmp memcpy memmove wcslen wcslcpy wcslcat _wcsdup wcsdup wcsstr wcscmp wcsncmp wcscasecmp _wcsicmp wcsncasecmp _wcsnicmp strlen strlcpy strlcat _strrev _strupr _strlwr index rindex strchr strrchr strstr strtok_r itoa _ltoa _uitoa _ultoa strtod strtol strtoul _i64toa _ui64toa strtoll strtoull atoi atof strcmp strncmp _stricmp strcasecmp _strnicmp strncasecmp strcasestr vsscanf vsnprintf fopen64 fseeko sigaction sigtimedwait setjmp nanosleep sysconf sysctlbyname getauxval elf_aux_info poll memfd_create posix_fallocate _Exit) | ||
|
||
AC_CHECK_LIB(m, pow, [LIBS="$LIBS -lm"; EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lm"]) | ||
AC_CHECK_FUNCS(acos acosf asin asinf atan atanf atan2 atan2f ceil ceilf copysign copysignf cos cosf exp expf fabs fabsf floor floorf trunc truncf fmod fmodf log logf log10 log10f lround lroundf pow powf round roundf scalbn scalbnf sin sinf sqrt sqrtf tan tanf) | ||
|
@@ -664,8 +674,8 @@ if test x$enable_assembly = xyes; then | |
|
||
dnl Check for various instruction support | ||
AC_ARG_ENABLE(mmx, | ||
[AS_HELP_STRING([--enable-mmx], [use MMX assembly routines [default=yes]])], | ||
, enable_mmx=yes) | ||
[AS_HELP_STRING([--enable-mmx], [use MMX assembly routines [[default=maybe]]])], | ||
, enable_mmx=$default_ssemath) | ||
if test x$enable_mmx = xyes; then | ||
save_CFLAGS="$CFLAGS" | ||
have_gcc_mmx=no | ||
|
@@ -698,8 +708,8 @@ dnl Check for various instruction support | |
fi | ||
|
||
AC_ARG_ENABLE(3dnow, | ||
[AS_HELP_STRING([--enable-3dnow], [use 3DNow! assembly routines [default=no]])], | ||
, enable_3dnow=no) | ||
[AS_HELP_STRING([--enable-3dnow], [use 3DNow! assembly routines [[default=maybe]]])], | ||
, enable_3dnow=$default_ssemath) | ||
if test x$enable_3dnow = xyes; then | ||
save_CFLAGS="$CFLAGS" | ||
have_gcc_3dnow=no | ||
|
@@ -727,8 +737,8 @@ dnl Check for various instruction support | |
fi | ||
|
||
AC_ARG_ENABLE(sse, | ||
[AS_HELP_STRING([--enable-sse], [use SSE assembly routines [default=yes]])], | ||
, enable_sse=yes) | ||
[AS_HELP_STRING([--enable-sse], [use SSE assembly routines [[default=maybe]]])], | ||
, enable_sse=$default_ssemath) | ||
if test x$enable_sse = xyes; then | ||
save_CFLAGS="$CFLAGS" | ||
have_gcc_sse=no | ||
|
@@ -2508,6 +2518,17 @@ CheckQNXAudio() | |
fi | ||
} | ||
|
||
dnl Set up the SVGA video driver if enabled | ||
CheckSVGAVideo() | ||
{ | ||
if test x$enable_video = xyes; then | ||
AC_DEFINE(SDL_VIDEO_DRIVER_SVGA, 1, [ ]) | ||
SOURCES="$SOURCES $srcdir/src/video/svga/*.c" | ||
have_video=yes | ||
SUMMARY_video="${SUMMARY_video} svga" | ||
fi | ||
} | ||
|
||
dnl Check to see if OpenGL support is desired | ||
AC_ARG_ENABLE(video-opengl, | ||
[AS_HELP_STRING([--enable-video-opengl], [include OpenGL support [default=yes]])], | ||
|
@@ -3694,6 +3715,17 @@ CheckClockGettime() | |
fi | ||
} | ||
|
||
dnl Check for uclock() | ||
CheckUCLOCK() | ||
{ | ||
AC_ARG_ENABLE(uclock, | ||
AS_HELP_STRING([--enable-uclock], [use uclock() for performance counter on DOS [[default=yes]]]), | ||
, enable_uclock=yes) | ||
if test x$enable_uclock = xyes; then | ||
AC_CHECK_FUNCS(uclock) | ||
fi | ||
} | ||
|
||
dnl Check for a valid linux/version.h | ||
CheckLinuxVersion() | ||
{ | ||
|
@@ -4673,6 +4705,27 @@ dnl BeOS support removed after SDL 2.0.1. Haiku still works. --ryan. | |
have_joystick=yes | ||
fi | ||
;; | ||
*-*-msdosdjgpp*) | ||
ARCH=dos | ||
CheckVisibilityHidden | ||
CheckDeclarationAfterStatement | ||
CheckDummyVideo | ||
CheckDiskAudio | ||
CheckDummyAudio | ||
CheckSVGAVideo | ||
CheckDLOPEN | ||
CheckUCLOCK | ||
|
||
# Set up files for the timer library | ||
if test x$enable_timers = xyes; then | ||
AC_DEFINE(SDL_TIMER_DOS, 1, [ ]) | ||
SOURCES="$SOURCES $srcdir/src/timer/dos/*.c" | ||
have_timers=yes | ||
fi | ||
|
||
# Set up files for shared DOS utilities and event handling | ||
SOURCES="$SOURCES $srcdir/src/core/dos/*.c" | ||
;; | ||
*) | ||
AC_MSG_ERROR([ | ||
*** Unsupported host: Please add to configure.ac | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be detected at runtime for DOS?