├── .gitattributes ├── BIN └── WIN32 │ ├── SDL2.DLL │ ├── TCC.EXE │ ├── LIBTCC.DLL │ ├── RGBASM.EXE │ ├── RGBFIX.EXE │ ├── RGBLINK.EXE │ ├── CONFIG.BAT │ ├── EXEC.BAT │ └── MAKE.BAT ├── SRC ├── CRT │ ├── libtcc1-32.a │ ├── values.h │ ├── stdbool.h │ ├── winapi │ │ ├── poppack.h │ │ ├── pshpack1.h │ │ ├── pshpack2.h │ │ ├── pshpack4.h │ │ ├── pshpack8.h │ │ ├── basetyps.h │ │ ├── windows.h │ │ └── guiddef.h │ ├── vadefs.h │ ├── mem.h │ ├── varargs.h │ ├── sys │ │ ├── unistd.h │ │ ├── fcntl.h │ │ ├── file.h │ │ ├── locking.h │ │ ├── time.h │ │ ├── types.h │ │ ├── timeb.h │ │ └── utime.h │ ├── sec_api │ │ ├── crtdbg_s.h │ │ ├── sys │ │ │ └── timeb_s.h │ │ ├── search_s.h │ │ ├── stralign_s.h │ │ ├── io_s.h │ │ ├── conio_s.h │ │ ├── string_s.h │ │ ├── time_s.h │ │ ├── mbstring_s.h │ │ └── stdlib_s.h │ ├── share.h │ ├── dir.h │ ├── dos.h │ ├── memory.h │ ├── fcntl.h │ ├── float.h │ ├── stddef.h │ ├── assert.h │ ├── errno.h │ ├── signal.h │ ├── direct.h │ ├── locale.h │ ├── stdarg.h │ ├── tcclib.h │ ├── limits.h │ ├── fenv.h │ ├── dirent.h │ ├── excpt.h │ ├── setjmp.h │ ├── _mingw.h │ └── wctype.h ├── SDL │ ├── SDL_revision.h │ ├── SDL_copying.h │ ├── SDL_opengles2_gl2platform.h │ ├── SDL_types.h │ ├── SDL_name.h │ ├── SDL_opengles.h │ ├── close_code.h │ ├── SDL_opengles2.h │ ├── SDL_clipboard.h │ ├── SDL_quit.h │ ├── SDL_gesture.h │ ├── SDL_error.h │ ├── SDL_power.h │ ├── SDL_config_minimal.h │ ├── SDL_metal.h │ ├── SDL_loadso.h │ ├── SDL_touch.h │ ├── LICENSE │ ├── SDL_bits.h │ ├── SDL_config_wiz.h │ ├── SDL_config_pandora.h │ ├── SDL_timer.h │ ├── SDL_config_psp.h │ ├── SDL_config_android.h │ ├── SDL.h │ ├── SDL_config_iphoneos.h │ ├── SDL_messagebox.h │ ├── begin_code.h │ ├── SDL_rect.h │ ├── SDL_filesystem.h │ ├── SDL_blendmode.h │ └── SDL_version.h ├── TBOIDRAW.C ├── TBOIMAP.C ├── MAIN.S ├── DEFINE.S ├── HEADER.S └── UTILS.S ├── .gitignore └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | *.h linguist-language=C 2 | *.c linguist-language=C 3 | -------------------------------------------------------------------------------- /BIN/WIN32/SDL2.DLL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JROB774/gbisaac/HEAD/BIN/WIN32/SDL2.DLL -------------------------------------------------------------------------------- /BIN/WIN32/TCC.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JROB774/gbisaac/HEAD/BIN/WIN32/TCC.EXE -------------------------------------------------------------------------------- /BIN/WIN32/LIBTCC.DLL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JROB774/gbisaac/HEAD/BIN/WIN32/LIBTCC.DLL -------------------------------------------------------------------------------- /BIN/WIN32/RGBASM.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JROB774/gbisaac/HEAD/BIN/WIN32/RGBASM.EXE -------------------------------------------------------------------------------- /BIN/WIN32/RGBFIX.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JROB774/gbisaac/HEAD/BIN/WIN32/RGBFIX.EXE -------------------------------------------------------------------------------- /BIN/WIN32/RGBLINK.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JROB774/gbisaac/HEAD/BIN/WIN32/RGBLINK.EXE -------------------------------------------------------------------------------- /SRC/CRT/libtcc1-32.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/JROB774/gbisaac/HEAD/SRC/CRT/libtcc1-32.a -------------------------------------------------------------------------------- /SRC/SDL/SDL_revision.h: -------------------------------------------------------------------------------- 1 | #define SDL_REVISION "hg-13609:34cc7d3b69d3" 2 | #define SDL_REVISION_NUMBER 13609 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | BGB/ 2 | ROM/ 3 | 4 | *.sublime-project 5 | *.sublime-workspace 6 | 7 | *.GB 8 | 9 | BIN/**/TBOI*.* 10 | -------------------------------------------------------------------------------- /BIN/WIN32/CONFIG.BAT: -------------------------------------------------------------------------------- 1 | @ECHO off 2 | 3 | SET output=..\ROM\TBOI 4 | SET source=MAIN.S 5 | SET object=MAIN.O 6 | SET define=-D DEBUG_BUILD 7 | -------------------------------------------------------------------------------- /SRC/TBOIDRAW.C: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char** argv) 4 | { 5 | printf("Hello, World!\n"); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /SRC/TBOIMAP.C: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char** argv) 4 | { 5 | printf("Hello, World!\n"); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /SRC/CRT/values.h: -------------------------------------------------------------------------------- 1 | /* 2 | * TODO: Nothing here yet. Should provide UNIX compatibility constants 3 | * comparable to those in limits.h and float.h. 4 | */ 5 | -------------------------------------------------------------------------------- /BIN/WIN32/EXEC.BAT: -------------------------------------------------------------------------------- 1 | @ECHO off 2 | SETLOCAL 3 | 4 | CALL CONFIG.BAT 5 | PUSHD ..\.. 6 | START BGB\BGB -watch -rom ROM\%output%.GB 7 | POPD 8 | 9 | ENDLOCAL 10 | -------------------------------------------------------------------------------- /SRC/CRT/stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDBOOL_H 2 | #define _STDBOOL_H 3 | 4 | /* ISOC99 boolean */ 5 | 6 | #define bool _Bool 7 | #define true 1 8 | #define false 0 9 | #define __bool_true_false_are_defined 1 10 | 11 | #endif /* _STDBOOL_H */ 12 | -------------------------------------------------------------------------------- /SRC/CRT/winapi/poppack.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !(defined(lint) || defined(RC_INVOKED)) 7 | #pragma pack(pop) 8 | #endif 9 | -------------------------------------------------------------------------------- /SRC/CRT/winapi/pshpack1.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !(defined(lint) || defined(RC_INVOKED)) 7 | #pragma pack(push,1) 8 | #endif 9 | -------------------------------------------------------------------------------- /SRC/CRT/winapi/pshpack2.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !(defined(lint) || defined(RC_INVOKED)) 7 | #pragma pack(push,2) 8 | #endif 9 | -------------------------------------------------------------------------------- /SRC/CRT/winapi/pshpack4.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !(defined(lint) || defined(RC_INVOKED)) 7 | #pragma pack(push,4) 8 | #endif 9 | -------------------------------------------------------------------------------- /SRC/CRT/winapi/pshpack8.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !(defined(lint) || defined(RC_INVOKED)) 7 | #pragma pack(push,8) 8 | #endif 9 | -------------------------------------------------------------------------------- /SRC/CRT/vadefs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_VADEFS 7 | #define _INC_VADEFS 8 | 9 | //!__TINYC__: GNUC specific stuff removed 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /SRC/CRT/mem.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* 7 | * This file is part of the Mingw32 package. 8 | * 9 | * mem.h maps to string.h 10 | */ 11 | #ifndef __STRICT_ANSI__ 12 | #include 13 | #endif 14 | -------------------------------------------------------------------------------- /SRC/CRT/varargs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _VARARGS_H 7 | #define _VARARGS_H 8 | 9 | #error "TinyCC no longer implements ." 10 | #error "Revise your code to use ." 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /SRC/CRT/sys/unistd.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* 7 | * This file is part of the Mingw32 package. 8 | * 9 | * unistd.h maps (roughly) to io.h 10 | */ 11 | #ifndef __STRICT_ANSI__ 12 | #include 13 | #endif 14 | 15 | -------------------------------------------------------------------------------- /SRC/CRT/sys/fcntl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* 7 | * This file is part of the Mingw32 package. 8 | * 9 | * This fcntl.h maps to the root fcntl.h 10 | */ 11 | #ifndef __STRICT_ANSI__ 12 | #include 13 | #endif 14 | -------------------------------------------------------------------------------- /SRC/CRT/sys/file.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* 7 | * This file is part of the Mingw32 package. 8 | * 9 | * This file.h maps to the root fcntl.h 10 | * TODO? 11 | */ 12 | #ifndef __STRICT_ANSI__ 13 | #include 14 | #endif 15 | -------------------------------------------------------------------------------- /SRC/CRT/sec_api/crtdbg_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | 7 | #ifndef _INC_CRTDBG_S 8 | #define _INC_CRTDBG_S 9 | 10 | #include 11 | 12 | #if defined(MINGW_HAS_SECURE_API) 13 | 14 | #define _dupenv_s_dbg(ps1,size,s2,t,f,l) _dupenv_s(ps1,size,s2) 15 | #define _wdupenv_s_dbg(ps1,size,s2,t,f,l) _wdupenv_s(ps1,size,s2) 16 | 17 | #endif 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /SRC/MAIN.S: -------------------------------------------------------------------------------- 1 | ; ============================================================================== 2 | 3 | INCLUDE "DEFINE.S" 4 | INCLUDE "HEADER.S" 5 | 6 | SECTION "MAIN", ROM0[ADDRMAIN] 7 | 8 | ; ------------------------------------------------------------------------------ 9 | ; this is the entry-point where the execution of our ROM begins 10 | ; ------------------------------------------------------------------------------ 11 | entrypoint: 12 | .loop 13 | jr .loop 14 | ; ------------------------------------------------------------------------------ 15 | 16 | ; ============================================================================== 17 | -------------------------------------------------------------------------------- /SRC/DEFINE.S: -------------------------------------------------------------------------------- 1 | ; ============================================================================== 2 | 3 | ADDRHEAD EQU $0100 ; start of ROMB0 header section 4 | ADDRMAIN EQU $0150 ; start of ROMB0 execution 5 | SCRW EQU 160 ; screen width in pixels 6 | SCRH EQU 144 ; screen height in pixels 7 | R_NR52 EQU $FF26 ; audio control bits (R/W) 8 | R_LCDC EQU $FF40 ; LCD control bits (R/W) 9 | R_LY EQU $FF44 ; LCDC y coordinate [0-153] [144-153]=vblank (R) 10 | R_BGP EQU $FF47 ; BG palette data (W) 11 | 12 | ; ============================================================================== 13 | -------------------------------------------------------------------------------- /SRC/CRT/share.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_SHARE 7 | #define _INC_SHARE 8 | 9 | #ifndef _WIN32 10 | #error Only Win32 target is supported! 11 | #endif 12 | 13 | #define _SH_COMPAT 0x00 14 | #define _SH_DENYRW 0x10 15 | #define _SH_DENYWR 0x20 16 | #define _SH_DENYRD 0x30 17 | #define _SH_DENYNO 0x40 18 | #define _SH_SECURE 0x80 19 | 20 | #ifndef NO_OLDNAMES 21 | #define SH_COMPAT _SH_COMPAT 22 | #define SH_DENYRW _SH_DENYRW 23 | #define SH_DENYWR _SH_DENYWR 24 | #define SH_DENYRD _SH_DENYRD 25 | #define SH_DENYNO _SH_DENYNO 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /SRC/CRT/sys/locking.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_LOCKING 7 | #define _INC_LOCKING 8 | 9 | #ifndef _WIN32 10 | #error Only Win32 target is supported! 11 | #endif 12 | 13 | /* All the headers include this file. */ 14 | #include <_mingw.h> 15 | 16 | #define _LK_UNLCK 0 17 | #define _LK_LOCK 1 18 | #define _LK_NBLCK 2 19 | #define _LK_RLCK 3 20 | #define _LK_NBRLCK 4 21 | 22 | #ifndef NO_OLDNAMES 23 | #define LK_UNLCK _LK_UNLCK 24 | #define LK_LOCK _LK_LOCK 25 | #define LK_NBLCK _LK_NBLCK 26 | #define LK_RLCK _LK_RLCK 27 | #define LK_NBRLCK _LK_NBRLCK 28 | #endif 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /SRC/CRT/sec_api/sys/timeb_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | 7 | #ifndef _TIMEB_H_S 8 | #define _TIMEB_H_S 9 | 10 | #include 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | #if defined(MINGW_HAS_SECURE_API) 17 | 18 | #ifdef _USE_32BIT_TIME_T 19 | #define _ftime_s _ftime32_s 20 | #else 21 | #define _ftime_s _ftime64_s 22 | #endif 23 | 24 | _CRTIMP errno_t __cdecl _ftime32_s(struct __timeb32 *_Time); 25 | #if _INTEGRAL_MAX_BITS >= 64 26 | _CRTIMP errno_t __cdecl _ftime64_s(struct __timeb64 *_Time); 27 | #endif 28 | #endif 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /BIN/WIN32/MAKE.BAT: -------------------------------------------------------------------------------- 1 | @ECHO off 2 | SETLOCAL 3 | 4 | CALL CONFIG.BAT 5 | 6 | PUSHD ..\..\SRC 7 | 8 | :: IF "%~1"=="tools" GOTO MakeTools 9 | :: IF "%~1"=="rom" GOTO MakeROM 10 | :: GOTO Error 11 | 12 | :: :MakeTools 13 | ..\BIN\WIN32\TCC TBOIDRAW.C -bench -I CRT -L CRT -o ..\BIN\WIN32\TBOIDRAW.EXE 14 | ..\BIN\WIN32\TCC TBOIMAP.C -bench -I CRT -L CRT -o ..\BIN\WIN32\TBOIMAP.EXE 15 | :: GOTO End 16 | 17 | :: :MakeROM 18 | IF NOT EXIST ..\ROM MKDIR ..\ROM 19 | ..\BIN\WIN32\RGBASM %define% -o %object% %source% 20 | ..\BIN\WIN32\RGBLINK -n %output%.SYM -o %output%.GB %object% 21 | ..\BIN\WIN32\RGBFIX -v -p 0 %output%.GB 22 | DEL *.O 23 | :: GOTO End 24 | 25 | :: :Error 26 | :: ECHO please specify an argument for making: 27 | :: ECHO rom : build the rom 28 | :: ECHO tools : build dev tools 29 | 30 | :: :End 31 | 32 | POPD 33 | ENDLOCAL 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # The Binding of Isaac: Game Boy Edition 2 | 3 | *This project is a continuation of **[this, now archived, repository](https://github.com/JRob774/gbjam8)**.* 4 | 5 | *The original prototype was made for **[#GBJAM8](https://itch.io/jam/gbjam-8)** (a Game Boy themed game jam).* 6 | 7 | ## Overview 8 | 9 | **The Binding of Isaac: Game Boy Edition** plans to be a *mostly* fully-featured demake of the original Binding of Isaac for 10 | the Nintendo Game Boy system. 11 | 12 | ## Development 13 | 14 | *Section incomplete...* 15 | 16 | ## Building 17 | 18 | *Section incomplete...* 19 | 20 | ## License 21 | 22 | *Section incomplete...* 23 | 24 | *The Binding of Isaac IP and all of its characters are owned by its respective copyright holders and I claim no ownership, 25 | this is simply a fan project made both for fun and educational purposes.* 26 | -------------------------------------------------------------------------------- /SRC/CRT/sec_api/search_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_SEARCH_S 7 | #define _INC_SEARCH_S 8 | 9 | #include 10 | 11 | #if defined(MINGW_HAS_SECURE_API) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | _CRTIMP void *__cdecl _lfind_s(const void *_Key,const void *_Base,unsigned int *_NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(void *,const void *,const void *),void *_Context); 18 | _CRTIMP void *__cdecl _lsearch_s(const void *_Key,void *_Base,unsigned int *_NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(void *,const void *,const void *),void *_Context); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | 24 | #endif 25 | #endif 26 | -------------------------------------------------------------------------------- /SRC/CRT/sec_api/stralign_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef __STRALIGN_H_S_ 7 | #define __STRALIGN_H_S_ 8 | 9 | #include 10 | 11 | #if defined(MINGW_HAS_SECURE_API) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | #if !defined(I_X86_) && defined(_WSTRING_S_DEFINED) 18 | #if defined(__cplusplus) && defined(_WConst_Return) 19 | static __inline PUWSTR ua_wcscpy_s(PUWSTR Destination,size_t DestinationSize,PCUWSTR Source) { 20 | if(WSTR_ALIGNED(Source) && WSTR_ALIGNED(Destination)) return (wcscpy_s((PWSTR)Destination,DestinationSize,(PCWSTR)Source)==0 ? Destination : NULL); 21 | return uaw_wcscpy((PCUWSTR)String,Character); 22 | } 23 | #endif 24 | #endif 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | #endif 30 | #endif 31 | -------------------------------------------------------------------------------- /SRC/SDL/SDL_copying.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | -------------------------------------------------------------------------------- /SRC/CRT/sec_api/io_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_IO_S 7 | #define _INC_IO_S 8 | 9 | #include 10 | 11 | #if defined(MINGW_HAS_SECURE_API) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | _CRTIMP errno_t __cdecl _access_s(const char *_Filename,int _AccessMode); 18 | _CRTIMP errno_t __cdecl _chsize_s(int _FileHandle,__int64 _Size); 19 | _CRTIMP errno_t __cdecl _mktemp_s(char *_TemplateName,size_t _Size); 20 | _CRTIMP errno_t __cdecl _umask_s(int _NewMode,int *_OldMode); 21 | 22 | #ifndef _WIO_S_DEFINED 23 | #define _WIO_S_DEFINED 24 | _CRTIMP errno_t __cdecl _waccess_s(const wchar_t *_Filename,int _AccessMode); 25 | _CRTIMP errno_t __cdecl _wmktemp_s(wchar_t *_TemplateName,size_t _SizeInWords); 26 | #endif 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif 33 | #endif 34 | -------------------------------------------------------------------------------- /SRC/SDL/SDL_opengles2_gl2platform.h: -------------------------------------------------------------------------------- 1 | #ifndef __gl2platform_h_ 2 | #define __gl2platform_h_ 3 | 4 | /* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */ 5 | 6 | /* 7 | * This document is licensed under the SGI Free Software B License Version 8 | * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . 9 | */ 10 | 11 | /* Platform-specific types and definitions for OpenGL ES 2.X gl2.h 12 | * 13 | * Adopters may modify khrplatform.h and this file to suit their platform. 14 | * You are encouraged to submit all modifications to the Khronos group so that 15 | * they can be included in future versions of this file. Please submit changes 16 | * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) 17 | * by filing a bug against product "OpenGL-ES" component "Registry". 18 | */ 19 | 20 | /*#include */ 21 | 22 | #ifndef GL_APICALL 23 | #define GL_APICALL KHRONOS_APICALL 24 | #endif 25 | 26 | #ifndef GL_APIENTRY 27 | #define GL_APIENTRY KHRONOS_APIENTRY 28 | #endif 29 | 30 | #endif /* __gl2platform_h_ */ 31 | -------------------------------------------------------------------------------- /SRC/CRT/dir.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* 7 | * dir.h 8 | * 9 | * This file OBSOLESCENT and only provided for backward compatibility. 10 | * Please use io.h instead. 11 | * 12 | * This file is part of the Mingw32 package. 13 | * 14 | * Contributors: 15 | * Created by Colin Peters 16 | * Mumit Khan 17 | * 18 | * THIS SOFTWARE IS NOT COPYRIGHTED 19 | * 20 | * This source code is offered for use in the public domain. You may 21 | * use, modify or distribute it freely. 22 | * 23 | * This code is distributed in the hope that it will be useful but 24 | * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY 25 | * DISCLAIMED. This includes but is not limited to warranties of 26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 27 | * 28 | */ 29 | 30 | #include 31 | 32 | -------------------------------------------------------------------------------- /SRC/SDL/SDL_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_types.h 24 | * 25 | * \deprecated 26 | */ 27 | 28 | /* DEPRECATED */ 29 | #include "SDL_stdinc.h" 30 | -------------------------------------------------------------------------------- /SRC/SDL/SDL_name.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDLname_h_ 23 | #define SDLname_h_ 24 | 25 | #if defined(__STDC__) || defined(__cplusplus) 26 | #define NeedFunctionPrototypes 1 27 | #endif 28 | 29 | #define SDL_NAME(X) SDL_##X 30 | 31 | #endif /* SDLname_h_ */ 32 | 33 | /* vi: set ts=4 sw=4 expandtab: */ 34 | -------------------------------------------------------------------------------- /SRC/CRT/dos.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_DOS 7 | #define _INC_DOS 8 | 9 | #include <_mingw.h> 10 | #include 11 | 12 | #pragma pack(push,_CRT_PACKING) 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #ifndef _DISKFREE_T_DEFINED 19 | #define _DISKFREE_T_DEFINED 20 | 21 | struct _diskfree_t { 22 | unsigned total_clusters; 23 | unsigned avail_clusters; 24 | unsigned sectors_per_cluster; 25 | unsigned bytes_per_sector; 26 | }; 27 | #endif 28 | 29 | #define _A_NORMAL 0x00 30 | #define _A_RDONLY 0x01 31 | #define _A_HIDDEN 0x02 32 | #define _A_SYSTEM 0x04 33 | #define _A_SUBDIR 0x10 34 | #define _A_ARCH 0x20 35 | 36 | #ifndef _GETDISKFREE_DEFINED 37 | #define _GETDISKFREE_DEFINED 38 | _CRTIMP unsigned __cdecl _getdiskfree(unsigned _Drive,struct _diskfree_t *_DiskFree); 39 | #endif 40 | 41 | #if (defined(_X86_) && !defined(__x86_64)) 42 | void __cdecl _disable(void); 43 | void __cdecl _enable(void); 44 | #endif 45 | 46 | #ifndef NO_OLDNAMES 47 | #define diskfree_t _diskfree_t 48 | #endif 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #pragma pack(pop) 55 | #endif 56 | -------------------------------------------------------------------------------- /SRC/CRT/memory.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_MEMORY 7 | #define _INC_MEMORY 8 | 9 | #include <_mingw.h> 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | #ifndef _CONST_RETURN 16 | #define _CONST_RETURN 17 | #endif 18 | 19 | #define _WConst_return _CONST_RETURN 20 | 21 | #ifndef _CRT_MEMORY_DEFINED 22 | #define _CRT_MEMORY_DEFINED 23 | _CRTIMP void *__cdecl _memccpy(void *_Dst,const void *_Src,int _Val,size_t _MaxCount); 24 | _CONST_RETURN void *__cdecl memchr(const void *_Buf ,int _Val,size_t _MaxCount); 25 | _CRTIMP int __cdecl _memicmp(const void *_Buf1,const void *_Buf2,size_t _Size); 26 | _CRTIMP int __cdecl _memicmp_l(const void *_Buf1,const void *_Buf2,size_t _Size,_locale_t _Locale); 27 | int __cdecl memcmp(const void *_Buf1,const void *_Buf2,size_t _Size); 28 | void *__cdecl memcpy(void *_Dst,const void *_Src,size_t _Size); 29 | void *__cdecl memset(void *_Dst,int _Val,size_t _Size); 30 | 31 | #ifndef NO_OLDNAMES 32 | void *__cdecl memccpy(void *_Dst,const void *_Src,int _Val,size_t _Size); 33 | int __cdecl memicmp(const void *_Buf1,const void *_Buf2,size_t _Size); 34 | #endif 35 | #endif 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | #endif 41 | -------------------------------------------------------------------------------- /SRC/SDL/SDL_opengles.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_opengles.h 24 | * 25 | * This is a simple file to encapsulate the OpenGL ES 1.X API headers. 26 | */ 27 | #include "SDL_config.h" 28 | 29 | #ifdef __IPHONEOS__ 30 | #include 31 | #include 32 | #else 33 | #include 34 | #include 35 | #endif 36 | 37 | #ifndef APIENTRY 38 | #define APIENTRY 39 | #endif 40 | -------------------------------------------------------------------------------- /SRC/CRT/fcntl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #include <_mingw.h> 7 | 8 | #include 9 | 10 | #ifndef _INC_FCNTL 11 | #define _INC_FCNTL 12 | 13 | #define _O_RDONLY 0x0000 14 | #define _O_WRONLY 0x0001 15 | #define _O_RDWR 0x0002 16 | #define _O_APPEND 0x0008 17 | #define _O_CREAT 0x0100 18 | #define _O_TRUNC 0x0200 19 | #define _O_EXCL 0x0400 20 | #define _O_TEXT 0x4000 21 | #define _O_BINARY 0x8000 22 | #define _O_WTEXT 0x10000 23 | #define _O_U16TEXT 0x20000 24 | #define _O_U8TEXT 0x40000 25 | #define _O_ACCMODE (_O_RDONLY|_O_WRONLY|_O_RDWR) 26 | 27 | #define _O_RAW _O_BINARY 28 | #define _O_NOINHERIT 0x0080 29 | #define _O_TEMPORARY 0x0040 30 | #define _O_SHORT_LIVED 0x1000 31 | 32 | #define _O_SEQUENTIAL 0x0020 33 | #define _O_RANDOM 0x0010 34 | 35 | #if !defined(NO_OLDNAMES) || defined(_POSIX) 36 | #define O_RDONLY _O_RDONLY 37 | #define O_WRONLY _O_WRONLY 38 | #define O_RDWR _O_RDWR 39 | #define O_APPEND _O_APPEND 40 | #define O_CREAT _O_CREAT 41 | #define O_TRUNC _O_TRUNC 42 | #define O_EXCL _O_EXCL 43 | #define O_TEXT _O_TEXT 44 | #define O_BINARY _O_BINARY 45 | #define O_RAW _O_BINARY 46 | #define O_TEMPORARY _O_TEMPORARY 47 | #define O_NOINHERIT _O_NOINHERIT 48 | #define O_SEQUENTIAL _O_SEQUENTIAL 49 | #define O_RANDOM _O_RANDOM 50 | #define O_ACCMODE _O_ACCMODE 51 | #endif 52 | #endif 53 | -------------------------------------------------------------------------------- /SRC/CRT/float.h: -------------------------------------------------------------------------------- 1 | #ifndef _FLOAT_H_ 2 | #define _FLOAT_H_ 3 | 4 | #define FLT_RADIX 2 5 | 6 | /* IEEE float */ 7 | #define FLT_MANT_DIG 24 8 | #define FLT_DIG 6 9 | #define FLT_ROUNDS 1 10 | #define FLT_EPSILON 1.19209290e-07F 11 | #define FLT_MIN_EXP (-125) 12 | #define FLT_MIN 1.17549435e-38F 13 | #define FLT_MIN_10_EXP (-37) 14 | #define FLT_MAX_EXP 128 15 | #define FLT_MAX 3.40282347e+38F 16 | #define FLT_MAX_10_EXP 38 17 | 18 | /* IEEE double */ 19 | #define DBL_MANT_DIG 53 20 | #define DBL_DIG 15 21 | #define DBL_EPSILON 2.2204460492503131e-16 22 | #define DBL_MIN_EXP (-1021) 23 | #define DBL_MIN 2.2250738585072014e-308 24 | #define DBL_MIN_10_EXP (-307) 25 | #define DBL_MAX_EXP 1024 26 | #define DBL_MAX 1.7976931348623157e+308 27 | #define DBL_MAX_10_EXP 308 28 | 29 | /* horrible intel long double */ 30 | #if defined __i386__ || defined __x86_64__ 31 | 32 | #define LDBL_MANT_DIG 64 33 | #define LDBL_DIG 18 34 | #define LDBL_EPSILON 1.08420217248550443401e-19L 35 | #define LDBL_MIN_EXP (-16381) 36 | #define LDBL_MIN 3.36210314311209350626e-4932L 37 | #define LDBL_MIN_10_EXP (-4931) 38 | #define LDBL_MAX_EXP 16384 39 | #define LDBL_MAX 1.18973149535723176502e+4932L 40 | #define LDBL_MAX_10_EXP 4932 41 | 42 | #else 43 | 44 | /* same as IEEE double */ 45 | #define LDBL_MANT_DIG 53 46 | #define LDBL_DIG 15 47 | #define LDBL_EPSILON 2.2204460492503131e-16 48 | #define LDBL_MIN_EXP (-1021) 49 | #define LDBL_MIN 2.2250738585072014e-308 50 | #define LDBL_MIN_10_EXP (-307) 51 | #define LDBL_MAX_EXP 1024 52 | #define LDBL_MAX 1.7976931348623157e+308 53 | #define LDBL_MAX_10_EXP 308 54 | 55 | #endif 56 | 57 | #endif /* _FLOAT_H_ */ 58 | -------------------------------------------------------------------------------- /SRC/CRT/stddef.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDDEF_H 2 | #define _STDDEF_H 3 | 4 | typedef __SIZE_TYPE__ size_t; 5 | typedef __PTRDIFF_TYPE__ ssize_t; 6 | typedef __WCHAR_TYPE__ wchar_t; 7 | typedef __PTRDIFF_TYPE__ ptrdiff_t; 8 | typedef __PTRDIFF_TYPE__ intptr_t; 9 | typedef __SIZE_TYPE__ uintptr_t; 10 | 11 | #ifndef __int8_t_defined 12 | #define __int8_t_defined 13 | typedef signed char int8_t; 14 | typedef signed short int int16_t; 15 | typedef signed int int32_t; 16 | #ifdef __LP64__ 17 | typedef signed long int int64_t; 18 | #else 19 | typedef signed long long int int64_t; 20 | #endif 21 | typedef unsigned char uint8_t; 22 | typedef unsigned short int uint16_t; 23 | typedef unsigned int uint32_t; 24 | #ifdef __LP64__ 25 | typedef unsigned long int uint64_t; 26 | #else 27 | typedef unsigned long long int uint64_t; 28 | #endif 29 | #endif 30 | 31 | #ifndef NULL 32 | #define NULL ((void*)0) 33 | #endif 34 | 35 | #define offsetof(type, field) ((size_t)&((type *)0)->field) 36 | 37 | void *alloca(size_t size); 38 | 39 | #endif 40 | 41 | /* Older glibc require a wint_t from (when requested 42 | by __need_wint_t, as otherwise stddef.h isn't allowed to 43 | define this type). Note that this must be outside the normal 44 | _STDDEF_H guard, so that it works even when we've included the file 45 | already (without requiring wint_t). Some other libs define _WINT_T 46 | if they've already provided that type, so we can use that as guard. 47 | TCC defines __WINT_TYPE__ for us. */ 48 | #if defined (__need_wint_t) 49 | #ifndef _WINT_T 50 | #define _WINT_T 51 | typedef __WINT_TYPE__ wint_t; 52 | #endif 53 | #undef __need_wint_t 54 | #endif 55 | -------------------------------------------------------------------------------- /SRC/SDL/close_code.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file close_code.h 24 | * 25 | * This file reverses the effects of begin_code.h and should be included 26 | * after you finish any function and structure declarations in your headers 27 | */ 28 | 29 | #ifndef _begin_code_h 30 | #error close_code.h included without matching begin_code.h 31 | #endif 32 | #undef _begin_code_h 33 | 34 | /* Reset structure packing at previous byte alignment */ 35 | #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) 36 | #ifdef __BORLANDC__ 37 | #pragma nopackwarning 38 | #endif 39 | #pragma pack(pop) 40 | #endif /* Compiler needs structure packing set */ 41 | -------------------------------------------------------------------------------- /SRC/CRT/assert.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef __ASSERT_H_ 7 | #define __ASSERT_H_ 8 | 9 | #include <_mingw.h> 10 | #ifdef __cplusplus 11 | #include 12 | #endif 13 | 14 | #ifdef NDEBUG 15 | #ifndef assert 16 | #define assert(_Expression) ((void)0) 17 | #endif 18 | #else 19 | 20 | #ifndef _CRT_TERMINATE_DEFINED 21 | #define _CRT_TERMINATE_DEFINED 22 | void __cdecl __MINGW_NOTHROW exit(int _Code) __MINGW_ATTRIB_NORETURN; 23 | _CRTIMP void __cdecl __MINGW_NOTHROW _exit(int _Code) __MINGW_ATTRIB_NORETURN; 24 | #if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */ 25 | /* C99 function name */ 26 | void __cdecl _Exit(int) __MINGW_ATTRIB_NORETURN; 27 | __CRT_INLINE __MINGW_ATTRIB_NORETURN void __cdecl _Exit(int status) 28 | { _exit(status); } 29 | #endif 30 | 31 | #pragma push_macro("abort") 32 | #undef abort 33 | void __cdecl __declspec(noreturn) abort(void); 34 | #pragma pop_macro("abort") 35 | 36 | #endif 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | 43 | extern void __cdecl _wassert(const wchar_t *_Message,const wchar_t *_File,unsigned _Line); 44 | extern void __cdecl _assert(const char *, const char *, unsigned); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #ifndef assert 51 | //#define assert(_Expression) (void)((!!(_Expression)) || (_wassert(_CRT_WIDE(#_Expression),_CRT_WIDE(__FILE__),__LINE__),0)) 52 | #define assert(e) ((e) ? (void)0 : _assert(#e, __FILE__, __LINE__)) 53 | #endif 54 | 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /SRC/CRT/sec_api/conio_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | 7 | #ifndef _INC_CONIO_S 8 | #define _INC_CONIO_S 9 | 10 | #include 11 | 12 | #if defined(MINGW_HAS_SECURE_API) 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | _CRTIMP errno_t __cdecl _cgets_s(char *_Buffer,size_t _Size,size_t *_SizeRead); 19 | _CRTIMP int __cdecl _cprintf_s(const char *_Format,...); 20 | _CRTIMP int __cdecl _cscanf_s(const char *_Format,...); 21 | _CRTIMP int __cdecl _cscanf_s_l(const char *_Format,_locale_t _Locale,...); 22 | _CRTIMP int __cdecl _vcprintf_s(const char *_Format,va_list _ArgList); 23 | _CRTIMP int __cdecl _cprintf_s_l(const char *_Format,_locale_t _Locale,...); 24 | _CRTIMP int __cdecl _vcprintf_s_l(const char *_Format,_locale_t _Locale,va_list _ArgList); 25 | 26 | #ifndef _WCONIO_DEFINED_S 27 | #define _WCONIO_DEFINED_S 28 | _CRTIMP errno_t __cdecl _cgetws_s(wchar_t *_Buffer,size_t _SizeInWords,size_t *_SizeRead); 29 | _CRTIMP int __cdecl _cwprintf_s(const wchar_t *_Format,...); 30 | _CRTIMP int __cdecl _cwscanf_s(const wchar_t *_Format,...); 31 | _CRTIMP int __cdecl _cwscanf_s_l(const wchar_t *_Format,_locale_t _Locale,...); 32 | _CRTIMP int __cdecl _vcwprintf_s(const wchar_t *_Format,va_list _ArgList); 33 | _CRTIMP int __cdecl _cwprintf_s_l(const wchar_t *_Format,_locale_t _Locale,...); 34 | _CRTIMP int __cdecl _vcwprintf_s_l(const wchar_t *_Format,_locale_t _Locale,va_list _ArgList); 35 | #endif 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | #endif 42 | #endif 43 | -------------------------------------------------------------------------------- /SRC/CRT/errno.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_ERRNO 7 | #define _INC_ERRNO 8 | 9 | #include <_mingw.h> 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | #ifndef _CRT_ERRNO_DEFINED 16 | #define _CRT_ERRNO_DEFINED 17 | _CRTIMP extern int *__cdecl _errno(void); 18 | #define errno (*_errno()) 19 | 20 | errno_t __cdecl _set_errno(int _Value); 21 | errno_t __cdecl _get_errno(int *_Value); 22 | #endif 23 | 24 | #define EPERM 1 25 | #define ENOENT 2 26 | #define ESRCH 3 27 | #define EINTR 4 28 | #define EIO 5 29 | #define ENXIO 6 30 | #define E2BIG 7 31 | #define ENOEXEC 8 32 | #define EBADF 9 33 | #define ECHILD 10 34 | #define EAGAIN 11 35 | #define ENOMEM 12 36 | #define EACCES 13 37 | #define EFAULT 14 38 | #define EBUSY 16 39 | #define EEXIST 17 40 | #define EXDEV 18 41 | #define ENODEV 19 42 | #define ENOTDIR 20 43 | #define EISDIR 21 44 | #define ENFILE 23 45 | #define EMFILE 24 46 | #define ENOTTY 25 47 | #define EFBIG 27 48 | #define ENOSPC 28 49 | #define ESPIPE 29 50 | #define EROFS 30 51 | #define EMLINK 31 52 | #define EPIPE 32 53 | #define EDOM 33 54 | #define EDEADLK 36 55 | #define ENAMETOOLONG 38 56 | #define ENOLCK 39 57 | #define ENOSYS 40 58 | #define ENOTEMPTY 41 59 | 60 | #ifndef RC_INVOKED 61 | #if !defined(_SECURECRT_ERRCODE_VALUES_DEFINED) 62 | #define _SECURECRT_ERRCODE_VALUES_DEFINED 63 | #define EINVAL 22 64 | #define ERANGE 34 65 | #define EILSEQ 42 66 | #define STRUNCATE 80 67 | #endif 68 | #endif 69 | 70 | #define EDEADLOCK EDEADLK 71 | 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | #endif 76 | -------------------------------------------------------------------------------- /SRC/SDL/SDL_opengles2.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_opengles2.h 24 | * 25 | * This is a simple file to encapsulate the OpenGL ES 2.0 API headers. 26 | */ 27 | #include "SDL_config.h" 28 | 29 | #ifndef _MSC_VER 30 | 31 | #ifdef __IPHONEOS__ 32 | #include 33 | #include 34 | #else 35 | #include 36 | #include 37 | #include 38 | #endif 39 | 40 | #else /* _MSC_VER */ 41 | 42 | /* OpenGL ES2 headers for Visual Studio */ 43 | #include "SDL_opengles2_khrplatform.h" 44 | #include "SDL_opengles2_gl2platform.h" 45 | #include "SDL_opengles2_gl2.h" 46 | #include "SDL_opengles2_gl2ext.h" 47 | 48 | #endif /* _MSC_VER */ 49 | 50 | #ifndef APIENTRY 51 | #define APIENTRY GL_APIENTRY 52 | #endif 53 | -------------------------------------------------------------------------------- /SRC/CRT/signal.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_SIGNAL 7 | #define _INC_SIGNAL 8 | 9 | #include <_mingw.h> 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | #ifndef _SIG_ATOMIC_T_DEFINED 16 | #define _SIG_ATOMIC_T_DEFINED 17 | typedef int sig_atomic_t; 18 | #endif 19 | 20 | #define NSIG 23 21 | 22 | #define SIGHUP 1 /* hangup */ 23 | #define SIGINT 2 24 | #define SIGQUIT 3 /* quit */ 25 | #define SIGILL 4 26 | #define SIGTRAP 5 /* trace trap (not reset when caught) */ 27 | #define SIGIOT 6 /* IOT instruction */ 28 | #define SIGABRT 6 /* used by abort, replace SIGIOT in the future */ 29 | #define SIGEMT 7 /* EMT instruction */ 30 | #define SIGFPE 8 31 | #define SIGKILL 9 /* kill (cannot be caught or ignored) */ 32 | #define SIGBUS 10 /* bus error */ 33 | #define SIGSEGV 11 34 | #define SIGSYS 12 /* bad argument to system call */ 35 | #define SIGPIPE 13 /* write on a pipe with no one to read it */ 36 | #ifdef __USE_MINGW_ALARM 37 | #define SIGALRM 14 /* alarm clock */ 38 | #endif 39 | #define SIGTERM 15 40 | #define SIGBREAK 21 41 | #define SIGABRT2 22 42 | 43 | #define SIGABRT_COMPAT 6 44 | 45 | typedef void (*__p_sig_fn_t)(int); 46 | 47 | #define SIG_DFL (__p_sig_fn_t)0 48 | #define SIG_IGN (__p_sig_fn_t)1 49 | #define SIG_GET (__p_sig_fn_t)2 50 | #define SIG_SGE (__p_sig_fn_t)3 51 | #define SIG_ACK (__p_sig_fn_t)4 52 | #define SIG_ERR (__p_sig_fn_t)-1 53 | 54 | extern void **__cdecl __pxcptinfoptrs(void); 55 | #define _pxcptinfoptrs (*__pxcptinfoptrs()) 56 | 57 | __p_sig_fn_t __cdecl signal(int _SigNum,__p_sig_fn_t _Func); 58 | int __cdecl raise(int _SigNum); 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | #endif 64 | -------------------------------------------------------------------------------- /SRC/CRT/sec_api/string_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_STRING_S 7 | #define _INC_STRING_S 8 | 9 | #include 10 | 11 | #if defined(MINGW_HAS_SECURE_API) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | _CRTIMP errno_t __cdecl _strset_s(char *_Dst,size_t _DstSize,int _Value); 18 | _CRTIMP errno_t __cdecl _strerror_s(char *_Buf,size_t _SizeInBytes,const char *_ErrMsg); 19 | _CRTIMP errno_t __cdecl _strlwr_s(char *_Str,size_t _Size); 20 | _CRTIMP errno_t __cdecl _strlwr_s_l(char *_Str,size_t _Size,_locale_t _Locale); 21 | _CRTIMP errno_t __cdecl _strnset_s(char *_Str,size_t _Size,int _Val,size_t _MaxCount); 22 | _CRTIMP errno_t __cdecl _strupr_s(char *_Str,size_t _Size); 23 | _CRTIMP errno_t __cdecl _strupr_s_l(char *_Str,size_t _Size,_locale_t _Locale); 24 | #ifndef _WSTRING_S_DEFINED 25 | #define _WSTRING_S_DEFINED 26 | _CRTIMP wchar_t *__cdecl wcstok_s(wchar_t *_Str,const wchar_t *_Delim,wchar_t **_Context); 27 | _CRTIMP errno_t __cdecl _wcserror_s(wchar_t *_Buf,size_t _SizeInWords,int _ErrNum); 28 | _CRTIMP errno_t __cdecl __wcserror_s(wchar_t *_Buffer,size_t _SizeInWords,const wchar_t *_ErrMsg); 29 | _CRTIMP errno_t __cdecl _wcsnset_s(wchar_t *_Dst,size_t _DstSizeInWords,wchar_t _Val,size_t _MaxCount); 30 | _CRTIMP errno_t __cdecl _wcsset_s(wchar_t *_Str,size_t _SizeInWords,wchar_t _Val); 31 | _CRTIMP errno_t __cdecl _wcslwr_s(wchar_t *_Str,size_t _SizeInWords); 32 | _CRTIMP errno_t __cdecl _wcslwr_s_l(wchar_t *_Str,size_t _SizeInWords,_locale_t _Locale); 33 | _CRTIMP errno_t __cdecl _wcsupr_s(wchar_t *_Str,size_t _Size); 34 | _CRTIMP errno_t __cdecl _wcsupr_s_l(wchar_t *_Str,size_t _Size,_locale_t _Locale); 35 | #endif 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | #endif 41 | #endif 42 | -------------------------------------------------------------------------------- /SRC/CRT/sys/time.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | 7 | #ifndef _SYS_TIME_H_ 8 | #define _SYS_TIME_H_ 9 | 10 | #include 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | #ifndef __STRICT_ANSI__ 17 | #ifndef _TIMEVAL_DEFINED /* also in winsock[2].h */ 18 | #define _TIMEVAL_DEFINED 19 | struct timeval { 20 | long tv_sec; 21 | long tv_usec; 22 | }; 23 | #define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) 24 | #define timercmp(tvp, uvp, cmp) \ 25 | (((tvp)->tv_sec != (uvp)->tv_sec) ? \ 26 | ((tvp)->tv_sec cmp (uvp)->tv_sec) : \ 27 | ((tvp)->tv_usec cmp (uvp)->tv_usec)) 28 | #define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 29 | #endif /* _TIMEVAL_DEFINED */ 30 | 31 | #ifndef _TIMEZONE_DEFINED /* also in sys/time.h */ 32 | #define _TIMEZONE_DEFINED 33 | /* Provided for compatibility with code that assumes that 34 | the presence of gettimeofday function implies a definition 35 | of struct timezone. */ 36 | struct timezone 37 | { 38 | int tz_minuteswest; /* of Greenwich */ 39 | int tz_dsttime; /* type of dst correction to apply */ 40 | }; 41 | 42 | extern int __cdecl mingw_gettimeofday (struct timeval *p, struct timezone *z); 43 | 44 | #endif 45 | 46 | /* 47 | Implementation as per: 48 | The Open Group Base Specifications, Issue 6 49 | IEEE Std 1003.1, 2004 Edition 50 | 51 | The timezone pointer arg is ignored. Errors are ignored. 52 | */ 53 | #ifndef _GETTIMEOFDAY_DEFINED 54 | #define _GETTIMEOFDAY_DEFINED 55 | int __cdecl gettimeofday(struct timeval *__restrict__, 56 | void *__restrict__ /* tzp (unused) */); 57 | #endif 58 | 59 | #endif /* __STRICT_ANSI__ */ 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | /* Adding timespec definition. */ 66 | #include 67 | 68 | 69 | #endif /* _SYS_TIME_H_ */ 70 | -------------------------------------------------------------------------------- /SRC/CRT/direct.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_DIRECT 7 | #define _INC_DIRECT 8 | 9 | #include <_mingw.h> 10 | #include 11 | 12 | #pragma pack(push,_CRT_PACKING) 13 | 14 | #ifdef __cplusplus 15 | extern "C" { 16 | #endif 17 | 18 | #ifndef _DISKFREE_T_DEFINED 19 | #define _DISKFREE_T_DEFINED 20 | struct _diskfree_t { 21 | unsigned total_clusters; 22 | unsigned avail_clusters; 23 | unsigned sectors_per_cluster; 24 | unsigned bytes_per_sector; 25 | }; 26 | #endif 27 | 28 | _CRTIMP char *__cdecl _getcwd(char *_DstBuf,int _SizeInBytes); 29 | _CRTIMP char *__cdecl _getdcwd(int _Drive,char *_DstBuf,int _SizeInBytes); 30 | char *__cdecl _getdcwd_nolock(int _Drive,char *_DstBuf,int _SizeInBytes); 31 | _CRTIMP int __cdecl _chdir(const char *_Path); 32 | _CRTIMP int __cdecl _mkdir(const char *_Path); 33 | _CRTIMP int __cdecl _rmdir(const char *_Path); 34 | _CRTIMP int __cdecl _chdrive(int _Drive); 35 | _CRTIMP int __cdecl _getdrive(void); 36 | _CRTIMP unsigned long __cdecl _getdrives(void); 37 | 38 | #ifndef _GETDISKFREE_DEFINED 39 | #define _GETDISKFREE_DEFINED 40 | _CRTIMP unsigned __cdecl _getdiskfree(unsigned _Drive,struct _diskfree_t *_DiskFree); 41 | #endif 42 | 43 | #ifndef _WDIRECT_DEFINED 44 | #define _WDIRECT_DEFINED 45 | _CRTIMP wchar_t *__cdecl _wgetcwd(wchar_t *_DstBuf,int _SizeInWords); 46 | _CRTIMP wchar_t *__cdecl _wgetdcwd(int _Drive,wchar_t *_DstBuf,int _SizeInWords); 47 | wchar_t *__cdecl _wgetdcwd_nolock(int _Drive,wchar_t *_DstBuf,int _SizeInWords); 48 | _CRTIMP int __cdecl _wchdir(const wchar_t *_Path); 49 | _CRTIMP int __cdecl _wmkdir(const wchar_t *_Path); 50 | _CRTIMP int __cdecl _wrmdir(const wchar_t *_Path); 51 | #endif 52 | 53 | #ifndef NO_OLDNAMES 54 | 55 | #define diskfree_t _diskfree_t 56 | 57 | char *__cdecl getcwd(char *_DstBuf,int _SizeInBytes); 58 | int __cdecl chdir(const char *_Path); 59 | int __cdecl mkdir(const char *_Path); 60 | int __cdecl rmdir(const char *_Path); 61 | #endif 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | 67 | #pragma pack(pop) 68 | #endif 69 | -------------------------------------------------------------------------------- /SRC/SDL/SDL_clipboard.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_clipboard.h 24 | * 25 | * Include file for SDL clipboard handling 26 | */ 27 | 28 | #ifndef SDL_clipboard_h_ 29 | #define SDL_clipboard_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* Function prototypes */ 40 | 41 | /** 42 | * \brief Put UTF-8 text into the clipboard 43 | * 44 | * \sa SDL_GetClipboardText() 45 | */ 46 | extern DECLSPEC int SDLCALL SDL_SetClipboardText(const char *text); 47 | 48 | /** 49 | * \brief Get UTF-8 text from the clipboard, which must be freed with SDL_free() 50 | * 51 | * \sa SDL_SetClipboardText() 52 | */ 53 | extern DECLSPEC char * SDLCALL SDL_GetClipboardText(void); 54 | 55 | /** 56 | * \brief Returns a flag indicating whether the clipboard exists and contains a text string that is non-empty 57 | * 58 | * \sa SDL_GetClipboardText() 59 | */ 60 | extern DECLSPEC SDL_bool SDLCALL SDL_HasClipboardText(void); 61 | 62 | 63 | /* Ends C function definitions when using C++ */ 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | #include "close_code.h" 68 | 69 | #endif /* SDL_clipboard_h_ */ 70 | 71 | /* vi: set ts=4 sw=4 expandtab: */ 72 | -------------------------------------------------------------------------------- /SRC/SDL/SDL_quit.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_quit.h 24 | * 25 | * Include file for SDL quit event handling. 26 | */ 27 | 28 | #ifndef SDL_quit_h_ 29 | #define SDL_quit_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | 34 | /** 35 | * \file SDL_quit.h 36 | * 37 | * An ::SDL_QUIT event is generated when the user tries to close the application 38 | * window. If it is ignored or filtered out, the window will remain open. 39 | * If it is not ignored or filtered, it is queued normally and the window 40 | * is allowed to close. When the window is closed, screen updates will 41 | * complete, but have no effect. 42 | * 43 | * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) 44 | * and SIGTERM (system termination request), if handlers do not already 45 | * exist, that generate ::SDL_QUIT events as well. There is no way 46 | * to determine the cause of an ::SDL_QUIT event, but setting a signal 47 | * handler in your application will override the default generation of 48 | * quit events for that signal. 49 | * 50 | * \sa SDL_Quit() 51 | */ 52 | 53 | /* There are no functions directly affecting the quit event */ 54 | 55 | #define SDL_QuitRequested() \ 56 | (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0)) 57 | 58 | #endif /* SDL_quit_h_ */ 59 | -------------------------------------------------------------------------------- /SRC/CRT/locale.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_LOCALE 7 | #define _INC_LOCALE 8 | 9 | #include <_mingw.h> 10 | 11 | #pragma pack(push,_CRT_PACKING) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | #ifndef NULL 18 | #ifdef __cplusplus 19 | #define NULL 0 20 | #else 21 | #define NULL ((void *)0) 22 | #endif 23 | #endif 24 | 25 | #define LC_ALL 0 26 | #define LC_COLLATE 1 27 | #define LC_CTYPE 2 28 | #define LC_MONETARY 3 29 | #define LC_NUMERIC 4 30 | #define LC_TIME 5 31 | 32 | #define LC_MIN LC_ALL 33 | #define LC_MAX LC_TIME 34 | 35 | #ifndef _LCONV_DEFINED 36 | #define _LCONV_DEFINED 37 | struct lconv { 38 | char *decimal_point; 39 | char *thousands_sep; 40 | char *grouping; 41 | char *int_curr_symbol; 42 | char *currency_symbol; 43 | char *mon_decimal_point; 44 | char *mon_thousands_sep; 45 | char *mon_grouping; 46 | char *positive_sign; 47 | char *negative_sign; 48 | char int_frac_digits; 49 | char frac_digits; 50 | char p_cs_precedes; 51 | char p_sep_by_space; 52 | char n_cs_precedes; 53 | char n_sep_by_space; 54 | char p_sign_posn; 55 | char n_sign_posn; 56 | }; 57 | #endif 58 | 59 | #ifndef _CONFIG_LOCALE_SWT 60 | #define _CONFIG_LOCALE_SWT 61 | 62 | #define _ENABLE_PER_THREAD_LOCALE 0x1 63 | #define _DISABLE_PER_THREAD_LOCALE 0x2 64 | #define _ENABLE_PER_THREAD_LOCALE_GLOBAL 0x10 65 | #define _DISABLE_PER_THREAD_LOCALE_GLOBAL 0x20 66 | #define _ENABLE_PER_THREAD_LOCALE_NEW 0x100 67 | #define _DISABLE_PER_THREAD_LOCALE_NEW 0x200 68 | 69 | #endif 70 | 71 | int __cdecl _configthreadlocale(int _Flag); 72 | char *__cdecl setlocale(int _Category,const char *_Locale); 73 | _CRTIMP struct lconv *__cdecl localeconv(void); 74 | _locale_t __cdecl _get_current_locale(void); 75 | _locale_t __cdecl _create_locale(int _Category,const char *_Locale); 76 | void __cdecl _free_locale(_locale_t _Locale); 77 | _locale_t __cdecl __get_current_locale(void); 78 | _locale_t __cdecl __create_locale(int _Category,const char *_Locale); 79 | void __cdecl __free_locale(_locale_t _Locale); 80 | 81 | #ifndef _WLOCALE_DEFINED 82 | #define _WLOCALE_DEFINED 83 | _CRTIMP wchar_t *__cdecl _wsetlocale(int _Category,const wchar_t *_Locale); 84 | #endif 85 | 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | 90 | #pragma pack(pop) 91 | #endif 92 | -------------------------------------------------------------------------------- /SRC/SDL/SDL_gesture.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_gesture.h 24 | * 25 | * Include file for SDL gesture event handling. 26 | */ 27 | 28 | #ifndef SDL_gesture_h_ 29 | #define SDL_gesture_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | #include "SDL_video.h" 34 | 35 | #include "SDL_touch.h" 36 | 37 | 38 | #include "begin_code.h" 39 | /* Set up for C function definitions, even when using C++ */ 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | typedef Sint64 SDL_GestureID; 45 | 46 | /* Function prototypes */ 47 | 48 | /** 49 | * \brief Begin Recording a gesture on the specified touch, or all touches (-1) 50 | * 51 | * 52 | */ 53 | extern DECLSPEC int SDLCALL SDL_RecordGesture(SDL_TouchID touchId); 54 | 55 | 56 | /** 57 | * \brief Save all currently loaded Dollar Gesture templates 58 | * 59 | * 60 | */ 61 | extern DECLSPEC int SDLCALL SDL_SaveAllDollarTemplates(SDL_RWops *dst); 62 | 63 | /** 64 | * \brief Save a currently loaded Dollar Gesture template 65 | * 66 | * 67 | */ 68 | extern DECLSPEC int SDLCALL SDL_SaveDollarTemplate(SDL_GestureID gestureId,SDL_RWops *dst); 69 | 70 | 71 | /** 72 | * \brief Load Dollar Gesture templates from a file 73 | * 74 | * 75 | */ 76 | extern DECLSPEC int SDLCALL SDL_LoadDollarTemplates(SDL_TouchID touchId, SDL_RWops *src); 77 | 78 | 79 | /* Ends C function definitions when using C++ */ 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | #include "close_code.h" 84 | 85 | #endif /* SDL_gesture_h_ */ 86 | 87 | /* vi: set ts=4 sw=4 expandtab: */ 88 | -------------------------------------------------------------------------------- /SRC/CRT/sec_api/time_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _TIME_H__S 7 | #define _TIME_H__S 8 | 9 | #include 10 | 11 | #if defined(MINGW_HAS_SECURE_API) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | _CRTIMP errno_t __cdecl _ctime32_s(char *_Buf,size_t _SizeInBytes,const __time32_t *_Time); 18 | _CRTIMP errno_t __cdecl _gmtime32_s(struct tm *_Tm,const __time32_t *_Time); 19 | _CRTIMP errno_t __cdecl _localtime32_s(struct tm *_Tm,const __time32_t *_Time); 20 | _CRTIMP errno_t __cdecl _strdate_s(char *_Buf,size_t _SizeInBytes); 21 | _CRTIMP errno_t __cdecl _strtime_s(char *_Buf ,size_t _SizeInBytes); 22 | #if _INTEGRAL_MAX_BITS >= 64 23 | _CRTIMP errno_t __cdecl _ctime64_s(char *_Buf,size_t _SizeInBytes,const __time64_t *_Time); 24 | _CRTIMP errno_t __cdecl _gmtime64_s(struct tm *_Tm,const __time64_t *_Time); 25 | _CRTIMP errno_t __cdecl _localtime64_s(struct tm *_Tm,const __time64_t *_Time); 26 | #endif 27 | 28 | #ifndef _WTIME_S_DEFINED 29 | #define _WTIME_S_DEFINED 30 | _CRTIMP errno_t __cdecl _wasctime_s(wchar_t *_Buf,size_t _SizeInWords,const struct tm *_Tm); 31 | _CRTIMP errno_t __cdecl _wctime32_s(wchar_t *_Buf,size_t _SizeInWords,const __time32_t *_Time); 32 | _CRTIMP errno_t __cdecl _wstrdate_s(wchar_t *_Buf,size_t _SizeInWords); 33 | _CRTIMP errno_t __cdecl _wstrtime_s(wchar_t *_Buf,size_t _SizeInWords); 34 | #if _INTEGRAL_MAX_BITS >= 64 35 | _CRTIMP errno_t __cdecl _wctime64_s(wchar_t *_Buf,size_t _SizeInWords,const __time64_t *_Time); 36 | #endif 37 | 38 | #if !defined (RC_INVOKED) && !defined (_INC_WTIME_S_INL) 39 | #define _INC_WTIME_S_INL 40 | #ifdef _USE_32BIT_TIME_T 41 | __CRT_INLINE errno_t __cdecl _wctime_s(wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) { return _wctime32_s(_Buffer,_SizeInWords,_Time); } 42 | #else 43 | __CRT_INLINE errno_t __cdecl _wctime_s(wchar_t *_Buffer,size_t _SizeInWords,const time_t *_Time) { return _wctime64_s(_Buffer,_SizeInWords,_Time); } 44 | #endif 45 | #endif 46 | #endif 47 | 48 | #ifndef RC_INVOKED 49 | #ifdef _USE_32BIT_TIME_T 50 | __CRT_INLINE errno_t __cdecl localtime_s(struct tm *_Tm,const time_t *_Time) { return _localtime32_s(_Tm,_Time); } 51 | #else 52 | __CRT_INLINE errno_t __cdecl localtime_s(struct tm *_Tm,const time_t *_Time) { return _localtime64_s(_Tm,_Time); } 53 | #endif 54 | #endif 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif 61 | #endif 62 | -------------------------------------------------------------------------------- /SRC/SDL/SDL_error.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_error.h 24 | * 25 | * Simple error message routines for SDL. 26 | */ 27 | 28 | #ifndef SDL_error_h_ 29 | #define SDL_error_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* Public functions */ 40 | /* SDL_SetError() unconditionally returns -1. */ 41 | extern DECLSPEC int SDLCALL SDL_SetError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); 42 | extern DECLSPEC const char *SDLCALL SDL_GetError(void); 43 | extern DECLSPEC void SDLCALL SDL_ClearError(void); 44 | 45 | /** 46 | * \name Internal error functions 47 | * 48 | * \internal 49 | * Private error reporting function - used internally. 50 | */ 51 | /* @{ */ 52 | #define SDL_OutOfMemory() SDL_Error(SDL_ENOMEM) 53 | #define SDL_Unsupported() SDL_Error(SDL_UNSUPPORTED) 54 | #define SDL_InvalidParamError(param) SDL_SetError("Parameter '%s' is invalid", (param)) 55 | typedef enum 56 | { 57 | SDL_ENOMEM, 58 | SDL_EFREAD, 59 | SDL_EFWRITE, 60 | SDL_EFSEEK, 61 | SDL_UNSUPPORTED, 62 | SDL_LASTERROR 63 | } SDL_errorcode; 64 | /* SDL_Error() unconditionally returns -1. */ 65 | extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code); 66 | /* @} *//* Internal error functions */ 67 | 68 | /* Ends C function definitions when using C++ */ 69 | #ifdef __cplusplus 70 | } 71 | #endif 72 | #include "close_code.h" 73 | 74 | #endif /* SDL_error_h_ */ 75 | 76 | /* vi: set ts=4 sw=4 expandtab: */ 77 | -------------------------------------------------------------------------------- /SRC/CRT/sys/types.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_TYPES 7 | #define _INC_TYPES 8 | 9 | #ifndef _WIN32 10 | #error Only Win32 target is supported! 11 | #endif 12 | 13 | #include <_mingw.h> 14 | 15 | #ifndef __TINYC__ /* gr */ 16 | #ifdef _USE_32BIT_TIME_T 17 | #ifdef _WIN64 18 | #undef _USE_32BIT_TIME_T 19 | #endif 20 | #else 21 | #if _INTEGRAL_MAX_BITS < 64 22 | #define _USE_32BIT_TIME_T 23 | #endif 24 | #endif 25 | #endif 26 | 27 | #ifndef _TIME32_T_DEFINED 28 | #define _TIME32_T_DEFINED 29 | typedef long __time32_t; 30 | #endif 31 | 32 | #ifndef _TIME64_T_DEFINED 33 | #define _TIME64_T_DEFINED 34 | #if _INTEGRAL_MAX_BITS >= 64 35 | typedef __int64 __time64_t; 36 | #endif 37 | #endif 38 | 39 | #ifndef _TIME_T_DEFINED 40 | #define _TIME_T_DEFINED 41 | #ifdef _USE_32BIT_TIME_T 42 | typedef __time32_t time_t; 43 | #else 44 | typedef __time64_t time_t; 45 | #endif 46 | #endif 47 | 48 | #ifndef _INO_T_DEFINED 49 | #define _INO_T_DEFINED 50 | typedef unsigned short _ino_t; 51 | #ifndef NO_OLDNAMES 52 | typedef unsigned short ino_t; 53 | #endif 54 | #endif 55 | 56 | #ifndef _DEV_T_DEFINED 57 | #define _DEV_T_DEFINED 58 | typedef unsigned int _dev_t; 59 | #ifndef NO_OLDNAMES 60 | typedef unsigned int dev_t; 61 | #endif 62 | #endif 63 | 64 | #ifndef _PID_T_ 65 | #define _PID_T_ 66 | #ifndef _WIN64 67 | typedef int _pid_t; 68 | #else 69 | typedef __int64 _pid_t; 70 | #endif 71 | 72 | #ifndef NO_OLDNAMES 73 | typedef _pid_t pid_t; 74 | #endif 75 | #endif /* Not _PID_T_ */ 76 | 77 | #ifndef _MODE_T_ 78 | #define _MODE_T_ 79 | typedef unsigned short _mode_t; 80 | 81 | #ifndef NO_OLDNAMES 82 | typedef _mode_t mode_t; 83 | #endif 84 | #endif /* Not _MODE_T_ */ 85 | 86 | #ifndef _OFF_T_DEFINED 87 | #define _OFF_T_DEFINED 88 | #ifndef _OFF_T_ 89 | #define _OFF_T_ 90 | typedef long _off_t; 91 | #if !defined(NO_OLDNAMES) || defined(_POSIX) 92 | typedef long off_t; 93 | #endif 94 | #endif 95 | #endif 96 | 97 | #ifndef _OFF64_T_DEFINED 98 | #define _OFF64_T_DEFINED 99 | typedef long long _off64_t; 100 | #if !defined(NO_OLDNAMES) || defined(_POSIX) 101 | typedef long long off64_t; 102 | #endif 103 | #endif 104 | 105 | #ifndef _TIMESPEC_DEFINED 106 | #define _TIMESPEC_DEFINED 107 | struct timespec { 108 | time_t tv_sec; /* Seconds */ 109 | long tv_nsec; /* Nanoseconds */ 110 | }; 111 | 112 | struct itimerspec { 113 | struct timespec it_interval; /* Timer period */ 114 | struct timespec it_value; /* Timer expiration */ 115 | }; 116 | #endif 117 | 118 | #endif 119 | -------------------------------------------------------------------------------- /SRC/SDL/SDL_power.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_power_h_ 23 | #define SDL_power_h_ 24 | 25 | /** 26 | * \file SDL_power.h 27 | * 28 | * Header for the SDL power management routines. 29 | */ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** 40 | * \brief The basic state for the system's power supply. 41 | */ 42 | typedef enum 43 | { 44 | SDL_POWERSTATE_UNKNOWN, /**< cannot determine power status */ 45 | SDL_POWERSTATE_ON_BATTERY, /**< Not plugged in, running on the battery */ 46 | SDL_POWERSTATE_NO_BATTERY, /**< Plugged in, no battery available */ 47 | SDL_POWERSTATE_CHARGING, /**< Plugged in, charging battery */ 48 | SDL_POWERSTATE_CHARGED /**< Plugged in, battery charged */ 49 | } SDL_PowerState; 50 | 51 | 52 | /** 53 | * \brief Get the current power supply details. 54 | * 55 | * \param secs Seconds of battery life left. You can pass a NULL here if 56 | * you don't care. Will return -1 if we can't determine a 57 | * value, or we're not running on a battery. 58 | * 59 | * \param pct Percentage of battery life left, between 0 and 100. You can 60 | * pass a NULL here if you don't care. Will return -1 if we 61 | * can't determine a value, or we're not running on a battery. 62 | * 63 | * \return The state of the battery (if any). 64 | */ 65 | extern DECLSPEC SDL_PowerState SDLCALL SDL_GetPowerInfo(int *secs, int *pct); 66 | 67 | /* Ends C function definitions when using C++ */ 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | #include "close_code.h" 72 | 73 | #endif /* SDL_power_h_ */ 74 | 75 | /* vi: set ts=4 sw=4 expandtab: */ 76 | -------------------------------------------------------------------------------- /SRC/CRT/winapi/basetyps.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #if !defined(_BASETYPS_H_) 7 | #define _BASETYPS_H_ 8 | 9 | #ifdef __cplusplus 10 | #define EXTERN_C extern "C" 11 | #else 12 | #define EXTERN_C extern 13 | #endif 14 | 15 | #define STDMETHODCALLTYPE WINAPI 16 | #define STDMETHODVCALLTYPE __cdecl 17 | 18 | #define STDAPICALLTYPE WINAPI 19 | #define STDAPIVCALLTYPE __cdecl 20 | 21 | #define STDAPI EXTERN_C HRESULT WINAPI 22 | #define STDAPI_(type) EXTERN_C type WINAPI 23 | 24 | #define STDMETHODIMP HRESULT WINAPI 25 | #define STDMETHODIMP_(type) type WINAPI 26 | 27 | #define STDAPIV EXTERN_C HRESULT STDAPIVCALLTYPE 28 | #define STDAPIV_(type) EXTERN_C type STDAPIVCALLTYPE 29 | 30 | #define STDMETHODIMPV HRESULT STDMETHODVCALLTYPE 31 | #define STDMETHODIMPV_(type) type STDMETHODVCALLTYPE 32 | 33 | #if defined(__cplusplus) && !defined(CINTERFACE) 34 | 35 | #define __STRUCT__ struct 36 | #define STDMETHOD(method) virtual HRESULT WINAPI method 37 | #define STDMETHOD_(type,method) virtual type WINAPI method 38 | #define STDMETHODV(method) virtual HRESULT STDMETHODVCALLTYPE method 39 | #define STDMETHODV_(type,method) virtual type STDMETHODVCALLTYPE method 40 | #define PURE = 0 41 | #define THIS_ 42 | #define THIS void 43 | #define DECLARE_INTERFACE(iface) __STRUCT__ iface 44 | #define DECLARE_INTERFACE_(iface,baseiface) __STRUCT__ iface : public baseiface 45 | #else 46 | 47 | #ifndef __OBJC__ 48 | #define interface struct 49 | #endif 50 | 51 | #define STDMETHOD(method) HRESULT (WINAPI *method) 52 | #define STDMETHOD_(type,method) type (WINAPI *method) 53 | #define STDMETHODV(method) HRESULT (STDMETHODVCALLTYPE *method) 54 | #define STDMETHODV_(type,method) type (STDMETHODVCALLTYPE *method) 55 | 56 | #define PURE 57 | #define THIS_ INTERFACE *This, 58 | #define THIS INTERFACE *This 59 | #ifdef CONST_VTABLE 60 | #define DECLARE_INTERFACE(iface) typedef struct iface { \ 61 | const struct iface##Vtbl *lpVtbl; } iface; \ 62 | typedef const struct iface##Vtbl iface##Vtbl; \ 63 | const struct iface##Vtbl 64 | #else 65 | #define DECLARE_INTERFACE(iface) typedef struct iface { \ 66 | struct iface##Vtbl *lpVtbl; \ 67 | } iface; \ 68 | typedef struct iface##Vtbl iface##Vtbl; \ 69 | struct iface##Vtbl 70 | #endif 71 | #define DECLARE_INTERFACE_(iface,baseiface) DECLARE_INTERFACE(iface) 72 | #endif 73 | 74 | #include 75 | 76 | #ifndef _ERROR_STATUS_T_DEFINED 77 | #define _ERROR_STATUS_T_DEFINED 78 | typedef unsigned long error_status_t; 79 | #endif 80 | 81 | #ifndef _WCHAR_T_DEFINED 82 | typedef unsigned short wchar_t; 83 | #define _WCHAR_T_DEFINED 84 | #endif 85 | #endif 86 | -------------------------------------------------------------------------------- /SRC/CRT/stdarg.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDARG_H 2 | #define _STDARG_H 3 | 4 | #ifdef __x86_64__ 5 | #ifndef _WIN64 6 | 7 | //This should be in sync with the declaration on our lib/libtcc1.c 8 | /* GCC compatible definition of va_list. */ 9 | typedef struct { 10 | unsigned int gp_offset; 11 | unsigned int fp_offset; 12 | union { 13 | unsigned int overflow_offset; 14 | char *overflow_arg_area; 15 | }; 16 | char *reg_save_area; 17 | } __va_list_struct; 18 | 19 | typedef __va_list_struct va_list[1]; 20 | 21 | void __va_start(__va_list_struct *ap, void *fp); 22 | void *__va_arg(__va_list_struct *ap, int arg_type, int size, int align); 23 | 24 | #define va_start(ap, last) __va_start(ap, __builtin_frame_address(0)) 25 | #define va_arg(ap, type) \ 26 | (*(type *)(__va_arg(ap, __builtin_va_arg_types(type), sizeof(type), __alignof__(type)))) 27 | #define va_copy(dest, src) (*(dest) = *(src)) 28 | #define va_end(ap) 29 | 30 | /* avoid conflicting definition for va_list on Macs. */ 31 | #define _VA_LIST_T 32 | 33 | #else /* _WIN64 */ 34 | typedef char *va_list; 35 | #define va_start(ap,last) __builtin_va_start(ap,last) 36 | #define va_arg(ap, t) ((sizeof(t) > 8 || (sizeof(t) & (sizeof(t) - 1))) \ 37 | ? **(t **)((ap += 8) - 8) : *(t *)((ap += 8) - 8)) 38 | #define va_copy(dest, src) ((dest) = (src)) 39 | #define va_end(ap) 40 | #endif 41 | 42 | #elif __arm__ 43 | typedef char *va_list; 44 | #define _tcc_alignof(type) ((int)&((struct {char c;type x;} *)0)->x) 45 | #define _tcc_align(addr,type) (((unsigned)addr + _tcc_alignof(type) - 1) \ 46 | & ~(_tcc_alignof(type) - 1)) 47 | #define va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+3)&~3) 48 | #define va_arg(ap,type) (ap = (void *) ((_tcc_align(ap,type)+sizeof(type)+3) \ 49 | &~3), *(type *)(ap - ((sizeof(type)+3)&~3))) 50 | #define va_copy(dest, src) (dest) = (src) 51 | #define va_end(ap) 52 | 53 | #elif defined(__aarch64__) 54 | typedef struct { 55 | void *__stack; 56 | void *__gr_top; 57 | void *__vr_top; 58 | int __gr_offs; 59 | int __vr_offs; 60 | } va_list; 61 | #define va_start(ap, last) __va_start(ap, last) 62 | #define va_arg(ap, type) __va_arg(ap, type) 63 | #define va_end(ap) 64 | #define va_copy(dest, src) ((dest) = (src)) 65 | 66 | #else /* __i386__ */ 67 | typedef char *va_list; 68 | /* only correct for i386 */ 69 | #define va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+3)&~3) 70 | #define va_arg(ap,type) (ap += (sizeof(type)+3)&~3, *(type *)(ap - ((sizeof(type)+3)&~3))) 71 | #define va_copy(dest, src) (dest) = (src) 72 | #define va_end(ap) 73 | #endif 74 | 75 | /* fix a buggy dependency on GCC in libio.h */ 76 | typedef va_list __gnuc_va_list; 77 | #define _VA_LIST_DEFINED 78 | 79 | #endif /* _STDARG_H */ 80 | -------------------------------------------------------------------------------- /SRC/CRT/winapi/windows.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _WINDOWS_ 7 | #define _WINDOWS_ 8 | 9 | #ifndef WIN32_LEAN_AND_MEAN 10 | #define WIN32_LEAN_AND_MEAN 1 11 | #endif 12 | 13 | #ifndef WINVER 14 | #define WINVER 0x0502 15 | #endif 16 | 17 | #include <_mingw.h> 18 | 19 | #ifndef _INC_WINDOWS 20 | #define _INC_WINDOWS 21 | 22 | #if defined(RC_INVOKED) && !defined(NOWINRES) 23 | 24 | #include 25 | #else 26 | 27 | #ifdef RC_INVOKED 28 | #define NOATOM 29 | #define NOGDI 30 | #define NOGDICAPMASKS 31 | #define NOMETAFILE 32 | #define NOMINMAX 33 | #define NOMSG 34 | #define NOOPENFILE 35 | #define NORASTEROPS 36 | #define NOSCROLL 37 | #define NOSOUND 38 | #define NOSYSMETRICS 39 | #define NOTEXTMETRIC 40 | #define NOWH 41 | #define NOCOMM 42 | #define NOKANJI 43 | #define NOCRYPT 44 | #define NOMCX 45 | #endif 46 | 47 | #if !defined(I_X86_) && !defined(_IA64_) && !defined(_AMD64_) && (defined(_X86_) && !defined(__x86_64)) 48 | #define I_X86_ 49 | #endif 50 | 51 | #if !defined(I_X86_) && !defined(_IA64_) && !defined(_AMD64_) && defined(__x86_64) 52 | #define _AMD64_ 53 | #endif 54 | 55 | #if !defined(I_X86_) && !(defined(_X86_) && !defined(__x86_64)) && !defined(_AMD64_) && defined(__ia64__) 56 | #if !defined(_IA64_) 57 | #define _IA64_ 58 | #endif 59 | #endif 60 | 61 | #ifndef RC_INVOKED 62 | #include 63 | #include 64 | #endif 65 | 66 | #include 67 | #include 68 | #include 69 | #include 70 | //gr #include 71 | #include 72 | #include 73 | #include 74 | //gr #include 75 | 76 | #ifndef WIN32_LEAN_AND_MEAN 77 | #include 78 | #include 79 | #include 80 | #include 81 | #include 82 | #include 83 | #include 84 | #include 85 | #include 86 | #include 87 | #include 88 | #ifndef NOCRYPT 89 | #include 90 | #include 91 | #include 92 | #endif 93 | 94 | #ifndef NOUSER 95 | #ifndef NOGDI 96 | #include 97 | #ifdef INC_OLE1 98 | #include 99 | #else 100 | #include 101 | #endif 102 | #include 103 | #endif 104 | #endif 105 | #endif 106 | 107 | //gr #include 108 | 109 | #ifdef INC_OLE2 110 | #include 111 | #endif 112 | 113 | #ifndef NOSERVICE 114 | #include 115 | #endif 116 | 117 | #ifndef NOMCX 118 | #include 119 | #endif 120 | 121 | #ifndef NOIME 122 | #include 123 | #endif 124 | 125 | #endif 126 | #endif 127 | #endif 128 | -------------------------------------------------------------------------------- /SRC/CRT/tcclib.h: -------------------------------------------------------------------------------- 1 | /* Simple libc header for TCC 2 | * 3 | * Add any function you want from the libc there. This file is here 4 | * only for your convenience so that you do not need to put the whole 5 | * glibc include files on your floppy disk 6 | */ 7 | #ifndef _TCCLIB_H 8 | #define _TCCLIB_H 9 | 10 | #include 11 | #include 12 | 13 | /* stdlib.h */ 14 | void *calloc(size_t nmemb, size_t size); 15 | void *malloc(size_t size); 16 | void free(void *ptr); 17 | void *realloc(void *ptr, size_t size); 18 | int atoi(const char *nptr); 19 | long int strtol(const char *nptr, char **endptr, int base); 20 | unsigned long int strtoul(const char *nptr, char **endptr, int base); 21 | void exit(int); 22 | 23 | /* stdio.h */ 24 | typedef struct __FILE FILE; 25 | #define EOF (-1) 26 | extern FILE *stdin; 27 | extern FILE *stdout; 28 | extern FILE *stderr; 29 | FILE *fopen(const char *path, const char *mode); 30 | FILE *fdopen(int fildes, const char *mode); 31 | FILE *freopen(const char *path, const char *mode, FILE *stream); 32 | int fclose(FILE *stream); 33 | size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream); 34 | size_t fwrite(void *ptr, size_t size, size_t nmemb, FILE *stream); 35 | int fgetc(FILE *stream); 36 | char *fgets(char *s, int size, FILE *stream); 37 | int getc(FILE *stream); 38 | int getchar(void); 39 | char *gets(char *s); 40 | int ungetc(int c, FILE *stream); 41 | int fflush(FILE *stream); 42 | int putchar (int c); 43 | 44 | int printf(const char *format, ...); 45 | int fprintf(FILE *stream, const char *format, ...); 46 | int sprintf(char *str, const char *format, ...); 47 | int snprintf(char *str, size_t size, const char *format, ...); 48 | int asprintf(char **strp, const char *format, ...); 49 | int dprintf(int fd, const char *format, ...); 50 | int vprintf(const char *format, va_list ap); 51 | int vfprintf(FILE *stream, const char *format, va_list ap); 52 | int vsprintf(char *str, const char *format, va_list ap); 53 | int vsnprintf(char *str, size_t size, const char *format, va_list ap); 54 | int vasprintf(char **strp, const char *format, va_list ap); 55 | int vdprintf(int fd, const char *format, va_list ap); 56 | 57 | void perror(const char *s); 58 | 59 | /* string.h */ 60 | char *strcat(char *dest, const char *src); 61 | char *strchr(const char *s, int c); 62 | char *strrchr(const char *s, int c); 63 | char *strcpy(char *dest, const char *src); 64 | void *memcpy(void *dest, const void *src, size_t n); 65 | void *memmove(void *dest, const void *src, size_t n); 66 | void *memset(void *s, int c, size_t n); 67 | char *strdup(const char *s); 68 | size_t strlen(const char *s); 69 | 70 | /* dlfcn.h */ 71 | #define RTLD_LAZY 0x001 72 | #define RTLD_NOW 0x002 73 | #define RTLD_GLOBAL 0x100 74 | 75 | void *dlopen(const char *filename, int flag); 76 | const char *dlerror(void); 77 | void *dlsym(void *handle, char *symbol); 78 | int dlclose(void *handle); 79 | 80 | #endif /* _TCCLIB_H */ 81 | -------------------------------------------------------------------------------- /SRC/SDL/SDL_config_minimal.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_config_minimal_h_ 23 | #define SDL_config_minimal_h_ 24 | #define SDL_config_h_ 25 | 26 | #include "SDL_platform.h" 27 | 28 | /** 29 | * \file SDL_config_minimal.h 30 | * 31 | * This is the minimal configuration that can be used to build SDL. 32 | */ 33 | 34 | #define HAVE_STDARG_H 1 35 | #define HAVE_STDDEF_H 1 36 | 37 | /* Most everything except Visual Studio 2008 and earlier has stdint.h now */ 38 | #if defined(_MSC_VER) && (_MSC_VER < 1600) 39 | /* Here are some reasonable defaults */ 40 | typedef unsigned int size_t; 41 | typedef signed char int8_t; 42 | typedef unsigned char uint8_t; 43 | typedef signed short int16_t; 44 | typedef unsigned short uint16_t; 45 | typedef signed int int32_t; 46 | typedef unsigned int uint32_t; 47 | typedef signed long long int64_t; 48 | typedef unsigned long long uint64_t; 49 | typedef unsigned long uintptr_t; 50 | #else 51 | #define HAVE_STDINT_H 1 52 | #endif /* Visual Studio 2008 */ 53 | 54 | #ifdef __GNUC__ 55 | #define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1 56 | #endif 57 | 58 | /* Enable the dummy audio driver (src/audio/dummy/\*.c) */ 59 | #define SDL_AUDIO_DRIVER_DUMMY 1 60 | 61 | /* Enable the stub joystick driver (src/joystick/dummy/\*.c) */ 62 | #define SDL_JOYSTICK_DISABLED 1 63 | 64 | /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ 65 | #define SDL_HAPTIC_DISABLED 1 66 | 67 | /* Enable the stub shared object loader (src/loadso/dummy/\*.c) */ 68 | #define SDL_LOADSO_DISABLED 1 69 | 70 | /* Enable the stub thread support (src/thread/generic/\*.c) */ 71 | #define SDL_THREADS_DISABLED 1 72 | 73 | /* Enable the stub timer support (src/timer/dummy/\*.c) */ 74 | #define SDL_TIMERS_DISABLED 1 75 | 76 | /* Enable the dummy video driver (src/video/dummy/\*.c) */ 77 | #define SDL_VIDEO_DRIVER_DUMMY 1 78 | 79 | /* Enable the dummy filesystem driver (src/filesystem/dummy/\*.c) */ 80 | #define SDL_FILESYSTEM_DUMMY 1 81 | 82 | #endif /* SDL_config_minimal_h_ */ 83 | -------------------------------------------------------------------------------- /SRC/SDL/SDL_metal.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_metal.h 24 | * 25 | * Header file for functions to creating Metal layers and views on SDL windows. 26 | */ 27 | 28 | #ifndef SDL_metal_h_ 29 | #define SDL_metal_h_ 30 | 31 | #include "SDL_video.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** 40 | * \brief A handle to a CAMetalLayer-backed NSView (macOS) or UIView (iOS/tvOS). 41 | * 42 | * \note This can be cast directly to an NSView or UIView. 43 | */ 44 | typedef void *SDL_MetalView; 45 | 46 | /** 47 | * \name Metal support functions 48 | */ 49 | /* @{ */ 50 | 51 | /** 52 | * \brief Create a CAMetalLayer-backed NSView/UIView and attach it to the 53 | * specified window. 54 | * 55 | * On macOS, this does *not* associate a MTLDevice with the CAMetalLayer on its 56 | * own. It is up to user code to do that. 57 | * 58 | * The returned handle can be casted directly to a NSView or UIView, and the 59 | * CAMetalLayer can be accessed from the view's 'layer' property. 60 | * 61 | * \code 62 | * SDL_MetalView metalview = SDL_Metal_CreateView(window); 63 | * UIView *uiview = (__bridge UIView *)metalview; 64 | * CAMetalLayer *metallayer = (CAMetalLayer *)uiview.layer; 65 | * // [...] 66 | * SDL_Metal_DestroyView(metalview); 67 | * \endcode 68 | * 69 | * \sa SDL_Metal_DestroyView 70 | */ 71 | extern DECLSPEC SDL_MetalView SDLCALL SDL_Metal_CreateView(SDL_Window * window); 72 | 73 | /** 74 | * \brief Destroy an existing SDL_MetalView object. 75 | * 76 | * This should be called before SDL_DestroyWindow, if SDL_Metal_CreateView was 77 | * called after SDL_CreateWindow. 78 | * 79 | * \sa SDL_Metal_CreateView 80 | */ 81 | extern DECLSPEC void SDLCALL SDL_Metal_DestroyView(SDL_MetalView view); 82 | 83 | /* @} *//* Metal support functions */ 84 | 85 | /* Ends C function definitions when using C++ */ 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | #include "close_code.h" 90 | 91 | #endif /* SDL_metal_h_ */ 92 | -------------------------------------------------------------------------------- /SRC/CRT/sys/timeb.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _TIMEB_H_ 7 | #define _TIMEB_H_ 8 | 9 | #include <_mingw.h> 10 | 11 | #ifndef _WIN32 12 | #error Only Win32 target is supported! 13 | #endif 14 | 15 | #pragma pack(push,_CRT_PACKING) 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #ifndef _CRTIMP 22 | #define _CRTIMP __declspec(dllimport) 23 | #endif 24 | 25 | #ifndef __TINYC__ /* gr */ 26 | #ifdef _USE_32BIT_TIME_T 27 | #ifdef _WIN64 28 | #undef _USE_32BIT_TIME_T 29 | #endif 30 | #else 31 | #if _INTEGRAL_MAX_BITS < 64 32 | #define _USE_32BIT_TIME_T 33 | #endif 34 | #endif 35 | #endif 36 | 37 | #ifndef _TIME32_T_DEFINED 38 | typedef long __time32_t; 39 | #define _TIME32_T_DEFINED 40 | #endif 41 | 42 | #ifndef _TIME64_T_DEFINED 43 | #if _INTEGRAL_MAX_BITS >= 64 44 | typedef __int64 __time64_t; 45 | #endif 46 | #define _TIME64_T_DEFINED 47 | #endif 48 | 49 | #ifndef _TIME_T_DEFINED 50 | #ifdef _USE_32BIT_TIME_T 51 | typedef __time32_t time_t; 52 | #else 53 | typedef __time64_t time_t; 54 | #endif 55 | #define _TIME_T_DEFINED 56 | #endif 57 | 58 | #ifndef _TIMEB_DEFINED 59 | #define _TIMEB_DEFINED 60 | 61 | struct __timeb32 { 62 | __time32_t time; 63 | unsigned short millitm; 64 | short timezone; 65 | short dstflag; 66 | }; 67 | 68 | #ifndef NO_OLDNAMES 69 | struct timeb { 70 | time_t time; 71 | unsigned short millitm; 72 | short timezone; 73 | short dstflag; 74 | }; 75 | #endif 76 | 77 | #if _INTEGRAL_MAX_BITS >= 64 78 | struct __timeb64 { 79 | __time64_t time; 80 | unsigned short millitm; 81 | short timezone; 82 | short dstflag; 83 | }; 84 | #endif 85 | 86 | #ifdef _USE_32BIT_TIME_T 87 | #define _timeb __timeb32 88 | //gr #define _ftime _ftime32 89 | #define _ftime32 _ftime 90 | #else 91 | #define _timeb __timeb64 92 | #define _ftime _ftime64 93 | #endif 94 | #endif 95 | 96 | _CRTIMP void __cdecl _ftime32(struct __timeb32 *_Time); 97 | #if _INTEGRAL_MAX_BITS >= 64 98 | _CRTIMP void __cdecl _ftime64(struct __timeb64 *_Time); 99 | #endif 100 | 101 | #ifndef _TIMESPEC_DEFINED 102 | #define _TIMESPEC_DEFINED 103 | struct timespec { 104 | time_t tv_sec; /* Seconds */ 105 | long tv_nsec; /* Nanoseconds */ 106 | }; 107 | 108 | struct itimerspec { 109 | struct timespec it_interval; /* Timer period */ 110 | struct timespec it_value; /* Timer expiration */ 111 | }; 112 | #endif 113 | 114 | #if !defined (RC_INVOKED) && !defined (NO_OLDNAMES) 115 | #ifdef _USE_32BIT_TIME_T 116 | __CRT_INLINE void __cdecl ftime(struct timeb *_Tmb) { 117 | _ftime32((struct __timeb32 *)_Tmb); 118 | } 119 | #else 120 | __CRT_INLINE void __cdecl ftime(struct timeb *_Tmb) { 121 | _ftime64((struct __timeb64 *)_Tmb); 122 | } 123 | #endif 124 | #endif 125 | 126 | #ifdef __cplusplus 127 | } 128 | #endif 129 | 130 | #pragma pack(pop) 131 | 132 | #include 133 | #endif 134 | -------------------------------------------------------------------------------- /SRC/SDL/SDL_loadso.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_loadso.h 24 | * 25 | * System dependent library loading routines 26 | * 27 | * Some things to keep in mind: 28 | * \li These functions only work on C function names. Other languages may 29 | * have name mangling and intrinsic language support that varies from 30 | * compiler to compiler. 31 | * \li Make sure you declare your function pointers with the same calling 32 | * convention as the actual library function. Your code will crash 33 | * mysteriously if you do not do this. 34 | * \li Avoid namespace collisions. If you load a symbol from the library, 35 | * it is not defined whether or not it goes into the global symbol 36 | * namespace for the application. If it does and it conflicts with 37 | * symbols in your code or other shared libraries, you will not get 38 | * the results you expect. :) 39 | */ 40 | 41 | #ifndef SDL_loadso_h_ 42 | #define SDL_loadso_h_ 43 | 44 | #include "SDL_stdinc.h" 45 | #include "SDL_error.h" 46 | 47 | #include "begin_code.h" 48 | /* Set up for C function definitions, even when using C++ */ 49 | #ifdef __cplusplus 50 | extern "C" { 51 | #endif 52 | 53 | /** 54 | * This function dynamically loads a shared object and returns a pointer 55 | * to the object handle (or NULL if there was an error). 56 | * The 'sofile' parameter is a system dependent name of the object file. 57 | */ 58 | extern DECLSPEC void *SDLCALL SDL_LoadObject(const char *sofile); 59 | 60 | /** 61 | * Given an object handle, this function looks up the address of the 62 | * named function in the shared object and returns it. This address 63 | * is no longer valid after calling SDL_UnloadObject(). 64 | */ 65 | extern DECLSPEC void *SDLCALL SDL_LoadFunction(void *handle, 66 | const char *name); 67 | 68 | /** 69 | * Unload a shared object from memory. 70 | */ 71 | extern DECLSPEC void SDLCALL SDL_UnloadObject(void *handle); 72 | 73 | /* Ends C function definitions when using C++ */ 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | #include "close_code.h" 78 | 79 | #endif /* SDL_loadso_h_ */ 80 | 81 | /* vi: set ts=4 sw=4 expandtab: */ 82 | -------------------------------------------------------------------------------- /SRC/CRT/limits.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #include <_mingw.h> 7 | 8 | #ifndef _INC_LIMITS 9 | #define _INC_LIMITS 10 | 11 | /* 12 | * File system limits 13 | * 14 | * TODO: NAME_MAX and OPEN_MAX are file system limits or not? Are they the 15 | * same as FILENAME_MAX and FOPEN_MAX from stdio.h? 16 | * NOTE: Apparently the actual size of PATH_MAX is 260, but a space is 17 | * required for the NUL. TODO: Test? 18 | */ 19 | #define PATH_MAX (259) 20 | 21 | #define CHAR_BIT 8 22 | #define SCHAR_MIN (-128) 23 | #define SCHAR_MAX 127 24 | #define UCHAR_MAX 0xff 25 | 26 | #define CHAR_MIN SCHAR_MIN 27 | #define CHAR_MAX SCHAR_MAX 28 | 29 | #define MB_LEN_MAX 5 30 | #define SHRT_MIN (-32768) 31 | #define SHRT_MAX 32767 32 | #define USHRT_MAX 0xffff 33 | #define INT_MIN (-2147483647 - 1) 34 | #define INT_MAX 2147483647 35 | #define UINT_MAX 0xffffffff 36 | #define LONG_MIN (-2147483647L - 1) 37 | #define LONG_MAX 2147483647L 38 | #define ULONG_MAX 0xffffffffUL 39 | #define LLONG_MAX 9223372036854775807ll 40 | #define LLONG_MIN (-9223372036854775807ll - 1) 41 | #define ULLONG_MAX 0xffffffffffffffffull 42 | 43 | #if _INTEGRAL_MAX_BITS >= 8 44 | #define _I8_MIN (-127 - 1) 45 | #define _I8_MAX 127i8 46 | #define _UI8_MAX 0xffu 47 | #endif 48 | 49 | #if _INTEGRAL_MAX_BITS >= 16 50 | #define _I16_MIN (-32767 - 1) 51 | #define _I16_MAX 32767i16 52 | #define _UI16_MAX 0xffffu 53 | #endif 54 | 55 | #if _INTEGRAL_MAX_BITS >= 32 56 | #define _I32_MIN (-2147483647 - 1) 57 | #define _I32_MAX 2147483647 58 | #define _UI32_MAX 0xffffffffu 59 | #endif 60 | 61 | #if defined(__GNUC__) 62 | #undef LONG_LONG_MAX 63 | #define LONG_LONG_MAX 9223372036854775807ll 64 | #undef LONG_LONG_MIN 65 | #define LONG_LONG_MIN (-LONG_LONG_MAX-1) 66 | #undef ULONG_LONG_MAX 67 | #define ULONG_LONG_MAX (2ull * LONG_LONG_MAX + 1ull) 68 | #endif 69 | 70 | #if _INTEGRAL_MAX_BITS >= 64 71 | #define _I64_MIN (-9223372036854775807ll - 1) 72 | #define _I64_MAX 9223372036854775807ll 73 | #define _UI64_MAX 0xffffffffffffffffull 74 | #endif 75 | 76 | #ifndef SIZE_MAX 77 | #ifdef _WIN64 78 | #define SIZE_MAX _UI64_MAX 79 | #else 80 | #define SIZE_MAX UINT_MAX 81 | #endif 82 | #endif 83 | 84 | #ifdef _POSIX_ 85 | #define _POSIX_ARG_MAX 4096 86 | #define _POSIX_CHILD_MAX 6 87 | #define _POSIX_LINK_MAX 8 88 | #define _POSIX_MAX_CANON 255 89 | #define _POSIX_MAX_INPUT 255 90 | #define _POSIX_NAME_MAX 14 91 | #define _POSIX_NGROUPS_MAX 0 92 | #define _POSIX_OPEN_MAX 16 93 | #define _POSIX_PATH_MAX 255 94 | #define _POSIX_PIPE_BUF 512 95 | #define _POSIX_SSIZE_MAX 32767 96 | #define _POSIX_STREAM_MAX 8 97 | #define _POSIX_TZNAME_MAX 3 98 | #define ARG_MAX 14500 99 | #define LINK_MAX 1024 100 | #define MAX_CANON _POSIX_MAX_CANON 101 | #define MAX_INPUT _POSIX_MAX_INPUT 102 | #define NAME_MAX 255 103 | #define NGROUPS_MAX 16 104 | #define OPEN_MAX 32 105 | #define PATH_MAX 512 106 | #define PIPE_BUF _POSIX_PIPE_BUF 107 | #define SSIZE_MAX _POSIX_SSIZE_MAX 108 | #define STREAM_MAX 20 109 | #define TZNAME_MAX 10 110 | #endif 111 | #endif 112 | -------------------------------------------------------------------------------- /SRC/SDL/SDL_touch.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_touch.h 24 | * 25 | * Include file for SDL touch event handling. 26 | */ 27 | 28 | #ifndef SDL_touch_h_ 29 | #define SDL_touch_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | #include "SDL_video.h" 34 | 35 | #include "begin_code.h" 36 | /* Set up for C function definitions, even when using C++ */ 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | typedef Sint64 SDL_TouchID; 42 | typedef Sint64 SDL_FingerID; 43 | 44 | typedef enum 45 | { 46 | SDL_TOUCH_DEVICE_INVALID = -1, 47 | SDL_TOUCH_DEVICE_DIRECT, /* touch screen with window-relative coordinates */ 48 | SDL_TOUCH_DEVICE_INDIRECT_ABSOLUTE, /* trackpad with absolute device coordinates */ 49 | SDL_TOUCH_DEVICE_INDIRECT_RELATIVE /* trackpad with screen cursor-relative coordinates */ 50 | } SDL_TouchDeviceType; 51 | 52 | typedef struct SDL_Finger 53 | { 54 | SDL_FingerID id; 55 | float x; 56 | float y; 57 | float pressure; 58 | } SDL_Finger; 59 | 60 | /* Used as the device ID for mouse events simulated with touch input */ 61 | #define SDL_TOUCH_MOUSEID ((Uint32)-1) 62 | 63 | /* Used as the SDL_TouchID for touch events simulated with mouse input */ 64 | #define SDL_MOUSE_TOUCHID ((Sint64)-1) 65 | 66 | 67 | /* Function prototypes */ 68 | 69 | /** 70 | * \brief Get the number of registered touch devices. 71 | */ 72 | extern DECLSPEC int SDLCALL SDL_GetNumTouchDevices(void); 73 | 74 | /** 75 | * \brief Get the touch ID with the given index, or 0 if the index is invalid. 76 | */ 77 | extern DECLSPEC SDL_TouchID SDLCALL SDL_GetTouchDevice(int index); 78 | 79 | /** 80 | * \brief Get the type of the given touch device. 81 | */ 82 | extern DECLSPEC SDL_TouchDeviceType SDLCALL SDL_GetTouchDeviceType(SDL_TouchID touchID); 83 | 84 | /** 85 | * \brief Get the number of active fingers for a given touch device. 86 | */ 87 | extern DECLSPEC int SDLCALL SDL_GetNumTouchFingers(SDL_TouchID touchID); 88 | 89 | /** 90 | * \brief Get the finger object of the given touch, with the given index. 91 | */ 92 | extern DECLSPEC SDL_Finger * SDLCALL SDL_GetTouchFinger(SDL_TouchID touchID, int index); 93 | 94 | /* Ends C function definitions when using C++ */ 95 | #ifdef __cplusplus 96 | } 97 | #endif 98 | #include "close_code.h" 99 | 100 | #endif /* SDL_touch_h_ */ 101 | 102 | /* vi: set ts=4 sw=4 expandtab: */ 103 | -------------------------------------------------------------------------------- /SRC/HEADER.S: -------------------------------------------------------------------------------- 1 | ; ============================================================================== 2 | 3 | SECTION "HEADER", ROM0[ADDRHEAD] 4 | ; ------------------------------------------------------------------------------ 5 | Header: 6 | NOP ; [$0100-$0103] entry point 7 | JP ADDRMAIN 8 | ; ------------------------------------------------------------------------------ 9 | ; [$0104-$0133] nintendo logo (must match exactly or ROM will fail boot) 10 | ; ------------------------------------------------------------------------------ 11 | DB $CE,$ED,$66,$66,$CC,$0D,$00,$0B,$03,$73,$00,$83,$00,$0C,$00,$0D 12 | DB $00,$08,$11,$1F,$88,$89,$00,$0E,$DC,$CC,$6E,$E6,$DD,$DD,$D9,$99 13 | DB $BB,$BB,$67,$63,$6E,$0E,$EC,$CC,$DD,$DC,$99,$9F,$BB,$B9,$33,$3E 14 | DB "BINDINGISAAC.GB" ; [$0134-$0142] rom title 15 | DB $00 ; [$0143] CGB flag ($00=GB $C0=CGB $80=GB+CGB) 16 | DW $0000 ; [$0144-$0145] game manufacturer code 17 | DB $00 ; [$0146] SGB flag ($00=normal $03=SGB) 18 | ; ------------------------------------------------------------------------------ 19 | ; [$0147] cartridge type (used to enable extra hardware features) 20 | ; ------------------------------------------------------------------------------ 21 | ; $00 - ROM only $12 - MBC3+RAM 22 | ; $01 - MBC1 $13 - MBC3+RAM+BATTERY 23 | ; $02 - MBC1+RAM $19 - MBC5 24 | ; $03 - MBC2+RAM+BATTERY $1A - MBC5+RAM 25 | ; $05 - MBC2 $1B - MBC5+RAM+BATTERY 26 | ; $06 - MBC2+BATTERY $1C - MBC5+RUMBLE 27 | ; $08 - ROM+RAM $1D - MBC5+RUMBLE+RAM 28 | ; $09 - ROM+RAM+BATTERY $1E - MBC5+RUMBLE+RAM+BATTERY 29 | ; $0B - MMM01 $20 - MBC6 30 | ; $0C - MMM01+RAM $22 - MBC7+SENSOR+RUMBLE+RAM+BATTERY 31 | ; $0D - MMM01+RAM+BATTERY $FC - POCKET CAMERA 32 | ; $0F - MBC3+TIMER+BATTERY $FD - BANDAI TAMA5 33 | ; $10 - MBC3+TIMER+RAM+BATTERY $FE - HuC3 34 | ; $11 - MBC3 $FF - HuC1+RAM+BATTERY 35 | DB $00 36 | ; ------------------------------------------------------------------------------ 37 | ; [$0148] ROM size 38 | ; ------------------------------------------------------------------------------ 39 | ; $00 - 32kb (no ROM banking) $06 - 2mb (128 banks) (125 MBC1) 40 | ; $01 - 64kb ( 4 banks) $07 - 4mb (256 banks) 41 | ; $02 - 128kb ( 8 banks) $08 - 8mb (512 banks) 42 | ; $03 - 256kb (16 banks) $52 - 1.1mb ( 72 banks) 43 | ; $04 - 512kb (32 banks) $53 - 1.2mb ( 80 banks) 44 | ; $05 - 1mb (64 banks) (63 MBC1) $54 - 1.5mb ( 96 banks) 45 | DB $00 46 | ; ------------------------------------------------------------------------------ 47 | ; [$0149] RAM size 48 | ; ------------------------------------------------------------------------------ 49 | ; $00 - none 50 | ; $01 - 2kb 51 | ; $02 - 8kb 52 | ; $03 - 32kb (4 banks of 8kb each) 53 | ; $04 - 128kb (16 banks of 8kb each) 54 | ; $05 - 64kb (8 banks of 8kb each) 55 | DB $00 56 | DB $01 ; [$014A] destination code ($00=JP $01=EU/US) 57 | DB $33 ; [$014B] old licensee code ($33 for SGB) 58 | DB $00 ; [$014C] ROM version number 59 | DB $00 ; [$014D] header checksum 60 | DW $0000 ; [$014E-$014F] global checksum 61 | ; ------------------------------------------------------------------------------ 62 | 63 | ; ============================================================================== 64 | -------------------------------------------------------------------------------- /SRC/UTILS.S: -------------------------------------------------------------------------------- 1 | ; ============================================================================== 2 | 3 | SECTION "UTILS", ROMX 4 | ; ------------------------------------------------------------------------------ 5 | ; halts execution until we are in the vertical blank region of the screen 6 | ; this should only be called if the LCD is on or else execution will hang 7 | ; ------------------------------------------------------------------------------ 8 | WaitVbl: LD A,[R_LY] 9 | CP SCRH 10 | JP NZ,WaitVbl ; halt until we're past the screen height 11 | RET 12 | ; ------------------------------------------------------------------------------ 13 | ; disables the LCD display 14 | ; ------------------------------------------------------------------------------ 15 | LCDOff: CALL WaitVbl ; wait for vblank to avoid hardware damage! 16 | LD A,[R_LCDC] 17 | RES 7,A ; flag to disable is at bit 7 of LCDC 18 | LD [R_LCDC],A 19 | RET 20 | ; ------------------------------------------------------------------------------ 21 | ; enables the LCD display 22 | ; ------------------------------------------------------------------------------ 23 | LCDOn: LD A,[R_LCDC] 24 | SET 7,A ; flag to enable is at bit 7 of LCDC 25 | LD [R_LCDC],A 26 | RET 27 | ; ------------------------------------------------------------------------------ 28 | ; disables the audio system 29 | ; ------------------------------------------------------------------------------ 30 | SndOff: LD A,[R_NR52] 31 | RES 7,A ; flag to disable is at bit 7 of NR52 32 | LD [R_NR52],A 33 | RET 34 | ; ------------------------------------------------------------------------------ 35 | ; enables the audio system 36 | ; ------------------------------------------------------------------------------ 37 | SndOn: LD A,[R_NR52] 38 | SET 7,A ; flag to enable is at bit 7 of NR5 39 | LD [R_NR52],A 40 | RET 41 | ; ------------------------------------------------------------------------------ 42 | ; copys a block of memory from a source location to a destination location 43 | ; ------------------------------------------------------------------------------ 44 | ; @param HL : destination address 45 | ; @param DE : source address 46 | ; @param BC : byte count to copy 47 | ; ------------------------------------------------------------------------------ 48 | MemCpy: LD A,[DE] 49 | LD [HL+],A ; copy to the destination and increment pointer 50 | INC DE 51 | DEC BC 52 | LD A,B 53 | OR C ; or B and C to check for non-zero counter 54 | JR NZ,MemCpy 55 | RET 56 | ; ------------------------------------------------------------------------------ 57 | ; assigns a block of memory at a location to a specific byte value 58 | ; ------------------------------------------------------------------------------ 59 | ; @param HL : destination address 60 | ; @param D : value to set 61 | ; @param BC : byte count to set 62 | ; ------------------------------------------------------------------------------ 63 | MemSet: LD A,D 64 | LD [HL+],A ; set byte at destination and increment pointer 65 | DEC BC 66 | LD A,B 67 | OR C ; or B and C to check for non-zero counter 68 | JR NZ,MemSet 69 | RET 70 | ; ------------------------------------------------------------------------------ 71 | 72 | ; ============================================================================== 73 | -------------------------------------------------------------------------------- /SRC/CRT/fenv.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _FENV_H_ 7 | #define _FENV_H_ 8 | 9 | #include <_mingw.h> 10 | 11 | /* FPU status word exception flags */ 12 | #define FE_INVALID 0x01 13 | #define FE_DENORMAL 0x02 14 | #define FE_DIVBYZERO 0x04 15 | #define FE_OVERFLOW 0x08 16 | #define FE_UNDERFLOW 0x10 17 | #define FE_INEXACT 0x20 18 | #define FE_ALL_EXCEPT (FE_INVALID | FE_DENORMAL | FE_DIVBYZERO \ 19 | | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT) 20 | 21 | /* FPU control word rounding flags */ 22 | #define FE_TONEAREST 0x0000 23 | #define FE_DOWNWARD 0x0400 24 | #define FE_UPWARD 0x0800 25 | #define FE_TOWARDZERO 0x0c00 26 | 27 | /* The MXCSR exception flags are the same as the 28 | FE flags. */ 29 | #define __MXCSR_EXCEPT_FLAG_SHIFT 0 30 | 31 | /* How much to shift FE status word exception flags 32 | to get MXCSR rounding flags, */ 33 | #define __MXCSR_ROUND_FLAG_SHIFT 3 34 | 35 | #ifndef RC_INVOKED 36 | /* 37 | For now, support only for the basic abstraction of flags that are 38 | either set or clear. fexcept_t could be structure that holds more 39 | info about the fp environment. 40 | */ 41 | typedef unsigned short fexcept_t; 42 | 43 | /* This 32-byte struct represents the entire floating point 44 | environment as stored by fnstenv or fstenv, augmented by 45 | the contents of the MXCSR register, as stored by stmxcsr 46 | (if CPU supports it). */ 47 | typedef struct 48 | { 49 | unsigned short __control_word; 50 | unsigned short __unused0; 51 | unsigned short __status_word; 52 | unsigned short __unused1; 53 | unsigned short __tag_word; 54 | unsigned short __unused2; 55 | unsigned int __ip_offset; /* instruction pointer offset */ 56 | unsigned short __ip_selector; 57 | unsigned short __opcode; 58 | unsigned int __data_offset; 59 | unsigned short __data_selector; 60 | unsigned short __unused3; 61 | unsigned int __mxcsr; /* contents of the MXCSR register */ 62 | } fenv_t; 63 | 64 | 65 | /*The C99 standard (7.6.9) allows us to define implementation-specific macros for 66 | different fp environments */ 67 | 68 | /* The default Intel x87 floating point environment (64-bit mantissa) */ 69 | #define FE_PC64_ENV ((const fenv_t *)-1) 70 | 71 | /* The floating point environment set by MSVCRT _fpreset (53-bit mantissa) */ 72 | #define FE_PC53_ENV ((const fenv_t *)-2) 73 | 74 | /* The FE_DFL_ENV macro is required by standard. 75 | fesetenv will use the environment set at app startup.*/ 76 | #define FE_DFL_ENV ((const fenv_t *) 0) 77 | 78 | #ifdef __cplusplus 79 | extern "C" { 80 | #endif 81 | 82 | /*TODO: Some of these could be inlined */ 83 | /* 7.6.2 Exception */ 84 | 85 | extern int __cdecl feclearexcept (int); 86 | extern int __cdecl fegetexceptflag (fexcept_t * flagp, int excepts); 87 | extern int __cdecl feraiseexcept (int excepts ); 88 | extern int __cdecl fesetexceptflag (const fexcept_t *, int); 89 | extern int __cdecl fetestexcept (int excepts); 90 | 91 | /* 7.6.3 Rounding */ 92 | 93 | extern int __cdecl fegetround (void); 94 | extern int __cdecl fesetround (int mode); 95 | 96 | /* 7.6.4 Environment */ 97 | 98 | extern int __cdecl fegetenv(fenv_t * envp); 99 | extern int __cdecl fesetenv(const fenv_t * ); 100 | extern int __cdecl feupdateenv(const fenv_t *); 101 | extern int __cdecl feholdexcept(fenv_t *); 102 | 103 | #ifdef __cplusplus 104 | } 105 | #endif 106 | #endif /* Not RC_INVOKED */ 107 | 108 | #endif /* ndef _FENV_H */ 109 | -------------------------------------------------------------------------------- /SRC/SDL/LICENSE: -------------------------------------------------------------------------------- 1 | Simple DirectMedia Layer 2 | Copyright (C) 1997-2020 Sam Lantinga 3 | 4 | This software is provided 'as-is', without any express or implied 5 | warranty. In no event will the authors be held liable for any damages 6 | arising from the use of this software. 7 | 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 12 | 1. The origin of this software must not be misrepresented; you must not 13 | claim that you wrote the original software. If you use this software 14 | in a product, an acknowledgment in the product documentation would be 15 | appreciated but is not required. 16 | 2. Altered source versions must be plainly marked as such, and must not be 17 | misrepresented as being the original software. 18 | 3. This notice may not be removed or altered from any source distribution. 19 | 20 | 21 | 22 | SDL_mixer: An audio mixer library based on the SDL library 23 | Copyright (C) 1997-2018 Sam Lantinga 24 | 25 | This software is provided 'as-is', without any express or implied 26 | warranty. In no event will the authors be held liable for any damages 27 | arising from the use of this software. 28 | 29 | Permission is granted to anyone to use this software for any purpose, 30 | including commercial applications, and to alter it and redistribute it 31 | freely, subject to the following restrictions: 32 | 33 | 1. The origin of this software must not be misrepresented; you must not 34 | claim that you wrote the original software. If you use this software 35 | in a product, an acknowledgment in the product documentation would be 36 | appreciated but is not required. 37 | 2. Altered source versions must be plainly marked as such, and must not be 38 | misrepresented as being the original software. 39 | 3. This notice may not be removed or altered from any source distribution. 40 | 41 | 42 | 43 | The source code to this library used with SDL_mixer can be found here: 44 | https://hg.libsdl.org/SDL_image/file/default/external 45 | --- 46 | 47 | Copyright (c) 2002-2008 Xiph.org Foundation 48 | 49 | Redistribution and use in source and binary forms, with or without 50 | modification, are permitted provided that the following conditions 51 | are met: 52 | 53 | - Redistributions of source code must retain the above copyright 54 | notice, this list of conditions and the following disclaimer. 55 | 56 | - Redistributions in binary form must reproduce the above copyright 57 | notice, this list of conditions and the following disclaimer in the 58 | documentation and/or other materials provided with the distribution. 59 | 60 | - Neither the name of the Xiph.org Foundation nor the names of its 61 | contributors may be used to endorse or promote products derived from 62 | this software without specific prior written permission. 63 | 64 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 65 | ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 66 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 67 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION 68 | OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 69 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 70 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 71 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 72 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 73 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 74 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 75 | -------------------------------------------------------------------------------- /SRC/SDL/SDL_bits.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_bits.h 24 | * 25 | * Functions for fiddling with bits and bitmasks. 26 | */ 27 | 28 | #ifndef SDL_bits_h_ 29 | #define SDL_bits_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** 40 | * \file SDL_bits.h 41 | */ 42 | 43 | /** 44 | * Get the index of the most significant bit. Result is undefined when called 45 | * with 0. This operation can also be stated as "count leading zeroes" and 46 | * "log base 2". 47 | * 48 | * \return Index of the most significant bit, or -1 if the value is 0. 49 | */ 50 | #if defined(__WATCOMC__) && defined(__386__) 51 | extern _inline int _SDL_clz_watcom (Uint32); 52 | #pragma aux _SDL_clz_watcom = \ 53 | "bsr eax, eax" \ 54 | "xor eax, 31" \ 55 | parm [eax] nomemory \ 56 | value [eax] \ 57 | modify exact [eax] nomemory; 58 | #endif 59 | 60 | SDL_FORCE_INLINE int 61 | SDL_MostSignificantBitIndex32(Uint32 x) 62 | { 63 | #if defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) 64 | /* Count Leading Zeroes builtin in GCC. 65 | * http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html 66 | */ 67 | if (x == 0) { 68 | return -1; 69 | } 70 | return 31 - __builtin_clz(x); 71 | #elif defined(__WATCOMC__) && defined(__386__) 72 | if (x == 0) { 73 | return -1; 74 | } 75 | return 31 - _SDL_clz_watcom(x); 76 | #else 77 | /* Based off of Bit Twiddling Hacks by Sean Eron Anderson 78 | * , released in the public domain. 79 | * http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog 80 | */ 81 | const Uint32 b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000}; 82 | const int S[] = {1, 2, 4, 8, 16}; 83 | 84 | int msbIndex = 0; 85 | int i; 86 | 87 | if (x == 0) { 88 | return -1; 89 | } 90 | 91 | for (i = 4; i >= 0; i--) 92 | { 93 | if (x & b[i]) 94 | { 95 | x >>= S[i]; 96 | msbIndex |= S[i]; 97 | } 98 | } 99 | 100 | return msbIndex; 101 | #endif 102 | } 103 | 104 | SDL_FORCE_INLINE SDL_bool 105 | SDL_HasExactlyOneBitSet32(Uint32 x) 106 | { 107 | if (x && !(x & (x - 1))) { 108 | return SDL_TRUE; 109 | } 110 | return SDL_FALSE; 111 | } 112 | 113 | /* Ends C function definitions when using C++ */ 114 | #ifdef __cplusplus 115 | } 116 | #endif 117 | #include "close_code.h" 118 | 119 | #endif /* SDL_bits_h_ */ 120 | 121 | /* vi: set ts=4 sw=4 expandtab: */ 122 | -------------------------------------------------------------------------------- /SRC/SDL/SDL_config_wiz.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_config_wiz_h_ 23 | #define SDL_config_wiz_h_ 24 | #define SDL_config_h_ 25 | 26 | /* This is a set of defines to configure the SDL features */ 27 | 28 | /* General platform specific identifiers */ 29 | #include "SDL_platform.h" 30 | 31 | #define SDL_BYTEORDER 1234 32 | 33 | #define HAVE_ALLOCA_H 1 34 | #define HAVE_SYS_TYPES_H 1 35 | #define HAVE_STDIO_H 1 36 | #define STDC_HEADERS 1 37 | #define HAVE_STDLIB_H 1 38 | #define HAVE_STDARG_H 1 39 | #define HAVE_MALLOC_H 1 40 | #define HAVE_MEMORY_H 1 41 | #define HAVE_STRING_H 1 42 | #define HAVE_STRINGS_H 1 43 | #define HAVE_INTTYPES_H 1 44 | #define HAVE_STDINT_H 1 45 | #define HAVE_CTYPE_H 1 46 | #define HAVE_MATH_H 1 47 | #define HAVE_ICONV_H 1 48 | #define HAVE_SIGNAL_H 1 49 | #define HAVE_MALLOC 1 50 | #define HAVE_CALLOC 1 51 | #define HAVE_REALLOC 1 52 | #define HAVE_FREE 1 53 | #define HAVE_ALLOCA 1 54 | #define HAVE_GETENV 1 55 | #define HAVE_SETENV 1 56 | #define HAVE_PUTENV 1 57 | #define HAVE_UNSETENV 1 58 | #define HAVE_QSORT 1 59 | #define HAVE_ABS 1 60 | #define HAVE_BCOPY 1 61 | #define HAVE_MEMSET 1 62 | #define HAVE_MEMCPY 1 63 | #define HAVE_MEMMOVE 1 64 | #define HAVE_STRLEN 1 65 | #define HAVE_STRDUP 1 66 | #define HAVE_STRCHR 1 67 | #define HAVE_STRRCHR 1 68 | #define HAVE_STRSTR 1 69 | #define HAVE_STRTOL 1 70 | #define HAVE_STRTOUL 1 71 | #define HAVE_STRTOLL 1 72 | #define HAVE_STRTOULL 1 73 | #define HAVE_ATOI 1 74 | #define HAVE_ATOF 1 75 | #define HAVE_STRCMP 1 76 | #define HAVE_STRNCMP 1 77 | #define HAVE_STRCASECMP 1 78 | #define HAVE_STRNCASECMP 1 79 | #define HAVE_VSSCANF 1 80 | #define HAVE_VSNPRINTF 1 81 | #define HAVE_M_PI 1 82 | #define HAVE_CEIL 1 83 | #define HAVE_COPYSIGN 1 84 | #define HAVE_COS 1 85 | #define HAVE_COSF 1 86 | #define HAVE_FABS 1 87 | #define HAVE_FLOOR 1 88 | #define HAVE_LOG 1 89 | #define HAVE_SCALBN 1 90 | #define HAVE_SIN 1 91 | #define HAVE_SINF 1 92 | #define HAVE_SQRT 1 93 | #define HAVE_SQRTF 1 94 | #define HAVE_TAN 1 95 | #define HAVE_TANF 1 96 | #define HAVE_SIGACTION 1 97 | #define HAVE_SETJMP 1 98 | #define HAVE_NANOSLEEP 1 99 | #define HAVE_POW 1 100 | 101 | #define SDL_AUDIO_DRIVER_DUMMY 1 102 | #define SDL_AUDIO_DRIVER_OSS 1 103 | 104 | #define SDL_INPUT_LINUXEV 1 105 | #define SDL_INPUT_TSLIB 1 106 | #define SDL_JOYSTICK_LINUX 1 107 | #define SDL_HAPTIC_LINUX 1 108 | 109 | #define SDL_LOADSO_DLOPEN 1 110 | 111 | #define SDL_THREAD_PTHREAD 1 112 | #define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1 113 | 114 | #define SDL_TIMER_UNIX 1 115 | 116 | #define SDL_VIDEO_DRIVER_DUMMY 1 117 | #define SDL_VIDEO_DRIVER_PANDORA 1 118 | #define SDL_VIDEO_RENDER_OGL_ES 1 119 | #define SDL_VIDEO_OPENGL_ES 1 120 | 121 | #endif /* SDL_config_wiz_h_ */ 122 | -------------------------------------------------------------------------------- /SRC/CRT/sec_api/mbstring_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_MBSTRING_S 7 | #define _INC_MBSTRING_S 8 | 9 | #include 10 | 11 | #if defined(MINGW_HAS_SECURE_API) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | #ifndef _MBSTRING_S_DEFINED 18 | #define _MBSTRING_S_DEFINED 19 | _CRTIMP errno_t __cdecl _mbscat_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src); 20 | _CRTIMP errno_t __cdecl _mbscat_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,_locale_t _Locale); 21 | _CRTIMP errno_t __cdecl _mbscpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src); 22 | _CRTIMP errno_t __cdecl _mbscpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,_locale_t _Locale); 23 | _CRTIMP errno_t __cdecl _mbslwr_s(unsigned char *_Str,size_t _SizeInBytes); 24 | _CRTIMP errno_t __cdecl _mbslwr_s_l(unsigned char *_Str,size_t _SizeInBytes,_locale_t _Locale); 25 | _CRTIMP errno_t __cdecl _mbsnbcat_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount); 26 | _CRTIMP errno_t __cdecl _mbsnbcat_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale); 27 | _CRTIMP errno_t __cdecl _mbsnbcpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount); 28 | _CRTIMP errno_t __cdecl _mbsnbcpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale); 29 | _CRTIMP errno_t __cdecl _mbsnbset_s(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Ch,size_t _MaxCount); 30 | _CRTIMP errno_t __cdecl _mbsnbset_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Ch,size_t _MaxCount,_locale_t _Locale); 31 | _CRTIMP errno_t __cdecl _mbsncat_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount); 32 | _CRTIMP errno_t __cdecl _mbsncat_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale); 33 | _CRTIMP errno_t __cdecl _mbsncpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount); 34 | _CRTIMP errno_t __cdecl _mbsncpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,const unsigned char *_Src,size_t _MaxCount,_locale_t _Locale); 35 | _CRTIMP errno_t __cdecl _mbsnset_s(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val,size_t _MaxCount); 36 | _CRTIMP errno_t __cdecl _mbsnset_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val,size_t _MaxCount,_locale_t _Locale); 37 | _CRTIMP errno_t __cdecl _mbsset_s(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val); 38 | _CRTIMP errno_t __cdecl _mbsset_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,unsigned int _Val,_locale_t _Locale); 39 | _CRTIMP unsigned char *__cdecl _mbstok_s(unsigned char *_Str,const unsigned char *_Delim,unsigned char **_Context); 40 | _CRTIMP unsigned char *__cdecl _mbstok_s_l(unsigned char *_Str,const unsigned char *_Delim,unsigned char **_Context,_locale_t _Locale); 41 | _CRTIMP errno_t __cdecl _mbsupr_s(unsigned char *_Str,size_t _SizeInBytes); 42 | _CRTIMP errno_t __cdecl _mbsupr_s_l(unsigned char *_Str,size_t _SizeInBytes,_locale_t _Locale); 43 | _CRTIMP errno_t __cdecl _mbccpy_s(unsigned char *_Dst,size_t _DstSizeInBytes,int *_PCopied,const unsigned char *_Src); 44 | _CRTIMP errno_t __cdecl _mbccpy_s_l(unsigned char *_Dst,size_t _DstSizeInBytes,int *_PCopied,const unsigned char *_Src,_locale_t _Locale); 45 | #endif 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif 52 | #endif 53 | -------------------------------------------------------------------------------- /SRC/SDL/SDL_config_pandora.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_config_pandora_h_ 23 | #define SDL_config_pandora_h_ 24 | #define SDL_config_h_ 25 | 26 | /* This is a set of defines to configure the SDL features */ 27 | 28 | /* General platform specific identifiers */ 29 | #include "SDL_platform.h" 30 | 31 | #ifdef __LP64__ 32 | #define SIZEOF_VOIDP 8 33 | #else 34 | #define SIZEOF_VOIDP 4 35 | #endif 36 | 37 | #define SDL_BYTEORDER 1234 38 | 39 | #define HAVE_ALLOCA_H 1 40 | #define HAVE_SYS_TYPES_H 1 41 | #define HAVE_STDIO_H 1 42 | #define STDC_HEADERS 1 43 | #define HAVE_STDLIB_H 1 44 | #define HAVE_STDARG_H 1 45 | #define HAVE_MALLOC_H 1 46 | #define HAVE_MEMORY_H 1 47 | #define HAVE_STRING_H 1 48 | #define HAVE_STRINGS_H 1 49 | #define HAVE_INTTYPES_H 1 50 | #define HAVE_STDINT_H 1 51 | #define HAVE_CTYPE_H 1 52 | #define HAVE_MATH_H 1 53 | #define HAVE_ICONV_H 1 54 | #define HAVE_SIGNAL_H 1 55 | #define HAVE_MALLOC 1 56 | #define HAVE_CALLOC 1 57 | #define HAVE_REALLOC 1 58 | #define HAVE_FREE 1 59 | #define HAVE_ALLOCA 1 60 | #define HAVE_GETENV 1 61 | #define HAVE_SETENV 1 62 | #define HAVE_PUTENV 1 63 | #define HAVE_UNSETENV 1 64 | #define HAVE_QSORT 1 65 | #define HAVE_ABS 1 66 | #define HAVE_BCOPY 1 67 | #define HAVE_MEMSET 1 68 | #define HAVE_MEMCPY 1 69 | #define HAVE_MEMMOVE 1 70 | #define HAVE_STRLEN 1 71 | #define HAVE_STRDUP 1 72 | #define HAVE_STRCHR 1 73 | #define HAVE_STRRCHR 1 74 | #define HAVE_STRSTR 1 75 | #define HAVE_STRTOL 1 76 | #define HAVE_STRTOUL 1 77 | #define HAVE_STRTOLL 1 78 | #define HAVE_STRTOULL 1 79 | #define HAVE_ATOI 1 80 | #define HAVE_ATOF 1 81 | #define HAVE_STRCMP 1 82 | #define HAVE_STRNCMP 1 83 | #define HAVE_STRCASECMP 1 84 | #define HAVE_STRNCASECMP 1 85 | #define HAVE_VSSCANF 1 86 | #define HAVE_VSNPRINTF 1 87 | #define HAVE_M_PI 1 88 | #define HAVE_CEIL 1 89 | #define HAVE_COPYSIGN 1 90 | #define HAVE_COS 1 91 | #define HAVE_COSF 1 92 | #define HAVE_FABS 1 93 | #define HAVE_FLOOR 1 94 | #define HAVE_LOG 1 95 | #define HAVE_SCALBN 1 96 | #define HAVE_SIN 1 97 | #define HAVE_SINF 1 98 | #define HAVE_SQRT 1 99 | #define HAVE_SQRTF 1 100 | #define HAVE_TAN 1 101 | #define HAVE_TANF 1 102 | #define HAVE_SIGACTION 1 103 | #define HAVE_SETJMP 1 104 | #define HAVE_NANOSLEEP 1 105 | 106 | #define SDL_AUDIO_DRIVER_DUMMY 1 107 | #define SDL_AUDIO_DRIVER_OSS 1 108 | 109 | #define SDL_INPUT_LINUXEV 1 110 | #define SDL_INPUT_TSLIB 1 111 | #define SDL_JOYSTICK_LINUX 1 112 | #define SDL_HAPTIC_LINUX 1 113 | 114 | #define SDL_LOADSO_DLOPEN 1 115 | 116 | #define SDL_THREAD_PTHREAD 1 117 | #define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP 1 118 | 119 | #define SDL_TIMER_UNIX 1 120 | #define SDL_FILESYSTEM_UNIX 1 121 | 122 | #define SDL_VIDEO_DRIVER_DUMMY 1 123 | #define SDL_VIDEO_DRIVER_X11 1 124 | #define SDL_VIDEO_DRIVER_PANDORA 1 125 | #define SDL_VIDEO_RENDER_OGL_ES 1 126 | #define SDL_VIDEO_OPENGL_ES 1 127 | 128 | #endif /* SDL_config_pandora_h_ */ 129 | -------------------------------------------------------------------------------- /SRC/CRT/dirent.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | /* All the headers include this file. */ 7 | #include <_mingw.h> 8 | 9 | #ifndef __STRICT_ANSI__ 10 | 11 | #ifndef _DIRENT_H_ 12 | #define _DIRENT_H_ 13 | 14 | 15 | #pragma pack(push,_CRT_PACKING) 16 | 17 | #include 18 | 19 | #ifndef RC_INVOKED 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | struct dirent 26 | { 27 | long d_ino; /* Always zero. */ 28 | unsigned short d_reclen; /* Always zero. */ 29 | unsigned short d_namlen; /* Length of name in d_name. */ 30 | char* d_name; /* File name. */ 31 | /* NOTE: The name in the dirent structure points to the name in the 32 | * finddata_t structure in the DIR. */ 33 | }; 34 | 35 | /* 36 | * This is an internal data structure. Good programmers will not use it 37 | * except as an argument to one of the functions below. 38 | * dd_stat field is now int (was short in older versions). 39 | */ 40 | typedef struct 41 | { 42 | /* disk transfer area for this dir */ 43 | struct _finddata_t dd_dta; 44 | 45 | /* dirent struct to return from dir (NOTE: this makes this thread 46 | * safe as long as only one thread uses a particular DIR struct at 47 | * a time) */ 48 | struct dirent dd_dir; 49 | 50 | /* _findnext handle */ 51 | long dd_handle; 52 | 53 | /* 54 | * Status of search: 55 | * 0 = not started yet (next entry to read is first entry) 56 | * -1 = off the end 57 | * positive = 0 based index of next entry 58 | */ 59 | int dd_stat; 60 | 61 | /* given path for dir with search pattern (struct is extended) */ 62 | char dd_name[1]; 63 | } DIR; 64 | 65 | DIR* __cdecl opendir (const char*); 66 | struct dirent* __cdecl readdir (DIR*); 67 | int __cdecl closedir (DIR*); 68 | void __cdecl rewinddir (DIR*); 69 | long __cdecl telldir (DIR*); 70 | void __cdecl seekdir (DIR*, long); 71 | 72 | 73 | /* wide char versions */ 74 | 75 | struct _wdirent 76 | { 77 | long d_ino; /* Always zero. */ 78 | unsigned short d_reclen; /* Always zero. */ 79 | unsigned short d_namlen; /* Length of name in d_name. */ 80 | wchar_t* d_name; /* File name. */ 81 | /* NOTE: The name in the dirent structure points to the name in the * wfinddata_t structure in the _WDIR. */ 82 | }; 83 | 84 | /* 85 | * This is an internal data structure. Good programmers will not use it 86 | * except as an argument to one of the functions below. 87 | */ 88 | typedef struct 89 | { 90 | /* disk transfer area for this dir */ 91 | struct _wfinddata_t dd_dta; 92 | 93 | /* dirent struct to return from dir (NOTE: this makes this thread 94 | * safe as long as only one thread uses a particular DIR struct at 95 | * a time) */ 96 | struct _wdirent dd_dir; 97 | 98 | /* _findnext handle */ 99 | long dd_handle; 100 | 101 | /* 102 | * Status of search: 103 | * 0 = not started yet (next entry to read is first entry) 104 | * -1 = off the end 105 | * positive = 0 based index of next entry 106 | */ 107 | int dd_stat; 108 | 109 | /* given path for dir with search pattern (struct is extended) */ 110 | wchar_t dd_name[1]; 111 | } _WDIR; 112 | 113 | 114 | 115 | _WDIR* __cdecl _wopendir (const wchar_t*); 116 | struct _wdirent* __cdecl _wreaddir (_WDIR*); 117 | int __cdecl _wclosedir (_WDIR*); 118 | void __cdecl _wrewinddir (_WDIR*); 119 | long __cdecl _wtelldir (_WDIR*); 120 | void __cdecl _wseekdir (_WDIR*, long); 121 | 122 | 123 | #ifdef __cplusplus 124 | } 125 | #endif 126 | 127 | #endif /* Not RC_INVOKED */ 128 | 129 | #pragma pack(pop) 130 | 131 | #endif /* Not _DIRENT_H_ */ 132 | 133 | 134 | #endif /* Not __STRICT_ANSI__ */ 135 | 136 | -------------------------------------------------------------------------------- /SRC/SDL/SDL_timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_timer_h_ 23 | #define SDL_timer_h_ 24 | 25 | /** 26 | * \file SDL_timer.h 27 | * 28 | * Header for the SDL time management routines. 29 | */ 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | 34 | #include "begin_code.h" 35 | /* Set up for C function definitions, even when using C++ */ 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** 41 | * \brief Get the number of milliseconds since the SDL library initialization. 42 | * 43 | * \note This value wraps if the program runs for more than ~49 days. 44 | */ 45 | extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void); 46 | 47 | /** 48 | * \brief Compare SDL ticks values, and return true if A has passed B 49 | * 50 | * e.g. if you want to wait 100 ms, you could do this: 51 | * Uint32 timeout = SDL_GetTicks() + 100; 52 | * while (!SDL_TICKS_PASSED(SDL_GetTicks(), timeout)) { 53 | * ... do work until timeout has elapsed 54 | * } 55 | */ 56 | #define SDL_TICKS_PASSED(A, B) ((Sint32)((B) - (A)) <= 0) 57 | 58 | /** 59 | * \brief Get the current value of the high resolution counter 60 | */ 61 | extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceCounter(void); 62 | 63 | /** 64 | * \brief Get the count per second of the high resolution counter 65 | */ 66 | extern DECLSPEC Uint64 SDLCALL SDL_GetPerformanceFrequency(void); 67 | 68 | /** 69 | * \brief Wait a specified number of milliseconds before returning. 70 | */ 71 | extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms); 72 | 73 | /** 74 | * Function prototype for the timer callback function. 75 | * 76 | * The callback function is passed the current timer interval and returns 77 | * the next timer interval. If the returned value is the same as the one 78 | * passed in, the periodic alarm continues, otherwise a new alarm is 79 | * scheduled. If the callback returns 0, the periodic alarm is cancelled. 80 | */ 81 | typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param); 82 | 83 | /** 84 | * Definition of the timer ID type. 85 | */ 86 | typedef int SDL_TimerID; 87 | 88 | /** 89 | * \brief Add a new timer to the pool of timers already running. 90 | * 91 | * \return A timer ID, or 0 when an error occurs. 92 | */ 93 | extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval, 94 | SDL_TimerCallback callback, 95 | void *param); 96 | 97 | /** 98 | * \brief Remove a timer knowing its ID. 99 | * 100 | * \return A boolean value indicating success or failure. 101 | * 102 | * \warning It is not safe to remove a timer multiple times. 103 | */ 104 | extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID id); 105 | 106 | 107 | /* Ends C function definitions when using C++ */ 108 | #ifdef __cplusplus 109 | } 110 | #endif 111 | #include "close_code.h" 112 | 113 | #endif /* SDL_timer_h_ */ 114 | 115 | /* vi: set ts=4 sw=4 expandtab: */ 116 | -------------------------------------------------------------------------------- /SRC/CRT/sys/utime.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_UTIME 7 | #define _INC_UTIME 8 | 9 | #ifndef _WIN32 10 | #error Only Win32 target is supported! 11 | #endif 12 | 13 | #include <_mingw.h> 14 | 15 | #pragma pack(push,_CRT_PACKING) 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #ifndef _CRTIMP 22 | #define _CRTIMP __declspec(dllimport) 23 | #endif 24 | 25 | #ifndef _WCHAR_T_DEFINED 26 | typedef unsigned short wchar_t; 27 | #define _WCHAR_T_DEFINED 28 | #endif 29 | 30 | #ifndef __TINYC__ /* gr */ 31 | #ifdef _USE_32BIT_TIME_T 32 | #ifdef _WIN64 33 | #undef _USE_32BIT_TIME_T 34 | #endif 35 | #else 36 | #if _INTEGRAL_MAX_BITS < 64 37 | #define _USE_32BIT_TIME_T 38 | #endif 39 | #endif 40 | #endif 41 | 42 | #ifndef _TIME32_T_DEFINED 43 | #define _TIME32_T_DEFINED 44 | typedef long __time32_t; 45 | #endif 46 | 47 | #ifndef _TIME64_T_DEFINED 48 | #define _TIME64_T_DEFINED 49 | #if _INTEGRAL_MAX_BITS >= 64 50 | typedef __int64 __time64_t; 51 | #endif 52 | #endif 53 | 54 | #ifndef _TIME_T_DEFINED 55 | #define _TIME_T_DEFINED 56 | #ifdef _USE_32BIT_TIME_T 57 | typedef __time32_t time_t; 58 | #else 59 | typedef __time64_t time_t; 60 | #endif 61 | #endif 62 | 63 | #ifndef _UTIMBUF_DEFINED 64 | #define _UTIMBUF_DEFINED 65 | 66 | struct _utimbuf { 67 | time_t actime; 68 | time_t modtime; 69 | }; 70 | 71 | struct __utimbuf32 { 72 | __time32_t actime; 73 | __time32_t modtime; 74 | }; 75 | 76 | #if _INTEGRAL_MAX_BITS >= 64 77 | struct __utimbuf64 { 78 | __time64_t actime; 79 | __time64_t modtime; 80 | }; 81 | #endif 82 | 83 | #ifndef NO_OLDNAMES 84 | struct utimbuf { 85 | time_t actime; 86 | time_t modtime; 87 | }; 88 | 89 | struct utimbuf32 { 90 | __time32_t actime; 91 | __time32_t modtime; 92 | }; 93 | #endif 94 | #endif 95 | 96 | _CRTIMP int __cdecl _utime32(const char *_Filename,struct __utimbuf32 *_Time); 97 | _CRTIMP int __cdecl _futime32(int _FileDes,struct __utimbuf32 *_Time); 98 | _CRTIMP int __cdecl _wutime32(const wchar_t *_Filename,struct __utimbuf32 *_Time); 99 | #if _INTEGRAL_MAX_BITS >= 64 100 | _CRTIMP int __cdecl _utime64(const char *_Filename,struct __utimbuf64 *_Time); 101 | _CRTIMP int __cdecl _futime64(int _FileDes,struct __utimbuf64 *_Time); 102 | _CRTIMP int __cdecl _wutime64(const wchar_t *_Filename,struct __utimbuf64 *_Time); 103 | #endif 104 | 105 | #ifndef RC_INVOKED 106 | #ifdef _USE_32BIT_TIME_T 107 | __CRT_INLINE int __cdecl _utime(const char *_Filename,struct _utimbuf *_Utimbuf) { 108 | return _utime32(_Filename,(struct __utimbuf32 *)_Utimbuf); 109 | } 110 | __CRT_INLINE int __cdecl _futime(int _Desc,struct _utimbuf *_Utimbuf) { 111 | return _futime32(_Desc,(struct __utimbuf32 *)_Utimbuf); 112 | } 113 | __CRT_INLINE int __cdecl _wutime(const wchar_t *_Filename,struct _utimbuf *_Utimbuf) { 114 | return _wutime32(_Filename,(struct __utimbuf32 *)_Utimbuf); 115 | } 116 | #else 117 | __CRT_INLINE int __cdecl _utime(const char *_Filename,struct _utimbuf *_Utimbuf) { 118 | return _utime64(_Filename,(struct __utimbuf64 *)_Utimbuf); 119 | } 120 | __CRT_INLINE int __cdecl _futime(int _Desc,struct _utimbuf *_Utimbuf) { 121 | return _futime64(_Desc,(struct __utimbuf64 *)_Utimbuf); 122 | } 123 | __CRT_INLINE int __cdecl _wutime(const wchar_t *_Filename,struct _utimbuf *_Utimbuf) { 124 | return _wutime64(_Filename,(struct __utimbuf64 *)_Utimbuf); 125 | } 126 | #endif 127 | 128 | #ifndef NO_OLDNAMES 129 | #ifdef _USE_32BIT_TIME_T 130 | __CRT_INLINE int __cdecl utime(const char *_Filename,struct utimbuf *_Utimbuf) { 131 | return _utime32(_Filename,(struct __utimbuf32 *)_Utimbuf); 132 | } 133 | #else 134 | __CRT_INLINE int __cdecl utime(const char *_Filename,struct utimbuf *_Utimbuf) { 135 | return _utime64(_Filename,(struct __utimbuf64 *)_Utimbuf); 136 | } 137 | #endif 138 | #endif 139 | #endif 140 | 141 | #ifdef __cplusplus 142 | } 143 | #endif 144 | 145 | #pragma pack(pop) 146 | #endif 147 | -------------------------------------------------------------------------------- /SRC/CRT/sec_api/stdlib_s.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_STDLIB_S 7 | #define _INC_STDLIB_S 8 | 9 | #include 10 | 11 | #if defined(MINGW_HAS_SECURE_API) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | _CRTIMP errno_t __cdecl _dupenv_s(char **_PBuffer,size_t *_PBufferSizeInBytes,const char *_VarName); 18 | _CRTIMP errno_t __cdecl _itoa_s(int _Value,char *_DstBuf,size_t _Size,int _Radix); 19 | #if _INTEGRAL_MAX_BITS >= 64 20 | _CRTIMP errno_t __cdecl _i64toa_s(__int64 _Val,char *_DstBuf,size_t _Size,int _Radix); 21 | _CRTIMP errno_t __cdecl _ui64toa_s(unsigned __int64 _Val,char *_DstBuf,size_t _Size,int _Radix); 22 | #endif 23 | _CRTIMP errno_t __cdecl _ltoa_s(long _Val,char *_DstBuf,size_t _Size,int _Radix); 24 | _CRTIMP errno_t __cdecl mbstowcs_s(size_t *_PtNumOfCharConverted,wchar_t *_DstBuf,size_t _SizeInWords,const char *_SrcBuf,size_t _MaxCount); 25 | _CRTIMP errno_t __cdecl _mbstowcs_s_l(size_t *_PtNumOfCharConverted,wchar_t *_DstBuf,size_t _SizeInWords,const char *_SrcBuf,size_t _MaxCount,_locale_t _Locale); 26 | _CRTIMP errno_t __cdecl _ultoa_s(unsigned long _Val,char *_DstBuf,size_t _Size,int _Radix); 27 | _CRTIMP errno_t __cdecl _wctomb_s_l(int *_SizeConverted,char *_MbCh,size_t _SizeInBytes,wchar_t _WCh,_locale_t _Locale); 28 | _CRTIMP errno_t __cdecl wcstombs_s(size_t *_PtNumOfCharConverted,char *_Dst,size_t _DstSizeInBytes,const wchar_t *_Src,size_t _MaxCountInBytes); 29 | _CRTIMP errno_t __cdecl _wcstombs_s_l(size_t *_PtNumOfCharConverted,char *_Dst,size_t _DstSizeInBytes,const wchar_t *_Src,size_t _MaxCountInBytes,_locale_t _Locale); 30 | 31 | #ifndef _WSTDLIB_S_DEFINED 32 | #define _WSTDLIB_S_DEFINED 33 | _CRTIMP errno_t __cdecl _itow_s (int _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); 34 | _CRTIMP errno_t __cdecl _ltow_s (long _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); 35 | _CRTIMP errno_t __cdecl _ultow_s (unsigned long _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); 36 | _CRTIMP errno_t __cdecl _wgetenv_s(size_t *_ReturnSize,wchar_t *_DstBuf,size_t _DstSizeInWords,const wchar_t *_VarName); 37 | _CRTIMP errno_t __cdecl _wdupenv_s(wchar_t **_Buffer,size_t *_BufferSizeInWords,const wchar_t *_VarName); 38 | #if _INTEGRAL_MAX_BITS >= 64 39 | _CRTIMP errno_t __cdecl _i64tow_s(__int64 _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); 40 | _CRTIMP errno_t __cdecl _ui64tow_s(unsigned __int64 _Val,wchar_t *_DstBuf,size_t _SizeInWords,int _Radix); 41 | #endif 42 | #endif 43 | 44 | #ifndef _POSIX_ 45 | _CRTIMP errno_t __cdecl _ecvt_s(char *_DstBuf,size_t _Size,double _Val,int _NumOfDights,int *_PtDec,int *_PtSign); 46 | _CRTIMP errno_t __cdecl _fcvt_s(char *_DstBuf,size_t _Size,double _Val,int _NumOfDec,int *_PtDec,int *_PtSign); 47 | _CRTIMP errno_t __cdecl _gcvt_s(char *_DstBuf,size_t _Size,double _Val,int _NumOfDigits); 48 | _CRTIMP errno_t __cdecl _makepath_s(char *_PathResult,size_t _Size,const char *_Drive,const char *_Dir,const char *_Filename,const char *_Ext); 49 | _CRTIMP errno_t __cdecl _putenv_s(const char *_Name,const char *_Value); 50 | _CRTIMP errno_t __cdecl _searchenv_s(const char *_Filename,const char *_EnvVar,char *_ResultPath,size_t _SizeInBytes); 51 | _CRTIMP errno_t __cdecl _splitpath_s(const char *_FullPath,char *_Drive,size_t _DriveSize,char *_Dir,size_t _DirSize,char *_Filename,size_t _FilenameSize,char *_Ext,size_t _ExtSize); 52 | 53 | #ifndef _WSTDLIBP_S_DEFINED 54 | #define _WSTDLIBP_S_DEFINED 55 | _CRTIMP errno_t __cdecl _wmakepath_s(wchar_t *_PathResult,size_t _SizeInWords,const wchar_t *_Drive,const wchar_t *_Dir,const wchar_t *_Filename,const wchar_t *_Ext); 56 | _CRTIMP errno_t __cdecl _wputenv_s(const wchar_t *_Name,const wchar_t *_Value); 57 | _CRTIMP errno_t __cdecl _wsearchenv_s(const wchar_t *_Filename,const wchar_t *_EnvVar,wchar_t *_ResultPath,size_t _SizeInWords); 58 | _CRTIMP errno_t __cdecl _wsplitpath_s(const wchar_t *_FullPath,wchar_t *_Drive,size_t _DriveSizeInWords,wchar_t *_Dir,size_t _DirSizeInWords,wchar_t *_Filename,size_t _FilenameSizeInWords,wchar_t *_Ext,size_t _ExtSizeInWords); 59 | #endif 60 | #endif 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif 67 | #endif 68 | -------------------------------------------------------------------------------- /SRC/CRT/excpt.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_EXCPT 7 | #define _INC_EXCPT 8 | 9 | #include <_mingw.h> 10 | 11 | #pragma pack(push,_CRT_PACKING) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | struct _EXCEPTION_POINTERS; 18 | 19 | #ifndef EXCEPTION_DISPOSITION 20 | #define EXCEPTION_DISPOSITION int 21 | #endif 22 | #define ExceptionContinueExecution 0 23 | #define ExceptionContinueSearch 1 24 | #define ExceptionNestedException 2 25 | #define ExceptionCollidedUnwind 3 26 | 27 | #if (defined(_X86_) && !defined(__x86_64)) 28 | struct _EXCEPTION_RECORD; 29 | struct _CONTEXT; 30 | 31 | EXCEPTION_DISPOSITION __cdecl _except_handler(struct _EXCEPTION_RECORD *_ExceptionRecord,void *_EstablisherFrame,struct _CONTEXT *_ContextRecord,void *_DispatcherContext); 32 | #elif defined(__ia64__) 33 | 34 | typedef struct _EXCEPTION_POINTERS *Exception_info_ptr; 35 | struct _EXCEPTION_RECORD; 36 | struct _CONTEXT; 37 | struct _DISPATCHER_CONTEXT; 38 | 39 | _CRTIMP EXCEPTION_DISPOSITION __cdecl __C_specific_handler (struct _EXCEPTION_RECORD *_ExceptionRecord,unsigned __int64 _MemoryStackFp,unsigned __int64 _BackingStoreFp,struct _CONTEXT *_ContextRecord,struct _DISPATCHER_CONTEXT *_DispatcherContext,unsigned __int64 _GlobalPointer); 40 | #elif defined(__x86_64) 41 | 42 | struct _EXCEPTION_RECORD; 43 | struct _CONTEXT; 44 | #endif 45 | 46 | #define GetExceptionCode _exception_code 47 | #define exception_code _exception_code 48 | #define GetExceptionInformation (struct _EXCEPTION_POINTERS *)_exception_info 49 | #define exception_info (struct _EXCEPTION_POINTERS *)_exception_info 50 | #define AbnormalTermination _abnormal_termination 51 | #define abnormal_termination _abnormal_termination 52 | 53 | unsigned long __cdecl _exception_code(void); 54 | void *__cdecl _exception_info(void); 55 | int __cdecl _abnormal_termination(void); 56 | 57 | #define EXCEPTION_EXECUTE_HANDLER 1 58 | #define EXCEPTION_CONTINUE_SEARCH 0 59 | #define EXCEPTION_CONTINUE_EXECUTION -1 60 | 61 | /* CRT stuff */ 62 | typedef void (__cdecl * _PHNDLR)(int); 63 | 64 | struct _XCPT_ACTION { 65 | unsigned long XcptNum; 66 | int SigNum; 67 | _PHNDLR XcptAction; 68 | }; 69 | 70 | extern struct _XCPT_ACTION _XcptActTab[]; 71 | extern int _XcptActTabCount; 72 | extern int _XcptActTabSize; 73 | extern int _First_FPE_Indx; 74 | extern int _Num_FPE; 75 | 76 | int __cdecl __CppXcptFilter(unsigned long _ExceptionNum,struct _EXCEPTION_POINTERS * _ExceptionPtr); 77 | int __cdecl _XcptFilter(unsigned long _ExceptionNum,struct _EXCEPTION_POINTERS * _ExceptionPtr); 78 | 79 | /* 80 | * The type of function that is expected as an exception handler to be 81 | * installed with _try1. 82 | */ 83 | typedef EXCEPTION_DISPOSITION (*PEXCEPTION_HANDLER)(struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*); 84 | 85 | #ifndef HAVE_NO_SEH 86 | /* 87 | * This is not entirely necessary, but it is the structure installed by 88 | * the _try1 primitive below. 89 | */ 90 | typedef struct _EXCEPTION_REGISTRATION { 91 | struct _EXCEPTION_REGISTRATION *prev; 92 | EXCEPTION_DISPOSITION (*handler)(struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*); 93 | } EXCEPTION_REGISTRATION, *PEXCEPTION_REGISTRATION; 94 | 95 | typedef EXCEPTION_REGISTRATION EXCEPTION_REGISTRATION_RECORD; 96 | typedef PEXCEPTION_REGISTRATION PEXCEPTION_REGISTRATION_RECORD; 97 | #endif 98 | 99 | #if (defined(_X86_) && !defined(__x86_64)) 100 | #define __try1(pHandler) \ 101 | __asm__ ("pushl %0;pushl %%fs:0;movl %%esp,%%fs:0;" : : "g" (pHandler)); 102 | 103 | #define __except1 \ 104 | __asm__ ("movl (%%esp),%%eax;movl %%eax,%%fs:0;addl $8,%%esp;" \ 105 | : : : "%eax"); 106 | #elif defined(__x86_64) 107 | #define __try1(pHandler) \ 108 | __asm__ ("pushq %0;pushq %%gs:0;movq %%rsp,%%gs:0;" : : "g" (pHandler)); 109 | 110 | #define __except1 \ 111 | __asm__ ("movq (%%rsp),%%rax;movq %%rax,%%gs:0;addq $16,%%rsp;" \ 112 | : : : "%rax"); 113 | #else 114 | #define __try1(pHandler) 115 | #define __except1 116 | #endif 117 | 118 | #ifdef __cplusplus 119 | } 120 | #endif 121 | 122 | #pragma pack(pop) 123 | #endif 124 | -------------------------------------------------------------------------------- /SRC/SDL/SDL_config_psp.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_config_psp_h_ 23 | #define SDL_config_psp_h_ 24 | #define SDL_config_h_ 25 | 26 | #include "SDL_platform.h" 27 | 28 | 29 | 30 | #ifdef __GNUC__ 31 | #define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1 32 | #endif 33 | 34 | #define HAVE_GCC_ATOMICS 1 35 | 36 | #define HAVE_ALLOCA_H 1 37 | #define HAVE_SYS_TYPES_H 1 38 | #define HAVE_STDIO_H 1 39 | #define STDC_HEADERS 1 40 | #define HAVE_STRING_H 1 41 | #define HAVE_INTTYPES_H 1 42 | #define HAVE_STDINT_H 1 43 | #define HAVE_CTYPE_H 1 44 | #define HAVE_MATH_H 1 45 | #define HAVE_SIGNAL_H 1 46 | 47 | /* C library functions */ 48 | #define HAVE_MALLOC 1 49 | #define HAVE_CALLOC 1 50 | #define HAVE_REALLOC 1 51 | #define HAVE_FREE 1 52 | #define HAVE_ALLOCA 1 53 | #define HAVE_GETENV 1 54 | #define HAVE_SETENV 1 55 | #define HAVE_PUTENV 1 56 | #define HAVE_SETENV 1 57 | #define HAVE_UNSETENV 1 58 | #define HAVE_QSORT 1 59 | #define HAVE_ABS 1 60 | #define HAVE_BCOPY 1 61 | #define HAVE_MEMSET 1 62 | #define HAVE_MEMCPY 1 63 | #define HAVE_MEMMOVE 1 64 | #define HAVE_MEMCMP 1 65 | #define HAVE_STRLEN 1 66 | #define HAVE_STRLCPY 1 67 | #define HAVE_STRLCAT 1 68 | #define HAVE_STRDUP 1 69 | #define HAVE_STRCHR 1 70 | #define HAVE_STRRCHR 1 71 | #define HAVE_STRSTR 1 72 | #define HAVE_STRTOL 1 73 | #define HAVE_STRTOUL 1 74 | #define HAVE_STRTOLL 1 75 | #define HAVE_STRTOULL 1 76 | #define HAVE_STRTOD 1 77 | #define HAVE_ATOI 1 78 | #define HAVE_ATOF 1 79 | #define HAVE_STRCMP 1 80 | #define HAVE_STRNCMP 1 81 | #define HAVE_STRCASECMP 1 82 | #define HAVE_STRNCASECMP 1 83 | #define HAVE_VSSCANF 1 84 | #define HAVE_VSNPRINTF 1 85 | #define HAVE_M_PI 1 86 | #define HAVE_ATAN 1 87 | #define HAVE_ATAN2 1 88 | #define HAVE_ACOS 1 89 | #define HAVE_ASIN 1 90 | #define HAVE_CEIL 1 91 | #define HAVE_COPYSIGN 1 92 | #define HAVE_COS 1 93 | #define HAVE_COSF 1 94 | #define HAVE_FABS 1 95 | #define HAVE_FLOOR 1 96 | #define HAVE_LOG 1 97 | #define HAVE_POW 1 98 | #define HAVE_SCALBN 1 99 | #define HAVE_SIN 1 100 | #define HAVE_SINF 1 101 | #define HAVE_SQRT 1 102 | #define HAVE_SQRTF 1 103 | #define HAVE_TAN 1 104 | #define HAVE_TANF 1 105 | #define HAVE_SETJMP 1 106 | #define HAVE_NANOSLEEP 1 107 | /* #define HAVE_SYSCONF 1 */ 108 | /* #define HAVE_SIGACTION 1 */ 109 | 110 | 111 | /* PSP isn't that sophisticated */ 112 | #define LACKS_SYS_MMAN_H 1 113 | 114 | /* Enable the stub thread support (src/thread/psp/\*.c) */ 115 | #define SDL_THREAD_PSP 1 116 | 117 | /* Enable the stub timer support (src/timer/psp/\*.c) */ 118 | #define SDL_TIMERS_PSP 1 119 | 120 | /* Enable the stub joystick driver (src/joystick/psp/\*.c) */ 121 | #define SDL_JOYSTICK_PSP 1 122 | 123 | /* Enable the stub audio driver (src/audio/psp/\*.c) */ 124 | #define SDL_AUDIO_DRIVER_PSP 1 125 | 126 | /* PSP video dirver */ 127 | #define SDL_VIDEO_DRIVER_PSP 1 128 | 129 | /* PSP render dirver */ 130 | #define SDL_VIDEO_RENDER_PSP 1 131 | 132 | #define SDL_POWER_PSP 1 133 | 134 | /* !!! FIXME: what does PSP do for filesystem stuff? */ 135 | #define SDL_FILESYSTEM_DUMMY 1 136 | 137 | /* PSP doesn't have haptic device (src/haptic/dummy/\*.c) */ 138 | #define SDL_HAPTIC_DISABLED 1 139 | 140 | /* PSP can't load shared object (src/loadso/dummy/\*.c) */ 141 | #define SDL_LOADSO_DISABLED 1 142 | 143 | 144 | #endif /* SDL_config_psp_h_ */ 145 | -------------------------------------------------------------------------------- /SRC/CRT/setjmp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_SETJMP 7 | #define _INC_SETJMP 8 | 9 | #include <_mingw.h> 10 | 11 | #pragma pack(push,_CRT_PACKING) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | #if (defined(_X86_) && !defined(__x86_64)) 18 | 19 | #define _JBLEN 16 20 | #define _JBTYPE int 21 | 22 | typedef struct __JUMP_BUFFER { 23 | unsigned long Ebp; 24 | unsigned long Ebx; 25 | unsigned long Edi; 26 | unsigned long Esi; 27 | unsigned long Esp; 28 | unsigned long Eip; 29 | unsigned long Registration; 30 | unsigned long TryLevel; 31 | unsigned long Cookie; 32 | unsigned long UnwindFunc; 33 | unsigned long UnwindData[6]; 34 | } _JUMP_BUFFER; 35 | #elif defined(__ia64__) 36 | typedef _CRT_ALIGN(16) struct _SETJMP_FLOAT128 { 37 | __int64 LowPart; 38 | __int64 HighPart; 39 | } SETJMP_FLOAT128; 40 | 41 | #define _JBLEN 33 42 | typedef SETJMP_FLOAT128 _JBTYPE; 43 | 44 | typedef struct __JUMP_BUFFER { 45 | 46 | unsigned long iAReserved[6]; 47 | 48 | unsigned long Registration; 49 | unsigned long TryLevel; 50 | unsigned long Cookie; 51 | unsigned long UnwindFunc; 52 | 53 | unsigned long UnwindData[6]; 54 | 55 | SETJMP_FLOAT128 FltS0; 56 | SETJMP_FLOAT128 FltS1; 57 | SETJMP_FLOAT128 FltS2; 58 | SETJMP_FLOAT128 FltS3; 59 | SETJMP_FLOAT128 FltS4; 60 | SETJMP_FLOAT128 FltS5; 61 | SETJMP_FLOAT128 FltS6; 62 | SETJMP_FLOAT128 FltS7; 63 | SETJMP_FLOAT128 FltS8; 64 | SETJMP_FLOAT128 FltS9; 65 | SETJMP_FLOAT128 FltS10; 66 | SETJMP_FLOAT128 FltS11; 67 | SETJMP_FLOAT128 FltS12; 68 | SETJMP_FLOAT128 FltS13; 69 | SETJMP_FLOAT128 FltS14; 70 | SETJMP_FLOAT128 FltS15; 71 | SETJMP_FLOAT128 FltS16; 72 | SETJMP_FLOAT128 FltS17; 73 | SETJMP_FLOAT128 FltS18; 74 | SETJMP_FLOAT128 FltS19; 75 | __int64 FPSR; 76 | __int64 StIIP; 77 | __int64 BrS0; 78 | __int64 BrS1; 79 | __int64 BrS2; 80 | __int64 BrS3; 81 | __int64 BrS4; 82 | __int64 IntS0; 83 | __int64 IntS1; 84 | __int64 IntS2; 85 | __int64 IntS3; 86 | __int64 RsBSP; 87 | __int64 RsPFS; 88 | __int64 ApUNAT; 89 | __int64 ApLC; 90 | __int64 IntSp; 91 | __int64 IntNats; 92 | __int64 Preds; 93 | 94 | } _JUMP_BUFFER; 95 | #elif defined(__x86_64) 96 | typedef _CRT_ALIGN(16) struct _SETJMP_FLOAT128 { 97 | unsigned __int64 Part[2]; 98 | } SETJMP_FLOAT128; 99 | 100 | #define _JBLEN 16 101 | typedef SETJMP_FLOAT128 _JBTYPE; 102 | 103 | typedef struct _JUMP_BUFFER { 104 | unsigned __int64 Frame; 105 | unsigned __int64 Rbx; 106 | unsigned __int64 Rsp; 107 | unsigned __int64 Rbp; 108 | unsigned __int64 Rsi; 109 | unsigned __int64 Rdi; 110 | unsigned __int64 R12; 111 | unsigned __int64 R13; 112 | unsigned __int64 R14; 113 | unsigned __int64 R15; 114 | unsigned __int64 Rip; 115 | unsigned __int64 Spare; 116 | SETJMP_FLOAT128 Xmm6; 117 | SETJMP_FLOAT128 Xmm7; 118 | SETJMP_FLOAT128 Xmm8; 119 | SETJMP_FLOAT128 Xmm9; 120 | SETJMP_FLOAT128 Xmm10; 121 | SETJMP_FLOAT128 Xmm11; 122 | SETJMP_FLOAT128 Xmm12; 123 | SETJMP_FLOAT128 Xmm13; 124 | SETJMP_FLOAT128 Xmm14; 125 | SETJMP_FLOAT128 Xmm15; 126 | } _JUMP_BUFFER; 127 | #endif 128 | #ifndef _JMP_BUF_DEFINED 129 | typedef _JBTYPE jmp_buf[_JBLEN]; 130 | #define _JMP_BUF_DEFINED 131 | #endif 132 | 133 | void * __cdecl __attribute__ ((__nothrow__)) mingw_getsp(void); 134 | 135 | #ifdef USE_MINGW_SETJMP_TWO_ARGS 136 | #ifndef _INC_SETJMPEX 137 | #define setjmp(BUF) _setjmp((BUF),mingw_getsp()) 138 | int __cdecl __attribute__ ((__nothrow__)) _setjmp(jmp_buf _Buf,void *_Ctx); 139 | #else 140 | #undef setjmp 141 | #define setjmp(BUF) _setjmpex((BUF),mingw_getsp()) 142 | #define setjmpex(BUF) _setjmpex((BUF),mingw_getsp()) 143 | int __cdecl __attribute__ ((__nothrow__)) _setjmpex(jmp_buf _Buf,void *_Ctx); 144 | #endif 145 | #else 146 | #ifndef _INC_SETJMPEX 147 | #define setjmp _setjmp 148 | #endif 149 | int __cdecl __attribute__ ((__nothrow__)) setjmp(jmp_buf _Buf); 150 | #endif 151 | 152 | __declspec(noreturn) __attribute__ ((__nothrow__)) void __cdecl ms_longjmp(jmp_buf _Buf,int _Value)/* throw(...)*/; 153 | __declspec(noreturn) __attribute__ ((__nothrow__)) void __cdecl longjmp(jmp_buf _Buf,int _Value); 154 | 155 | #ifdef __cplusplus 156 | } 157 | #endif 158 | 159 | #pragma pack(pop) 160 | #endif 161 | -------------------------------------------------------------------------------- /SRC/CRT/_mingw.h: -------------------------------------------------------------------------------- 1 | /* 2 | * _mingw.h 3 | * 4 | * This file is for TinyCC and not part of the Mingw32 package. 5 | * 6 | * THIS SOFTWARE IS NOT COPYRIGHTED 7 | * 8 | * This source code is offered for use in the public domain. You may 9 | * use, modify or distribute it freely. 10 | * 11 | * This code is distributed in the hope that it will be useful but 12 | * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY 13 | * DISCLAIMED. This includes but is not limited to warranties of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15 | * 16 | */ 17 | 18 | #ifndef __MINGW_H 19 | #define __MINGW_H 20 | 21 | /* some winapi files define these before including _mingw.h --> */ 22 | #undef __cdecl 23 | #undef _X86_ 24 | #undef WIN32 25 | /* <-- */ 26 | 27 | #include 28 | #include 29 | 30 | #define __int8 char 31 | #define __int16 short 32 | #define __int32 int 33 | #define __int64 long long 34 | #define _HAVE_INT64 35 | 36 | #define __cdecl 37 | #define __declspec(x) __attribute__((x)) 38 | #define __unaligned __attribute__((packed)) 39 | #define __fastcall __attribute__((fastcall)) 40 | 41 | #define __MSVCRT__ 1 42 | #undef _MSVCRT_ 43 | #define __MINGW_IMPORT extern __declspec(dllimport) 44 | #define __MINGW_ATTRIB_NORETURN 45 | #define __MINGW_ATTRIB_CONST 46 | #define __MINGW_ATTRIB_DEPRECATED 47 | #define __MINGW_ATTRIB_MALLOC 48 | #define __MINGW_ATTRIB_PURE 49 | #define __MINGW_ATTRIB_NONNULL(arg) 50 | #define __MINGW_NOTHROW 51 | #define __GNUC_VA_LIST 52 | 53 | #define _CRTIMP extern 54 | #define __CRT_INLINE extern __inline__ 55 | 56 | #define _CRT_ALIGN(x) __attribute__((aligned(x))) 57 | #define DECLSPEC_ALIGN(x) __attribute__((aligned(x))) 58 | #define _CRT_PACKING 8 59 | #define __CRT_UNALIGNED 60 | #define _CONST_RETURN 61 | 62 | #ifndef _TRUNCATE 63 | #define _TRUNCATE ((size_t)-1) 64 | #endif 65 | 66 | #define __CRT_STRINGIZE(_Value) #_Value 67 | #define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value) 68 | #define __CRT_WIDE(_String) L ## _String 69 | #define _CRT_WIDE(_String) __CRT_WIDE(_String) 70 | 71 | #ifdef _WIN64 72 | #define __stdcall 73 | #define _AMD64_ 1 74 | #define __x86_64 1 75 | #define _M_X64 100 /* Visual Studio */ 76 | #define _M_AMD64 100 /* Visual Studio */ 77 | #define USE_MINGW_SETJMP_TWO_ARGS 78 | #define mingw_getsp tinyc_getbp 79 | #define __TRY__ 80 | #else 81 | #define __stdcall __attribute__((__stdcall__)) 82 | #define _X86_ 1 83 | #define _M_IX86 300 /* Visual Studio */ 84 | #define WIN32 1 85 | #define _USE_32BIT_TIME_T 86 | #ifdef __arm__ 87 | #define __TRY__ 88 | #else 89 | #define __TRY__ void __try__(void**), *_sehrec[6]; __try__(_sehrec); 90 | #endif 91 | #endif 92 | 93 | /* in stddef.h */ 94 | #define _SIZE_T_DEFINED 95 | #define _SSIZE_T_DEFINED 96 | #define _PTRDIFF_T_DEFINED 97 | #define _WCHAR_T_DEFINED 98 | #define _UINTPTR_T_DEFINED 99 | #define _INTPTR_T_DEFINED 100 | #define _INTEGRAL_MAX_BITS 64 101 | 102 | #ifndef _TIME32_T_DEFINED 103 | #define _TIME32_T_DEFINED 104 | typedef long __time32_t; 105 | #endif 106 | 107 | #ifndef _TIME64_T_DEFINED 108 | #define _TIME64_T_DEFINED 109 | typedef long long __time64_t; 110 | #endif 111 | 112 | #ifndef _TIME_T_DEFINED 113 | #define _TIME_T_DEFINED 114 | #ifdef _USE_32BIT_TIME_T 115 | typedef __time32_t time_t; 116 | #else 117 | typedef __time64_t time_t; 118 | #endif 119 | #endif 120 | 121 | #ifndef _WCTYPE_T_DEFINED 122 | #define _WCTYPE_T_DEFINED 123 | typedef wchar_t wctype_t; 124 | #endif 125 | 126 | #ifndef _WINT_T 127 | #define _WINT_T 128 | typedef __WINT_TYPE__ wint_t; 129 | #endif 130 | 131 | typedef int errno_t; 132 | #define _ERRCODE_DEFINED 133 | 134 | typedef struct threadlocaleinfostruct *pthreadlocinfo; 135 | typedef struct threadmbcinfostruct *pthreadmbcinfo; 136 | typedef struct localeinfo_struct _locale_tstruct,*_locale_t; 137 | 138 | /* for winapi */ 139 | #define _ANONYMOUS_UNION 140 | #define _ANONYMOUS_STRUCT 141 | #define DECLSPEC_NORETURN 142 | #define DECLARE_STDCALL_P(type) __stdcall type 143 | #define NOSERVICE 1 144 | #define NOMCX 1 145 | #define NOIME 1 146 | #define __INTRIN_H_ 147 | #ifndef DUMMYUNIONNAME 148 | # define DUMMYUNIONNAME 149 | # define DUMMYUNIONNAME1 150 | # define DUMMYUNIONNAME2 151 | # define DUMMYUNIONNAME3 152 | # define DUMMYUNIONNAME4 153 | # define DUMMYUNIONNAME5 154 | #endif 155 | #ifndef DUMMYSTRUCTNAME 156 | # define DUMMYSTRUCTNAME 157 | #endif 158 | #ifndef WINVER 159 | # define WINVER 0x0502 160 | #endif 161 | #ifndef _WIN32_WINNT 162 | # define _WIN32_WINNT 0x502 163 | #endif 164 | 165 | #define __C89_NAMELESS 166 | #define __MINGW_EXTENSION 167 | #define WINAPI_FAMILY_PARTITION(X) 1 168 | #define MINGW_HAS_SECURE_API 169 | 170 | #endif /* __MINGW_H */ 171 | -------------------------------------------------------------------------------- /SRC/SDL/SDL_config_android.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_config_android_h_ 23 | #define SDL_config_android_h_ 24 | #define SDL_config_h_ 25 | 26 | #include "SDL_platform.h" 27 | 28 | /** 29 | * \file SDL_config_android.h 30 | * 31 | * This is a configuration that can be used to build SDL for Android 32 | */ 33 | 34 | #include 35 | 36 | #define HAVE_GCC_ATOMICS 1 37 | 38 | #define HAVE_ALLOCA_H 1 39 | #define HAVE_SYS_TYPES_H 1 40 | #define HAVE_STDIO_H 1 41 | #define STDC_HEADERS 1 42 | #define HAVE_STRING_H 1 43 | #define HAVE_INTTYPES_H 1 44 | #define HAVE_STDINT_H 1 45 | #define HAVE_CTYPE_H 1 46 | #define HAVE_MATH_H 1 47 | #define HAVE_SIGNAL_H 1 48 | 49 | /* C library functions */ 50 | #define HAVE_MALLOC 1 51 | #define HAVE_CALLOC 1 52 | #define HAVE_REALLOC 1 53 | #define HAVE_FREE 1 54 | #define HAVE_ALLOCA 1 55 | #define HAVE_GETENV 1 56 | #define HAVE_SETENV 1 57 | #define HAVE_PUTENV 1 58 | #define HAVE_SETENV 1 59 | #define HAVE_UNSETENV 1 60 | #define HAVE_QSORT 1 61 | #define HAVE_ABS 1 62 | #define HAVE_BCOPY 1 63 | #define HAVE_MEMSET 1 64 | #define HAVE_MEMCPY 1 65 | #define HAVE_MEMMOVE 1 66 | #define HAVE_MEMCMP 1 67 | #define HAVE_STRLEN 1 68 | #define HAVE_STRLCPY 1 69 | #define HAVE_STRLCAT 1 70 | #define HAVE_STRDUP 1 71 | #define HAVE_STRCHR 1 72 | #define HAVE_STRRCHR 1 73 | #define HAVE_STRSTR 1 74 | #define HAVE_STRTOL 1 75 | #define HAVE_STRTOUL 1 76 | #define HAVE_STRTOLL 1 77 | #define HAVE_STRTOULL 1 78 | #define HAVE_STRTOD 1 79 | #define HAVE_ATOI 1 80 | #define HAVE_ATOF 1 81 | #define HAVE_STRCMP 1 82 | #define HAVE_STRNCMP 1 83 | #define HAVE_STRCASECMP 1 84 | #define HAVE_STRNCASECMP 1 85 | #define HAVE_VSSCANF 1 86 | #define HAVE_VSNPRINTF 1 87 | #define HAVE_M_PI 1 88 | #define HAVE_ATAN 1 89 | #define HAVE_ATAN2 1 90 | #define HAVE_ACOS 1 91 | #define HAVE_ASIN 1 92 | #define HAVE_CEIL 1 93 | #define HAVE_COPYSIGN 1 94 | #define HAVE_COS 1 95 | #define HAVE_COSF 1 96 | #define HAVE_FABS 1 97 | #define HAVE_FLOOR 1 98 | #define HAVE_LOG 1 99 | #define HAVE_POW 1 100 | #define HAVE_SCALBN 1 101 | #define HAVE_SIN 1 102 | #define HAVE_SINF 1 103 | #define HAVE_SQRT 1 104 | #define HAVE_SQRTF 1 105 | #define HAVE_TAN 1 106 | #define HAVE_TANF 1 107 | #define HAVE_SIGACTION 1 108 | #define HAVE_SETJMP 1 109 | #define HAVE_NANOSLEEP 1 110 | #define HAVE_SYSCONF 1 111 | #define HAVE_CLOCK_GETTIME 1 112 | 113 | #define SIZEOF_VOIDP 4 114 | 115 | /* Enable various audio drivers */ 116 | #define SDL_AUDIO_DRIVER_ANDROID 1 117 | #define SDL_AUDIO_DRIVER_DUMMY 1 118 | 119 | /* Enable various input drivers */ 120 | #define SDL_JOYSTICK_ANDROID 1 121 | #define SDL_HAPTIC_ANDROID 1 122 | 123 | /* Enable various shared object loading systems */ 124 | #define SDL_LOADSO_DLOPEN 1 125 | 126 | /* Enable various threading systems */ 127 | #define SDL_THREAD_PTHREAD 1 128 | #define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 129 | 130 | /* Enable various timer systems */ 131 | #define SDL_TIMER_UNIX 1 132 | 133 | /* Enable various video drivers */ 134 | #define SDL_VIDEO_DRIVER_ANDROID 1 135 | 136 | /* Enable OpenGL ES */ 137 | #define SDL_VIDEO_OPENGL_ES 1 138 | #define SDL_VIDEO_OPENGL_ES2 1 139 | #define SDL_VIDEO_OPENGL_EGL 1 140 | #define SDL_VIDEO_RENDER_OGL_ES 1 141 | #define SDL_VIDEO_RENDER_OGL_ES2 1 142 | 143 | /* Enable Vulkan support */ 144 | /* Android does not support Vulkan in native code using the "armeabi" ABI. */ 145 | #if defined(__ARM_ARCH) && __ARM_ARCH < 7 146 | #define SDL_VIDEO_VULKAN 0 147 | #else 148 | #define SDL_VIDEO_VULKAN 1 149 | #endif 150 | 151 | /* Enable system power support */ 152 | #define SDL_POWER_ANDROID 1 153 | 154 | /* Enable the filesystem driver */ 155 | #define SDL_FILESYSTEM_ANDROID 1 156 | 157 | #endif /* SDL_config_android_h_ */ 158 | -------------------------------------------------------------------------------- /SRC/SDL/SDL.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL.h 24 | * 25 | * Main include header for the SDL library 26 | */ 27 | 28 | 29 | #ifndef SDL_h_ 30 | #define SDL_h_ 31 | 32 | #include "SDL_main.h" 33 | #include "SDL_stdinc.h" 34 | #include "SDL_assert.h" 35 | #include "SDL_atomic.h" 36 | #include "SDL_audio.h" 37 | #include "SDL_clipboard.h" 38 | #include "SDL_cpuinfo.h" 39 | #include "SDL_endian.h" 40 | #include "SDL_error.h" 41 | #include "SDL_events.h" 42 | #include "SDL_filesystem.h" 43 | #include "SDL_gamecontroller.h" 44 | #include "SDL_haptic.h" 45 | #include "SDL_hints.h" 46 | #include "SDL_joystick.h" 47 | #include "SDL_loadso.h" 48 | #include "SDL_log.h" 49 | #include "SDL_messagebox.h" 50 | #include "SDL_metal.h" 51 | #include "SDL_mutex.h" 52 | #include "SDL_power.h" 53 | #include "SDL_render.h" 54 | #include "SDL_rwops.h" 55 | #include "SDL_sensor.h" 56 | #include "SDL_shape.h" 57 | #include "SDL_system.h" 58 | #include "SDL_thread.h" 59 | #include "SDL_timer.h" 60 | #include "SDL_version.h" 61 | #include "SDL_video.h" 62 | 63 | #include "begin_code.h" 64 | /* Set up for C function definitions, even when using C++ */ 65 | #ifdef __cplusplus 66 | extern "C" { 67 | #endif 68 | 69 | /* As of version 0.5, SDL is loaded dynamically into the application */ 70 | 71 | /** 72 | * \name SDL_INIT_* 73 | * 74 | * These are the flags which may be passed to SDL_Init(). You should 75 | * specify the subsystems which you will be using in your application. 76 | */ 77 | /* @{ */ 78 | #define SDL_INIT_TIMER 0x00000001u 79 | #define SDL_INIT_AUDIO 0x00000010u 80 | #define SDL_INIT_VIDEO 0x00000020u /**< SDL_INIT_VIDEO implies SDL_INIT_EVENTS */ 81 | #define SDL_INIT_JOYSTICK 0x00000200u /**< SDL_INIT_JOYSTICK implies SDL_INIT_EVENTS */ 82 | #define SDL_INIT_HAPTIC 0x00001000u 83 | #define SDL_INIT_GAMECONTROLLER 0x00002000u /**< SDL_INIT_GAMECONTROLLER implies SDL_INIT_JOYSTICK */ 84 | #define SDL_INIT_EVENTS 0x00004000u 85 | #define SDL_INIT_SENSOR 0x00008000u 86 | #define SDL_INIT_NOPARACHUTE 0x00100000u /**< compatibility; this flag is ignored. */ 87 | #define SDL_INIT_EVERYTHING ( \ 88 | SDL_INIT_TIMER | SDL_INIT_AUDIO | SDL_INIT_VIDEO | SDL_INIT_EVENTS | \ 89 | SDL_INIT_JOYSTICK | SDL_INIT_HAPTIC | SDL_INIT_GAMECONTROLLER | SDL_INIT_SENSOR \ 90 | ) 91 | /* @} */ 92 | 93 | /** 94 | * This function initializes the subsystems specified by \c flags 95 | */ 96 | extern DECLSPEC int SDLCALL SDL_Init(Uint32 flags); 97 | 98 | /** 99 | * This function initializes specific SDL subsystems 100 | * 101 | * Subsystem initialization is ref-counted, you must call 102 | * SDL_QuitSubSystem() for each SDL_InitSubSystem() to correctly 103 | * shutdown a subsystem manually (or call SDL_Quit() to force shutdown). 104 | * If a subsystem is already loaded then this call will 105 | * increase the ref-count and return. 106 | */ 107 | extern DECLSPEC int SDLCALL SDL_InitSubSystem(Uint32 flags); 108 | 109 | /** 110 | * This function cleans up specific SDL subsystems 111 | */ 112 | extern DECLSPEC void SDLCALL SDL_QuitSubSystem(Uint32 flags); 113 | 114 | /** 115 | * This function returns a mask of the specified subsystems which have 116 | * previously been initialized. 117 | * 118 | * If \c flags is 0, it returns a mask of all initialized subsystems. 119 | */ 120 | extern DECLSPEC Uint32 SDLCALL SDL_WasInit(Uint32 flags); 121 | 122 | /** 123 | * This function cleans up all initialized subsystems. You should 124 | * call it upon all exit conditions. 125 | */ 126 | extern DECLSPEC void SDLCALL SDL_Quit(void); 127 | 128 | /* Ends C function definitions when using C++ */ 129 | #ifdef __cplusplus 130 | } 131 | #endif 132 | #include "close_code.h" 133 | 134 | #endif /* SDL_h_ */ 135 | 136 | /* vi: set ts=4 sw=4 expandtab: */ 137 | -------------------------------------------------------------------------------- /SRC/CRT/winapi/guiddef.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef GUID_DEFINED 7 | #define GUID_DEFINED 8 | typedef struct _GUID { 9 | unsigned long Data1; 10 | unsigned short Data2; 11 | unsigned short Data3; 12 | unsigned char Data4[8 ]; 13 | } GUID; 14 | #endif 15 | 16 | #ifndef UUID_DEFINED 17 | #define UUID_DEFINED 18 | typedef GUID UUID; 19 | #endif 20 | 21 | #ifndef FAR 22 | #define FAR 23 | #endif 24 | 25 | #ifndef DECLSPEC_SELECTANY 26 | #define DECLSPEC_SELECTANY __declspec(selectany) 27 | #endif 28 | 29 | #ifndef EXTERN_C 30 | #ifdef __cplusplus 31 | #define EXTERN_C extern "C" 32 | #else 33 | #define EXTERN_C extern 34 | #endif 35 | #endif 36 | 37 | #ifdef DEFINE_GUID 38 | #undef DEFINE_GUID 39 | #endif 40 | 41 | #ifdef INITGUID 42 | #ifdef __cplusplus 43 | #define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) EXTERN_C const GUID DECLSPEC_SELECTANY name = { l,w1,w2,{ b1,b2,b3,b4,b5,b6,b7,b8 } } 44 | #else 45 | #define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID DECLSPEC_SELECTANY name = { l,w1,w2,{ b1,b2,b3,b4,b5,b6,b7,b8 } } 46 | #endif 47 | #else 48 | #define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) EXTERN_C const GUID name 49 | #endif 50 | 51 | #define DEFINE_OLEGUID(name,l,w1,w2) DEFINE_GUID(name,l,w1,w2,0xC0,0,0,0,0,0,0,0x46) 52 | 53 | #ifndef _GUIDDEF_H_ 54 | #define _GUIDDEF_H_ 55 | 56 | #ifndef __LPGUID_DEFINED__ 57 | #define __LPGUID_DEFINED__ 58 | typedef GUID *LPGUID; 59 | #endif 60 | 61 | #ifndef __LPCGUID_DEFINED__ 62 | #define __LPCGUID_DEFINED__ 63 | typedef const GUID *LPCGUID; 64 | #endif 65 | 66 | #ifndef __IID_DEFINED__ 67 | #define __IID_DEFINED__ 68 | 69 | typedef GUID IID; 70 | typedef IID *LPIID; 71 | #define IID_NULL GUID_NULL 72 | #define IsEqualIID(riid1,riid2) IsEqualGUID(riid1,riid2) 73 | typedef GUID CLSID; 74 | typedef CLSID *LPCLSID; 75 | #define CLSID_NULL GUID_NULL 76 | #define IsEqualCLSID(rclsid1,rclsid2) IsEqualGUID(rclsid1,rclsid2) 77 | typedef GUID FMTID; 78 | typedef FMTID *LPFMTID; 79 | #define FMTID_NULL GUID_NULL 80 | #define IsEqualFMTID(rfmtid1,rfmtid2) IsEqualGUID(rfmtid1,rfmtid2) 81 | 82 | #ifdef __midl_proxy 83 | #define __MIDL_CONST 84 | #else 85 | #define __MIDL_CONST const 86 | #endif 87 | 88 | #ifndef _REFGUID_DEFINED 89 | #define _REFGUID_DEFINED 90 | #ifdef __cplusplus 91 | #define REFGUID const GUID & 92 | #else 93 | #define REFGUID const GUID *__MIDL_CONST 94 | #endif 95 | #endif 96 | 97 | #ifndef _REFIID_DEFINED 98 | #define _REFIID_DEFINED 99 | #ifdef __cplusplus 100 | #define REFIID const IID & 101 | #else 102 | #define REFIID const IID *__MIDL_CONST 103 | #endif 104 | #endif 105 | 106 | #ifndef _REFCLSID_DEFINED 107 | #define _REFCLSID_DEFINED 108 | #ifdef __cplusplus 109 | #define REFCLSID const IID & 110 | #else 111 | #define REFCLSID const IID *__MIDL_CONST 112 | #endif 113 | #endif 114 | 115 | #ifndef _REFFMTID_DEFINED 116 | #define _REFFMTID_DEFINED 117 | #ifdef __cplusplus 118 | #define REFFMTID const IID & 119 | #else 120 | #define REFFMTID const IID *__MIDL_CONST 121 | #endif 122 | #endif 123 | #endif 124 | 125 | #ifndef _SYS_GUID_OPERATORS_ 126 | #define _SYS_GUID_OPERATORS_ 127 | #include 128 | 129 | #ifdef __cplusplus 130 | __inline int InlineIsEqualGUID(REFGUID rguid1,REFGUID rguid2) { 131 | return (((unsigned long *) &rguid1)[0]==((unsigned long *) &rguid2)[0] && ((unsigned long *) &rguid1)[1]==((unsigned long *) &rguid2)[1] && 132 | ((unsigned long *) &rguid1)[2]==((unsigned long *) &rguid2)[2] && ((unsigned long *) &rguid1)[3]==((unsigned long *) &rguid2)[3]); 133 | } 134 | __inline int IsEqualGUID(REFGUID rguid1,REFGUID rguid2) { return !memcmp(&rguid1,&rguid2,sizeof(GUID)); } 135 | #else 136 | #define InlineIsEqualGUID(rguid1,rguid2) (((unsigned long *) rguid1)[0]==((unsigned long *) rguid2)[0] && ((unsigned long *) rguid1)[1]==((unsigned long *) rguid2)[1] && ((unsigned long *) rguid1)[2]==((unsigned long *) rguid2)[2] && ((unsigned long *) rguid1)[3]==((unsigned long *) rguid2)[3]) 137 | #define IsEqualGUID(rguid1,rguid2) (!memcmp(rguid1,rguid2,sizeof(GUID))) 138 | #endif 139 | 140 | #ifdef __INLINE_ISEQUAL_GUID 141 | #undef IsEqualGUID 142 | #define IsEqualGUID(rguid1,rguid2) InlineIsEqualGUID(rguid1,rguid2) 143 | #endif 144 | 145 | #define IsEqualIID(riid1,riid2) IsEqualGUID(riid1,riid2) 146 | #define IsEqualCLSID(rclsid1,rclsid2) IsEqualGUID(rclsid1,rclsid2) 147 | 148 | #if !defined _SYS_GUID_OPERATOR_EQ_ && !defined _NO_SYS_GUID_OPERATOR_EQ_ 149 | #define _SYS_GUID_OPERATOR_EQ_ 150 | #ifdef __cplusplus 151 | __inline int operator==(REFGUID guidOne,REFGUID guidOther) { return IsEqualGUID(guidOne,guidOther); } 152 | __inline int operator!=(REFGUID guidOne,REFGUID guidOther) { return !(guidOne==guidOther); } 153 | #endif 154 | #endif 155 | #endif 156 | #endif 157 | -------------------------------------------------------------------------------- /SRC/SDL/SDL_config_iphoneos.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_config_iphoneos_h_ 23 | #define SDL_config_iphoneos_h_ 24 | #define SDL_config_h_ 25 | 26 | #include "SDL_platform.h" 27 | 28 | #ifdef __LP64__ 29 | #define SIZEOF_VOIDP 8 30 | #else 31 | #define SIZEOF_VOIDP 4 32 | #endif 33 | 34 | #define HAVE_GCC_ATOMICS 1 35 | 36 | #define HAVE_ALLOCA_H 1 37 | #define HAVE_SYS_TYPES_H 1 38 | #define HAVE_STDIO_H 1 39 | #define STDC_HEADERS 1 40 | #define HAVE_STRING_H 1 41 | #define HAVE_INTTYPES_H 1 42 | #define HAVE_STDINT_H 1 43 | #define HAVE_CTYPE_H 1 44 | #define HAVE_MATH_H 1 45 | #define HAVE_SIGNAL_H 1 46 | 47 | /* C library functions */ 48 | #define HAVE_MALLOC 1 49 | #define HAVE_CALLOC 1 50 | #define HAVE_REALLOC 1 51 | #define HAVE_FREE 1 52 | #define HAVE_ALLOCA 1 53 | #define HAVE_GETENV 1 54 | #define HAVE_SETENV 1 55 | #define HAVE_PUTENV 1 56 | #define HAVE_SETENV 1 57 | #define HAVE_UNSETENV 1 58 | #define HAVE_QSORT 1 59 | #define HAVE_ABS 1 60 | #define HAVE_BCOPY 1 61 | #define HAVE_MEMSET 1 62 | #define HAVE_MEMCPY 1 63 | #define HAVE_MEMMOVE 1 64 | #define HAVE_MEMCMP 1 65 | #define HAVE_STRLEN 1 66 | #define HAVE_STRLCPY 1 67 | #define HAVE_STRLCAT 1 68 | #define HAVE_STRDUP 1 69 | #define HAVE_STRCHR 1 70 | #define HAVE_STRRCHR 1 71 | #define HAVE_STRSTR 1 72 | #define HAVE_STRTOL 1 73 | #define HAVE_STRTOUL 1 74 | #define HAVE_STRTOLL 1 75 | #define HAVE_STRTOULL 1 76 | #define HAVE_STRTOD 1 77 | #define HAVE_ATOI 1 78 | #define HAVE_ATOF 1 79 | #define HAVE_STRCMP 1 80 | #define HAVE_STRNCMP 1 81 | #define HAVE_STRCASECMP 1 82 | #define HAVE_STRNCASECMP 1 83 | #define HAVE_VSSCANF 1 84 | #define HAVE_VSNPRINTF 1 85 | #define HAVE_M_PI 1 86 | #define HAVE_ATAN 1 87 | #define HAVE_ATAN2 1 88 | #define HAVE_ACOS 1 89 | #define HAVE_ASIN 1 90 | #define HAVE_CEIL 1 91 | #define HAVE_COPYSIGN 1 92 | #define HAVE_COS 1 93 | #define HAVE_COSF 1 94 | #define HAVE_FABS 1 95 | #define HAVE_FLOOR 1 96 | #define HAVE_LOG 1 97 | #define HAVE_POW 1 98 | #define HAVE_SCALBN 1 99 | #define HAVE_SIN 1 100 | #define HAVE_SINF 1 101 | #define HAVE_SQRT 1 102 | #define HAVE_SQRTF 1 103 | #define HAVE_TAN 1 104 | #define HAVE_TANF 1 105 | #define HAVE_SIGACTION 1 106 | #define HAVE_SETJMP 1 107 | #define HAVE_NANOSLEEP 1 108 | #define HAVE_SYSCONF 1 109 | #define HAVE_SYSCTLBYNAME 1 110 | 111 | /* enable iPhone version of Core Audio driver */ 112 | #define SDL_AUDIO_DRIVER_COREAUDIO 1 113 | /* Enable the dummy audio driver (src/audio/dummy/\*.c) */ 114 | #define SDL_AUDIO_DRIVER_DUMMY 1 115 | 116 | /* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ 117 | #define SDL_HAPTIC_DUMMY 1 118 | 119 | /* Enable MFi joystick support */ 120 | #define SDL_JOYSTICK_MFI 1 121 | 122 | /* Enable Unix style SO loading */ 123 | #define SDL_LOADSO_DLOPEN 1 124 | 125 | /* Enable various threading systems */ 126 | #define SDL_THREAD_PTHREAD 1 127 | #define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1 128 | 129 | /* Enable various timer systems */ 130 | #define SDL_TIMER_UNIX 1 131 | 132 | /* Supported video drivers */ 133 | #define SDL_VIDEO_DRIVER_UIKIT 1 134 | #define SDL_VIDEO_DRIVER_DUMMY 1 135 | 136 | /* enable OpenGL ES */ 137 | #define SDL_VIDEO_OPENGL_ES2 1 138 | #define SDL_VIDEO_OPENGL_ES 1 139 | #define SDL_VIDEO_RENDER_OGL_ES 1 140 | #define SDL_VIDEO_RENDER_OGL_ES2 1 141 | 142 | /* Enable Vulkan support */ 143 | #if !TARGET_OS_SIMULATOR && !TARGET_CPU_ARM // Only 64-bit devices have Metal 144 | #define SDL_VIDEO_VULKAN 1 145 | #else 146 | #define SDL_VIDEO_VULKAN 0 147 | #endif 148 | 149 | /* Enable system power support */ 150 | #define SDL_POWER_UIKIT 1 151 | 152 | /* enable iPhone keyboard support */ 153 | #define SDL_IPHONE_KEYBOARD 1 154 | 155 | /* enable iOS extended launch screen */ 156 | #define SDL_IPHONE_LAUNCHSCREEN 1 157 | 158 | /* Set max recognized G-force from accelerometer 159 | See src/joystick/uikit/SDL_sysjoystick.m for notes on why this is needed 160 | */ 161 | #define SDL_IPHONE_MAX_GFORCE 5.0 162 | 163 | /* enable filesystem support */ 164 | #define SDL_FILESYSTEM_COCOA 1 165 | 166 | #endif /* SDL_config_iphoneos_h_ */ 167 | -------------------------------------------------------------------------------- /SRC/SDL/SDL_messagebox.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDL_messagebox_h_ 23 | #define SDL_messagebox_h_ 24 | 25 | #include "SDL_stdinc.h" 26 | #include "SDL_video.h" /* For SDL_Window */ 27 | 28 | #include "begin_code.h" 29 | /* Set up for C function definitions, even when using C++ */ 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | /** 35 | * \brief SDL_MessageBox flags. If supported will display warning icon, etc. 36 | */ 37 | typedef enum 38 | { 39 | SDL_MESSAGEBOX_ERROR = 0x00000010, /**< error dialog */ 40 | SDL_MESSAGEBOX_WARNING = 0x00000020, /**< warning dialog */ 41 | SDL_MESSAGEBOX_INFORMATION = 0x00000040, /**< informational dialog */ 42 | SDL_MESSAGEBOX_BUTTONS_LEFT_TO_RIGHT = 0x00000080, /**< buttons placed left to right */ 43 | SDL_MESSAGEBOX_BUTTONS_RIGHT_TO_LEFT = 0x00000100 /**< buttons placed right to left */ 44 | } SDL_MessageBoxFlags; 45 | 46 | /** 47 | * \brief Flags for SDL_MessageBoxButtonData. 48 | */ 49 | typedef enum 50 | { 51 | SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT = 0x00000001, /**< Marks the default button when return is hit */ 52 | SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT = 0x00000002 /**< Marks the default button when escape is hit */ 53 | } SDL_MessageBoxButtonFlags; 54 | 55 | /** 56 | * \brief Individual button data. 57 | */ 58 | typedef struct 59 | { 60 | Uint32 flags; /**< ::SDL_MessageBoxButtonFlags */ 61 | int buttonid; /**< User defined button id (value returned via SDL_ShowMessageBox) */ 62 | const char * text; /**< The UTF-8 button text */ 63 | } SDL_MessageBoxButtonData; 64 | 65 | /** 66 | * \brief RGB value used in a message box color scheme 67 | */ 68 | typedef struct 69 | { 70 | Uint8 r, g, b; 71 | } SDL_MessageBoxColor; 72 | 73 | typedef enum 74 | { 75 | SDL_MESSAGEBOX_COLOR_BACKGROUND, 76 | SDL_MESSAGEBOX_COLOR_TEXT, 77 | SDL_MESSAGEBOX_COLOR_BUTTON_BORDER, 78 | SDL_MESSAGEBOX_COLOR_BUTTON_BACKGROUND, 79 | SDL_MESSAGEBOX_COLOR_BUTTON_SELECTED, 80 | SDL_MESSAGEBOX_COLOR_MAX 81 | } SDL_MessageBoxColorType; 82 | 83 | /** 84 | * \brief A set of colors to use for message box dialogs 85 | */ 86 | typedef struct 87 | { 88 | SDL_MessageBoxColor colors[SDL_MESSAGEBOX_COLOR_MAX]; 89 | } SDL_MessageBoxColorScheme; 90 | 91 | /** 92 | * \brief MessageBox structure containing title, text, window, etc. 93 | */ 94 | typedef struct 95 | { 96 | Uint32 flags; /**< ::SDL_MessageBoxFlags */ 97 | SDL_Window *window; /**< Parent window, can be NULL */ 98 | const char *title; /**< UTF-8 title */ 99 | const char *message; /**< UTF-8 message text */ 100 | 101 | int numbuttons; 102 | const SDL_MessageBoxButtonData *buttons; 103 | 104 | const SDL_MessageBoxColorScheme *colorScheme; /**< ::SDL_MessageBoxColorScheme, can be NULL to use system settings */ 105 | } SDL_MessageBoxData; 106 | 107 | /** 108 | * \brief Create a modal message box. 109 | * 110 | * \param messageboxdata The SDL_MessageBoxData structure with title, text, etc. 111 | * \param buttonid The pointer to which user id of hit button should be copied. 112 | * 113 | * \return -1 on error, otherwise 0 and buttonid contains user id of button 114 | * hit or -1 if dialog was closed. 115 | * 116 | * \note This function should be called on the thread that created the parent 117 | * window, or on the main thread if the messagebox has no parent. It will 118 | * block execution of that thread until the user clicks a button or 119 | * closes the messagebox. 120 | */ 121 | extern DECLSPEC int SDLCALL SDL_ShowMessageBox(const SDL_MessageBoxData *messageboxdata, int *buttonid); 122 | 123 | /** 124 | * \brief Create a simple modal message box 125 | * 126 | * \param flags ::SDL_MessageBoxFlags 127 | * \param title UTF-8 title text 128 | * \param message UTF-8 message text 129 | * \param window The parent window, or NULL for no parent 130 | * 131 | * \return 0 on success, -1 on error 132 | * 133 | * \sa SDL_ShowMessageBox 134 | */ 135 | extern DECLSPEC int SDLCALL SDL_ShowSimpleMessageBox(Uint32 flags, const char *title, const char *message, SDL_Window *window); 136 | 137 | 138 | /* Ends C function definitions when using C++ */ 139 | #ifdef __cplusplus 140 | } 141 | #endif 142 | #include "close_code.h" 143 | 144 | #endif /* SDL_messagebox_h_ */ 145 | 146 | /* vi: set ts=4 sw=4 expandtab: */ 147 | -------------------------------------------------------------------------------- /SRC/CRT/wctype.h: -------------------------------------------------------------------------------- 1 | /** 2 | * This file has no copyright assigned and is placed in the Public Domain. 3 | * This file is part of the w64 mingw-runtime package. 4 | * No warranty is given; refer to the file DISCLAIMER within this package. 5 | */ 6 | #ifndef _INC_WCTYPE 7 | #define _INC_WCTYPE 8 | 9 | #ifndef _WIN32 10 | #error Only Win32 target is supported! 11 | #endif 12 | 13 | #include <_mingw.h> 14 | 15 | #pragma pack(push,_CRT_PACKING) 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #ifndef _CRTIMP 22 | #define _CRTIMP __declspec(dllimport) 23 | #endif 24 | 25 | #ifndef _WCHAR_T_DEFINED 26 | typedef unsigned short wchar_t; 27 | #define _WCHAR_T_DEFINED 28 | #endif 29 | 30 | #ifndef _WCTYPE_T_DEFINED 31 | typedef unsigned short wint_t; 32 | typedef unsigned short wctype_t; 33 | #define _WCTYPE_T_DEFINED 34 | #endif 35 | 36 | #ifndef WEOF 37 | #define WEOF (wint_t)(0xFFFF) 38 | #endif 39 | 40 | #ifndef _CRT_CTYPEDATA_DEFINED 41 | #define _CRT_CTYPEDATA_DEFINED 42 | #ifndef _CTYPE_DISABLE_MACROS 43 | 44 | #ifndef __PCTYPE_FUNC 45 | #define __PCTYPE_FUNC __pctype_func() 46 | #ifdef _MSVCRT_ 47 | #define __pctype_func() (_pctype) 48 | #else 49 | #define __pctype_func() (*_imp___pctype) 50 | #endif 51 | #endif 52 | 53 | #ifndef _pctype 54 | #ifdef _MSVCRT_ 55 | extern unsigned short *_pctype; 56 | #else 57 | extern unsigned short **_imp___pctype; 58 | #define _pctype (*_imp___pctype) 59 | #endif 60 | #endif 61 | 62 | #endif 63 | #endif 64 | 65 | #ifndef _CRT_WCTYPEDATA_DEFINED 66 | #define _CRT_WCTYPEDATA_DEFINED 67 | #ifndef _CTYPE_DISABLE_MACROS 68 | #ifndef _wctype 69 | #ifdef _MSVCRT_ 70 | extern unsigned short *_wctype; 71 | #else 72 | extern unsigned short **_imp___wctype; 73 | #define _wctype (*_imp___wctype) 74 | #endif 75 | #endif 76 | 77 | #ifndef _pwctype 78 | #ifdef _MSVCRT_ 79 | extern unsigned short *_pwctype; 80 | #else 81 | extern unsigned short **_imp___pwctype; 82 | #define _pwctype (*_imp___pwctype) 83 | #define __pwctype_func() (*_imp___pwctype) 84 | #endif 85 | #endif 86 | #endif 87 | #endif 88 | 89 | #define _UPPER 0x1 90 | #define _LOWER 0x2 91 | #define _DIGIT 0x4 92 | #define _SPACE 0x8 93 | 94 | #define _PUNCT 0x10 95 | #define _CONTROL 0x20 96 | #define _BLANK 0x40 97 | #define _HEX 0x80 98 | 99 | #define _LEADBYTE 0x8000 100 | #define _ALPHA (0x0100|_UPPER|_LOWER) 101 | 102 | #ifndef _WCTYPE_DEFINED 103 | #define _WCTYPE_DEFINED 104 | 105 | int __cdecl iswalpha(wint_t); 106 | int __cdecl iswupper(wint_t); 107 | int __cdecl iswlower(wint_t); 108 | int __cdecl iswdigit(wint_t); 109 | int __cdecl iswxdigit(wint_t); 110 | int __cdecl iswspace(wint_t); 111 | int __cdecl iswpunct(wint_t); 112 | int __cdecl iswalnum(wint_t); 113 | int __cdecl iswprint(wint_t); 114 | int __cdecl iswgraph(wint_t); 115 | int __cdecl iswcntrl(wint_t); 116 | int __cdecl iswascii(wint_t); 117 | int __cdecl isleadbyte(int); 118 | wint_t __cdecl towupper(wint_t); 119 | wint_t __cdecl towlower(wint_t); 120 | int __cdecl iswctype(wint_t,wctype_t); 121 | _CRTIMP int __cdecl __iswcsymf(wint_t); 122 | _CRTIMP int __cdecl __iswcsym(wint_t); 123 | int __cdecl is_wctype(wint_t,wctype_t); 124 | #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || !defined (NO_OLDNAMES) 125 | int __cdecl isblank(int _C); 126 | #endif 127 | #endif 128 | 129 | #ifndef _WCTYPE_INLINE_DEFINED 130 | #define _WCTYPE_INLINE_DEFINED 131 | #ifndef __cplusplus 132 | #define iswalpha(_c) (iswctype(_c,_ALPHA)) 133 | #define iswupper(_c) (iswctype(_c,_UPPER)) 134 | #define iswlower(_c) (iswctype(_c,_LOWER)) 135 | #define iswdigit(_c) (iswctype(_c,_DIGIT)) 136 | #define iswxdigit(_c) (iswctype(_c,_HEX)) 137 | #define iswspace(_c) (iswctype(_c,_SPACE)) 138 | #define iswpunct(_c) (iswctype(_c,_PUNCT)) 139 | #define iswalnum(_c) (iswctype(_c,_ALPHA|_DIGIT)) 140 | #define iswprint(_c) (iswctype(_c,_BLANK|_PUNCT|_ALPHA|_DIGIT)) 141 | #define iswgraph(_c) (iswctype(_c,_PUNCT|_ALPHA|_DIGIT)) 142 | #define iswcntrl(_c) (iswctype(_c,_CONTROL)) 143 | #define iswascii(_c) ((unsigned)(_c) < 0x80) 144 | #define isleadbyte(c) (__pctype_func()[(unsigned char)(c)] & _LEADBYTE) 145 | #else 146 | __CRT_INLINE int __cdecl iswalpha(wint_t _C) {return (iswctype(_C,_ALPHA)); } 147 | __CRT_INLINE int __cdecl iswupper(wint_t _C) {return (iswctype(_C,_UPPER)); } 148 | __CRT_INLINE int __cdecl iswlower(wint_t _C) {return (iswctype(_C,_LOWER)); } 149 | __CRT_INLINE int __cdecl iswdigit(wint_t _C) {return (iswctype(_C,_DIGIT)); } 150 | __CRT_INLINE int __cdecl iswxdigit(wint_t _C) {return (iswctype(_C,_HEX)); } 151 | __CRT_INLINE int __cdecl iswspace(wint_t _C) {return (iswctype(_C,_SPACE)); } 152 | __CRT_INLINE int __cdecl iswpunct(wint_t _C) {return (iswctype(_C,_PUNCT)); } 153 | __CRT_INLINE int __cdecl iswalnum(wint_t _C) {return (iswctype(_C,_ALPHA|_DIGIT)); } 154 | __CRT_INLINE int __cdecl iswprint(wint_t _C) {return (iswctype(_C,_BLANK|_PUNCT|_ALPHA|_DIGIT)); } 155 | __CRT_INLINE int __cdecl iswgraph(wint_t _C) {return (iswctype(_C,_PUNCT|_ALPHA|_DIGIT)); } 156 | __CRT_INLINE int __cdecl iswcntrl(wint_t _C) {return (iswctype(_C,_CONTROL)); } 157 | __CRT_INLINE int __cdecl iswascii(wint_t _C) {return ((unsigned)(_C) < 0x80); } 158 | __CRT_INLINE int __cdecl isleadbyte(int _C) {return (__pctype_func()[(unsigned char)(_C)] & _LEADBYTE); } 159 | #endif 160 | #endif 161 | 162 | typedef wchar_t wctrans_t; 163 | wint_t __cdecl towctrans(wint_t,wctrans_t); 164 | wctrans_t __cdecl wctrans(const char *); 165 | wctype_t __cdecl wctype(const char *); 166 | 167 | #ifdef __cplusplus 168 | } 169 | #endif 170 | 171 | #pragma pack(pop) 172 | #endif 173 | -------------------------------------------------------------------------------- /SRC/SDL/begin_code.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file begin_code.h 24 | * 25 | * This file sets things up for C dynamic library function definitions, 26 | * static inlined functions, and structures aligned at 4-byte alignment. 27 | * If you don't like ugly C preprocessor code, don't look at this file. :) 28 | */ 29 | 30 | /* This shouldn't be nested -- included it around code only. */ 31 | #ifdef _begin_code_h 32 | #error Nested inclusion of begin_code.h 33 | #endif 34 | #define _begin_code_h 35 | 36 | #ifndef SDL_DEPRECATED 37 | # if (__GNUC__ >= 4) /* technically, this arrived in gcc 3.1, but oh well. */ 38 | # define SDL_DEPRECATED __attribute__((deprecated)) 39 | # else 40 | # define SDL_DEPRECATED 41 | # endif 42 | #endif 43 | 44 | #ifndef SDL_UNUSED 45 | # ifdef __GNUC__ 46 | # define SDL_UNUSED __attribute__((unused)) 47 | # else 48 | # define SDL_UNUSED 49 | # endif 50 | #endif 51 | 52 | /* Some compilers use a special export keyword */ 53 | #ifndef DECLSPEC 54 | # if defined(__WIN32__) || defined(__WINRT__) 55 | # ifdef __BORLANDC__ 56 | # ifdef BUILD_SDL 57 | # define DECLSPEC 58 | # else 59 | # define DECLSPEC __declspec(dllimport) 60 | # endif 61 | # else 62 | # define DECLSPEC __declspec(dllexport) 63 | # endif 64 | # elif defined(__OS2__) 65 | # ifdef BUILD_SDL 66 | # define DECLSPEC __declspec(dllexport) 67 | # else 68 | # define DECLSPEC 69 | # endif 70 | # else 71 | # if defined(__GNUC__) && __GNUC__ >= 4 72 | # define DECLSPEC __attribute__ ((visibility("default"))) 73 | # else 74 | # define DECLSPEC 75 | # endif 76 | # endif 77 | #endif 78 | 79 | /* By default SDL uses the C calling convention */ 80 | #ifndef SDLCALL 81 | #if (defined(__WIN32__) || defined(__WINRT__)) && !defined(__GNUC__) 82 | #define SDLCALL __cdecl 83 | #elif defined(__OS2__) || defined(__EMX__) 84 | #define SDLCALL _System 85 | # if defined (__GNUC__) && !defined(_System) 86 | # define _System /* for old EMX/GCC compat. */ 87 | # endif 88 | #else 89 | #define SDLCALL 90 | #endif 91 | #endif /* SDLCALL */ 92 | 93 | /* Removed DECLSPEC on Symbian OS because SDL cannot be a DLL in EPOC */ 94 | #ifdef __SYMBIAN32__ 95 | #undef DECLSPEC 96 | #define DECLSPEC 97 | #endif /* __SYMBIAN32__ */ 98 | 99 | /* Force structure packing at 4 byte alignment. 100 | This is necessary if the header is included in code which has structure 101 | packing set to an alternate value, say for loading structures from disk. 102 | The packing is reset to the previous value in close_code.h 103 | */ 104 | #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) 105 | #ifdef _MSC_VER 106 | #pragma warning(disable: 4103) 107 | #endif 108 | #ifdef __clang__ 109 | #pragma clang diagnostic ignored "-Wpragma-pack" 110 | #endif 111 | #ifdef __BORLANDC__ 112 | #pragma nopackwarning 113 | #endif 114 | #ifdef _M_X64 115 | /* Use 8-byte alignment on 64-bit architectures, so pointers are aligned */ 116 | #pragma pack(push,8) 117 | #else 118 | #pragma pack(push,4) 119 | #endif 120 | #endif /* Compiler needs structure packing set */ 121 | 122 | #ifndef SDL_INLINE 123 | #if defined(__GNUC__) 124 | #define SDL_INLINE __inline__ 125 | #elif defined(_MSC_VER) || defined(__BORLANDC__) || \ 126 | defined(__DMC__) || defined(__SC__) || \ 127 | defined(__WATCOMC__) || defined(__LCC__) || \ 128 | defined(__DECC) || defined(__CC_ARM) 129 | #define SDL_INLINE __inline 130 | #ifndef __inline__ 131 | #define __inline__ __inline 132 | #endif 133 | #else 134 | #define SDL_INLINE inline 135 | #ifndef __inline__ 136 | #define __inline__ inline 137 | #endif 138 | #endif 139 | #endif /* SDL_INLINE not defined */ 140 | 141 | #ifndef SDL_FORCE_INLINE 142 | #if defined(_MSC_VER) 143 | #define SDL_FORCE_INLINE __forceinline 144 | #elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) ) 145 | #define SDL_FORCE_INLINE __attribute__((always_inline)) static __inline__ 146 | #else 147 | #define SDL_FORCE_INLINE static SDL_INLINE 148 | #endif 149 | #endif /* SDL_FORCE_INLINE not defined */ 150 | 151 | #ifndef SDL_NORETURN 152 | #if defined(__GNUC__) 153 | #define SDL_NORETURN __attribute__((noreturn)) 154 | #elif defined(_MSC_VER) 155 | #define SDL_NORETURN __declspec(noreturn) 156 | #else 157 | #define SDL_NORETURN 158 | #endif 159 | #endif /* SDL_NORETURN not defined */ 160 | 161 | /* Apparently this is needed by several Windows compilers */ 162 | #if !defined(__MACH__) 163 | #ifndef NULL 164 | #ifdef __cplusplus 165 | #define NULL 0 166 | #else 167 | #define NULL ((void *)0) 168 | #endif 169 | #endif /* NULL */ 170 | #endif /* ! Mac OS X - breaks precompiled headers */ 171 | -------------------------------------------------------------------------------- /SRC/SDL/SDL_rect.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_rect.h 24 | * 25 | * Header file for SDL_rect definition and management functions. 26 | */ 27 | 28 | #ifndef SDL_rect_h_ 29 | #define SDL_rect_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | #include "SDL_pixels.h" 34 | #include "SDL_rwops.h" 35 | 36 | #include "begin_code.h" 37 | /* Set up for C function definitions, even when using C++ */ 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | /** 43 | * \brief The structure that defines a point (integer) 44 | * 45 | * \sa SDL_EnclosePoints 46 | * \sa SDL_PointInRect 47 | */ 48 | typedef struct SDL_Point 49 | { 50 | int x; 51 | int y; 52 | } SDL_Point; 53 | 54 | /** 55 | * \brief The structure that defines a point (floating point) 56 | * 57 | * \sa SDL_EnclosePoints 58 | * \sa SDL_PointInRect 59 | */ 60 | typedef struct SDL_FPoint 61 | { 62 | float x; 63 | float y; 64 | } SDL_FPoint; 65 | 66 | 67 | /** 68 | * \brief A rectangle, with the origin at the upper left (integer). 69 | * 70 | * \sa SDL_RectEmpty 71 | * \sa SDL_RectEquals 72 | * \sa SDL_HasIntersection 73 | * \sa SDL_IntersectRect 74 | * \sa SDL_UnionRect 75 | * \sa SDL_EnclosePoints 76 | */ 77 | typedef struct SDL_Rect 78 | { 79 | int x, y; 80 | int w, h; 81 | } SDL_Rect; 82 | 83 | 84 | /** 85 | * \brief A rectangle, with the origin at the upper left (floating point). 86 | */ 87 | typedef struct SDL_FRect 88 | { 89 | float x; 90 | float y; 91 | float w; 92 | float h; 93 | } SDL_FRect; 94 | 95 | 96 | /** 97 | * \brief Returns true if point resides inside a rectangle. 98 | */ 99 | SDL_FORCE_INLINE SDL_bool SDL_PointInRect(const SDL_Point *p, const SDL_Rect *r) 100 | { 101 | return ( (p->x >= r->x) && (p->x < (r->x + r->w)) && 102 | (p->y >= r->y) && (p->y < (r->y + r->h)) ) ? SDL_TRUE : SDL_FALSE; 103 | } 104 | 105 | /** 106 | * \brief Returns true if the rectangle has no area. 107 | */ 108 | SDL_FORCE_INLINE SDL_bool SDL_RectEmpty(const SDL_Rect *r) 109 | { 110 | return ((!r) || (r->w <= 0) || (r->h <= 0)) ? SDL_TRUE : SDL_FALSE; 111 | } 112 | 113 | /** 114 | * \brief Returns true if the two rectangles are equal. 115 | */ 116 | SDL_FORCE_INLINE SDL_bool SDL_RectEquals(const SDL_Rect *a, const SDL_Rect *b) 117 | { 118 | return (a && b && (a->x == b->x) && (a->y == b->y) && 119 | (a->w == b->w) && (a->h == b->h)) ? SDL_TRUE : SDL_FALSE; 120 | } 121 | 122 | /** 123 | * \brief Determine whether two rectangles intersect. 124 | * 125 | * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. 126 | */ 127 | extern DECLSPEC SDL_bool SDLCALL SDL_HasIntersection(const SDL_Rect * A, 128 | const SDL_Rect * B); 129 | 130 | /** 131 | * \brief Calculate the intersection of two rectangles. 132 | * 133 | * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. 134 | */ 135 | extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRect(const SDL_Rect * A, 136 | const SDL_Rect * B, 137 | SDL_Rect * result); 138 | 139 | /** 140 | * \brief Calculate the union of two rectangles. 141 | */ 142 | extern DECLSPEC void SDLCALL SDL_UnionRect(const SDL_Rect * A, 143 | const SDL_Rect * B, 144 | SDL_Rect * result); 145 | 146 | /** 147 | * \brief Calculate a minimal rectangle enclosing a set of points 148 | * 149 | * \return SDL_TRUE if any points were within the clipping rect 150 | */ 151 | extern DECLSPEC SDL_bool SDLCALL SDL_EnclosePoints(const SDL_Point * points, 152 | int count, 153 | const SDL_Rect * clip, 154 | SDL_Rect * result); 155 | 156 | /** 157 | * \brief Calculate the intersection of a rectangle and line segment. 158 | * 159 | * \return SDL_TRUE if there is an intersection, SDL_FALSE otherwise. 160 | */ 161 | extern DECLSPEC SDL_bool SDLCALL SDL_IntersectRectAndLine(const SDL_Rect * 162 | rect, int *X1, 163 | int *Y1, int *X2, 164 | int *Y2); 165 | 166 | /* Ends C function definitions when using C++ */ 167 | #ifdef __cplusplus 168 | } 169 | #endif 170 | #include "close_code.h" 171 | 172 | #endif /* SDL_rect_h_ */ 173 | 174 | /* vi: set ts=4 sw=4 expandtab: */ 175 | -------------------------------------------------------------------------------- /SRC/SDL/SDL_filesystem.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_filesystem.h 24 | * 25 | * \brief Include file for filesystem SDL API functions 26 | */ 27 | 28 | #ifndef SDL_filesystem_h_ 29 | #define SDL_filesystem_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | 35 | /* Set up for C function definitions, even when using C++ */ 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** 41 | * \brief Get the path where the application resides. 42 | * 43 | * Get the "base path". This is the directory where the application was run 44 | * from, which is probably the installation directory, and may or may not 45 | * be the process's current working directory. 46 | * 47 | * This returns an absolute path in UTF-8 encoding, and is guaranteed to 48 | * end with a path separator ('\\' on Windows, '/' most other places). 49 | * 50 | * The pointer returned by this function is owned by you. Please call 51 | * SDL_free() on the pointer when you are done with it, or it will be a 52 | * memory leak. This is not necessarily a fast call, though, so you should 53 | * call this once near startup and save the string if you need it. 54 | * 55 | * Some platforms can't determine the application's path, and on other 56 | * platforms, this might be meaningless. In such cases, this function will 57 | * return NULL. 58 | * 59 | * \return String of base dir in UTF-8 encoding, or NULL on error. 60 | * 61 | * \sa SDL_GetPrefPath 62 | */ 63 | extern DECLSPEC char *SDLCALL SDL_GetBasePath(void); 64 | 65 | /** 66 | * \brief Get the user-and-app-specific path where files can be written. 67 | * 68 | * Get the "pref dir". This is meant to be where users can write personal 69 | * files (preferences and save games, etc) that are specific to your 70 | * application. This directory is unique per user, per application. 71 | * 72 | * This function will decide the appropriate location in the native filesystem, 73 | * create the directory if necessary, and return a string of the absolute 74 | * path to the directory in UTF-8 encoding. 75 | * 76 | * On Windows, the string might look like: 77 | * "C:\\Users\\bob\\AppData\\Roaming\\My Company\\My Program Name\\" 78 | * 79 | * On Linux, the string might look like: 80 | * "/home/bob/.local/share/My Program Name/" 81 | * 82 | * On Mac OS X, the string might look like: 83 | * "/Users/bob/Library/Application Support/My Program Name/" 84 | * 85 | * (etc.) 86 | * 87 | * You specify the name of your organization (if it's not a real organization, 88 | * your name or an Internet domain you own might do) and the name of your 89 | * application. These should be untranslated proper names. 90 | * 91 | * Both the org and app strings may become part of a directory name, so 92 | * please follow these rules: 93 | * 94 | * - Try to use the same org string (including case-sensitivity) for 95 | * all your applications that use this function. 96 | * - Always use a unique app string for each one, and make sure it never 97 | * changes for an app once you've decided on it. 98 | * - Unicode characters are legal, as long as it's UTF-8 encoded, but... 99 | * - ...only use letters, numbers, and spaces. Avoid punctuation like 100 | * "Game Name 2: Bad Guy's Revenge!" ... "Game Name 2" is sufficient. 101 | * 102 | * This returns an absolute path in UTF-8 encoding, and is guaranteed to 103 | * end with a path separator ('\\' on Windows, '/' most other places). 104 | * 105 | * The pointer returned by this function is owned by you. Please call 106 | * SDL_free() on the pointer when you are done with it, or it will be a 107 | * memory leak. This is not necessarily a fast call, though, so you should 108 | * call this once near startup and save the string if you need it. 109 | * 110 | * You should assume the path returned by this function is the only safe 111 | * place to write files (and that SDL_GetBasePath(), while it might be 112 | * writable, or even the parent of the returned path, aren't where you 113 | * should be writing things). 114 | * 115 | * Some platforms can't determine the pref path, and on other 116 | * platforms, this might be meaningless. In such cases, this function will 117 | * return NULL. 118 | * 119 | * \param org The name of your organization. 120 | * \param app The name of your application. 121 | * \return UTF-8 string of user dir in platform-dependent notation. NULL 122 | * if there's a problem (creating directory failed, etc). 123 | * 124 | * \sa SDL_GetBasePath 125 | */ 126 | extern DECLSPEC char *SDLCALL SDL_GetPrefPath(const char *org, const char *app); 127 | 128 | /* Ends C function definitions when using C++ */ 129 | #ifdef __cplusplus 130 | } 131 | #endif 132 | #include "close_code.h" 133 | 134 | #endif /* SDL_filesystem_h_ */ 135 | 136 | /* vi: set ts=4 sw=4 expandtab: */ 137 | -------------------------------------------------------------------------------- /SRC/SDL/SDL_blendmode.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_blendmode.h 24 | * 25 | * Header file declaring the SDL_BlendMode enumeration 26 | */ 27 | 28 | #ifndef SDL_blendmode_h_ 29 | #define SDL_blendmode_h_ 30 | 31 | #include "begin_code.h" 32 | /* Set up for C function definitions, even when using C++ */ 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | /** 38 | * \brief The blend mode used in SDL_RenderCopy() and drawing operations. 39 | */ 40 | typedef enum 41 | { 42 | SDL_BLENDMODE_NONE = 0x00000000, /**< no blending 43 | dstRGBA = srcRGBA */ 44 | SDL_BLENDMODE_BLEND = 0x00000001, /**< alpha blending 45 | dstRGB = (srcRGB * srcA) + (dstRGB * (1-srcA)) 46 | dstA = srcA + (dstA * (1-srcA)) */ 47 | SDL_BLENDMODE_ADD = 0x00000002, /**< additive blending 48 | dstRGB = (srcRGB * srcA) + dstRGB 49 | dstA = dstA */ 50 | SDL_BLENDMODE_MOD = 0x00000004, /**< color modulate 51 | dstRGB = srcRGB * dstRGB 52 | dstA = dstA */ 53 | SDL_BLENDMODE_MUL = 0x00000008, /**< color multiply 54 | dstRGB = (srcRGB * dstRGB) + (dstRGB * (1-srcA)) 55 | dstA = (srcA * dstA) + (dstA * (1-srcA)) */ 56 | SDL_BLENDMODE_INVALID = 0x7FFFFFFF 57 | 58 | /* Additional custom blend modes can be returned by SDL_ComposeCustomBlendMode() */ 59 | 60 | } SDL_BlendMode; 61 | 62 | /** 63 | * \brief The blend operation used when combining source and destination pixel components 64 | */ 65 | typedef enum 66 | { 67 | SDL_BLENDOPERATION_ADD = 0x1, /**< dst + src: supported by all renderers */ 68 | SDL_BLENDOPERATION_SUBTRACT = 0x2, /**< dst - src : supported by D3D9, D3D11, OpenGL, OpenGLES */ 69 | SDL_BLENDOPERATION_REV_SUBTRACT = 0x3, /**< src - dst : supported by D3D9, D3D11, OpenGL, OpenGLES */ 70 | SDL_BLENDOPERATION_MINIMUM = 0x4, /**< min(dst, src) : supported by D3D11 */ 71 | SDL_BLENDOPERATION_MAXIMUM = 0x5 /**< max(dst, src) : supported by D3D11 */ 72 | 73 | } SDL_BlendOperation; 74 | 75 | /** 76 | * \brief The normalized factor used to multiply pixel components 77 | */ 78 | typedef enum 79 | { 80 | SDL_BLENDFACTOR_ZERO = 0x1, /**< 0, 0, 0, 0 */ 81 | SDL_BLENDFACTOR_ONE = 0x2, /**< 1, 1, 1, 1 */ 82 | SDL_BLENDFACTOR_SRC_COLOR = 0x3, /**< srcR, srcG, srcB, srcA */ 83 | SDL_BLENDFACTOR_ONE_MINUS_SRC_COLOR = 0x4, /**< 1-srcR, 1-srcG, 1-srcB, 1-srcA */ 84 | SDL_BLENDFACTOR_SRC_ALPHA = 0x5, /**< srcA, srcA, srcA, srcA */ 85 | SDL_BLENDFACTOR_ONE_MINUS_SRC_ALPHA = 0x6, /**< 1-srcA, 1-srcA, 1-srcA, 1-srcA */ 86 | SDL_BLENDFACTOR_DST_COLOR = 0x7, /**< dstR, dstG, dstB, dstA */ 87 | SDL_BLENDFACTOR_ONE_MINUS_DST_COLOR = 0x8, /**< 1-dstR, 1-dstG, 1-dstB, 1-dstA */ 88 | SDL_BLENDFACTOR_DST_ALPHA = 0x9, /**< dstA, dstA, dstA, dstA */ 89 | SDL_BLENDFACTOR_ONE_MINUS_DST_ALPHA = 0xA /**< 1-dstA, 1-dstA, 1-dstA, 1-dstA */ 90 | 91 | } SDL_BlendFactor; 92 | 93 | /** 94 | * \brief Create a custom blend mode, which may or may not be supported by a given renderer 95 | * 96 | * \param srcColorFactor source color factor 97 | * \param dstColorFactor destination color factor 98 | * \param colorOperation color operation 99 | * \param srcAlphaFactor source alpha factor 100 | * \param dstAlphaFactor destination alpha factor 101 | * \param alphaOperation alpha operation 102 | * 103 | * The result of the blend mode operation will be: 104 | * dstRGB = dstRGB * dstColorFactor colorOperation srcRGB * srcColorFactor 105 | * and 106 | * dstA = dstA * dstAlphaFactor alphaOperation srcA * srcAlphaFactor 107 | */ 108 | extern DECLSPEC SDL_BlendMode SDLCALL SDL_ComposeCustomBlendMode(SDL_BlendFactor srcColorFactor, 109 | SDL_BlendFactor dstColorFactor, 110 | SDL_BlendOperation colorOperation, 111 | SDL_BlendFactor srcAlphaFactor, 112 | SDL_BlendFactor dstAlphaFactor, 113 | SDL_BlendOperation alphaOperation); 114 | 115 | /* Ends C function definitions when using C++ */ 116 | #ifdef __cplusplus 117 | } 118 | #endif 119 | #include "close_code.h" 120 | 121 | #endif /* SDL_blendmode_h_ */ 122 | 123 | /* vi: set ts=4 sw=4 expandtab: */ 124 | -------------------------------------------------------------------------------- /SRC/SDL/SDL_version.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_version.h 24 | * 25 | * This header defines the current SDL version. 26 | */ 27 | 28 | #ifndef SDL_version_h_ 29 | #define SDL_version_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /** 40 | * \brief Information the version of SDL in use. 41 | * 42 | * Represents the library's version as three levels: major revision 43 | * (increments with massive changes, additions, and enhancements), 44 | * minor revision (increments with backwards-compatible changes to the 45 | * major revision), and patchlevel (increments with fixes to the minor 46 | * revision). 47 | * 48 | * \sa SDL_VERSION 49 | * \sa SDL_GetVersion 50 | */ 51 | typedef struct SDL_version 52 | { 53 | Uint8 major; /**< major version */ 54 | Uint8 minor; /**< minor version */ 55 | Uint8 patch; /**< update version */ 56 | } SDL_version; 57 | 58 | /* Printable format: "%d.%d.%d", MAJOR, MINOR, PATCHLEVEL 59 | */ 60 | #define SDL_MAJOR_VERSION 2 61 | #define SDL_MINOR_VERSION 0 62 | #define SDL_PATCHLEVEL 12 63 | 64 | /** 65 | * \brief Macro to determine SDL version program was compiled against. 66 | * 67 | * This macro fills in a SDL_version structure with the version of the 68 | * library you compiled against. This is determined by what header the 69 | * compiler uses. Note that if you dynamically linked the library, you might 70 | * have a slightly newer or older version at runtime. That version can be 71 | * determined with SDL_GetVersion(), which, unlike SDL_VERSION(), 72 | * is not a macro. 73 | * 74 | * \param x A pointer to a SDL_version struct to initialize. 75 | * 76 | * \sa SDL_version 77 | * \sa SDL_GetVersion 78 | */ 79 | #define SDL_VERSION(x) \ 80 | { \ 81 | (x)->major = SDL_MAJOR_VERSION; \ 82 | (x)->minor = SDL_MINOR_VERSION; \ 83 | (x)->patch = SDL_PATCHLEVEL; \ 84 | } 85 | 86 | /** 87 | * This macro turns the version numbers into a numeric value: 88 | * \verbatim 89 | (1,2,3) -> (1203) 90 | \endverbatim 91 | * 92 | * This assumes that there will never be more than 100 patchlevels. 93 | */ 94 | #define SDL_VERSIONNUM(X, Y, Z) \ 95 | ((X)*1000 + (Y)*100 + (Z)) 96 | 97 | /** 98 | * This is the version number macro for the current SDL version. 99 | */ 100 | #define SDL_COMPILEDVERSION \ 101 | SDL_VERSIONNUM(SDL_MAJOR_VERSION, SDL_MINOR_VERSION, SDL_PATCHLEVEL) 102 | 103 | /** 104 | * This macro will evaluate to true if compiled with SDL at least X.Y.Z. 105 | */ 106 | #define SDL_VERSION_ATLEAST(X, Y, Z) \ 107 | (SDL_COMPILEDVERSION >= SDL_VERSIONNUM(X, Y, Z)) 108 | 109 | /** 110 | * \brief Get the version of SDL that is linked against your program. 111 | * 112 | * If you are linking to SDL dynamically, then it is possible that the 113 | * current version will be different than the version you compiled against. 114 | * This function returns the current version, while SDL_VERSION() is a 115 | * macro that tells you what version you compiled with. 116 | * 117 | * \code 118 | * SDL_version compiled; 119 | * SDL_version linked; 120 | * 121 | * SDL_VERSION(&compiled); 122 | * SDL_GetVersion(&linked); 123 | * printf("We compiled against SDL version %d.%d.%d ...\n", 124 | * compiled.major, compiled.minor, compiled.patch); 125 | * printf("But we linked against SDL version %d.%d.%d.\n", 126 | * linked.major, linked.minor, linked.patch); 127 | * \endcode 128 | * 129 | * This function may be called safely at any time, even before SDL_Init(). 130 | * 131 | * \sa SDL_VERSION 132 | */ 133 | extern DECLSPEC void SDLCALL SDL_GetVersion(SDL_version * ver); 134 | 135 | /** 136 | * \brief Get the code revision of SDL that is linked against your program. 137 | * 138 | * Returns an arbitrary string (a hash value) uniquely identifying the 139 | * exact revision of the SDL library in use, and is only useful in comparing 140 | * against other revisions. It is NOT an incrementing number. 141 | */ 142 | extern DECLSPEC const char *SDLCALL SDL_GetRevision(void); 143 | 144 | /** 145 | * \brief Get the revision number of SDL that is linked against your program. 146 | * 147 | * Returns a number uniquely identifying the exact revision of the SDL 148 | * library in use. It is an incrementing number based on commits to 149 | * hg.libsdl.org. 150 | */ 151 | extern DECLSPEC int SDLCALL SDL_GetRevisionNumber(void); 152 | 153 | 154 | /* Ends C function definitions when using C++ */ 155 | #ifdef __cplusplus 156 | } 157 | #endif 158 | #include "close_code.h" 159 | 160 | #endif /* SDL_version_h_ */ 161 | 162 | /* vi: set ts=4 sw=4 expandtab: */ 163 | --------------------------------------------------------------------------------