This is a modified SDL.pas from Free Pascal's distribution.
It is sloppily hacked to avoid any dependencies on libX11
and libc.