-#define KSYM_F13 SDLK_F13
-#define KSYM_F14 SDLK_F14
-#define KSYM_F15 SDLK_F15
-#define KSYM_F16 KSYM_UNDEFINED
-#define KSYM_F17 KSYM_UNDEFINED
-#define KSYM_F18 KSYM_UNDEFINED
-#define KSYM_F19 KSYM_UNDEFINED
-#define KSYM_F20 KSYM_UNDEFINED
-#define KSYM_F21 KSYM_UNDEFINED
-#define KSYM_F22 KSYM_UNDEFINED
-#define KSYM_F23 KSYM_UNDEFINED
-#define KSYM_F24 KSYM_UNDEFINED
-
-
-/* SDL function definitions */
-
-inline void SDLInitBufferedDisplay(DrawBuffer *, DrawWindow *);
-inline boolean SDLSetVideoMode(DrawBuffer *, boolean);
-inline void SDLCopyArea(SDL_Surface *, SDL_Surface *,
- int, int, int, int, int, int);
-inline void SDLFillRectangle(SDL_Surface *, int, int, int, int, unsigned int);
-inline void SDLDrawSimpleLine(SDL_Surface *, int, int, int, int, unsigned int);
-
-inline boolean SDLOpenAudio(void);
-inline void SDLCloseAudio(void);
-
-#endif /* SDL_H */
+
+#define KSYM_FKEY_FIRST KSYM_F1
+#define KSYM_FKEY_LAST KSYM_F12
+#define KSYM_NUM_FKEYS (KSYM_FKEY_LAST - KSYM_FKEY_FIRST + 1)
+
+#define KSYM_RAW(k) (((k) >= KSYM_a && \
+ (k) <= KSYM_z) || \
+ ((k) >= KSYM_0 && \
+ (k) <= KSYM_9) || \
+ (k) == KSYM_space)
+
+#define KSYM_PRINTABLE(k) (((k) >= KSYM_space && \
+ (k) <= KSYM_z) || \
+ (k) == KSYM_Adiaeresis || \
+ (k) == KSYM_Odiaeresis || \
+ (k) == KSYM_Udiaeresis || \
+ (k) == KSYM_adiaeresis || \
+ (k) == KSYM_odiaeresis || \
+ (k) == KSYM_udiaeresis)
+
+#define KMOD_None KMOD_NONE
+#define KMOD_Shift_L KMOD_LSHIFT
+#define KMOD_Shift_R KMOD_RSHIFT
+#define KMOD_Control_L KMOD_LCTRL
+#define KMOD_Control_R KMOD_RCTRL
+#define KMOD_Meta_L KMOD_LGUI
+#define KMOD_Meta_R KMOD_RGUI
+#define KMOD_Alt_L KMOD_LALT
+#define KMOD_Alt_R KMOD_RALT
+
+#define KMOD_Shift (KMOD_Shift_L | KMOD_Shift_R)
+#define KMOD_Control (KMOD_Control_L | KMOD_Control_R)
+#define KMOD_Meta (KMOD_Meta_L | KMOD_Meta_R)
+#define KMOD_Alt (KMOD_Alt_L | KMOD_Alt_R)
+
+// this only contains "valid" key modifiers (and ignores keys like "NumLock")
+#define KMOD_Valid (KMOD_Shift | \
+ KMOD_Control | \
+ KMOD_Meta | \
+ KMOD_Alt)
+
+#define KMOD_TextInput (KMOD_Shift | KMOD_Alt_R)
+
+
+// SDL function definitions
+
+void SDLSetAlpha(SDL_Surface *, boolean, int);
+const char *SDLGetRendererName(void);
+boolean SDLSetNativeSurface(SDL_Surface **);
+SDL_Surface *SDLGetNativeSurface(SDL_Surface *);
+SDL_Surface *SDLCreateNativeSurface(int, int, int);
+Bitmap *SDLGetBitmapFromSurface(SDL_Surface *);
+void SDLCreateBitmapTextures(Bitmap *);
+void SDLFreeBitmapTextures(Bitmap *);
+
+SDL_Surface *SDL_DisplayFormat(SDL_Surface *);
+void SDLSetWindowScaling(int);
+void SDLSetWindowScalingQuality(char *);
+void SDLSetWindowFullscreen(boolean);
+void SDLSetDisplaySize(void);
+void SDLSetScreenSizeAndOffsets(int, int);
+void SDLSetScreenSizeForRenderer(int, int);
+void SDLSetScreenProperties(void);
+
+void SDLSetScreenRenderingMode(char *);
+void SDLSetScreenVsyncMode(char *);
+void SDLRedrawWindow(void);
+void SDLSetWindowTitle(void);
+
+void SDLLimitScreenUpdates(boolean);
+void SDLInitVideoDisplay(void);
+void SDLInitVideoBuffer(boolean);
+boolean SDLSetVideoMode(boolean);
+void SDLFreeBitmapPointers(Bitmap *);
+void SDLBlitSurface(SDL_Surface *, SDL_Surface *, int, int, int, int, int, int);
+void SDLCopyArea(Bitmap *, Bitmap *, int, int, int, int, int, int, int);
+void SDLBlitTexture(Bitmap *, int, int, int, int, int, int, int);
+void SDLFillRectangle(Bitmap *, int, int, int, int, Uint32);
+void SDLFadeRectangle(int, int, int, int, int, int, int,
+ void (*draw_border_function)(void));
+void SDLDrawSimpleLine(Bitmap *, int, int, int, int, Uint32);
+void SDLDrawLine(Bitmap *, int, int, int, int, Uint32);
+Pixel SDLGetPixel(Bitmap *, int, int);
+void SDLPutPixel(Bitmap *, int, int, Pixel);
+
+void SDLCopyInverseMasked(Bitmap *, Bitmap *, int, int, int, int, int, int);
+
+SDL_Surface *SDLZoomSurface(SDL_Surface *, int, int);
+Bitmap *SDLZoomBitmap(Bitmap *, int, int);
+
+Bitmap *SDLLoadImage(char *);
+
+void SDLSetMouseCursor(struct MouseCursorInfo *);
+
+void SDLOpenAudio(void);
+void SDLCloseAudio(void);
+
+void SDLWaitEvent(Event *);
+void SDLCorrectRawMousePosition(int *, int *);
+
+void HandleJoystickEvent(Event *);
+void SDLInitJoysticks(void);
+boolean SDLReadJoystick(int, int *, int *, boolean *, boolean *);
+boolean SDLCheckJoystickOpened(int);
+void SDLClearJoystickState(void);
+boolean SDLOpenJoystick(int);
+void SDLCloseJoystick(int);
+
+void PrepareFadeBitmap(int);
+
+void Delay_WithScreenUpdates(unsigned int);
+
+#endif // SDL_H