diff --git a/SRB2.cbp b/SRB2.cbp
index 628e7da3..4834563e 100644
--- a/SRB2.cbp
+++ b/SRB2.cbp
@@ -33,7 +33,7 @@ HW3SOUND for 3D hardware sound support
-
+
@@ -56,7 +56,7 @@ HW3SOUND for 3D hardware sound support
-
+
@@ -77,7 +77,7 @@ HW3SOUND for 3D hardware sound support
-
+
@@ -107,7 +107,7 @@ HW3SOUND for 3D hardware sound support
-
+
@@ -138,7 +138,7 @@ HW3SOUND for 3D hardware sound support
-
+
@@ -185,7 +185,7 @@ HW3SOUND for 3D hardware sound support
-
+
@@ -551,7 +551,7 @@ HW3SOUND for 3D hardware sound support
-
+
@@ -592,7 +592,7 @@ HW3SOUND for 3D hardware sound support
-
+
diff --git a/Srb2.dev b/Srb2.dev
index 00b7811e..21683e7c 100644
--- a/Srb2.dev
+++ b/Srb2.dev
@@ -2228,7 +2228,7 @@ Includes=libs/libpng-src;libs/zlib;libs
Libs=libs/libpng-src/projects;libs/zlib/win32;libs/miniupnpc/mingw32
ResourceIncludes=src/win32
MakeIncludes=comptime.mk;cpdebug.mk
-Compiler=-DNDEBUG_@@_-fno-exceptions_@@_-DSTDC_HEADERS_@@_-Wall_@@_-Os_@@_-g_@@_-gdwarf-2_@@_-DUSE_WGL_SWAP_@@_-DDIRECTFULLSCREEN_@@_-DSDL_@@_-DHWRENDER_@@_-DHW3SOUND_@@_-DHAVE_MIXER_@@_-DHAVE_PNG_@@_-D__USE_MINGW_ANSI_STDIO=0_@@_-DHAVE_MINIUPNPC_@@_-DSTATIC_MINIUPNPC_@@_-DHAVE_BLUA_@@_
+Compiler=-DNDEBUG_@@_-fno-exceptions_@@_-DSTDC_HEADERS_@@_-Wall_@@_-Os_@@_-g_@@_-gdwarf-2_@@_-DUSE_WGL_SWAP_@@_-DDIRECTFULLSCREEN_@@_-DHAVE_SDL_@@_-DHWRENDER_@@_-DHW3SOUND_@@_-DHAVE_MIXER_@@_-DHAVE_PNG_@@_-D__USE_MINGW_ANSI_STDIO=0_@@_-DHAVE_MINIUPNPC_@@_-DSTATIC_MINIUPNPC_@@_-DHAVE_BLUA_@@_
CppCompiler=-Os_@@_-g_@@_-gdwarf-2_@@_
Linker=-lSDL_@@_-lSDL_Mixer_@@_-lpng32_@@_-lz32_@@_-lminiupnpc_@@_-lws2_32_@@_-liphlpapi_@@_-mconsole_@@_
PreprocDefines=NORMALSRB2_@@_
@@ -2305,7 +2305,7 @@ Includes=libs/libpng-src;libs/zlib;libs
Libs=libs/libpng-src/projects;libs/zlib/win32;libs/miniupnpc/mingw32
ResourceIncludes=src/win32
MakeIncludes=comptime.mk;cpdebug.mk
-Compiler=-D_DEBUG_@@_-fno-exceptions_@@_-DSTDC_HEADERS_@@_-Wall_@@_-O0_@@_-g_@@_-gdwarf-2_@@_-DUSE_WGL_SWAP_@@_-DDIRECTFULLSCREEN_@@_-DSDL_@@_-DHWRENDER_@@_-DHW3SOUND_@@_-DHAVE_MIXER_@@_-DHAVE_PNG_@@_-D__USE_MINGW_ANSI_STDIO=0_@@_-DHAVE_MINIUPNPC_@@_-DSTATIC_MINIUPNPC_@@_-DHAVE_BLUA_@@_
+Compiler=-D_DEBUG_@@_-fno-exceptions_@@_-DSTDC_HEADERS_@@_-Wall_@@_-O0_@@_-g_@@_-gdwarf-2_@@_-DUSE_WGL_SWAP_@@_-DDIRECTFULLSCREEN_@@_-DHAVE_SDL_@@_-DHWRENDER_@@_-DHW3SOUND_@@_-DHAVE_MIXER_@@_-DHAVE_PNG_@@_-D__USE_MINGW_ANSI_STDIO=0_@@_-DHAVE_MINIUPNPC_@@_-DSTATIC_MINIUPNPC_@@_-DHAVE_BLUA_@@_
CppCompiler=-O0_@@_-g_@@_-gdwarf-2_@@_
Linker=-lSDL_@@_-lSDL_Mixer_@@_-lpng32_@@_-lz32_@@_-lminiupnpc_@@_-lws2_32_@@_-liphlpapi_@@_-mconsole_@@_
PreprocDefines=NORMALSRB2_@@_
@@ -2386,7 +2386,7 @@ Includes=libs/libpng-src;libs/zlib;libs
Libs=libs/libpng-src/projects;libs/zlib/win32;libs/miniupnpc/mingw64
ResourceIncludes=src/win32
MakeIncludes=comptime.mk;cpdebug.mk
-Compiler=-DNDEBUG_@@_-fno-exceptions_@@_-DSTDC_HEADERS_@@_-Wall_@@_-Os_@@_-g_@@_-DUSE_WGL_SWAP_@@_-DDIRECTFULLSCREEN_@@_-DSDL_@@_-DHWRENDER_@@_-DHW3SOUND_@@_-DHAVE_MIXER_@@_-DHAVE_PNG_@@_-D__USE_MINGW_ANSI_STDIO=0_@@_-DHAVE_MINIUPNPC_@@_-DSTATIC_MINIUPNPC_@@_-DHAVE_BLUA_@@_
+Compiler=-DNDEBUG_@@_-fno-exceptions_@@_-DSTDC_HEADERS_@@_-Wall_@@_-Os_@@_-g_@@_-DUSE_WGL_SWAP_@@_-DDIRECTFULLSCREEN_@@_-DHAVE_SDL_@@_-DHWRENDER_@@_-DHW3SOUND_@@_-DHAVE_MIXER_@@_-DHAVE_PNG_@@_-D__USE_MINGW_ANSI_STDIO=0_@@_-DHAVE_MINIUPNPC_@@_-DSTATIC_MINIUPNPC_@@_-DHAVE_BLUA_@@_
CppCompiler=-Os_@@_-g_@@_
Linker=-lSDL_@@_-lSDL_Mixer_@@_-lpng64_@@_-lz64_@@_-lminiupnpc_@@_-lws2_32_@@_-liphlpapi_@@_-mconsole_@@_
PreprocDefines=NORMALSRB2_@@_
@@ -2413,7 +2413,7 @@ Includes=libs/libpng-src;libs/zlib;libs
Libs=libs/libpng-src/projects;libs/zlib/win32;libs/miniupnpc/mingw64
ResourceIncludes=src/win32
MakeIncludes=comptime.mk;cpdebug.mk
-Compiler=-D_DEBUG_@@_-fno-exceptions_@@_-DSTDC_HEADERS_@@_-Wall_@@_-O0_@@_-g_@@_-DUSE_WGL_SWAP_@@_-DDIRECTFULLSCREEN_@@_-DSDL_@@_-DHWRENDER_@@_-DHW3SOUND_@@_-DHAVE_MIXER_@@_-DHAVE_PNG_@@_-D__USE_MINGW_ANSI_STDIO=0_@@_-DHAVE_MINIUPNPC_@@_-DSTATIC_MINIUPNPC_@@_-DHAVE_BLUA_@@_
+Compiler=-D_DEBUG_@@_-fno-exceptions_@@_-DSTDC_HEADERS_@@_-Wall_@@_-O0_@@_-g_@@_-DUSE_WGL_SWAP_@@_-DDIRECTFULLSCREEN_@@_-DHAVE_SDL_@@_-DHWRENDER_@@_-DHW3SOUND_@@_-DHAVE_MIXER_@@_-DHAVE_PNG_@@_-D__USE_MINGW_ANSI_STDIO=0_@@_-DHAVE_MINIUPNPC_@@_-DSTATIC_MINIUPNPC_@@_-DHAVE_BLUA_@@_
CppCompiler=-O0_@@_-g_@@_
Linker=-lSDL_@@_-lSDL_Mixer_@@_-lpng64_@@_-lz64_@@_-lminiupnpc_@@_-lws2_32_@@_-liphlpapi_@@_-mconsole_@@_
PreprocDefines=NORMALSRB2_@@_
diff --git a/libs/fmodex/lib/libfmodex64_vc.a b/libs/fmodex/lib/libfmodex64_vc.a
deleted file mode 100644
index 77a761d3..00000000
Binary files a/libs/fmodex/lib/libfmodex64_vc.a and /dev/null differ
diff --git a/libs/fmodex/lib/libfmodexL64_vc.a b/libs/fmodex/lib/libfmodexL64_vc.a
deleted file mode 100644
index 6c008895..00000000
Binary files a/libs/fmodex/lib/libfmodexL64_vc.a and /dev/null differ
diff --git a/libs/fmodex/lib/libfmodexL_vc.a b/libs/fmodex/lib/libfmodexL_vc.a
deleted file mode 100644
index 63b6ee4f..00000000
Binary files a/libs/fmodex/lib/libfmodexL_vc.a and /dev/null differ
diff --git a/libs/fmodex/lib/libfmodex_vc.a b/libs/fmodex/lib/libfmodex_vc.a
deleted file mode 100644
index ec169885..00000000
Binary files a/libs/fmodex/lib/libfmodex_vc.a and /dev/null differ
diff --git a/src/Makefile b/src/Makefile
index 9aa96efe..f5d58af3 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -10,7 +10,7 @@
# -DPC_DOS -> use DOS specific code (eg:textmode stuff)...
# -DLINUX -> use for the GNU/Linux specific
# -D_WINDOWS -> use for the Win32/DirectX specific
-# -DSDL -> use for the SDL interface
+# -DHAVE_SDL -> use for the SDL interface
#
# Sets:
# Compile the DGJPP/DOS version with 'make WATTCP=1'
diff --git a/src/Makefile.cfg b/src/Makefile.cfg
index ccf84165..1ea96df9 100644
--- a/src/Makefile.cfg
+++ b/src/Makefile.cfg
@@ -230,7 +230,6 @@ ifdef DUMMY
BIN:=$(BIN)/dummy
else
ifdef LINUX
- INTERFACE=sdl
NASMFORMAT=elf -DLINUX
SDL=1
ifndef NOGETTEXT
diff --git a/src/console.c b/src/console.c
index f8d31a69..5f8dd2bb 100644
--- a/src/console.c
+++ b/src/console.c
@@ -1139,7 +1139,7 @@ void CONS_Printf(const char *fmt, ...)
// if not in display loop, force screen update
if (con_startup)
{
-#if (defined (_WINDOWS)) || (defined (__OS2__) && !defined (SDL))
+#if (defined (_WINDOWS)) || (defined (__OS2__) && !defined (HAVE_SDL))
static lumpnum_t con_backpic_lumpnum = UINT32_MAX;
patch_t *con_backpic;
diff --git a/src/d_main.c b/src/d_main.c
index 2f3dd8b6..b0d248ef 100644
--- a/src/d_main.c
+++ b/src/d_main.c
@@ -731,7 +731,7 @@ static void IdentifyVersion(void)
char *srb2wad1, *srb2wad2;
const char *srb2waddir = NULL;
-#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (SDL)
+#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
// change to the directory where 'srb2.srb' is found
srb2waddir = I_LocateWad();
#endif
@@ -757,7 +757,7 @@ static void IdentifyVersion(void)
}
}
-#if defined (macintosh) && !defined (SDL)
+#if defined (macintosh) && !defined (HAVE_SDL)
// cwd is always "/" when app is dbl-clicked
if (!stricmp(srb2waddir, "/"))
srb2waddir = I_GetWadDir();
@@ -804,7 +804,7 @@ static void IdentifyVersion(void)
// Add our crappy patches to fix our bugs
D_AddFile(va(pandf,srb2waddir,"patch.dta"));
-#if !defined (SDL) || defined (HAVE_MIXER)
+#if !defined (HAVE_SDL) || defined (HAVE_MIXER)
{
#if defined (DC) && 0
const char *musicfile = "music_dc.dta";
@@ -929,7 +929,7 @@ void D_SRB2Main(void)
D_Titlebar(srb2, title);
#endif
-#if defined (__OS2__) && !defined (SDL)
+#if defined (__OS2__) && !defined (HAVE_SDL)
// set PM window title
snprintf(pmData->title, sizeof (pmData->title),
"Sonic Robo Blast 2" VERSIONSTRING ": %s",
@@ -1136,7 +1136,7 @@ void D_SRB2Main(void)
G_LoadGameData();
-#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (SDL)
+#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
VID_PrepareModeList(); // Regenerate Modelist according to cv_fullscreen
#endif
diff --git a/src/d_netcmd.c b/src/d_netcmd.c
index 1a1777a4..62531598 100644
--- a/src/d_netcmd.c
+++ b/src/d_netcmd.c
@@ -258,7 +258,7 @@ consvar_t cv_usejoystick = {"use_joystick", "0", CV_SAVE|CV_CALL, usejoystick_co
consvar_t cv_usejoystick2 = {"use_joystick2", "0", CV_SAVE|CV_CALL, usejoystick_cons_t,
I_InitJoystick2, 0, NULL, NULL, 0, 0, NULL};
#endif
-#if (defined (LJOYSTICK) || defined (SDL))
+#if (defined (LJOYSTICK) || defined (HAVE_SDL))
#ifdef LJOYSTICK
consvar_t cv_joyport = {"joyport", "/dev/js0", CV_SAVE, joyport_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_joyport2 = {"joyport2", "/dev/js0", CV_SAVE, joyport_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; //Alam: for later
diff --git a/src/doomdef.h b/src/doomdef.h
index 3ce330af..df61c499 100644
--- a/src/doomdef.h
+++ b/src/doomdef.h
@@ -24,7 +24,7 @@
#define SOUND_FMOD 3
#ifndef SOUND
-#ifdef SDL
+#ifdef HAVE_SDL
// Use Mixer interface?
#ifdef HAVE_MIXER
diff --git a/src/hardware/hw3dsdrv.h b/src/hardware/hw3dsdrv.h
index 4938f876..8811d454 100644
--- a/src/hardware/hw3dsdrv.h
+++ b/src/hardware/hw3dsdrv.h
@@ -24,7 +24,7 @@
#include "hw_dll.h"
#include "hws_data.h"
-#if defined (SDL) || !defined (HWD)
+#if defined (HAVE_SDL) || !defined (HWD)
EXPORT void HWRAPI(Shutdown) (void);
#endif
diff --git a/src/hardware/hw_data.h b/src/hardware/hw_data.h
index 77db1080..a6525a2f 100644
--- a/src/hardware/hw_data.h
+++ b/src/hardware/hw_data.h
@@ -26,7 +26,7 @@
#include
#endif
-#if defined (VID_X11) && !defined (SDL)
+#if defined (VID_X11) && !defined (HAVE_SDL)
#include
#endif
diff --git a/src/hardware/hw_drv.h b/src/hardware/hw_drv.h
index 854e7aaa..76fce5e4 100644
--- a/src/hardware/hw_drv.h
+++ b/src/hardware/hw_drv.h
@@ -32,12 +32,12 @@
// STANDARD DLL EXPORTS
// ==========================================================================
-#ifdef SDL
+#ifdef HAVE_SDL
#undef VID_X11
#endif
EXPORT boolean HWRAPI(Init) (I_Error_t ErrorFunction);
-#ifndef SDL
+#ifndef HAVE_SDL
EXPORT void HWRAPI(Shutdown) (void);
#endif
#ifdef _WINDOWS
@@ -116,7 +116,7 @@ struct hwdriver_s
HookXwin pfnHookXwin;
GetRenderer pfnGetRenderer;
#endif
-#ifndef SDL
+#ifndef HAVE_SDL
Shutdown pfnShutdown;
#endif
#ifdef SHUFFLE
diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c
index 2e57ae6e..b853f084 100644
--- a/src/hardware/r_opengl/r_opengl.c
+++ b/src/hardware/r_opengl/r_opengl.c
@@ -163,7 +163,7 @@ static I_Error_t I_Error_GL = NULL;
// : else do nothing
// Returns :
// -----------------+
-#if !(defined (SDL) && defined (STATIC3DS))
+#if !(defined (HAVE_SDL) && defined (STATIC3DS))
FUNCPRINTF void DBG_Printf(const char *lpFmt, ...)
{
#ifdef DEBUG_TO_FILE
diff --git a/src/hardware/r_opengl/r_opengl.h b/src/hardware/r_opengl/r_opengl.h
index 875ac6fb..fd018f4b 100644
--- a/src/hardware/r_opengl/r_opengl.h
+++ b/src/hardware/r_opengl/r_opengl.h
@@ -20,7 +20,7 @@
#ifndef _R_OPENGL_H_
#define _R_OPENGL_H_
-#ifdef SDL
+#ifdef HAVE_SDL
#ifdef _MSC_VER
#pragma warning(disable : 4214 4244)
@@ -50,7 +50,7 @@
#undef DEBUG_TO_FILE // maybe defined in previous *.h
#define DEBUG_TO_FILE // output debugging msgs to ogllog.txt
-#if defined ( SDL ) && !defined ( LOGMESSAGES )
+#if defined ( HAVE_SDL ) && !defined ( LOGMESSAGES )
#undef DEBUG_TO_FILE
#endif
@@ -109,7 +109,7 @@ extern PFNglGetString pglGetString;
extern const GLubyte *gl_extensions;
extern RGBA_t myPaletteData[];
-#ifndef SDL
+#ifndef HAVE_SDL
extern FILE *logstream;
#endif
extern GLint screen_width;
diff --git a/src/hardware/s_ds3d/s_ds3d.c b/src/hardware/s_ds3d/s_ds3d.c
index 2cbf9559..5299c179 100644
--- a/src/hardware/s_ds3d/s_ds3d.c
+++ b/src/hardware/s_ds3d/s_ds3d.c
@@ -48,7 +48,7 @@
#undef DEBUG_TO_FILE
#define DEBUG_TO_FILE
-#if defined ( SDL ) && !defined ( LOGMESSAGES )
+#if defined ( HAVE_SDL ) && !defined ( LOGMESSAGES )
#undef DEBUG_TO_FILE
#endif
diff --git a/src/hardware/s_fmod/s_fmod.c b/src/hardware/s_fmod/s_fmod.c
index 849fd44f..120d6354 100644
--- a/src/hardware/s_fmod/s_fmod.c
+++ b/src/hardware/s_fmod/s_fmod.c
@@ -55,7 +55,7 @@ FILE *logstream = NULL;
#define MAXCHANNEL 1024
#undef DEBUG_TO_FILE
-#if defined ( SDL ) && !defined ( LOGMESSAGES )
+#if defined ( HAVE_SDL ) && !defined ( LOGMESSAGES )
#define DEBUG_TO_FILE
#endif
@@ -1187,7 +1187,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, // handle to DLL module
}
return TRUE; // Successful DLL_PROCESS_ATTACH.
}
-#elif !defined (SDL)
+#elif !defined (HAVE_SDL)
// **************************************************************************
// FUNCTIONS
diff --git a/src/hardware/s_openal/s_openal.c b/src/hardware/s_openal/s_openal.c
index ad842bde..7f91ccf2 100644
--- a/src/hardware/s_openal/s_openal.c
+++ b/src/hardware/s_openal/s_openal.c
@@ -31,7 +31,7 @@ FILE* logstream = NULL;
#include
#include
#include
-#ifndef SDL // let not make a logstream here is we are inline the HW3D in the SDL binary
+#ifndef HAVE_SDL // let not make a logstream here is we are inline the HW3D in the SDL binary
FILE* logstream = NULL;
#endif
#endif
@@ -49,7 +49,7 @@ FILE* logstream = NULL;
#include "../hw3dsdrv.h"
//#undef DEBUG_TO_FILE
-//#if defined ( SDL ) && !defined ( LOGMESSAGES )
+//#if defined ( HAVE_SDL ) && !defined ( LOGMESSAGES )
#define DEBUG_TO_FILE
//#endif
diff --git a/src/m_menu.c b/src/m_menu.c
index 887ac5fc..653576f4 100644
--- a/src/m_menu.c
+++ b/src/m_menu.c
@@ -1110,7 +1110,7 @@ static menuitem_t OP_VideoOptionsMenu[] =
{IT_SUBMENU|IT_STRING, NULL, "3D Card Options...", &OP_OpenGLOptionsDef, 20},
#endif
-#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (SDL)
+#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
{IT_STRING|IT_CVAR, NULL, "Fullscreen", &cv_fullscreen, 30},
#endif
@@ -6827,7 +6827,7 @@ static void M_VideoModeMenu(INT32 choice)
memset(modedescs, 0, sizeof(modedescs));
-#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (SDL)
+#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
VID_PrepareModeList(); // FIXME: hack
#endif
vidm_nummodes = 0;
diff --git a/src/m_misc.c b/src/m_misc.c
index bb0bb046..73d17c00 100644
--- a/src/m_misc.c
+++ b/src/m_misc.c
@@ -47,8 +47,11 @@
#include "hardware/hw_main.h"
#endif
-#ifdef SDL
+#ifdef HAVE_SDL
#include "sdl/hwsym_sdl.h"
+#ifdef __linux__
+typedef off_t off64_t;
+#endif
#endif
#if defined (_WIN32)
@@ -651,7 +654,7 @@ static void M_PNGText(png_structp png_ptr, png_infop png_info_ptr, PNG_CONST png
char Movietxt[] = "SRB2 Movie";
size_t i;
char interfacetxt[] =
-#ifdef SDL
+#ifdef HAVE_SDL
"SDL";
#elif defined (_WINDOWS)
"DirectX";
@@ -806,7 +809,7 @@ static inline boolean M_PNGLib(void)
pnglib = GetModuleHandleA("libpng12.dll");
if (!pnglib)
pnglib = GetModuleHandleA("libpng13.dll");
-#elif defined (SDL)
+#elif defined (HAVE_SDL)
#ifdef __APPLE__
pnglib = hwOpen("libpng.dylib");
#else
@@ -815,7 +818,7 @@ static inline boolean M_PNGLib(void)
#endif
if (!pnglib)
return false;
-#ifdef SDL
+#ifdef HAVE_SDL
apng_set_acTL = hwSym("png_set_acTL", pnglib);
apng_write_frame_head = hwSym("png_write_frame_head", pnglib);
apng_write_frame_tail = hwSym("png_write_frame_tail", pnglib);
diff --git a/src/s_sound.c b/src/s_sound.c
index 6e6c492a..b48b60a0 100644
--- a/src/s_sound.c
+++ b/src/s_sound.c
@@ -253,7 +253,7 @@ void S_RegisterSoundStuff(void)
CV_RegisterVar(&surround);
CV_RegisterVar(&cv_samplerate);
-#if defined (macintosh) && !defined (SDL) // mp3 playlist stuff
+#if defined (macintosh) && !defined (HAVE_SDL) // mp3 playlist stuff
{
INT32 i;
for (i = 0; i < PLAYLIST_LENGTH; i++)
@@ -761,7 +761,7 @@ void S_PauseSound(void)
}
// pause cd music
-#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (SDL)
+#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
I_PauseCD();
#else
I_StopCD();
@@ -1050,7 +1050,7 @@ static boolean S_MIDIMusic(musicinfo_t *music, boolean looping)
// load & register it
music->data = W_CacheLumpNum(music->lumpnum, PU_MUSIC);
-#if defined (macintosh) && !defined (SDL)
+#if defined (macintosh) && !defined (HAVE_SDL)
music->handle = I_RegisterSong(music_num);
#else
music->handle = I_RegisterSong(music->data, W_LumpLength(music->lumpnum));
@@ -1154,7 +1154,7 @@ void S_StopMusic(void)
I_StopSong(mus_playing->handle);
I_UnRegisterSong(mus_playing->handle);
-#ifndef SDL //SDL uses RWOPS
+#ifndef HAVE_SDL //SDL uses RWOPS
Z_ChangeTag(mus_playing->data, PU_CACHE);
#endif
diff --git a/src/s_sound.h b/src/s_sound.h
index 200b5bb3..6589ca59 100644
--- a/src/s_sound.h
+++ b/src/s_sound.h
@@ -37,7 +37,7 @@ extern CV_PossibleValue_t soundvolume_cons_t[];
//part of i_cdmus.c
extern consvar_t cd_volume, cdUpdate;
-#if defined (macintosh) && !defined (SDL)
+#if defined (macintosh) && !defined (HAVE_SDL)
typedef enum
{
music_normal,
diff --git a/src/sdl/MakeNIX.cfg b/src/sdl/MakeNIX.cfg
index 457f5230..f5c9b207 100644
--- a/src/sdl/MakeNIX.cfg
+++ b/src/sdl/MakeNIX.cfg
@@ -30,6 +30,10 @@ ifdef NOTERMIOS
endif
endif
+ifdef LINUX64
+ OPTS+=-DLINUX64
+endif
+
#
#here is Solaris
#
@@ -89,4 +93,4 @@ ifndef NOHW
endif
# name of the exefile
- EXENAME?=lsdlsrb2
+ EXENAME?=lsdl2srb2
diff --git a/src/sdl/Makefile.cfg b/src/sdl/Makefile.cfg
index 1f9c7204..3b92a9fb 100644
--- a/src/sdl/Makefile.cfg
+++ b/src/sdl/Makefile.cfg
@@ -43,9 +43,9 @@ SDL_CFLAGS?=$(shell $(PKG_CONFIG) $(SDL_PKGCONFIG) --cflags)
SDL_LDFLAGS?=$(shell $(PKG_CONFIG) $(SDL_PKGCONFIG) --libs)
else
ifdef PREFIX
- SDL_CONFIG?=$(PREFIX)-sdl-config
+ SDL_CONFIG?=$(PREFIX)-sdl2-config
else
- SDL_CONFIG?=sdl-config
+ SDL_CONFIG?=sdl2-config
endif
ifdef STATIC
@@ -67,7 +67,7 @@ endif
OBJS+=$(OBJDIR)/i_video.o $(OBJDIR)/dosstr.o $(OBJDIR)/endtxt.o $(OBJDIR)/hwsym_sdl.o
- OPTS+=-DDIRECTFULLSCREEN -DSDL
+ OPTS+=-DDIRECTFULLSCREEN -DHAVE_SDL
ifndef NOHW
OBJS+=$(OBJDIR)/r_opengl.o $(OBJDIR)/ogl_sdl.o
@@ -95,33 +95,28 @@ endif
endif
endif
-ifdef FILTERS
- OBJS+=$(OBJDIR)/filters.o $(OBJDIR)/hq2x.o $(OBJDIR)/lq2x.o
- OPTS+=-DHAVE_FILTER
-endif
-
ifdef NOMIXER
i_sound_o=$(OBJDIR)/sdl_sound.o
else
i_sound_o=$(OBJDIR)/mixer_sound.o
OPTS+=-DHAVE_MIXER
- SDL_LDFLAGS+=-lSDL_mixer
+ SDL_LDFLAGS+=-lSDL2_mixer
endif
ifdef SDL_TTF
OPTS+=-DHAVE_TTF
- SDL_LDFLAGS+=-lSDL_ttf -lfreetype -lz
+ SDL_LDFLAGS+=-lSDL2_ttf -lfreetype -lz
OBJS+=$(OBJDIR)/i_ttf.o
endif
-#ifdef SDL_IMAGE
-# OPTS+=-DHAVE_IMAGE
-# SDL_LDFLAGS+=-lSDL_image
-#endif
+ifdef SDL_IMAGE
+ OPTS+=-DHAVE_IMAGE
+ SDL_LDFLAGS+=-lSDL2_image
+endif
ifdef SDL_NET
OPTS+=-DHAVE_SDLNET
- SDL_LDFLAGS+=-lSDL_net
+ SDL_LDFLAGS+=-lSDL2_net
endif
ifdef SDLMAIN
diff --git a/src/sdl/SRB2CE/Makefile.cfg b/src/sdl/SRB2CE/Makefile.cfg
deleted file mode 100644
index 8d4ae3e4..00000000
--- a/src/sdl/SRB2CE/Makefile.cfg
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# Makefile.cfg for WinCE with GCC
-#
-
-OPTS+=-D_WIN32_WCE -D_UNICODE
-SDL_CFLAGS?=
-SDL_LDFLAGS?=
-NOHS=1
-NOHW=1
-NONET=1
-NOMIXER=1
-NOPNG=1
diff --git a/src/sdl/SRB2CE/SRB2CE.zip b/src/sdl/SRB2CE/SRB2CE.zip
deleted file mode 100644
index 3ac8530d..00000000
Binary files a/src/sdl/SRB2CE/SRB2CE.zip and /dev/null differ
diff --git a/src/sdl/SRB2CE/cehelp.c b/src/sdl/SRB2CE/cehelp.c
deleted file mode 100644
index b9fafd04..00000000
--- a/src/sdl/SRB2CE/cehelp.c
+++ /dev/null
@@ -1,447 +0,0 @@
-// Emacs style mode select -*- C++ -*-
-//-----------------------------------------------------------------------------
-//
-// Copyright (C) 2004 by Sonic Team Jr.
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// DESCRIPTION:
-// stub and replacement "ANSI" C functions for use under Windows CE
-//
-//-----------------------------------------------------------------------------
-
-#include "../../doomdef.h"
-#include "cehelp.h"
-
-#define _SEC_IN_MINUTE 60
-#define _SEC_IN_HOUR 3600
-#define _SEC_IN_DAY 86400
-
-static const int DAYS_IN_MONTH[12] =
-{31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
-
-#define _DAYS_IN_MONTH(x) ((x == 1) ? days_in_feb : DAYS_IN_MONTH[x])
-
-static const int _DAYS_BEFORE_MONTH[12] =
-{0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334};
-
-#define _ISLEAP(y) (((y) % 4) == 0 && (((y) % 100) != 0 || (((y)+1900) % 400) == 0))
-#define _DAYS_IN_YEAR(year) (_ISLEAP(year) ? 366 : 365)
-
-char *strerror(int ecode)
-{
- static char buff[1024 + 1];
- DWORD dwMsgLen = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
- ecode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), &buff[0], 1024, NULL);
- return buff;
-}
-
-int unlink( const char *filename )
-{
- return remove(filename);
-}
-
-int remove( const char *path )
-{
- return DeleteFileA(path)-1;
-}
-
-int rename( const char *oldname, const char *newname )
-{
- return MoveFileA(oldname, newname)!=0;
-}
-
-static inline void STToTM(const SYSTEMTIME *st, struct tm *tm)
-{
- if (!st || !tm) return;
- tm->tm_sec = st->wSecond;
- tm->tm_min = st->wMinute;
- tm->tm_hour = st->wHour;
- tm->tm_mday = st->wDay;
- tm->tm_mon = st->wMonth - 1;
- tm->tm_year = st->wYear - 1900;
- tm->tm_wday = st->wDayOfWeek;
- tm->tm_yday = 0;
- tm->tm_isdst = 0;
-}
-
-time_t time(time_t *T)
-{
- time_t returntime;
- SYSTEMTIME st;
- struct tm stft;
- GetSystemTime(&st);
- STToTM(&st,&stft);
- returntime = mktime(&stft);
- if (T) *T = returntime;
- return returntime;
-}
-
-static inline UINT64 TTtoFT(const time_t wt, FILETIME *ft)
-{
- UINT64 temptime = wt; // FILETIME: 1/(10^7) secs since January 1, 1601
- temptime *= 10000000; // time_t : 1 secs since January 1, 1970
- // 369 years * 365 days * 24 hours * 60 mins * 60 secs * 10
- // 123 leaps days * 24 hours * 60 mins * 60 secs * 10
- temptime += 116444736000000000;
- if (ft) CopyMemory(ft,&temptime,sizeof (ULARGE_INTEGER));
- return temptime;
-}
-
-static struct tm cehelptm;
-
-struct tm * localtime(const time_t *CLOCK)
-{
- SYSTEMTIME st;
- FILETIME stft;
- UINT64 ftli = 0;
- if (CLOCK) ftli = TTtoFT(*CLOCK, &stft);
- if (ftli)
- FileTimeToSystemTime(&stft,&st);
- else
- GetSystemTime(&st);
- STToTM(&st,&cehelptm);
- if (st.wYear >= 1970)
- return &cehelptm;
- else
- return NULL;
-}
-
-static void validate_structure (struct tm *tim_p) // from newlib
-{
- div_t res;
- int days_in_feb = 28;
-
- /* calculate time & date to account for out of range values */
- if (tim_p->tm_sec < 0 || tim_p->tm_sec > 59)
- {
- res = div (tim_p->tm_sec, 60);
- tim_p->tm_min += res.quot;
- if ((tim_p->tm_sec = res.rem) < 0)
- {
- tim_p->tm_sec += 60;
- --tim_p->tm_min;
- }
- }
-
- if (tim_p->tm_min < 0 || tim_p->tm_min > 59)
- {
- res = div (tim_p->tm_min, 60);
- tim_p->tm_hour += res.quot;
- if ((tim_p->tm_min = res.rem) < 0)
- {
- tim_p->tm_min += 60;
- --tim_p->tm_hour;
- }
- }
-
- if (tim_p->tm_hour < 0 || tim_p->tm_hour > 23)
- {
- res = div (tim_p->tm_hour, 24);
- tim_p->tm_mday += res.quot;
- if ((tim_p->tm_hour = res.rem) < 0)
- {
- tim_p->tm_hour += 24;
- --tim_p->tm_mday;
- }
- }
-
- if (tim_p->tm_mon > 11)
- {
- res = div (tim_p->tm_mon, 12);
- tim_p->tm_year += res.quot;
- if ((tim_p->tm_mon = res.rem) < 0)
- {
- tim_p->tm_mon += 12;
- --tim_p->tm_year;
- }
- }
-
- if (_DAYS_IN_YEAR (tim_p->tm_year) == 366)
- days_in_feb = 29;
-
- if (tim_p->tm_mday <= 0)
- {
- while (tim_p->tm_mday <= 0)
- {
- if (--tim_p->tm_mon == -1)
- {
- tim_p->tm_year--;
- tim_p->tm_mon = 11;
- days_in_feb =
- ((_DAYS_IN_YEAR (tim_p->tm_year) == 366) ?
- 29 : 28);
- }
- tim_p->tm_mday += _DAYS_IN_MONTH (tim_p->tm_mon);
- }
- }
- else
- {
- while (tim_p->tm_mday > _DAYS_IN_MONTH (tim_p->tm_mon))
- {
- tim_p->tm_mday -= _DAYS_IN_MONTH (tim_p->tm_mon);
- if (++tim_p->tm_mon == 12)
- {
- tim_p->tm_year++;
- tim_p->tm_mon = 0;
- days_in_feb =
- ((_DAYS_IN_YEAR (tim_p->tm_year) == 366) ?
- 29 : 28);
- }
- }
- }
-}
-
-time_t mktime (struct tm *tim_p) // from newlib
-{
- time_t tim = 0;
- long days = 0;
- int year;
-
- /* validate structure */
- validate_structure (tim_p);
-
- /* compute hours, minutes, seconds */
- tim += tim_p->tm_sec + (tim_p->tm_min * _SEC_IN_MINUTE) +
- (tim_p->tm_hour * _SEC_IN_HOUR);
-
- /* compute days in year */
- days += tim_p->tm_mday - 1;
- days += _DAYS_BEFORE_MONTH[tim_p->tm_mon];
- if (tim_p->tm_mon > 1 && _DAYS_IN_YEAR (tim_p->tm_year) == 366)
- days++;
-
- /* compute day of the year */
- tim_p->tm_yday = days;
-
- if (tim_p->tm_year > 10000
- || tim_p->tm_year < -10000)
- {
- return (time_t) -1;
- }
-
- /* compute days in other years */
- if (tim_p->tm_year > 70)
- {
- for (year = 70; year < tim_p->tm_year; year++)
- days += _DAYS_IN_YEAR (year);
- }
- else if (tim_p->tm_year < 70)
- {
- for (year = 69; year > tim_p->tm_year; year--)
- days -= _DAYS_IN_YEAR (year);
- days -= _DAYS_IN_YEAR (year);
- }
-
- /* compute day of the week */
- if ((tim_p->tm_wday = (days + 4) % 7) < 0)
- tim_p->tm_wday += 7;
-
- /* compute total seconds */
- tim += (days * _SEC_IN_DAY);
-
- return tim;
-}
-
-#undef WINAPI
-#define WINAPI __stdcall //__delcspec(dllexport)
-
-#ifdef _MSC_VER
-//#pragma warning(disable : 4273)
-#endif
-
-
-static __forceinline int STRtoWSTR(LPCSTR lpMultiByteStr, int cchMultiByte,
- LPWSTR lpWideCharStr, int cchWideChar)
-{
- return MultiByteToWideChar(CP_ACP,MB_PRECOMPOSED,lpMultiByteStr,
- cchMultiByte,lpWideCharStr,cchWideChar);
-}
-
-static __forceinline int WSTRtoSTR(LPCWSTR lpWideCharStr, int cchWideChar,
- LPSTR lpMultiByteStr, int cbMultiByte)
-{
- return WideCharToMultiByte(CP_ACP,WC_COMPOSITECHECK|WC_SEPCHARS,
- lpWideCharStr,cchWideChar,lpMultiByteStr,cbMultiByte,NULL,NULL);
-}
-
-DWORD WINAPI FormatMessageA(
- DWORD dwFlags,
- LPCVOID lpSource,
- DWORD dwMessageId,
- DWORD dwLanguageId,
- LPSTR lpBuffer,
- DWORD nSize,
- va_list *Arguments)
-{
- const int nSizeW = STRtoWSTR(lpBuffer,nSize,NULL,0);
- int nSizeF = 0;
- LPWSTR lpBufferW = alloca(sizeof (wchar_t)*nSizeW);
- LPWSTR lpSourceW = NULL;
-
- if (!lpBufferW)
- {
- SetLastError(ERROR_NOT_ENOUGH_MEMORY);
- ZeroMemory(lpBuffer,nSize);
- return nSizeF;
- }
-
- if (dwFlags & FORMAT_MESSAGE_FROM_STRING)
- {
- const int sLen = STRtoWSTR(lpSource, -1, NULL, 0);
- lpSourceW = alloca(sizeof (wchar_t)*sLen);
-
- if (lpSourceW)
- STRtoWSTR(lpSource, -1, lpSourceW, sLen);
- else
- {
- SetLastError(ERROR_NOT_ENOUGH_MEMORY);
- return nSizeF;
- }
- }
-
- if (lpSourceW)
- nSizeF = FormatMessageW(dwFlags, lpSourceW, dwMessageId, dwLanguageId,
- lpBufferW, nSizeW, Arguments);
- else
- nSizeF = FormatMessageW(dwFlags, lpSource, dwMessageId, dwLanguageId,
- lpBufferW, nSizeW, Arguments);
-
- return WSTRtoSTR(lpBufferW, nSizeF, lpBuffer, nSize);
-}
-
-BOOL WINAPI DeleteFileA(
- LPCSTR lpFileName)
-{
- const int sLen = STRtoWSTR(lpFileName, -1, NULL, 0);
- LPWSTR lpFileNameW = alloca(sizeof (wchar_t)*sLen);
-
- if (lpFileNameW)
- STRtoWSTR(lpFileName, -1, lpFileNameW, sLen);
- else
- {
- SetLastError(ERROR_NOT_ENOUGH_MEMORY);
- return 0;
- }
-
- return DeleteFileW(lpFileNameW);
-}
-
-BOOL WINAPI MoveFileA(
- LPCSTR lpExistingFileName,
- LPCSTR lpNewFileName
-)
-{
- const int sLen1 = STRtoWSTR(lpExistingFileName, -1, NULL, 0);
- LPWSTR lpExistingFileNameW = alloca(sizeof (wchar_t)*sLen1);
-
- const int sLen2 = STRtoWSTR(lpNewFileName, -1, NULL, 0);
- LPWSTR lpNewFileNameW = alloca(sizeof (wchar_t)*sLen2);
-
-
- if (!lpExistingFileNameW || !lpNewFileNameW)
- {
- SetLastError(ERROR_NOT_ENOUGH_MEMORY);
- return 0;
- }
-
- STRtoWSTR(lpExistingFileName, -1, lpExistingFileNameW, sLen1);
- STRtoWSTR(lpNewFileName, -1, lpNewFileNameW, sLen2);
-
- return MoveFileW(lpExistingFileNameW, lpNewFileNameW);
-}
-
-
-HANDLE WINAPI CreateFileA(
- LPCSTR lpFileName,
- DWORD dwDesiredAccess,
- DWORD dwShareMode,
- LPSECURITY_ATTRIBUTES lpSecurityAttributes,
- DWORD dwCreationDisposition,
- DWORD dwFlagsAndAttributes,
- HANDLE hTemplateFile)
-{
- const int sLen = STRtoWSTR(lpFileName, -1, NULL, 0);
- LPWSTR lpFileNameW = alloca(sizeof (wchar_t)*sLen);
-
- if (lpFileNameW)
- STRtoWSTR(lpFileName, -1, lpFileNameW, sLen);
- else
- {
- SetLastError(ERROR_NOT_ENOUGH_MEMORY);
- return INVALID_HANDLE_VALUE;
- }
-
- return CreateFileW(lpFileNameW, dwDesiredAccess, dwShareMode,
- lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes,
- hTemplateFile);
-}
-
-BOOL WINAPI CreateDirectoryA(
- LPCSTR lpPathName,
- LPSECURITY_ATTRIBUTES lpSecurityAttributes)
-{
- const int sLen = STRtoWSTR(lpPathName, -1, NULL, 0);
- LPWSTR lpPathNameW = alloca(sizeof (wchar_t)*sLen);
-
- if (lpPathNameW)
- STRtoWSTR(lpPathName, -1, lpPathNameW, sLen);
- else
- {
- SetLastError(ERROR_NOT_ENOUGH_MEMORY);
- return 0;
- }
-
- return CreateDirectoryW(lpPathNameW, lpSecurityAttributes);
-}
-
-int WINAPI MessageBoxA(
- HWND hWnd ,
- LPCSTR lpText,
- LPCSTR lpCaption,
- UINT uType)
-{
- const int sLen1 = STRtoWSTR(lpText, -1, NULL, 0);
- LPWSTR lpTextW = alloca(sizeof (wchar_t)*sLen1);
-
- const int sLen2 = STRtoWSTR(lpCaption, -1, NULL, 0);
- LPWSTR lpCaptionW = alloca(sizeof (wchar_t)*sLen2);
-
-
- if (!lpTextW || !lpCaptionW)
- {
- SetLastError(ERROR_NOT_ENOUGH_MEMORY);
- return 0;
- }
-
- STRtoWSTR(lpText, -1, lpTextW, sLen1);
- STRtoWSTR(lpCaption, -1, lpCaptionW, sLen2);
-
- return MessageBoxW(hWnd, lpTextW, lpCaptionW, uType);
-}
-
-VOID WINAPI OutputDebugStringA(
- LPCSTR lpOutputString)
-{
- const int sLen = STRtoWSTR(lpOutputString, -1, NULL, 0);
- LPWSTR lpOutputStringW = alloca(sizeof (wchar_t)*sLen);
-
- if (lpOutputStringW)
- STRtoWSTR(lpOutputString, -1, lpOutputStringW, sLen);
- else
- {
- SetLastError(ERROR_NOT_ENOUGH_MEMORY);
- return;
- }
-
- OutputDebugStringW(lpOutputStringW);
-}
-
diff --git a/src/sdl/SRB2CE/cehelp.h b/src/sdl/SRB2CE/cehelp.h
deleted file mode 100644
index bc265b05..00000000
--- a/src/sdl/SRB2CE/cehelp.h
+++ /dev/null
@@ -1,63 +0,0 @@
-// Emacs style mode select -*- C++ -*-
-//-----------------------------------------------------------------------------
-//
-// Copyright (C) 2004 by Sonic Team Jr.
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// DESCRIPTION:
-// stub and replacement "ANSI" C functions for use under Windows CE
-//
-//-----------------------------------------------------------------------------
-
-#ifndef __I_WINCE__
-#define __I_WINCE__
-
-#ifdef USEASMCE
-#define USEASM // Remline if NASM doesn't work on x86 targets
-#endif
-
-char *strerror(int ecode);
-int access(const char *path, int amode);
-int unlink( const char *filename );
-int remove( const char *path );
-int rename( const char *oldname, const char *newname );
-//CreateDirectoryEx( const char *currectpath, const char *path,SECURITY_ATTRIBUTES)
-
-#ifndef _TIME_T_DEFINED
-typedef long time_t; /* time value */
-#define _TIME_T_DEFINED /* avoid multiple def's of time_t */
-#endif
-
-time_t time(time_t *T);
-
-#ifndef __GNUC__
-#ifndef _TM_DEFINED
-struct tm {
- int tm_sec; /* seconds after the minute - [0,59] */
- int tm_min; /* minutes after the hour - [0,59] */
- int tm_hour; /* hours since midnight - [0,23] */
- int tm_mday; /* day of the month - [1,31] */
- int tm_mon; /* months since January - [0,11] */
- int tm_year; /* years since 1900 */
- int tm_wday; /* days since Sunday - [0,6] */
- int tm_yday; /* days since January 1 - [0,365] */
- int tm_isdst; /* daylight savings time flag */
- };
-#define _TM_DEFINED
-#endif
-
-struct tm * localtime(const time_t *CLOCK);
-
-time_t mktime (struct tm *tim_p);
-#endif
-
-#endif
diff --git a/src/sdl/SRB2DC/.gitignore b/src/sdl/SRB2DC/.gitignore
deleted file mode 100644
index a966585d..00000000
--- a/src/sdl/SRB2DC/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-/scramble
diff --git a/src/sdl/SRB2DC/IP.BIN b/src/sdl/SRB2DC/IP.BIN
deleted file mode 100644
index c3366213..00000000
Binary files a/src/sdl/SRB2DC/IP.BIN and /dev/null differ
diff --git a/src/sdl/SRB2DC/Makefile.cfg b/src/sdl/SRB2DC/Makefile.cfg
deleted file mode 100644
index 3edaf8a1..00000000
--- a/src/sdl/SRB2DC/Makefile.cfg
+++ /dev/null
@@ -1,53 +0,0 @@
-#
-# Makefile.cfg for SRB2/Dreamcast
-#
-
-#include $(KOS_BASE)/Makefile.rules
-
-#
-#hmmm, the Dreamcast
-#
-
- HOSTCC:=$(CC)
- CC=$(KOS_CC)
- PREFIX=$(KOS_CC_BASE)/bin/$(KOS_CC_PREFIX)
- OBJDUMP=$(PREFIX)-objdump
- OBJCOPY=$(PREFIX)-objcopy
-
- #NOHW=1 #No working MiniGL right now
- NOHS=1 #No HWSound right now
-ifndef LWIP
- NONET=1 #No LWIP
-endif
- #i_net_o=$(OBJDIR)/i_udp.o #use KOS's UDP
- #NOMIXER=1 #Basic sound only
- NOIPX=1 #No IPX network code
- NOPNG=1 #No Screenshot
-
- OPTS=$(KOS_CFLAGS) -DUNIXCOMMON -DDC
-ifndef NOHW
- OPTS+=-DSTATIC_OPENGL -DMINI_GL_COMPATIBILITY -DKOS_GL_COMPATIBILITY
-endif
- SDL_CFLAGS?=-I$(KOS_BASE)/addons/include/SDL
- SDL_LDFLAGS?=-lSDL
- LDFLAGS=$(KOS_LDFLAGS)
- LIBS:=$(KOS_LIBS) -lconio -lm
-ifndef NOMIXER
- LIBS:=-loggvorbisplay -lSDL $(LIBS)
-endif
-
-ifdef LWIP
- OPTS+=-I$(KOS_BASE)/../kos-ports/lwip/kos/include -I$(KOS_BASE)/../kos-ports/lwip/lwip/src/include/ipv4 -I$(KOS_BASE)/../kos-ports/lwip/lwip/src/include -DIPv4
- LIBS:=-llwip4 -lkosutils $(LIBS)
- OPTS+=-DHAVE_LWIP
-endif
-ifndef NOHW
- LIBS+=-lgl
-endif
-
- i_system_o+=$(OBJDIR)/dchelp.o
- i_main_o=$(KOS_START) $(OBJDIR)/i_main.o $(OBJEXTRA)
-
- # name of the exefile
- EXENAME?=SRB2.elf
- BINNAME?=SRB2.BIN
diff --git a/src/sdl/SRB2DC/SELFBOOT.BIN b/src/sdl/SRB2DC/SELFBOOT.BIN
deleted file mode 100644
index a87ee386..00000000
Binary files a/src/sdl/SRB2DC/SELFBOOT.BIN and /dev/null differ
diff --git a/src/sdl/SRB2DC/VMU.xbm b/src/sdl/SRB2DC/VMU.xbm
deleted file mode 100644
index 0d56985f..00000000
--- a/src/sdl/SRB2DC/VMU.xbm
+++ /dev/null
@@ -1,19 +0,0 @@
-#define VMU_width 48
-#define VMU_height 32
-static unsigned char VMU_bits[] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x0f, 0x00, 0x00,
- 0x00, 0x00, 0x58, 0x75, 0x00, 0x00, 0x00, 0x00, 0xee, 0xaa, 0x00, 0x00,
- 0x00, 0x86, 0x55, 0x55, 0x01, 0x00, 0x00, 0xda, 0xc8, 0xaf, 0x00, 0x00,
- 0x00, 0x62, 0x55, 0x54, 0x00, 0x00, 0x00, 0x32, 0xa2, 0x6c, 0x00, 0x00,
- 0x00, 0x5c, 0x55, 0xfd, 0x01, 0x00, 0x00, 0xac, 0x88, 0xaa, 0x02, 0x00,
- 0x00, 0x54, 0x75, 0x55, 0x05, 0x00, 0x00, 0xac, 0xbf, 0xaa, 0x0a, 0x00,
- 0x00, 0xd6, 0x61, 0x55, 0x15, 0x00, 0x00, 0xe9, 0xc0, 0xaa, 0x2a, 0x00,
- 0x00, 0x39, 0x40, 0x55, 0x55, 0x00, 0x00, 0x6d, 0xc0, 0xaa, 0xbe, 0x00,
- 0x00, 0x6d, 0x40, 0xd5, 0xc3, 0x00, 0x00, 0x6d, 0xc0, 0xea, 0x00, 0x00,
- 0x00, 0x29, 0x60, 0xf5, 0x00, 0x00, 0x00, 0x26, 0xe0, 0xfa, 0x00, 0x00,
- 0x00, 0x58, 0xb8, 0xbd, 0x00, 0x00, 0x00, 0x84, 0x07, 0xdf, 0x00, 0x00,
- 0x00, 0x08, 0x20, 0xae, 0x00, 0x00, 0x00, 0x30, 0xc0, 0x5f, 0x01, 0x00,
- 0x00, 0xc0, 0x3f, 0xb8, 0x01, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
diff --git a/src/sdl/SRB2DC/dchelp.c b/src/sdl/SRB2DC/dchelp.c
deleted file mode 100644
index 5fdf04bc..00000000
--- a/src/sdl/SRB2DC/dchelp.c
+++ /dev/null
@@ -1,134 +0,0 @@
-// Emacs style mode select -*- C++ -*-
-//-----------------------------------------------------------------------------
-//
-// Copyright (C) 2006 by Sonic Team Jr.
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// DESCRIPTION:
-// stub and replacement "ANSI" C functions for use on Dreamcast/KOS
-//
-//-----------------------------------------------------------------------------
-#include
-#include
-#ifndef HAVE_LWIP
-#include
-#endif
-#include "../../doomdef.h"
-#include "dchelp.h"
-
-int access(const char *path, int amode)
-{
- file_t handle = FILEHND_INVALID;
-
- if (amode == F_OK || amode == R_OK)
- handle=fs_open(path,O_RDONLY);
- else if (amode == (R_OK|W_OK))
- handle=fs_open(path,O_RDWR);
- else if (amode == W_OK)
- handle=fs_open(path,O_WRONLY);
-
- if (handle != FILEHND_INVALID)
- {
- fs_close(handle);
- return 0;
- }
-
- return -1;
-}
-
-double hypot(double x, double y)
-{
- double ax, yx, yx2, yx1;
- if (abs(y) > abs(x)) // |y|>|x|
- {
- ax = abs(y); // |y| => ax
- yx = (x/y);
- }
- else // |x|>|y|
- {
- ax = abs(x); // |x| => ax
- yx = (x/y);
- }
- yx2 = yx*yx; // (x/y)^2
- yx1 = sqrt(1+yx2); // (1 + (x/y)^2)^1/2
- return ax*yx1; // |x|*((1 + (x/y)^2)^1/2)
-}
-
-#if !(defined (NONET) || defined (NOMD5))
-#ifdef HAVE_LWIP
-
-#include
-
-static uint8 ip[4];
-static char *h_addr_listtmp[2] = {ip, NULL};
-static struct hostent hostenttmp = {NULL, NULL, 0, 1, h_addr_listtmp};
-
-struct hostent *gethostbyname(const char *name)
-{
- struct sockaddr_in dnssrv;
- dnssrv.sin_family = AF_INET;
- dnssrv.sin_port = htons(53);
- dnssrv.sin_addr.s_addr = htonl(0x0a030202); ///< what?
- if (lwip_gethostbyname(&dnssrv, name, ip) < 0)
- return NULL;
- else
- return &hostenttmp;
-}
-#else
-
-struct hostent *gethostbyname(const char *name)
-{
- (void)name;
- return NULL;
-}
-
-int ioctl(int s, long cmd, void *argp)
-{
- return fs_ioctl(s, argp, cmd); //FIONBIO?
-}
-
-int select(int maxfdp1, void *readset, void *writeset, void *exceptset,
- void *timeout)
-{
- (void)maxfdp1;
- (void)readset;
- (void)writeset;
- (void)exceptset;
- (void)timeout;
- errno = EAFNOSUPPORT;
- return -1;
-}
-
-int getsockopt (int s, int level, int optname, void *optval, socklen_t *optlen)
-{
- (void)s;
- (void)level; //SOL_SOCKET
- (void)optname; //SO_RCVBUF, SO_ERROR
- (void)optval;
- (void)optlen;
- errno = EAFNOSUPPORT;
- return -1;
-}
-
-int setsockopt (int s, int level, int optname, void *optval, socklen_t optlen)
-{
- (void)s;
- (void)level; //SOL_SOCKET
- (void)optname; //SO_REUSEADDR, SO_BROADCAST, SO_RCVBUF
- (void)optval;
- (void)optlen;
- errno = EAFNOSUPPORT;
- return -1;
-}
-
-#endif
-#endif
diff --git a/src/sdl/SRB2DC/dchelp.h b/src/sdl/SRB2DC/dchelp.h
deleted file mode 100644
index 236f3111..00000000
--- a/src/sdl/SRB2DC/dchelp.h
+++ /dev/null
@@ -1,51 +0,0 @@
-// Emacs style mode select -*- C++ -*-
-//-----------------------------------------------------------------------------
-//
-// Copyright (C) 2006 by Sonic Team Jr.
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// DESCRIPTION:
-// stub and replacement "ANSI" C functions for use on Dreamcast/KOS
-//
-//-----------------------------------------------------------------------------
-
-#ifndef __I_DREAMCAST__
-#define __I_DREAMCAST__
-
-struct hostent
-{
- char *h_name; /* Official name of host. */
- char **h_aliases; /* Alias list. */
- int h_addrtype; /* Host address type. */
- int h_length; /* Length of address. */
- char **h_addr_list; /* List of addresses from name server. */
-#define h_addr h_addr_list[0] /* Address, for backward compatibility. */
-};
-
-struct hostent *gethostbyname(const char *name);
-
-#ifndef HAVE_LWIP
-#define INADDR_NONE ((uint32) 0xffffffff)
-#define INADDR_LOOPBACK ((uint32) 0x7f000001)
-#define SOCK_STREAM 1
-#define FIONBIO 0
-#define SOL_SOCKET 0
-#define SO_ERROR 0
-#define SO_REUSEADDR 0
-#define SO_BROADCAST 0
-#define SO_RCVBUF 0
-int ioctl(int s, long cmd, void *argp);
-int select(int maxfdp1, void *readset, void *writeset, void *exceptset, void *timeout);
-int getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen);
-int setsockopt(int s, int level, int optname, void *optval, socklen_t optlen);
-#endif
-#endif
diff --git a/src/sdl/SRB2DC/i_udp.c b/src/sdl/SRB2DC/i_udp.c
deleted file mode 100644
index ec5e305f..00000000
--- a/src/sdl/SRB2DC/i_udp.c
+++ /dev/null
@@ -1,455 +0,0 @@
-// Emacs style mode select -*- C++ -*-
-//-----------------------------------------------------------------------------
-// Copyright (C) 1993-1996 by id Software, Inc.
-// Portions Copyright (C) 2005 by Sonic Team Jr.
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//-----------------------------------------------------------------------------
-/// \file
-/// \brief KOS UDP network interface
-
-#include "../../doomdef.h"
-
-#include "../../i_system.h"
-#include "../../d_event.h"
-#include "../../d_net.h"
-#include "../../m_argv.h"
-
-#include "../../doomstat.h"
-
-#include "../../i_net.h"
-
-#include "../../z_zone.h"
-
-#include "../../i_tcp.h"
-
-#include
-//#include
-#define NET_NONE 0x00000000
-#define NET_LOCAL 0x0100007F
-#define NET_ANY 0xFFFFFFFF
-
-#define MAXBANS 20
-
-typedef struct
-{
- uint32 host;
- uint16 port;
-} IPaddress;
-
-static IPaddress clientaddress[MAXNETNODES+1];
-static boolean nodeconnected[MAXNETNODES+1];
-
-static int mysocket = 0;
-static boolean init_KOSUDP_driver = false;
-
-static size_t numbans = 0;
-static IPaddress banned[MAXBANS];
-static boolean KOSUDP_bannednode[MAXNETNODES+1]; /// \note do we really need the +1?
-
-static inline int net_udp_sendto(int sock, const uint8 *data, int size, uint16 rem_port, uint32 rem_addr)
-{
- uint8 dst_ip[4] = {((uint8*)(&(rem_addr)))[0],
- ((uint8*)(&(rem_addr)))[1],
- ((uint8*)(&(rem_addr)))[2],
- ((uint8*)(&(rem_addr)))[3]};
- return net_udp_send_raw(net_default_dev, clientaddress[0].port, rem_port, dst_ip, data, size);
- (void)sock;
-}
-
-static inline int net_udp_recvfrom(int sock, uint8 *buf, int size, uint16 *rem_port, uint32 *rem_addr)
-{
- return net_udp_recv(sock, buf, size);
- (void)rem_port;
- (void)rem_addr;
-}
-
-static const char *KOSUDP_AddrToStr(IPaddress* sk)
-{
- static char s[22]; // 255.255.255.255:65535
- sprintf(s,"%d.%d.%d.%d:%d",
- ((uint8*)(&(sk->host)))[3],
- ((uint8*)(&(sk->host)))[2],
- ((uint8*)(&(sk->host)))[1],
- ((uint8*)(&(sk->host)))[0],
- net_ntohs(sk->port));
- return s;
-}
-
-static const char *KOSUDP_GetNodeAddress(int node)
-{
- if (!nodeconnected[node])
- return NULL;
- return KOSUDP_AddrToStr(&clientaddress[node]);
-}
-
-static const char *KOSUDP_GetBanAddress(size_t ban)
-{
- if (ban > numbans)
- return NULL;
- return KOSUDP_AddrToStr(&banned[ban]);
-}
-
-static boolean KOSUDP_cmpaddr(IPaddress* a, IPaddress* b)
-{
- return (a->host == b->host && (b->port == 0 || a->port == b->port));
-}
-
-static SINT8 getfreenode(void)
-{
- SINT8 j;
-
- for (j = 0; j < MAXNETNODES; j++)
- if (!nodeconnected[j])
- {
- nodeconnected[j] = true;
- return j;
- }
- return -1;
-}
-
-static void KOSUDP_Get(void)
-{
- int size;
- size_t i;
- SINT8 j;
- IPaddress temp = {clientaddress[BROADCASTADDR].host,clientaddress[BROADCASTADDR].port};
-
- size = net_udp_recvfrom(mysocket,(char *)&doomcom->data, MAXPACKETLENGTH, &temp.port, &temp.host);
- if (size == 0)
- {
- doomcom->remotenode = -1; // no packet
- return;
- }
-
- // find remote node number
- for (i = 0; i < MAXNETNODES; i++)
- if (KOSUDP_cmpaddr(&temp, &(clientaddress[i])))
- {
- doomcom->remotenode = (INT16)i; // good packet from a game player
- doomcom->datalength = (INT16)size;
- return;
- }
-
- // not found
-
- // find a free slot
- j = getfreenode();
- if (j > 0)
- {
- M_Memcpy(&clientaddress[j], &temp, sizeof (temp));
- DEBFILE(va("New node detected: node:%d address:%s\n", j,
- KOSUDP_GetNodeAddress(j)));
- doomcom->remotenode = (INT16)j; // good packet from a game player
- doomcom->datalength = (INT16)size;
- // check if it's a banned dude so we can send a refusal later
- for (i = 0; i < numbans; i++)
- if (KOSUDP_cmpaddr(&temp, &banned[i]))
- {
- KOSUDP_bannednode[j] = true;
- DEBFILE("This dude has been banned\n");
- break;
- }
- if (i == numbans)
- KOSUDP_bannednode[j] = false;
- return;
- }
-
- DEBFILE("New node detected: No more free slots\n");
- doomcom->remotenode = -1; // no packet
-}
-
-#if 0
-static boolean KOSUDP_CanSend(void)
-{
- return true;
-}
-#endif
-
-static void KOSUDP_Send(void)
-{
- const IPaddress *nodeinfo;
-
- if (!doomcom->remotenode || !nodeconnected[doomcom->remotenode])
- return;
-
- nodeinfo = clientaddress + doomcom->remotenode;
-
- if (net_udp_sendto(mysocket, (char *)&doomcom->data, doomcom->datalength, nodeinfo->port, nodeinfo->host) == -1)
- {
- CONS_Printf("KOSUDP: error sending data\n");
- }
-}
-
-static void KOSUDP_FreeNodenum(int numnode)
-{
- // can't disconnect from self :)
- if (!numnode)
- return;
-
- DEBFILE(va("Free node %d (%s)\n", numnode, KOSUDP_GetNodeAddress(numnode)));
-
- nodeconnected[numnode] = false;
-
- memset(&clientaddress[numnode], 0, sizeof (IPaddress));
-}
-
-static int KOSUDP_Socket(void)
-{
- int temp = 0;
- uint16 portnum = 0;
- const uint32 hostip = net_default_dev?net_ntohl(net_ipv4_address(net_default_dev->ip_addr)):NET_LOCAL;
- //Hurdler: I'd like to put a server and a client on the same computer
- //Logan: Me too
- //BP: in fact for client we can use any free port we want i have read
- // in some doc that connect in udp can do it for us...
- //Alam: where?
- if (M_CheckParm("-clientport"))
- {
- if (!M_IsNextParm())
- I_Error("syntax: -clientport ");
- portnum = net_ntohs(atoi(M_GetNextParm()));
- }
- else
- portnum = net_ntohs(sock_port);
-
- temp = net_udp_sock_open(portnum, hostip, portnum, NET_NONE);
- if (temp)
- {
- int btemp = net_udp_sock_open(portnum, hostip, portnum, NET_ANY);
- clientaddress[0].port = portnum;
- clientaddress[0].host = NET_NONE;
- if (btemp)
- {
- clientaddress[BROADCASTADDR].port = net_ntohs(sock_port);
- clientaddress[BROADCASTADDR].host = NET_ANY;
- }
- else
- {
- CONS_Printf("KOSUDP: can't setup broadcast sock\n");
- net_udp_sock_close(temp);
- return 0;
- }
- }
- else
- {
- CONS_Printf("KOSUDP: can't setup main sock\n");
- return 0;
- }
-
- doomcom->extratics = 1; // internet is very high ping
-
- return temp;
-}
-
-static void I_ShutdownKOSUDPDriver(void)
-{
- //net_shutdown();
- init_KOSUDP_driver = false;
-}
-
-static void I_InitKOSUDPDriver(void)
-{
- if (init_KOSUDP_driver)
- I_ShutdownKOSUDPDriver();
- else
- net_init();
- D_SetDoomcom();
- memset(&clientaddress,0,sizeof (clientaddress));
- init_KOSUDP_driver = true;
-}
-
-static void KOSUDP_CloseSocket(void)
-{
- if (mysocket)
- net_udp_sock_close(mysocket);
- mysocket = 0;
-}
-
-static SINT8 KOSUDP_NetMakeNodewPort(const char *hostname, const char* port)
-{
- SINT8 newnode;
- uint16 portnum = net_ntohs(sock_port);
-
- if (port && !port[0])
- portnum = net_ntohs((UINT16)atoi(port));
-
- newnode = getfreenode();
- if (newnode == -1)
- return -1;
- // find ip of the server
- clientaddress[newnode].port = portnum;
- clientaddress[newnode].host = inet_addr(hostname);
-
- if (clientaddress[newnode].host == NET_NONE)
- {
- free(hostname);
- return -1;
- }
- return newnode;
-}
-
-static boolean KOSUDP_OpenSocket(void)
-{
- size_t i;
-
- memset(clientaddress, 0, sizeof (clientaddress));
-
- for (i = 0; i < MAXNETNODES; i++)
- nodeconnected[i] = false;
-
- //CONS_Printf("KOSUDP Code starting up\n");
-
- nodeconnected[0] = true; // always connected to self
- nodeconnected[BROADCASTADDR] = true;
- I_NetSend = KOSUDP_Send;
- I_NetGet = KOSUDP_Get;
- I_NetCloseSocket = KOSUDP_CloseSocket;
- I_NetFreeNodenum = KOSUDP_FreeNodenum;
- I_NetMakeNodewPort = KOSUDP_NetMakeNodewPort;
-
- //I_NetCanSend = KOSUDP_CanSend;
-
- // build the socket but close it first
- KOSUDP_CloseSocket();
- mysocket = KOSUDP_Socket();
-
- if (mysocket)
- {
-#if 0
- // for select
- myset = SDLNet_AllocSocketSet(1);
- if (!myset)
- {
- CONS_Printf("SDL_Net: %s",SDLNet_GetError());
- return false;
- }
- if (SDLNet_UDP_AddSocket(myset,mysocket) == -1)
- {
- CONS_Printf("SDL_Net: %s",SDLNet_GetError());
- return false;
- }
-#endif
- return true;
- }
- return false;
-}
-
-static boolean KOSUDP_Ban(int node)
-{
- if (numbans == MAXBANS)
- return false;
-
- M_Memcpy(&banned[numbans], &clientaddress[node], sizeof (IPaddress));
- banned[numbans].port = 0'
- numbans++;
- return true;
-}
-
-static void KOSUDP_ClearBans(void)
-{
- numbans = 0;
-}
-
-//
-// I_InitNetwork
-// Only required for DOS, so this is more a dummy
-//
-boolean I_InitNetwork(void)
-{
- char serverhostname[255];
- boolean ret = false;
- //if (!M_CheckParm ("-kosnet"))
- // return false;
- // initilize the driver
- I_InitKOSUDPDriver();
- I_AddExitFunc(I_ShutdownKOSUDPDriver);
- if (!init_KOSUDP_driver)
- return false;
-
- if (M_CheckParm("-udpport"))
- {
- if (M_IsNextParm())
- sock_port = (UINT16)atoi(M_GetNextParm());
- else
- sock_port = 0;
- }
-
- // parse network game options,
- if (M_CheckParm("-server") || dedicated)
- {
- server = true;
-
- // If a number of clients (i.e. nodes) is specified, the server will wait for the clients
- // to connect before starting.
- // If no number is specified here, the server starts with 1 client, and others can join
- // in-game.
- // Since Boris has implemented join in-game, there is no actual need for specifying a
- // particular number here.
- // FIXME: for dedicated server, numnodes needs to be set to 0 upon start
-/* if (M_IsNextParm())
- doomcom->numnodes = (INT16)atoi(M_GetNextParm());
- else */if (dedicated)
- doomcom->numnodes = 0;
- else
- doomcom->numnodes = 1;
-
- if (doomcom->numnodes < 0)
- doomcom->numnodes = 0;
- if (doomcom->numnodes > MAXNETNODES)
- doomcom->numnodes = MAXNETNODES;
-
- // server
- servernode = 0;
- // FIXME:
- // ??? and now ?
- // server on a big modem ??? 4*isdn
- net_bandwidth = 16000;
- hardware_MAXPACKETLENGTH = INETPACKETLENGTH;
-
- ret = true;
- }
- else if (M_CheckParm("-connect"))
- {
- if (M_IsNextParm())
- strcpy(serverhostname, M_GetNextParm());
- else
- serverhostname[0] = 0; // assuming server in the LAN, use broadcast to detect it
-
- // server address only in ip
- if (serverhostname[0])
- {
- COM_BufAddText("connect \"");
- COM_BufAddText(serverhostname);
- COM_BufAddText("\"\n");
-
- // probably modem
- hardware_MAXPACKETLENGTH = INETPACKETLENGTH;
- }
- else
- {
- // so we're on a LAN
- COM_BufAddText("connect any\n");
-
- net_bandwidth = 800000;
- hardware_MAXPACKETLENGTH = MAXPACKETLENGTH;
- }
- }
-
- I_NetOpenSocket = KOSUDP_OpenSocket;
- I_Ban = KOSUDP_Ban;
- I_ClearBans = KOSUDP_ClearBans;
- I_GetNodeAddress = KOSUDP_GetNodeAddress;
- I_GetBanAddress = KOSUDP_GetBanAddress;
- bannednode = KOSUDP_bannednode;
-
- return ret;
-}
diff --git a/src/sdl/SRB2DC/scramble.c b/src/sdl/SRB2DC/scramble.c
deleted file mode 100644
index a3483b00..00000000
--- a/src/sdl/SRB2DC/scramble.c
+++ /dev/null
@@ -1,259 +0,0 @@
-#include
-#include
-
-#define MAXCHUNK (2048*1024)
-
-static unsigned int seed;
-
-void my_srand(unsigned int n)
-{
- seed = n & 0xffff;
-}
-
-unsigned int my_rand()
-{
- seed = (seed * 2109 + 9273) & 0x7fff;
- return (seed + 0xc000) & 0xffff;
-}
-
-void load(FILE *fh, unsigned char *ptr, unsigned long sz)
-{
- if (fread(ptr, 1, sz, fh) != sz)
- {
- fprintf(stderr, "Read error!\n");
- exit(1);
- }
-}
-
-void load_chunk(FILE *fh, unsigned char *ptr, unsigned long sz)
-{
- static int idx[MAXCHUNK/32];
- int i;
-
- /* Convert chunk size to number of slices */
- sz /= 32;
-
- /* Initialize index table with unity,
- so that each slice gets loaded exactly once */
- for (i = 0; i < sz; i++)
- idx[i] = i;
-
- for (i = sz-1; i >= 0; --i)
- {
- /* Select a replacement index */
- int x = (my_rand() * i) >> 16;
-
- /* Swap */
- int tmp = idx[i];
- idx[i] = idx[x];
- idx[x] = tmp;
-
- /* Load resulting slice */
- load(fh, ptr+32*idx[i], 32);
- }
-}
-
-void load_file(FILE *fh, unsigned char *ptr, unsigned long filesz)
-{
- unsigned long chunksz;
-
- my_srand(filesz);
-
- /* Descramble 2 meg blocks for as long as possible, then
- gradually reduce the window down to 32 bytes (1 slice) */
- for (chunksz = MAXCHUNK; chunksz >= 32; chunksz >>= 1)
- while (filesz >= chunksz)
- {
- load_chunk(fh, ptr, chunksz);
- filesz -= chunksz;
- ptr += chunksz;
- }
-
- /* Load final incomplete slice */
- if (filesz)
- load(fh, ptr, filesz);
-}
-
-void read_file(char *filename, unsigned char **ptr, unsigned long *sz)
-{
- FILE *fh = fopen(filename, "rb");
- if (fh == NULL)
- {
- fprintf(stderr, "Can't open \"%s\".\n", filename);
- exit(1);
- }
- if (fseek(fh, 0, SEEK_END)<0)
- {
- fprintf(stderr, "Seek error.\n");
- exit(1);
- }
- *sz = ftell(fh);
- *ptr = malloc(*sz);
- if ( *ptr == NULL )
- {
- fprintf(stderr, "Out of memory.\n");
- exit(1);
- }
- if (fseek(fh, 0, SEEK_SET)<0)
- {
- fprintf(stderr, "Seek error.\n");
- exit(1);
- }
- load_file(fh, *ptr, *sz);
- fclose(fh);
-}
-
-void save(FILE *fh, unsigned char *ptr, unsigned long sz)
-{
- if (fwrite(ptr, 1, sz, fh) != sz)
- {
- fprintf(stderr, "Write error!\n");
- exit(1);
- }
-}
-
-void save_chunk(FILE *fh, unsigned char *ptr, unsigned long sz)
-{
- static int idx[MAXCHUNK/32];
- int i;
-
- /* Convert chunk size to number of slices */
- sz /= 32;
-
- /* Initialize index table with unity,
- so that each slice gets saved exactly once */
- for (i = 0; i < sz; i++)
- idx[i] = i;
-
- for (i = sz-1; i >= 0; --i)
- {
- /* Select a replacement index */
- int x = (my_rand() * i) >> 16;
-
- /* Swap */
- int tmp = idx[i];
- idx[i] = idx[x];
- idx[x] = tmp;
-
- /* Save resulting slice */
- save(fh, ptr+32*idx[i], 32);
- }
-}
-
-void save_file(FILE *fh, unsigned char *ptr, unsigned long filesz)
-{
- unsigned long chunksz;
-
- my_srand(filesz);
-
- /* Descramble 2 meg blocks for as long as possible, then
- gradually reduce the window down to 32 bytes (1 slice) */
- for (chunksz = MAXCHUNK; chunksz >= 32; chunksz >>= 1)
- while (filesz >= chunksz)
- {
- save_chunk(fh, ptr, chunksz);
- filesz -= chunksz;
- ptr += chunksz;
- }
-
- /* Save final incomplete slice */
- if (filesz)
- save(fh, ptr, filesz);
-}
-
-void write_file(char *filename, unsigned char *ptr, unsigned long sz)
-{
- FILE *fh = fopen(filename, "wb");
- if (fh == NULL)
- {
- fprintf(stderr, "Can't open \"%s\".\n", filename);
- exit(1);
- }
- save_file(fh, ptr, sz);
- fclose(fh);
-}
-
-void descramble(char *src, char *dst)
-{
- unsigned char *ptr = NULL;
- unsigned long sz = 0;
- FILE *fh;
-
- read_file(src, &ptr, &sz);
-
- fh = fopen(dst, "wb");
- if (fh == NULL)
- {
- fprintf(stderr, "Can't open \"%s\".\n", dst);
- exit(1);
- }
- if ( fwrite(ptr, 1, sz, fh) != sz )
- {
- fprintf(stderr, "Write error.\n");
- exit(1);
- }
- fclose(fh);
- free(ptr);
-}
-
-void scramble(char *src, char *dst)
-{
- unsigned char *ptr = NULL;
- unsigned long sz = 0;
- FILE *fh;
-
- fh = fopen(src, "rb");
- if (fh == NULL)
- {
- fprintf(stderr, "Can't open \"%s\".\n", src);
- exit(1);
- }
- if (fseek(fh, 0, SEEK_END)<0)
- {
- fprintf(stderr, "Seek error.\n");
- exit(1);
- }
- sz = ftell(fh);
- ptr = malloc(sz);
- if ( ptr == NULL )
- {
- fprintf(stderr, "Out of memory.\n");
- exit(1);
- }
- if (fseek(fh, 0, SEEK_SET)<0)
- {
- fprintf(stderr, "Seek error.\n");
- exit(1);
- }
- if ( fread(ptr, 1, sz, fh) != sz )
- {
- fprintf(stderr, "Read error.\n");
- exit(1);
- }
- fclose(fh);
-
- write_file(dst, ptr, sz);
-
- free(ptr);
-}
-
-int main(int argc, char *argv[])
-{
- int opt = 0;
-
- if (argc > 1 && !strcmp(argv[1], "-d"))
- opt ++;
-
- if (argc != 3+opt)
- {
- fprintf(stderr, "Usage: %s [-d] from to\n", argv[0]);
- exit(1);
- }
-
- if (opt)
- descramble(argv[2], argv[3]);
- else
- scramble(argv[1], argv[2]);
-
- return 0;
-}
diff --git a/src/sdl/SRB2PS3/ICON0.png b/src/sdl/SRB2PS3/ICON0.png
deleted file mode 100644
index 140230c1..00000000
Binary files a/src/sdl/SRB2PS3/ICON0.png and /dev/null differ
diff --git a/src/sdl/SRB2PS3/Makefile.cfg b/src/sdl/SRB2PS3/Makefile.cfg
deleted file mode 100644
index a4a01714..00000000
--- a/src/sdl/SRB2PS3/Makefile.cfg
+++ /dev/null
@@ -1,139 +0,0 @@
-#
-# Makefile.cfg for SRB2 for the PlayStation 3 using PSL1GHT
-#
-
-# Check if PS3DEV and PSL1GHT is set in the environment. If so, continue with compilation.
-.SUFFIXES:
-
-ifeq ($(strip $(PS3DEV)),)
-$(error "Please set PS3DEV in your environment. export PS3DEV=ps3dev-toolchain")
-endif
-
-ifeq ($(strip $(PSL1GHT)),)
-$(error "Please set PSL1GHT in your environment. export PSL1GHT=PSL1GHT")
-endif
-
-# Set compiler flags
-
-# Disable same warning flags
-WFLAGS+=-Wno-shadow -Wno-char-subscripts -Wno-format
-
-ifdef JAILBREAK
-EXENAME?=SRB2PS3-jb.elf
-PKGNAME?=SRB2PS3-jb.pkg
-else
-EXENAME?=SRB2PS3.elf
-PKGNAME?=SRB2PS3.pkg
-endif
-DGBNAME?=$(EXENAME).debug
-
-SRB2PS3DIR=sdl/SRB2PS3
-ICON0?=$(SRB2PS3DIR)/ICON0.png
-SFOXML?=sfo.xml
-SRB2TTF?=sdl/srb2.ttf
-
-TITLE=Sonic Robo Blast 2 v2.0.6
-APPID=SRB2-PS3
-CONTENTID=UP0001-$(APPID)_00-0000000000000000
-
-FSELF=$(PS3DEV)/bin/fself.py
-MAKE_SELF_NPDRM=$(PS3DEV)/ps3publictools/make_self_npdrm
-FINALIZE=$(PS3DEV)/ps3publictools/package_finalize
-SFO=$(PS3DEV)/bin/sfo.py
-PKG=$(PS3DEV)/bin/pkg.py
-PS3LOADEXE=$(PS3DEV)/ps3tools/ps3load
-SED=sed
-MV=mv
-XARGS=xargs
-FOR=for
-SHXARGS:=$(XARGS)
-SHSED:=$(SED)
-SPRXLINKER=$(PS3DEV)/bin/sprxlinker
-
-ifdef JAILBREAK
-PKGDIR=$(BIN)/pkg-jb
-else
-PKGDIR=$(BIN)/pkg
-endif
-USRDIR=$(PKGDIR)/USRDIR
-ETCDIR=$(USRDIR)/etc
-WGET=wget -P $(ETCDIR) -c -nc
-
-ifndef ECHO
- FSELF:=@$(FSELF)
- MAKE_SELF_NPDRM:=@$(MAKE_SELF_NPDRM)
- FINALIZE:=@$(FINALIZE)
- SFO:=@$(SFO)
- PKG:=@$(PKG)
- PS3LOADEXE:=@$(PS3LOADEXE)
- SED:=@$(SED)
- MV:=@$(MV)
- SPRXLINKER:=@$(SPRXLINKER)
- XARGS:=@$(XARGS)
- FOR:=@(FOR)
-endif
-
-# SRB2PS3 needs SDL_ttf to display any console text
-SDL_TTF=1
-
-# newlib has no support for networking
-#NONET=1
-
-# use absolute paths because changing PATH variable breaks distcc
-PREFIX := $(PS3DEV)/ppu/bin/$(PREFIX)
-
-# PS3DEV toolchain libdir and includedir
-PS3DEV_INC := $(PS3DEV)/ppu/include
-PS3DEV_LIB := $(PS3DEV)/ppu/lib
-
-# PSL1GHT libdir and includedir
-PSL1GHT_INC := $(PSL1GHT)/ppu/include
-PSL1GHT_LIB := $(PSL1GHT)/ppu/lib
-
-PS3PORTS := $(PS3DEV)/portlibs
-PS3PORTS_BIN := $(PS3PORTS)/ppu/bin
-PS3PORTS_INC := $(PS3PORTS)/ppu/include
-
-PNG_CONFIG := $(PS3PORTS_BIN)/libpng-config
-# static compilation
-PNG_STATIC=1
-
-SDL_CONFIG := $(PS3PORTS_BIN)/sdl-config
-
-INCLUDE := -I$(PSL1GHT_INC) -I$(PS3DEV_INC) -I$(PS3PORTS_INC)
-
-OPTS+=-D_PS3 -DUNIXCOMMON
-CFLAGS+= -g $(INCLUDE) -L$(PSL1GHT_LIB) -L$(PS3DEV_LIB) -L$(PS3DEV)/lib
-CXXFLAGS+=$(CFLAGS)
-LDFLAGS+= -B$(PSL1GHT_LIB) -B$(PS3DEV_LIB) -B$(PS3DEV)/lib
-LIBS+=-lrsx
-ifndef NONET
-LIBS+=-lnet -lsysmodule
-endif
-
-$(BIN)/$(PKGNAME): $(OBJS) $(BIN)/$(EXENAME)
- @echo Linking $(PKGNAME)...
- -$(MKDIR) $(ETCDIR)
- $(CP) $(ICON0) $(PKGDIR)
- $(CP) $(SRB2TTF) $(ETCDIR)
-ifdef WITHDATA
- $(FOR) datafile in $(shell echo $(D_FILES) | $(SHSED) 's/\.srb/\.wad/' | $(SHXARGS) -n 1 basename); do \
- $(WGET) http://alam.srb2.org/SRB2/2.0.6-Final/Resources/$$datafile; \
- done
-endif
- $(SPRXLINKER) $(BIN)/$(EXENAME)
-ifdef JAILBREAK
- $(SED) 's/@@PS3_SYSTEM_VER@@/3.41/' $(SRB2PS3DIR)/$(SFOXML) > $(BIN)/$(SFOXML)
- $(FSELF) -n $(BIN)/$(EXENAME) $(USRDIR)/EBOOT.BIN
-else
- $(SED) 's/@@PS3_SYSTEM_VER@@/3.55/' $(SRB2PS3DIR)/$(SFOXML) > $(BIN)/$(SFOXML)
- $(MAKE_SELF_NPDRM) $(BIN)/$(EXENAME) $(USRDIR)/EBOOT.BIN $(CONTENTID)
-endif
- $(SFO) --title "$(TITLE)" --appid "$(APPID)" -f $(BIN)/$(SFOXML) $(PKGDIR)/PARAM.SFO
- $(PKG) --contentid $(CONTENTID) $(PKGDIR)/ $(BIN)/$(PKGNAME)
-ifndef JAILBREAK
- $(FINALIZE) $(BIN)/$(PKGNAME)
-endif
-
-run: $(BIN)/$(EXENAME)
- $(PS3LOADEXE) $(USRDIR)/EBOOT.BIN
diff --git a/src/sdl/SRB2PS3/sfo.xml b/src/sdl/SRB2PS3/sfo.xml
deleted file mode 100644
index d7719b54..00000000
--- a/src/sdl/SRB2PS3/sfo.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
- 02.06
-
-
- 0
-
-
- 1
-
-
- HG
-
-
- This application was created with the official non-official SDK called PSL1GHT, for more information visit http://www.psl1ght.com/ . This is in no way associated with Sony Computer Entertainment Inc., please do not contact them for help, they will not be able to provide it.
-
-
- 0
-
-
- 0@@PS3_SYSTEM_VER@@00
-
-
- 63
-
-
- 279
-
-
- Sonic Robo Blast 2
-
-
- SRB200000
-
-
- 02.06
-
-
diff --git a/src/sdl/SRB2PSP/ICON0.png b/src/sdl/SRB2PSP/ICON0.png
deleted file mode 100644
index 140230c1..00000000
Binary files a/src/sdl/SRB2PSP/ICON0.png and /dev/null differ
diff --git a/src/sdl/SRB2PSP/Makefile.cfg b/src/sdl/SRB2PSP/Makefile.cfg
deleted file mode 100644
index f9ec6416..00000000
--- a/src/sdl/SRB2PSP/Makefile.cfg
+++ /dev/null
@@ -1,126 +0,0 @@
-#
-# Makefile.cfg for SRB2/PSP
-#
-
-#
-#hmmm, the PSP
-#
-
- PSPSDK=$(shell psp-config -p)
- PSPDEV=$(shell psp-config -d)
- PSPPREFIX=$(shell psp-config -P)
- STRIP=psp-strip
- MKSFO?=mksfoex -d MEMSIZE=1
- #MKSFO=mksfo
- PACK_PBP=pack-pbp
- FIXUP=psp-fixup-imports
- HOSTCC:=$(CC)
- CC=$(PSPDEV)/bin/psp-gcc
- OBJCOPY=psp-objcopy
- OBJDUMP=psp-objdump
-ifdef FIXEDPRX
- PRXGEN=psp-prxgen
-else
- PRXGEN=$(OBJCOPY)
-endif
-ifndef PRXSIGN
- SIGNER:=$(PSPDEV)/bin/$(OBJCOPY)
-endif
-
-ifndef ECHO
- MKSFO:=@$(MKSFO)
- PACK_PBP:=@$(PACK_PBP)
- FIXUP:=@$(FIXUP)
- PRXGEN:=@$(PRXGEN)
-endif
-
- PSP_EBOOT_TITLE=SRB2-PSP vME
- PSP_EBOOT_SFO=$(BIN)/PARAM.SFO
- PSP_EBOOT_ICON=sdl/SRB2PSP/ICON0.png
- PSP_EBOOT_ICON1=NULL
- PSP_EBOOT_UNKPNG=NULL
- PSP_EBOOT_PIC1=sdl/SRB2PSP/PIC1.png
- PSP_EBOOT_SND0=NULL
- PSP_EBOOT_PSAR=NULL
-
- SIGNER?=sdl/SRB2PSP/psp-prxsign/psp-prxsign
-
- SDL=1
- PREFIX=psp
- NONX86=1
- #NOHW=1
- NOHS=1
- NOMD5=1
- NONET=1 #No TCPIP code
- NOPNG=1 #No Screenshot
-
- OPTS=-I$(PSPPREFIX)/include -I$(PSPSDK)/include
- OPTS+=-DUNIXCOMMON -DFORCESDLMAIN -G0
- WFLAGS+=-Wno-undef
- WFLAGS+=-O1
- LIBS=-lm
- SDL_CONFIG?=$(PSPPREFIX)/bin/sdl-config
- #SDL_CFLAGS?=-I$(PSPDEV)/psp/include/SDL
- #SDL_LDFLAGS?=-lSDLmain -lSDL -lglut -lGLU -lGL -lpspgu -lpspaudiolib -lpspaudio -lpsphprm -lpspvfpu -lpsprtc
-ifndef NOMIXER
- LIBS:=-liberty -lvorbisfile -lvorbis -logg -lSDL $(LIBS)
-endif
-ifndef NOHW
- OPTS+=-DSTATIC_OPENGL -DMINI_GL_COMPATIBILITY
- LIBS+=-lGLU -lGL -lm
-endif
- #PSPSDK_LIBS=-L$(PSPSDK)/lib -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk
- #LIBS+=$(PSPSDK_LIBS) -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel
-ifdef FIXEDPRX
- LDFLAGS := -specs=$(PSPSDK)/lib/prxspecs -Wl,-q,-T$(PSPSDK)/lib/linkfile.prx $(LDFLAGS)
- LIBS+=$(PSPSDK)/lib/prxexports.o
-endif
-
-ifeq ($(PSP_FW_VERSION),)
-PSP_FW_VERSION=150
-endif
-
- CPPFLAGS:=-D_PSP_FW_VERSION=$(PSP_FW_VERSION) $(CPPFLAGS)
-
-
- # name of the exefile
- EXENAME?=SRB2PSP.elf
- PRXNAME?=SRB2PSP.prx
- DBGNAME?=SRB2PSP.debug
-
-post-build: $(BIN)/EBOOT.PBP
-
-kxploit: $(BIN)/$(EXENAME) $(PSP_EBOOT_SFO)
- -$(MKDIR) "$(BIN)/kxploit/srb2"
- @echo emitting kxploit/srb2/
- $(STRIP) $(BIN)/$(EXENAME) -o $(BIN)/kxploit/srb2/EBOOT.PBP
- @echo emitting kxploit/srb2%
- -$(MKDIR) "$(BIN)/kxploit/srb2%/"
- $(PACK_PBP) "$(BIN)/kxploit/srb2%/EBOOT.PBP" $(PSP_EBOOT_SFO) $(PSP_EBOOT_ICON) \
- $(PSP_EBOOT_ICON1) $(PSP_EBOOT_UNKPNG) $(PSP_EBOOT_PIC1) \
- $(PSP_EBOOT_SND0) NULL $(PSP_EBOOT_PSAR)
-
-sdl/SRB2PSP/psp-prxsign/psp-prxsign:
- -$(MAKE) -C sdl/SRB2PSP/psp-prxsign CFLAGS=-pipe CC="$(HOSTCC)"
-
-fix-up: $(BIN)/$(EXENAME)
- @echo Running psp-fixup-imports on $(EXENAME)
- $(FIXUP) $(BIN)/$(EXENAME)
-
-$(BIN)/$(PRXNAME): $(BIN)/$(EXENAME) fix-up
- @echo Building $(PRXNAME) out of $(EXENAME)
- $(PRXGEN) $(BIN)/$(EXENAME) $@
-
-$(BIN)/EBOOT.PBP: $(BIN)/$(PRXNAME) $(SIGNER) $(PSP_EBOOT_SFO)
- @echo Signing and running pack-pbp to make PBP
- $(SIGNER) $(BIN)/$(PRXNAME) $(BIN)/$(PRXNAME).sign
- $(PACK_PBP) $@ $(PSP_EBOOT_SFO) $(PSP_EBOOT_ICON) \
- $(PSP_EBOOT_ICON1) $(PSP_EBOOT_UNKPNG) $(PSP_EBOOT_PIC1) \
- $(PSP_EBOOT_SND0) $(BIN)/$(PRXNAME).sign $(PSP_EBOOT_PSAR)
- $(REMOVE) $(BIN)/$(PRXNAME).sign
-
-$(PSP_EBOOT_SFO):
- -$(MKDIR) $(BIN)
- $(MKSFO) '$(PSP_EBOOT_TITLE)' $@
-
-#include $(PSPSDK)/lib/build.mak
diff --git a/src/sdl/SRB2PSP/PIC1.png b/src/sdl/SRB2PSP/PIC1.png
deleted file mode 100644
index 0722a96b..00000000
Binary files a/src/sdl/SRB2PSP/PIC1.png and /dev/null differ
diff --git a/src/sdl/SRB2PSP/psp-prxsign/.gitignore b/src/sdl/SRB2PSP/psp-prxsign/.gitignore
deleted file mode 100644
index 6a07f1a5..00000000
--- a/src/sdl/SRB2PSP/psp-prxsign/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/psp-prxsign
-/psp-prxsign.exe
diff --git a/src/sdl/SRB2PSP/psp-prxsign/Makefile b/src/sdl/SRB2PSP/psp-prxsign/Makefile
deleted file mode 100644
index 4a9b7da0..00000000
--- a/src/sdl/SRB2PSP/psp-prxsign/Makefile
+++ /dev/null
@@ -1,22 +0,0 @@
-EXE=psp-prxsign
-SRC=main.c cmac.c
-OBJ=$(SRC:.c=.o)# replaces the .c from SRC with .o
-
-OPENSSL_PKGCONFIG?=openssl
-OPENSSL_CFLAGS?=$(shell pkg-config $(OPENSSL_PKGCONFIG) --cflags)
-OPENSSL_LDFLAGS?=$(shell pkg-config $(OPENSSL_PKGCONFIG) --libs)
-
-CFLAGS+=$(OPENSSL_CFLAGS)
-LDFLAGS+=$(OPENSSL_LDFLAGS)
-
-.PHONY : all # .PHONY ignores files named all
-
-all: $(EXE) # all is dependent on $(BIN) to be complete
-
-
-$(EXE): $(OBJ) # $(EXE) is dependent on all of the files in $(OBJ) to exist
- $(CC) $^ $(LDFLAGS) -o $@
-
-.PHONY : clean # .PHONY ignores files named clean
-clean:
- -$(RM) $(OBJ) $(EXE)
diff --git a/src/sdl/SRB2PSP/psp-prxsign/cmac.c b/src/sdl/SRB2PSP/psp-prxsign/cmac.c
deleted file mode 100644
index f527f7a7..00000000
--- a/src/sdl/SRB2PSP/psp-prxsign/cmac.c
+++ /dev/null
@@ -1,130 +0,0 @@
-#include "cmac.h"
-
-#define AES_128 0
-unsigned char const_Rb[16] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87
-};
-unsigned char const_Zero[16] = {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-void xor_128(unsigned char *a, unsigned char *b, unsigned char *out)
-{
- int i;
- for (i=0;i<16; i++)
- {
- out[i] = a[i] ^ b[i];
- }
-}
-
-/* AES-CMAC Generation Function */
-
-static inline void leftshift_onebit(unsigned char *input,unsigned char *output)
-{
- int i;
- unsigned char overflow = 0;
-
- for ( i=15; i>=0; i-- )
- {
- output[i] = input[i] << 1;
- output[i] |= overflow;
- overflow = (input[i] & 0x80)?1:0;
- }
-}
-
-void generate_subkey(unsigned char *key, unsigned char *K1, unsigned char *K2)
-{
- unsigned char L[16];
- unsigned char Z[16];
- unsigned char tmp[16];
- int i;
-
- for ( i=0; i<16; i++ ) Z[i] = 0;
-
- AES_KEY aes;
- AES_set_encrypt_key(key, 128, &aes);
-
- AES_encrypt(Z, L, &aes);
-
- if ( (L[0] & 0x80) == 0 ) /* If MSB(L) = 0, then K1 = L << 1 */
- {
- leftshift_onebit(L,K1);
- } else { /* Else K1 = ( L << 1 ) (+) Rb */
- leftshift_onebit(L,tmp);
- xor_128(tmp,const_Rb,K1);
- }
-
- if ( (K1[0] & 0x80) == 0 )
- {
- leftshift_onebit(K1,K2);
- } else {
- leftshift_onebit(K1,tmp);
- xor_128(tmp,const_Rb,K2);
- }
-}
-
-static inline void padding ( unsigned char *lastb, unsigned char *pad, int length )
-{
- int j;
-
- /* original last block */
- for ( j=0; j<16; j++ )
- {
- if ( j < length )
- {
- pad[j] = lastb[j];
- } else if ( j == length ) {
- pad[j] = 0x80;
- } else {
- pad[j] = 0x00;
- }
- }
-}
-
-void AES_CMAC ( unsigned char *key, unsigned char *input, int length, unsigned char *mac )
-{
- unsigned char X[16],Y[16], M_last[16], padded[16];
- unsigned char K1[16], K2[16];
- int n, i, flag;
- generate_subkey(key,K1,K2);
-
- n = (length+15) / 16; /* n is number of rounds */
-
- if ( n == 0 )
- {
- n = 1;
- flag = 0;
- } else {
- if ( (length%16) == 0 ) { /* last block is a complete block */
- flag = 1;
- } else { /* last block is not complete block */
- flag = 0;
- }
-
- }
-
- if ( flag ) { /* last block is complete block */
- xor_128(&input[16*(n-1)],K1,M_last);
- } else {
- padding(&input[16*(n-1)],padded,length%16);
- xor_128(padded,K2,M_last);
- }
- AES_KEY aes;
- AES_set_encrypt_key(key, 128, &aes);
-
- for ( i=0; i<16; i++ ) X[i] = 0;
- for ( i=0; i
-#include
-
-void xor_128(unsigned char *a, unsigned char *b, unsigned char *out);
-void generate_subkey(unsigned char *key, unsigned char *K1, unsigned char *K2);
-void AES_CMAC(unsigned char *key, unsigned char *input, int length, unsigned char *mac);
-
-#endif
diff --git a/src/sdl/SRB2PSP/psp-prxsign/kirk_header.h b/src/sdl/SRB2PSP/psp-prxsign/kirk_header.h
deleted file mode 100644
index 76c921ef..00000000
--- a/src/sdl/SRB2PSP/psp-prxsign/kirk_header.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef __kirk_header__
-#define __kirk_header__
-
-static unsigned int size_kirk_header = 272;
-static unsigned char kirk_header[] __attribute__((aligned(16))) = {
- 0x2a, 0x4f, 0x3c, 0x49, 0x8a, 0x73, 0x4e, 0xd1, 0xf4, 0x55, 0x93, 0x0b, 0x9b, 0x69, 0xdc, 0x65,
- 0x73, 0x22, 0x69, 0xd3, 0x73, 0x96, 0x7a, 0x60, 0x66, 0x8c, 0x88, 0xcf, 0x2f, 0x83, 0x58, 0xbc,
- 0xb2, 0x00, 0x0a, 0x11, 0x72, 0x43, 0xc5, 0xde, 0xef, 0xbb, 0x2c, 0xbf, 0x97, 0x79, 0x6b, 0x9c,
- 0x10, 0x1e, 0x7c, 0x57, 0x0e, 0xdb, 0x1d, 0x61, 0x6e, 0xb5, 0xf9, 0x3d, 0x35, 0xe9, 0x5c, 0xd8,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x33, 0x55, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x7e, 0x50, 0x53, 0x50, 0x00, 0x02, 0x00, 0x00, 0x01, 0x01, 0x22, 0x74, 0x69, 0x66, 0x70, 0x73,
- 0x70, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x33, 0x55, 0x00, 0x50, 0x34, 0x55, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x40, 0x67, 0x3d, 0x00, 0x50, 0x55, 0x0a, 0x01, 0x10, 0x00, 0x40, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x6b, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x4c, 0x6b, 0x3d, 0x00, 0xcc, 0xbb, 0x11, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00,
-};
-
-#endif
diff --git a/src/sdl/SRB2PSP/psp-prxsign/main.c b/src/sdl/SRB2PSP/psp-prxsign/main.c
deleted file mode 100644
index a970ae6c..00000000
--- a/src/sdl/SRB2PSP/psp-prxsign/main.c
+++ /dev/null
@@ -1,190 +0,0 @@
-#include
-#include
-#include
-#include
-#include
-#include "cmac.h"
-#include "kirk_header.h"
-#include "psp_header.h"
-
-typedef unsigned char byte;
-
-typedef struct {
- byte key[16];
- byte ckey[16];
- byte head_hash[16];
- byte data_hash[16];
- byte unused[32];
- int unk1; // 1
- int unk2; // 0
- int unk3[2];
- int datasize;
- int dataoffset;
- int unk4[6];
-} kirk1head_t;
-
-// secret kirk command 1 key
-byte kirk_key[] = {
- 0x98, 0xc9, 0x40, 0x97, 0x5c, 0x1d, 0x10, 0xe8, 0x7f, 0xe6, 0x0e, 0xa3, 0xfd, 0x03, 0xa8, 0xba
-};
-
-int main(int argc, char **argv)
-{
- int i, relrem, size, fullsize, blocks, datasize;
- size_t j;
- kirk1head_t kirk;
- byte iv[16];
- byte cmac[32];
- byte subk[32];
- byte psph[0x150];
- byte *datablob;
- byte *filebuff;
- FILE *f;
- AES_KEY aesKey;
- Elf32_Ehdr *ehdr;
- Elf32_Shdr *shdr;
- Elf32_Rel *relo;
-
- if(argc < 3) {
- printf("Usage: %s unsigned.prx signed.prx\n", argv[0]);
- return 1;
- }
-
- // clean kirk header, use modified PRXdecrypter to get it
- /*f = fopen(argv[1], "rb");
- if(!f) {
- printf("failed to open %s\n", argv[1]);
- return 1;
- }
- fread(&kirk, 1, sizeof(kirk1head_t), f);
- fclose(f);*/
- //memcpy(&kirk, kirk_header, size_kirk_header);
- memcpy(&kirk, kirk_header, sizeof(kirk1head_t));
-
- datasize = kirk.datasize;
- if(datasize % 16) datasize += 16 - (datasize % 16);
-
- // original ~PSP header
- /*f = fopen(argv[2], "rb");
- if(!f) {
- free(datablob);
- printf("failed to open %s\n", argv[2]);
- return 1;
- }
- fread(psph, 1, 0x150, f);
- fclose(f);*/
- memcpy(&psph, psp_header, size_psp_header);
-
- // file to encrypt
- f = fopen(argv[1], "rb");
- if(!f) {
- printf("psp-prxsign: Unable to open PRX\n");
- return 1;
- }
- fseek(f, 0, SEEK_END);
- size = ftell(f);
- if(size > datasize - 16) {
- fclose(f);
- printf("psp-prxsign: PRX is too large\n");
- return 1;
- }
- printf("%s : %i\n", argv[1], size);
- fseek(f, 0, SEEK_SET);
-
- fullsize = datasize + 0x30 + kirk.dataoffset;
-
- // datablob holds everything needed to calculate data HASH
- datablob = malloc(fullsize);
- if(!datablob) {
- fclose(f);
- printf("psp-prxsign: Failed to allocate memory for blob\n");
- return 1;
- }
- memset(datablob, 0, fullsize);
- memcpy(datablob, &kirk.unk1, 0x30);
- memcpy(datablob + 0x30, psph, kirk.dataoffset);
- filebuff = datablob + 0x30 + kirk.dataoffset;
-
- int whocares = fread(filebuff, 1, size, f);
- (void)whocares;
- fclose(f);
-
- // remove relocations type 7
- relrem = 0;
- ehdr = (void *)filebuff;
- if(!memcmp(ehdr->e_ident, ELFMAG, 4) && ehdr->e_shnum) {
- shdr = (void *)(filebuff + ehdr->e_shoff);
- for(i = 0; i < ehdr->e_shnum; i++) {
- if(shdr[i].sh_type == 0x700000A0) {
- relo = (void *)(filebuff + shdr[i].sh_offset);
- for(j = 0; j < shdr[i].sh_size / sizeof(Elf32_Rel); j++) {
- if((relo[j].r_info & 0xFF) == 7) {
- relo[j].r_info = 0;
- relrem++;
- }
- }
- }
- }
- }
- //printf("%i relocations type 7 removed\ncalculating ...\n", relrem);
-
- // get AES/CMAC key
- AES_set_decrypt_key(kirk_key, 128, &aesKey);
- memset(iv, 0, 16);
- AES_cbc_encrypt(kirk.key, kirk.key, 32, &aesKey, iv, AES_DECRYPT);
-
- // check header hash, optional
- // if you take correct kirk header, hash is always correct
-/* AES_CMAC(kirk.ckey, datablob, 0x30, cmac);
- if(memcmp(cmac, kirk.head_hash, 16)) {
- free(datablob);
- printf("header hash invalid\n");
- return 1;
- }
-*/
-
- // encrypt input file
- AES_set_encrypt_key(kirk.key, 128, &aesKey);
- memset(iv, 0, 16);
- AES_cbc_encrypt(filebuff, filebuff, datasize, &aesKey, iv, AES_ENCRYPT);
-
- // make CMAC correct
- generate_subkey(kirk.ckey, subk, subk + 16);
- AES_set_encrypt_key(kirk.ckey, 128, &aesKey);
- blocks = fullsize / 16;
- memset(cmac, 0, 16);
- for(i = 0; i < blocks - 1; i++) {
- xor_128(cmac, &datablob[16 * i], cmac + 16);
- AES_encrypt(cmac + 16, cmac, &aesKey);
- }
-
- AES_set_decrypt_key(kirk.ckey, 128, &aesKey);
- AES_decrypt(kirk.data_hash, iv, &aesKey);
- xor_128(cmac, iv, iv);
- xor_128(iv, subk, &datablob[16 * (blocks-1)]);
- // check it, optional
- // it works, this is only if you want to change something
-/* AES_CMAC(kirk.ckey, datablob, fullsize, cmac);
- if(memcmp(cmac, kirk.data_hash, 16)) {
- fclose(f);
- free(datablob);
- printf("data hash calculation error\n");
- return 1;
- }
-*/
- f = fopen(argv[2], "wb");
- if(!f) {
- free(datablob);
- printf("psp-prxsign: Failed to write signed PRX\n");
- return 1;
- }
- //printf("saving ...\n");
- // save ~PSP header
- fwrite(psph, 1, 0x150, f);
- // save encrypted file
- fwrite(filebuff, 1, fullsize - 0x30 - kirk.dataoffset, f);
- fclose(f);
- free(datablob);
- //printf("everything done\n");
- return 0;
-}
diff --git a/src/sdl/SRB2PSP/psp-prxsign/psp_header.h b/src/sdl/SRB2PSP/psp-prxsign/psp_header.h
deleted file mode 100644
index 7faef832..00000000
--- a/src/sdl/SRB2PSP/psp-prxsign/psp_header.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef __psp_header__
-#define __psp_header__
-
-static unsigned int size_psp_header = 336;
-static unsigned char psp_header[] __attribute__((aligned(16))) = {
- 0x7e, 0x50, 0x53, 0x50, 0x00, 0x02, 0x00, 0x00, 0x01, 0x01, 0x22, 0x74, 0x69, 0x66, 0x70, 0x73,
- 0x70, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x33, 0x55, 0x00, 0x50, 0x34, 0x55, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x40, 0x67, 0x3d, 0x00, 0x50, 0x55, 0x0a, 0x01, 0x10, 0x00, 0x40, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x6b, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x4c, 0x6b, 0x3d, 0x00, 0xcc, 0xbb, 0x11, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00,
- 0x90, 0x82, 0x4c, 0x48, 0xa3, 0x53, 0xb2, 0x1b, 0x13, 0x95, 0x2f, 0xf1, 0x0b, 0x90, 0x9c, 0x11,
- 0x61, 0x40, 0x20, 0x67, 0xf8, 0xdb, 0xfc, 0x95, 0x5c, 0xbe, 0x8c, 0x80, 0xf3, 0x92, 0x03, 0x01,
- 0xb0, 0xbe, 0xf5, 0xf8, 0xa1, 0xaf, 0xaf, 0xa8, 0x38, 0x26, 0x63, 0x09, 0x26, 0x0e, 0xb7, 0xd5,
- 0x00, 0x33, 0x55, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x5c, 0x3e, 0x03, 0x22, 0xe5, 0x7d, 0xb9, 0xd1, 0x13, 0x67, 0x97, 0xa3, 0x5b, 0xd8, 0x77, 0x1f,
- 0xf0, 0x05, 0xf3, 0xad, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, 0x4a, 0xd7, 0x37,
- 0xc2, 0x8f, 0x15, 0x43, 0x33, 0x93, 0x4d, 0x5b, 0xc0, 0x6e, 0xe4, 0x00, 0xc6, 0x0a, 0x71, 0x11,
- 0x98, 0xb6, 0xc3, 0xb7, 0x59, 0x66, 0x21, 0xa8, 0x65, 0xf6, 0x53, 0xa9, 0x7a, 0x48, 0x17, 0xb6,
-};
-
-#endif
diff --git a/src/sdl/SRB2WII/Makefile.cfg b/src/sdl/SRB2WII/Makefile.cfg
deleted file mode 100644
index 1b186304..00000000
--- a/src/sdl/SRB2WII/Makefile.cfg
+++ /dev/null
@@ -1,124 +0,0 @@
-#
-# Makefile.cfg for SRB2Wii native using libogc
-#
-
-# Check if DEVKITPPC is set in the environment. If so, continue with compilation.
-.SUFFIXES:
-
-ifeq ($(strip $(DEVKITPPC)),)
-$(error "Please set DEVKITPPC in your environment. export DEVKITPPC=devkitPPC")
-endif
-
-# Set compiler flags
-
-SRB2NAME?=srb2wii
-EXENAME?=$(SRB2NAME).elf
-DBGNAME?=$(SRB2NAME).elf.debug
-DOLNAME?=$(SRB2NAME).dol
-
-ICONPNG?=sdl/SRB2WII/icon.png
-METAXML?=sdl/SRB2WII/meta.xml
-
-APPDIR=apps/$(SRB2NAME)
-ZIPNAME=$(SRB2NAME).zip
-
-ELF2DOL=$(DEVKITPPC)/bin/elf2dol
-WIILOADEXE=$(DEVKITPPC)/bin/wiiload
-ZIP=zip -r -9
-WGET=wget -P srb2wii -c -nc
-SED=sed
-XARGS=xargs
-SHXARGS:=$(XARGS)
-SHSED:=$(SED)
-FOR=for
-
-ifndef ECHO
- ELF2DOL:=@$(ELF2DOL)
- WIILOADEXE:=@$(WIILOADEXE)
- ZIP:=@$(ZIP)
- SED:=@$(SED)
- XARGS:=@$(XARGS)
- FOR:=@$(FOR)
-endif
-
-# Disable same warning flags
-WFLAGS+=-Wno-shadow -Wno-char-subscripts -Wno-old-style-definition -Wno-unsuffixed-float-constants
-
-# newlib has no support for networking
-NONET=1
-
-# use pkgconfig for PKG
-PNG_PKGCONFIG=libpng
-
-# use absolute paths because changing PATH variable breaks distcc
-PREFIX := $(DEVKITPPC)/bin/$(PREFIX)
-
-# FIXME: DevkitPPC and ready-compiled SDL Wii require these things to be in a silly order
-# libogc/DevkitPro required stuff
-LIBOGC := $(DEVKITPRO)/libogc
-LIBOGC_INC := $(LIBOGC)/include
-LIBOGC_LIB := $(LIBOGC)/lib
-
-PORTLIBS := $(DEVKITPRO)/portlibs/ppc
-PORTLIBS_INC := $(PORTLIBS)/include
-PORTLIBS_LIB := $(PORTLIBS)/lib
-
-SDL_CPPFLAGS := -I$(LIBOGC_INC)/SDL
-SDL_LIB := $(DEVKITPRO)/libogc/lib/wii
-INCLUDE := -I$(LIBOGC_INC) $(SDL_CPPFLAGS) -I$(PORTLIBS_INC)
-
-PKG_CONFIG_PATH := $(PORTLIBS)/lib/pkgconfig
-PKG_BROKEN_SWTICH := --static --define-variable=DEVKITPRO=$(DEVKITPRO)
-PNG_PKGCONFIG := $(PKG_CONFIG_PATH)/libpng.pc $(PKG_BROKEN_SWTICH)
-ZLIB_PKGCONFIG := $(PKG_CONFIG_PATH)/zlib.pc $(PKG_BROKEN_SWTICH)
-
-ZLIB_CFLAGS?=$(shell $(PKG_CONFIG) $(ZLIB_PKGCONFIG) --cflags)
-ZLIB_LDFLAGS?=$(shell $(PKG_CONFIG) $(ZLIB_PKGCONFIG) --libs)
-
-ifdef RDB
- LIBS+=-ldb
- OPTS+=-DREMOTE_DEBUGGING=$(RDB)
-endif
-
-LIBS+= -L$(SDL_LIB)
-ifndef NOMIXER
- LD=$(CXX)
- LIBS+=-lSDL_mixer -lvorbisidec -lsmpeg
-endif
-LIBS+=-lSDL
-
-LIBS+=$(ZLIB_LDFLAGS) -lfat -lwiiuse -lbte -logc -lm -lwiikeyboard -L$(LIBOGC_LIB)
-
-MACHDEP = -DGEKKO -mrvl -mcpu=750 -meabi -mhard-float
-OPTS+=-DWII -D_WII -DUNIXCOMMON
-CFLAGS+=-D__BIG_ENDIAN__ -g -O3 -fsigned-char $(MACHDEP) $(INCLUDE)
-CXXFLAGS+=$(CFLAGS)
-LDFLAGS+=-g $(MACHDEP) -Wl,-Map,$(notdir $@).map
-
-SDL_CONFIG=/bin/true
-SDL_CFLAGS=
-SDL_LDFLAGS=
-
-$(BIN)/$(DOLNAME): $(BIN)/$(EXENAME)
- @echo Linking $(DOLNAME)...
- $(ELF2DOL) $(BIN)/$(EXENAME) $(BIN)/$(DOLNAME)
- @echo Creating /apps/$(SRB2NAME)...
- $(MKDIR) $(APPDIR)
- $(CP) $(BIN)/$(DOLNAME) $(APPDIR)/boot.dol
- $(CP) $(ICONPNG) $(APPDIR)
- $(CP) $(METAXML) $(APPDIR)
-ifdef WITHDATA
- $(MKDIR) srb2wii
- $(FOR) datafile in $(shell echo $(D_FILES) | $(SHSED) -e 's/\.srb/\.wad/' -e 's/music.dta//' | $(SHXARGS) -n 1 basename); do \
- $(WGET) http://alam.srb2.org/SRB2/2.0.6-Final/Resources/$$datafile; \
- done
- # downsampled music.dta specially for SRB2Wii
- $(WGET) http://repos.srb2.org/srb2ports/music.dta
- $(ZIP) $(BIN)/$(ZIPNAME) $(APPDIR) srb2wii
-else
- $(ZIP) $(BIN)/$(ZIPNAME) $(APPDIR)
-endif
- $(REMOVE) -r $(APPDIR)
-
-run: $(BIN)/$(EXENAME)
- $(WIILOADEXE) $(BIN)/$(DBGNAME)
diff --git a/src/sdl/SRB2WII/icon.png b/src/sdl/SRB2WII/icon.png
deleted file mode 100644
index d22324bc..00000000
Binary files a/src/sdl/SRB2WII/icon.png and /dev/null differ
diff --git a/src/sdl/SRB2WII/meta.xml b/src/sdl/SRB2WII/meta.xml
deleted file mode 100644
index 843176d3..00000000
--- a/src/sdl/SRB2WII/meta.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
- SRB2Wii
- Callum
- 2.0.6
- 20101207
- A 3D Sonic fangame
- Sonic Robo Blast 2 is a 3D fangame by a small group called
-Sonic Team Junior, using the Doom engine as a base.
-The game has been worked on for almost 11 years so far, and
-it is still being very much developed today, with a huge
-fanbase developing custom content, including characters,
-levels, and even large-scale modifications that play out
-a brand new adventure.
-Based on the Doom II engine, SRB2's system requirements
-are very low, even the oldest computers can play it at a
-decent speed.
-
diff --git a/src/sdl/SRB2XBOX/Makefile.cfg b/src/sdl/SRB2XBOX/Makefile.cfg
deleted file mode 100644
index 56966d43..00000000
--- a/src/sdl/SRB2XBOX/Makefile.cfg
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# Makefile.cfg for SRB2/XBOX
-#
-
-#
-#hmmm, the XBOX
-#
-
- NOHW=1 #No working OpenGL right now
- NOHS=1 #No HWSound right now
- NOASM=1 #No Fast code
- NONET=1 #No network code
- NOMD5=1 #No Slow MD5
- NOPNG=1 #No Screenshot
- #SDLMAIN=1 #SDLMain!
-
-ifndef OPENXDK
- OPENXDK=/usr/local/openxdk
-endif
-
- CXBE=$(OPENXDK)/bin/cxbe
-
-ifdef ECHO
- CXBE:=@$(CXBE)
-endif
-
-ifndef NOHW
- OPTS+=-DMINI_GL_COMPATIBILITY
-endif
-
- BUILTLM=-fno-builtin
- CFLAGS+=-D_XBOX -std=gnu99 -ffreestanding $(BUILTLM) -fno-exceptions
- CFLAGS+=-I$(OPENXDK)/i386-pc-xbox/include -I$(OPENXDK)/include
- OPTS+=-nostdlib -mno-cygwin -march=i386
- LDFLAGS+=-nostdlib -Wl,--file-alignment,0x20 -Wl,--section-alignment,0x20 -shared -Wl,--entry,_WinMainCRTStartup -Wl,--strip-all -L$(OPENXDK)/i386-pc-xbox/lib -L$(OPENXDK)/lib
- LIBS=-lg -lc -lm
- SDL_CFLAGS?=-I$(OPENXDK)/include/SDL
- SDL_LDFLAGS?=-lSDL -lopenxdk -lhal -lc -lhal -lusb -lhal -lc -lxboxkrnl
-
- i_system_o+=$(OBJDIR)/xboxhelp.o
-
- # name of the exefile
- EXENAME?=SRB2XBOX.EXE
- BINNAME?=default.xbe
diff --git a/src/sdl/SRB2XBOX/xboxhelp.c b/src/sdl/SRB2XBOX/xboxhelp.c
deleted file mode 100644
index 9de01712..00000000
--- a/src/sdl/SRB2XBOX/xboxhelp.c
+++ /dev/null
@@ -1,91 +0,0 @@
-// Emacs style mode select -*- C++ -*-
-//-----------------------------------------------------------------------------
-//
-// Copyright (C) 2004 by Sonic Team Jr.
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// DESCRIPTION:
-// stub and replacement "ANSI" C functions for use under OpenXDK
-//
-//-----------------------------------------------------------------------------
-
-#include "../../doomdef.h"
-#include "xboxhelp.h"
-#ifdef __GNUC__
-#include
-#else
-#include
-#endif
-
-char *getcwd(char *_buf, size_t _size )
-{
- (void)_buf;
- (void)_size;
- return _buf;
-}
-
-#ifdef _MSC_VER
-int mkdir(const char *path)
-{
- (void)path;
- return 0;
-}
-#elif 0 //__GNUC__?
-int mkdir(const char *path, mode_t _mode)
-{
- (void)path;
- (void)_mode;
- return 0;
-}
-#endif
-
-int chdir (const char *__path )
-{
- (void)__path;
- return 0;
-}
-
-time_t time(time_t *T)
-{
- long returntime = 0;
- (void)T;
-/*
- SYSTEMTIME st;
- FILETIME stft;
- INT64 ftli;
- if (!T) return returntime;
- GetSystemTime(&st);
- SystemTimeToFileTime(&st,&stft);
- CopyMemory(&ftli,&stft,sizeof (LARGE_INTEGER));
- returntime = (long)ftli;
- *T = returntime;
-*/
- return returntime;
-}
-
-#ifdef _MSC_VER
-#include
-void __cdecl _RTC_Initialize(void)
-{
-}
-char *getenv(const char *__env)
-{
- __env = NULL;
- return NULL;
-}
-
-int putenv(const char *__env)
-{
- __env = NULL;
- return 0;
-}
-#endif
diff --git a/src/sdl/SRB2XBOX/xboxhelp.h b/src/sdl/SRB2XBOX/xboxhelp.h
deleted file mode 100644
index 97ef0a3b..00000000
--- a/src/sdl/SRB2XBOX/xboxhelp.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#if defined (_MSC_VER)
-int access(const char *path, int amode);
-char *getcwd(char *_buf, size_t _size );
-int mkdir(const char *path);
-int chdir (const char *__path );
-#endif
diff --git a/src/sdl/Srb2SDL-vc10.vcxproj b/src/sdl/Srb2SDL-vc10.vcxproj
index 192f1915..958cd7d0 100644
--- a/src/sdl/Srb2SDL-vc10.vcxproj
+++ b/src/sdl/Srb2SDL-vc10.vcxproj
@@ -96,7 +96,7 @@
Disabled
$(ProjectDir)..\..\libs\libpng-src;$(ProjectDir)..\..\libs\zlib;%(AdditionalIncludeDirectories)
- _DEBUG;USE_WGL_SWAP;DIRECTFULLSCREEN;SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;USEASM;HAVE_PNG;COMPVERSION;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
+ _DEBUG;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;USEASM;HAVE_PNG;COMPVERSION;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
true
EnableFastChecks
MultiThreadedDebug
@@ -145,7 +145,7 @@
Disabled
$(ProjectDir)..\..\libs\libpng-src;$(ProjectDir)..\..\libs\zlib;%(AdditionalIncludeDirectories)
- _DEBUG;USE_WGL_SWAP;DIRECTFULLSCREEN;SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;HAVE_PNG;COMPVERSION;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
+ _DEBUG;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;HAVE_PNG;COMPVERSION;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
true
EnableFastChecks
MultiThreadedDebug
@@ -202,7 +202,7 @@
Speed
true
$(ProjectDir)..\..\libs\libpng-src;$(ProjectDir)..\..\libs\zlib;%(AdditionalIncludeDirectories)
- NDEBUG;SDLMAIN;NO_STDIO_REDIRECT;USE_WGL_SWAP;DIRECTFULLSCREEN;SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;USEASM;HAVE_PNG;COMPVERSION;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
+ NDEBUG;SDLMAIN;NO_STDIO_REDIRECT;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;USEASM;HAVE_PNG;COMPVERSION;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
true
MultiThreaded
.\..\..\objs\VC10\$(Platform)\$(Configuration)\SDL\Srb2SDL-vc9.pch
@@ -258,7 +258,7 @@
Speed
true
$(ProjectDir)..\..\libs\libpng-src;$(ProjectDir)..\..\libs\zlib;%(AdditionalIncludeDirectories)
- NDEBUG;SDLMAIN;NO_STDIO_REDIRECT;USE_WGL_SWAP;DIRECTFULLSCREEN;SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;HAVE_PNG;COMPVERSION;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
+ NDEBUG;SDLMAIN;NO_STDIO_REDIRECT;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;HAVE_PNG;COMPVERSION;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)
true
MultiThreaded
.\..\..\objs\VC10\$(Platform)\$(Configuration)\SDL\Srb2SDL-vc9.pch
@@ -1461,4 +1461,4 @@
-
\ No newline at end of file
+
diff --git a/src/sdl/Srb2SDL-vc9.vcproj b/src/sdl/Srb2SDL-vc9.vcproj
index 620202bd..d2a268f8 100644
--- a/src/sdl/Srb2SDL-vc9.vcproj
+++ b/src/sdl/Srb2SDL-vc9.vcproj
@@ -50,7 +50,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""$(ProjectDir)..\..\libs\libpng-src";"$(ProjectDir)..\..\libs\zlib""
- PreprocessorDefinitions="_DEBUG;USE_WGL_SWAP;DIRECTFULLSCREEN;SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;USEASM;HAVE_PNG;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
+ PreprocessorDefinitions="_DEBUG;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;USEASM;HAVE_PNG;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -145,7 +145,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""$(ProjectDir)..\..\libs\libpng-src";"$(ProjectDir)..\..\libs\zlib""
- PreprocessorDefinitions="_DEBUG;USE_WGL_SWAP;DIRECTFULLSCREEN;SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;HAVE_PNG;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
+ PreprocessorDefinitions="_DEBUG;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;HAVE_PNG;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
@@ -248,7 +248,7 @@
FavorSizeOrSpeed="1"
OmitFramePointers="true"
AdditionalIncludeDirectories=""$(ProjectDir)..\..\libs\libpng-src";"$(ProjectDir)..\..\libs\zlib""
- PreprocessorDefinitions="NDEBUG;SDLMAIN;NO_STDIO_REDIRECT;USE_WGL_SWAP;DIRECTFULLSCREEN;SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;USEASM;HAVE_PNG;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
+ PreprocessorDefinitions="NDEBUG;SDLMAIN;NO_STDIO_REDIRECT;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;USEASM;HAVE_PNG;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
StringPooling="true"
RuntimeLibrary="0"
PrecompiledHeaderFile=".\..\..\objs\VC9\$(Platform)\$(Configuration)\SDL\Srb2SDL-vc9.pch"
@@ -350,7 +350,7 @@
FavorSizeOrSpeed="1"
OmitFramePointers="true"
AdditionalIncludeDirectories=""$(ProjectDir)..\..\libs\libpng-src";"$(ProjectDir)..\..\libs\zlib""
- PreprocessorDefinitions="NDEBUG;SDLMAIN;NO_STDIO_REDIRECT;USE_WGL_SWAP;DIRECTFULLSCREEN;SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;HAVE_PNG;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
+ PreprocessorDefinitions="NDEBUG;SDLMAIN;NO_STDIO_REDIRECT;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;HAVE_PNG;HAVE_BLUA;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE"
StringPooling="true"
RuntimeLibrary="0"
PrecompiledHeaderFile=".\..\..\objs\VC9\$(Platform)\$(Configuration)\SDL\Srb2SDL-vc9.pch"
diff --git a/src/sdl/Srb2SDL.dsp b/src/sdl/Srb2SDL.dsp
index 02c3b270..879113ca 100644
--- a/src/sdl/Srb2SDL.dsp
+++ b/src/sdl/Srb2SDL.dsp
@@ -45,7 +45,7 @@ MTL=midl.exe
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /G5 /W3 /GX /Zi /Ot /Og /Oi /Op /Oy /Ob1 /I "..\..\libs\libpng-src" /I "..\..\libs\zlib" /D "NDEBUG" /D "SDLMAIN" /D "NO_STDIO_REDIRECT" /D "USE_WGL_SWAP" /D "DIRECTFULLSCREEN" /D "SDL" /D "HWRENDER" /D "HW3SOUND" /D "HAVE_FILTER" /D "HAVE_MIXER" /D "USEASM" /D "HAVE_PNG" /FR /FD /GF /c
+# ADD CPP /nologo /G5 /W3 /GX /Zi /Ot /Og /Oi /Op /Oy /Ob1 /I "..\..\libs\libpng-src" /I "..\..\libs\zlib" /D "NDEBUG" /D "SDLMAIN" /D "NO_STDIO_REDIRECT" /D "USE_WGL_SWAP" /D "DIRECTFULLSCREEN" /D "HAVE_SDL" /D "HWRENDER" /D "HW3SOUND" /D "HAVE_FILTER" /D "HAVE_MIXER" /D "USEASM" /D "HAVE_PNG" /FR /FD /GF /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
# SUBTRACT RSC /x
@@ -72,7 +72,7 @@ LINK32=link.exe
# PROP Target_Dir ""
MTL=midl.exe
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /G6 /W4 /WX /Gm /GX /ZI /Od /Op /I "..\..\libs\libpng-src" /I "..\..\libs\zlib" /D "_DEBUG" /D "USE_WGL_SWAP" /D "DIRECTFULLSCREEN" /D "SDL" /D "HWRENDER" /D "HW3SOUND" /D "HAVE_FILTER" /D "HAVE_MIXER" /D "USEASM" /D "HAVE_PNG" /FR /FD /GZ /c
+# ADD CPP /nologo /G6 /W4 /WX /Gm /GX /ZI /Od /Op /I "..\..\libs\libpng-src" /I "..\..\libs\zlib" /D "_DEBUG" /D "USE_WGL_SWAP" /D "DIRECTFULLSCREEN" /D "HAVE_SDL" /D "HWRENDER" /D "HW3SOUND" /D "HAVE_FILTER" /D "HAVE_MIXER" /D "USEASM" /D "HAVE_PNG" /FR /FD /GZ /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
diff --git a/src/sdl/filter/filters.c b/src/sdl/filter/filters.c
deleted file mode 100644
index 1b2346e8..00000000
--- a/src/sdl/filter/filters.c
+++ /dev/null
@@ -1,1000 +0,0 @@
-#include
-#include "filters.h"
-
-//Alam_GBC: C file based on sms_sdl's filter.c
-
-/* 2X SAI Filter */
-static Uint32 colorMask = 0xF7DEF7DE;
-static Uint32 lowPixelMask = 0x08210821;
-static Uint32 qcolorMask = 0xE79CE79C;
-static Uint32 qlowpixelMask = 0x18631863;
-static Uint32 redblueMask = 0xF81F;
-static Uint32 greenMask = 0x7E0;
-
-SDL_Surface *filter_2x(SDL_Surface *src, SDL_Rect *srcclp, filter_2 filter)
-{
- return filter_2xe(src,srcclp,filter,0,0,0);
-}
-
-SDL_Surface *filter_2xe(SDL_Surface *src, SDL_Rect *srcclp, filter_2 filter,Uint8 R, Uint8 G, Uint8 B)
-{
- SDL_Surface *srcfilter = NULL;
- SDL_Rect dstclp = {0,3,0,0};
- SDL_Surface *dstfilter = NULL;
- Uint32 Fillcolor = 0;
- if(!src || !filter) return NULL; // Need src and filter
- if(srcclp) // size by clp
- {
- dstclp.w = srcclp->w; //clp's width
- dstclp.h = srcclp->h; //clp's height
- }
- else // size by src
- {
- dstclp.w = (Uint16)src->w; //src's width
- dstclp.h = (Uint16)src->h; //src's height
- }
- if(filter == hq2x32 || filter == lq2x32) // src 0888 surface
- srcfilter = SDL_CreateRGBSurface(SDL_SWSURFACE,dstclp.w,dstclp.h+6,32,0x00FF0000,0x0000FF00,0x000000FF,0x00);
- else // src 565 surface
- srcfilter = SDL_CreateRGBSurface(SDL_SWSURFACE,dstclp.w,dstclp.h+6,16,0x0000F800,0x000007E0,0x0000001F,0x00);
- if(!srcfilter) return NULL; //No Memory?
- Fillcolor = SDL_MapRGB(srcfilter->format,R,G,B); //Choose color
- SDL_FillRect(srcfilter,NULL,Fillcolor); //fill it
- if(filter == filter_hq2x || filter == hq2x32 || filter == lq2x32) // dst 0888 surface
- dstfilter = SDL_CreateRGBSurface(SDL_SWSURFACE,dstclp.w*2,dstclp.h*2,32,0x00FF0000,0x0000FF00,0x000000FF,0x00);
- else // dst 565 surface
- dstfilter = SDL_CreateRGBSurface(SDL_SWSURFACE,dstclp.w*2,dstclp.h*2,16,0x0000F800,0x000007E0,0x0000001F,0x00);
- if(!dstfilter || SDL_BlitSurface(src,srcclp,srcfilter,&dstclp) == -1) // No dstfilter or Blit failed
- {
- SDL_FreeSurface(srcfilter); // Free memory
- return NULL; //No Memory?
- }
- else // have dstfilter ready and srcfilter done
- {
- SDL_FillRect(dstfilter,NULL,Fillcolor); //fill it too
- filter(FILTER(srcfilter,dstfilter)); //filtering
- SDL_FreeSurface(srcfilter); //almost
- }
- return dstfilter; //done
-}
-
-
-int filter_init_2xsai(SDL_PixelFormat *BitFormat)
-{
- if (!BitFormat || BitFormat->BytesPerPixel != 2 ||BitFormat->Amask != 0x0)
- {
- return 0;
- }
- else if (BitFormat->Rmask == 0xF800 && BitFormat->Gmask == 0x7E0
- && BitFormat->Bmask == 0x1F && BitFormat->BitsPerPixel == 16) //565
- {
- colorMask = 0xF7DEF7DE;
- lowPixelMask = 0x08210821;
- qcolorMask = 0xE79CE79C;
- qlowpixelMask = 0x18631863;
- redblueMask = 0xF81F;
- greenMask = 0x7E0;
- }
- else if (BitFormat->Rmask == 0x7C00 && BitFormat->Gmask == 0x3E0
- && BitFormat->Bmask == 0x1F && BitFormat->BitsPerPixel == 15) //555
- {
- colorMask = 0x7BDE7BDE;
- lowPixelMask = 0x04210421;
- qcolorMask = 0x739C739C;
- qlowpixelMask = 0x0C630C63;
- redblueMask = 0x7C1F;
- greenMask = 0x3E0;
- }
- else
- {
- return 0;
- }
-#ifdef MMX
- if(BitFormat->Gmask == 0x7E0) Init_2xSaIMMX(565);
- else Init_2xSaIMMX(555);
-#endif
- return 1;
-}
-
-
-FUNCINLINE static ATTRINLINE int GetResult1 (Uint32 A, Uint32 B, Uint32 C, Uint32 D, Uint32 E)
-{
- int x = 0;
- int y = 0;
- int r = 0;
- (void)E;
-
- if (A == C)
- x += 1;
- else if (B == C)
- y += 1;
- if (A == D)
- x += 1;
- else if (B == D)
- y += 1;
- if (x <= 1)
- r += 1;
- if (y <= 1)
- r -= 1;
- return r;
-}
-
-FUNCINLINE static ATTRINLINE int GetResult2 (Uint32 A, Uint32 B, Uint32 C, Uint32 D, Uint32 E)
-{
- int x = 0;
- int y = 0;
- int r = 0;
- (void)E;
-
- if (A == C)
- x += 1;
- else if (B == C)
- y += 1;
- if (A == D)
- x += 1;
- else if (B == D)
- y += 1;
- if (x <= 1)
- r -= 1;
- if (y <= 1)
- r += 1;
- return r;
-}
-
-FUNCINLINE static ATTRINLINE int GetResult (Uint32 A, Uint32 B, Uint32 C, Uint32 D)
-{
- int x = 0;
- int y = 0;
- int r = 0;
-
- if (A == C)
- x += 1;
- else if (B == C)
- y += 1;
- if (A == D)
- x += 1;
- else if (B == D)
- y += 1;
- if (x <= 1)
- r += 1;
- if (y <= 1)
- r -= 1;
- return r;
-}
-
-FUNCINLINE static ATTRINLINE Uint32 INTERPOLATE (Uint32 A, Uint32 B)
-{
- if (A != B)
- {
- return (((A & colorMask) >> 1) + ((B & colorMask) >> 1) +
- (A & B & lowPixelMask));
- }
- else
- return A;
-}
-
-FUNCINLINE static ATTRINLINE Uint32 Q_INTERPOLATE (Uint32 A, Uint32 B, Uint32 C, Uint32 D)
-{
- register Uint32 x = ((A & qcolorMask) >> 2) +
- ((B & qcolorMask) >> 2) +
- ((C & qcolorMask) >> 2) + ((D & qcolorMask) >> 2);
- register Uint32 y = (A & qlowpixelMask) +
- (B & qlowpixelMask) + (C & qlowpixelMask) + (D & qlowpixelMask);
- y = (y >> 2) & qlowpixelMask;
- return x + y;
-}
-
-#define BLUE_MASK565 0x001F001F
-#define RED_MASK565 0xF800F800
-#define GREEN_MASK565 0x07E007E0
-
-#define BLUE_MASK555 0x001F001F
-#define RED_MASK555 0x7C007C00
-#define GREEN_MASK555 0x03E003E0
-
-void filter_super2xsai(Uint8 *srcPtr, Uint32 srcPitch,
- Uint8 *dstPtr, Uint32 dstPitch,
- int width, int height)
-{
- Uint16 *bP;
- Uint8 *dP;
- Uint32 inc_bP;
- Uint32 Nextline = srcPitch >> 1;
-
- Uint32 finish;
- inc_bP = 1;
-
- for (; height; height--)
- {
- bP = (Uint16 *) srcPtr;
- dP = (Uint8 *) dstPtr;
-
- for (finish = width; finish; finish -= inc_bP)
- {
- Uint32 color4, color5, color6;
- Uint32 color1, color2, color3;
- Uint32 colorA0, colorA1, colorA2, colorA3,
- colorB0, colorB1, colorB2, colorB3, colorS1, colorS2;
- Uint32 product1a, product1b, product2a, product2b;
-
-//--------------------------------------- B1 B2
-// 4 5 6 S2
-// 1 2 3 S1
-// A1 A2
-
- colorB0 = *(bP - Nextline - 1);
- colorB1 = *(bP - Nextline);
- colorB2 = *(bP - Nextline + 1);
- colorB3 = *(bP - Nextline + 2);
-
- color4 = *(bP - 1);
- color5 = *(bP);
- color6 = *(bP + 1);
- colorS2 = *(bP + 2);
-
- color1 = *(bP + Nextline - 1);
- color2 = *(bP + Nextline);
- color3 = *(bP + Nextline + 1);
- colorS1 = *(bP + Nextline + 2);
-
- colorA0 = *(bP + Nextline + Nextline - 1);
- colorA1 = *(bP + Nextline + Nextline);
- colorA2 = *(bP + Nextline + Nextline + 1);
- colorA3 = *(bP + Nextline + Nextline + 2);
-
-//--------------------------------------
- if (color2 == color6 && color5 != color3)
- {
- product2b = product1b = color2;
- }
- else if (color5 == color3 && color2 != color6)
- {
- product2b = product1b = color5;
- }
- else if (color5 == color3 && color2 == color6)
- {
- register int r = 0;
-
- r += GetResult (color6, color5, color1, colorA1);
- r += GetResult (color6, color5, color4, colorB1);
- r += GetResult (color6, color5, colorA2, colorS1);
- r += GetResult (color6, color5, colorB2, colorS2);
-
- if (r > 0)
- product2b = product1b = color6;
- else if (r < 0)
- product2b = product1b = color5;
- else
- {
- product2b = product1b = INTERPOLATE (color5, color6);
- }
- }
- else
- {
- if (color6 == color3 && color3 == colorA1
- && color2 != colorA2 && color3 != colorA0)
- product2b =
- Q_INTERPOLATE (color3, color3, color3, color2);
- else if (color5 == color2 && color2 == colorA2
- && colorA1 != color3 && color2 != colorA3)
- product2b =
- Q_INTERPOLATE (color2, color2, color2, color3);
- else
- product2b = INTERPOLATE (color2, color3);
-
- if (color6 == color3 && color6 == colorB1
- && color5 != colorB2 && color6 != colorB0)
- product1b =
- Q_INTERPOLATE (color6, color6, color6, color5);
- else if (color5 == color2 && color5 == colorB2
- && colorB1 != color6 && color5 != colorB3)
- product1b =
- Q_INTERPOLATE (color6, color5, color5, color5);
- else
- product1b = INTERPOLATE (color5, color6);
- }
-
- if (color5 == color3 && color2 != color6 && color4 == color5
- && color5 != colorA2)
- product2a = INTERPOLATE (color2, color5);
- else
- if (color5 == color1 && color6 == color5
- && color4 != color2 && color5 != colorA0)
- product2a = INTERPOLATE (color2, color5);
- else
- product2a = color2;
-
- if (color2 == color6 && color5 != color3 && color1 == color2
- && color2 != colorB2)
- product1a = INTERPOLATE (color2, color5);
- else
- if (color4 == color2 && color3 == color2
- && color1 != color5 && color2 != colorB0)
- product1a = INTERPOLATE (color2, color5);
- else
- product1a = color5;
-
-#ifdef LSB_FIRST
- product1a = product1a | (product1b << 16);
- product2a = product2a | (product2b << 16);
-#else
- product1a = (product1a << 16) | product1b;
- product2a = (product2a << 16) | product2b;
-#endif
- *((Uint32 *) dP) = product1a;
- *((Uint32 *) (dP + dstPitch)) = product2a;
-
- bP += inc_bP;
- dP += sizeof (Uint32);
- } // end of for ( finish= width etc..)
-
- srcPtr += srcPitch;
- dstPtr += dstPitch * 2;
- } // endof: for (; height; height--)
-}
-
-void filter_supereagle(Uint8 *srcPtr, Uint32 srcPitch, /* Uint8 *deltaPtr, */
- Uint8 *dstPtr, Uint32 dstPitch, int width, int height)
-{
- Uint8 *dP;
- Uint16 *bP;
- Uint32 inc_bP;
-
-
-
- Uint32 finish;
- Uint32 Nextline = srcPitch >> 1;
-
- inc_bP = 1;
-
- for (; height ; height--)
- {
- bP = (Uint16 *) srcPtr;
- dP = dstPtr;
- for (finish = width; finish; finish -= inc_bP)
- {
- Uint32 color4, color5, color6;
- Uint32 color1, color2, color3;
- Uint32 colorA1, colorA2, colorB1, colorB2, colorS1, colorS2;
- Uint32 product1a, product1b, product2a, product2b;
- colorB1 = *(bP - Nextline);
- colorB2 = *(bP - Nextline + 1);
-
- color4 = *(bP - 1);
- color5 = *(bP);
- color6 = *(bP + 1);
- colorS2 = *(bP + 2);
-
- color1 = *(bP + Nextline - 1);
- color2 = *(bP + Nextline);
- color3 = *(bP + Nextline + 1);
- colorS1 = *(bP + Nextline + 2);
-
- colorA1 = *(bP + Nextline + Nextline);
- colorA2 = *(bP + Nextline + Nextline + 1);
- // --------------------------------------
- if (color2 == color6 && color5 != color3)
- {
- product1b = product2a = color2;
- if ((color1 == color2) || (color6 == colorB2))
- {
- product1a = INTERPOLATE (color2, color5);
- product1a = INTERPOLATE (color2, product1a);
-// product1a = color2;
- }
- else
- {
- product1a = INTERPOLATE (color5, color6);
- }
-
- if ((color6 == colorS2) || (color2 == colorA1))
- {
- product2b = INTERPOLATE (color2, color3);
- product2b = INTERPOLATE (color2, product2b);
-// product2b = color2;
- }
- else
- {
- product2b = INTERPOLATE (color2, color3);
- }
- }
- else if (color5 == color3 && color2 != color6)
- {
- product2b = product1a = color5;
-
- if ((colorB1 == color5) || (color3 == colorS1))
- {
- product1b = INTERPOLATE (color5, color6);
- product1b = INTERPOLATE (color5, product1b);
-// product1b = color5;
- }
- else
- {
- product1b = INTERPOLATE (color5, color6);
- }
-
- if ((color3 == colorA2) || (color4 == color5))
- {
- product2a = INTERPOLATE (color5, color2);
- product2a = INTERPOLATE (color5, product2a);
-// product2a = color5;
- }
- else
- {
- product2a = INTERPOLATE (color2, color3);
- }
-
- }
- else if (color5 == color3 && color2 == color6)
- {
- register int r = 0;
-
- r += GetResult (color6, color5, color1, colorA1);
- r += GetResult (color6, color5, color4, colorB1);
- r += GetResult (color6, color5, colorA2, colorS1);
- r += GetResult (color6, color5, colorB2, colorS2);
-
- if (r > 0)
- {
- product1b = product2a = color2;
- product1a = product2b = INTERPOLATE (color5, color6);
- }
- else if (r < 0)
- {
- product2b = product1a = color5;
- product1b = product2a = INTERPOLATE (color5, color6);
- }
- else
- {
- product2b = product1a = color5;
- product1b = product2a = color2;
- }
- }
- else
- {
- product2b = product1a = INTERPOLATE (color2, color6);
- product2b =
- Q_INTERPOLATE (color3, color3, color3, product2b);
- product1a =
- Q_INTERPOLATE (color5, color5, color5, product1a);
-
- product2a = product1b = INTERPOLATE (color5, color3);
- product2a =
- Q_INTERPOLATE (color2, color2, color2, product2a);
- product1b =
- Q_INTERPOLATE (color6, color6, color6, product1b);
-
-// product1a = color5;
-// product1b = color6;
-// product2a = color2;
-// product2b = color3;
- }
-#ifdef LSB_FIRST
- product1a = product1a | (product1b << 16);
- product2a = product2a | (product2b << 16);
-#else
- product1a = (product1a << 16) | product1b;
- product2a = (product2a << 16) | product2b;
-#endif
-
- *((Uint32 *) dP) = product1a;
- *((Uint32 *) (dP + dstPitch)) = product2a;
-
- bP += inc_bP;
- dP += sizeof (Uint32);
- } // end of for ( finish= width etc..)
- srcPtr += srcPitch;
- dstPtr += dstPitch * 2;
- } // endof: for (height; height; height--)
-}
-
-void filter_2xsai (Uint8 *srcPtr, Uint32 srcPitch,
- Uint8 *dstPtr, Uint32 dstPitch, int width, int height)
-{
- Uint8 *dP;
- Uint16 *bP;
- Uint32 inc_bP;
-
-
- Uint32 finish;
- Uint32 Nextline = srcPitch >> 1;
- inc_bP = 1;
-
-
- for (; height; height--)
- {
- bP = (Uint16 *) srcPtr;
- dP = dstPtr;
-
- for (finish = width; finish; finish -= inc_bP)
- {
-
- register Uint32 colorA, colorB;
- Uint32 colorC, colorD,
- colorE, colorF, colorG, colorH,
- colorI, colorJ, colorK, colorL,
-
- colorM, colorN, colorO, colorP;
- Uint32 product, product1, product2;
-
-//---------------------------------------
-// Map of the pixels: I|E F|J
-// G|A B|K
-// H|C D|L
-// M|N O|P
- colorI = *(bP - Nextline - 1);
- colorE = *(bP - Nextline);
- colorF = *(bP - Nextline + 1);
- colorJ = *(bP - Nextline + 2);
-
- colorG = *(bP - 1);
- colorA = *(bP);
- colorB = *(bP + 1);
- colorK = *(bP + 2);
-
- colorH = *(bP + Nextline - 1);
- colorC = *(bP + Nextline);
- colorD = *(bP + Nextline + 1);
- colorL = *(bP + Nextline + 2);
-
- colorM = *(bP + Nextline + Nextline - 1);
- colorN = *(bP + Nextline + Nextline);
- colorO = *(bP + Nextline + Nextline + 1);
- colorP = *(bP + Nextline + Nextline + 2);
-
- if ((colorA == colorD) && (colorB != colorC))
- {
- if (((colorA == colorE) && (colorB == colorL)) ||
- ((colorA == colorC) && (colorA == colorF)
- && (colorB != colorE) && (colorB == colorJ)))
- {
- product = colorA;
- }
- else
- {
- product = INTERPOLATE (colorA, colorB);
- }
-
- if (((colorA == colorG) && (colorC == colorO)) ||
- ((colorA == colorB) && (colorA == colorH)
- && (colorG != colorC) && (colorC == colorM)))
- {
- product1 = colorA;
- }
- else
- {
- product1 = INTERPOLATE (colorA, colorC);
- }
- product2 = colorA;
- }
- else if ((colorB == colorC) && (colorA != colorD))
- {
- if (((colorB == colorF) && (colorA == colorH)) ||
- ((colorB == colorE) && (colorB == colorD)
- && (colorA != colorF) && (colorA == colorI)))
- {
- product = colorB;
- }
- else
- {
- product = INTERPOLATE (colorA, colorB);
- }
-
- if (((colorC == colorH) && (colorA == colorF)) ||
- ((colorC == colorG) && (colorC == colorD)
- && (colorA != colorH) && (colorA == colorI)))
- {
- product1 = colorC;
- }
- else
- {
- product1 = INTERPOLATE (colorA, colorC);
- }
- product2 = colorB;
- }
- else if ((colorA == colorD) && (colorB == colorC))
- {
- if (colorA == colorB)
- {
- product = colorA;
- product1 = colorA;
- product2 = colorA;
- }
- else
- {
- register int r = 0;
-
- product1 = INTERPOLATE (colorA, colorC);
- product = INTERPOLATE (colorA, colorB);
-
- r +=
- GetResult1 (colorA, colorB, colorG, colorE,
- colorI);
- r +=
- GetResult2 (colorB, colorA, colorK, colorF,
- colorJ);
- r +=
- GetResult2 (colorB, colorA, colorH, colorN,
- colorM);
- r +=
- GetResult1 (colorA, colorB, colorL, colorO,
- colorP);
-
- if (r > 0)
- product2 = colorA;
- else if (r < 0)
- product2 = colorB;
- else
- {
- product2 =
- Q_INTERPOLATE (colorA, colorB, colorC,
- colorD);
- }
- }
- }
- else
- {
- product2 = Q_INTERPOLATE (colorA, colorB, colorC, colorD);
-
- if ((colorA == colorC) && (colorA == colorF)
- && (colorB != colorE) && (colorB == colorJ))
- {
- product = colorA;
- }
- else
- if ((colorB == colorE) && (colorB == colorD)
- && (colorA != colorF) && (colorA == colorI))
- {
- product = colorB;
- }
- else
- {
- product = INTERPOLATE (colorA, colorB);
- }
-
- if ((colorA == colorB) && (colorA == colorH)
- && (colorG != colorC) && (colorC == colorM))
- {
- product1 = colorA;
- }
- else
- if ((colorC == colorG) && (colorC == colorD)
- && (colorA != colorH) && (colorA == colorI))
- {
- product1 = colorC;
- }
- else
- {
- product1 = INTERPOLATE (colorA, colorC);
- }
- }
-#ifdef LSB_FIRST
- product = colorA | (product << 16);
- product1 = product1 | (product2 << 16);
-#else
- product = (colorA << 16) | product;
- product1 = (product1 << 16) | product2;
-#endif
- *((Uint32 *) dP) = product;
- *((Uint32 *) (dP + dstPitch)) = product1;
-
- bP += inc_bP;
- dP += sizeof (Uint32);
- } // end of for ( finish= width etc..)
-
- srcPtr += srcPitch;
- dstPtr += dstPitch * 2;
- } // endof: for (height; height; height--)
-}
-
-#if 0
-static inline Uint32 Bilinear(Uint32 A, Uint32 B, Uint32 x)
-{
- unsigned long areaA, areaB;
- unsigned long result;
-
- if (A == B)
- return A;
-
- areaB = (x >> 11) & 0x1f; // reduce 16 bit fraction to 5 bits
- areaA = 0x20 - areaB;
-
- A = (A & redblueMask) | ((A & greenMask) << 16);
- B = (B & redblueMask) | ((B & greenMask) << 16);
-
- result = ((areaA * A) + (areaB * B)) >> 5;
-
- return (result & redblueMask) | ((result >> 16) & greenMask);
-
-}
-
-static inline Uint32 Bilinear4 (Uint32 A, Uint32 B, Uint32 C, Uint32 D, Uint32 x,
- Uint32 y)
-{
- unsigned long areaA, areaB, areaC, areaD;
- unsigned long result, xy;
-
- x = (x >> 11) & 0x1f;
- y = (y >> 11) & 0x1f;
- xy = (x * y) >> 5;
-
- A = (A & redblueMask) | ((A & greenMask) << 16);
- B = (B & redblueMask) | ((B & greenMask) << 16);
- C = (C & redblueMask) | ((C & greenMask) << 16);
- D = (D & redblueMask) | ((D & greenMask) << 16);
-
- areaA = 0x20 + xy - x - y;
- areaB = x - xy;
- areaC = y - xy;
- areaD = xy;
-
- result = ((areaA * A) + (areaB * B) + (areaC * C) + (areaD * D)) >> 5;
-
- return (result & redblueMask) | ((result >> 16) & greenMask);
-}
-#endif
-
-
-void filter_advmame2x(Uint8 *srcPtr, Uint32 srcPitch,
- Uint8 *dstPtr, Uint32 dstPitch,
- int width, int height)
-{
- unsigned int nextlineSrc = srcPitch / sizeof(short);
- short *p = (short *)srcPtr;
-
- unsigned int nextlineDst = dstPitch / sizeof(short);
- short *q = (short *)dstPtr;
-
- while(height--) {
- int i = 0, j = 0;
- for(i = 0; i < width; ++i, j += 2) {
- short B = *(p + i - nextlineSrc);
- short D = *(p + i - 1);
- short E = *(p + i);
- short F = *(p + i + 1);
- short H = *(p + i + nextlineSrc);
-
- *(q + j) = (short)(D == B && B != F && D != H ? D : E);
- *(q + j + 1) = (short)(B == F && B != D && F != H ? F : E);
- *(q + j + nextlineDst) = (short)(D == H && D != B && H != F ? D : E);
- *(q + j + nextlineDst + 1) = (short)(H == F && D != H && B != F ? F : E);
- }
- p += nextlineSrc;
- q += nextlineDst << 1;
- }
-}
-
-
-void filter_tv2x(Uint8 *srcPtr, Uint32 srcPitch,
- Uint8 *dstPtr, Uint32 dstPitch,
- int width, int height)
-{
- unsigned int nextlineSrc = srcPitch / sizeof(Uint16);
- Uint16 *p = (Uint16 *)srcPtr;
-
- unsigned int nextlineDst = dstPitch / sizeof(Uint16);
- Uint16 *q = (Uint16 *)dstPtr;
-
- while(height--) {
- int i = 0, j = 0;
- for(; i < width; ++i, j += 2) {
- Uint16 p1 = *(p + i);
- Uint32 pi;
-
- pi = (((p1 & redblueMask) * 7) >> 3) & redblueMask;
- pi |= (((p1 & greenMask) * 7) >> 3) & greenMask;
-
- *(q + j) = (Uint16)p1;
- *(q + j + 1) = (Uint16)p1;
- *(q + j + nextlineDst) = (Uint16)pi;
- *(q + j + nextlineDst + 1) = (Uint16)pi;
- }
- p += nextlineSrc;
- q += nextlineDst << 1;
- }
-}
-
-void filter_normal2x(Uint8 *srcPtr, Uint32 srcPitch,
- Uint8 *dstPtr, Uint32 dstPitch,
- int width, int height)
-{
- unsigned int nextlineSrc = srcPitch / sizeof(Uint16);
- Uint16 *p = (Uint16 *)srcPtr;
-
- unsigned int nextlineDst = dstPitch / sizeof(Uint16);
- Uint16 *q = (Uint16 *)dstPtr;
-
- while(height--) {
- int i = 0, j = 0;
- for(; i < width; ++i, j += 2) {
- Uint16 color = *(p + i);
-
- *(q + j) = color;
- *(q + j + 1) = color;
- *(q + j + nextlineDst) = color;
- *(q + j + nextlineDst + 1) = color;
- }
- p += nextlineSrc;
- q += nextlineDst << 1;
- }
-}
-
-void filter_scan50(Uint8 *srcPtr, Uint32 srcPitch,
- Uint8 *dstPtr, Uint32 dstPitch,
- int width, int height)
-{
-
- unsigned int nextlineSrc = srcPitch / sizeof(Uint16);
- Uint16 *p = (Uint16 *)srcPtr;
-
- unsigned int nextlineDst = dstPitch / sizeof(Uint16);
- Uint16 *q = (Uint16 *)dstPtr;
-
- while(height--) {
- int i = 0, j = 0;
- for(; i < width; ++i, j += 2) {
- Uint16 p1 = *(p + i);
- Uint16 p2 = *(p + i + nextlineSrc);
- // 0111 1011 1110 1111 == 0x7BEF
- Uint16 pm = (Uint16)(((p1 + p2) >> 2) & 0x7BEF);
-
- *(q + j) = p1;
- *(q + j + 1) = p1;
- *(q + j + nextlineDst) = pm;
- *(q + j + nextlineDst + 1) = pm;
-
- }
- p += nextlineSrc;
- q += nextlineDst << 1;
- }
-}
-
-
-void filter_scan100(Uint8 *srcPtr, Uint32 srcPitch,
- Uint8 *dstPtr, Uint32 dstPitch,
- int width, int height)
-{
- unsigned int nextlineSrc = srcPitch / sizeof(Uint16);
- Uint16 *p = (Uint16 *)srcPtr;
-
- unsigned int nextlineDst = dstPitch / sizeof(Uint16);
- Uint16 *q = (Uint16 *)dstPtr;
-
- while(height--) {
- int i = 0, j = 0;
- for(; i < width; ++i, j += 2) {
- *(q + j) = *(q + j + 1) = *(p + i);
- }
- p += nextlineSrc;
- q += nextlineDst << 1;
- }
-}
-
-
-FUNCINLINE static ATTRINLINE Uint16 DOT_16(Uint16 c, int j, int i) {
- static const Uint16 dotmatrix[16] = {
- 0x01E0, 0x0007, 0x3800, 0x0000,
- 0x39E7, 0x0000, 0x39E7, 0x0000,
- 0x3800, 0x0000, 0x01E0, 0x0007,
- 0x39E7, 0x0000, 0x39E7, 0x0000
- };
- return (Uint16)(c - ((c >> 2) & *(dotmatrix + ((j & 3) << 2) + (i & 3))));
-}
-
-void filter_dotmatrix(Uint8 *srcPtr, Uint32 srcPitch,
- Uint8 *dstPtr, Uint32 dstPitch,
- int width, int height)
-{
- unsigned int nextlineSrc = srcPitch / sizeof(Uint16);
- Uint16 *p = (Uint16 *)srcPtr;
-
- unsigned int nextlineDst = dstPitch / sizeof(Uint16);
- Uint16 *q = (Uint16 *)dstPtr;
-
- int i, ii, j, jj;
- for(j = 0, jj = 0; j < height; ++j, jj += 2) {
- for(i = 0, ii = 0; i < width; ++i, ii += 2) {
- Uint16 c = *(p + i);
- *(q + ii) = DOT_16(c, jj, ii);
- *(q + ii + 1) = DOT_16(c, jj, ii + 1);
- *(q + ii + nextlineDst) = DOT_16(c, jj + 1, ii);
- *(q + ii + nextlineDst + 1) = DOT_16(c, jj + 1, ii + 1);
- }
- p += nextlineSrc;
- q += nextlineDst << 1;
- }
-}
-
-
-void filter_bilinear(Uint8 *srcPtr, Uint32 srcPitch,
- Uint8 *dstPtr, Uint32 dstPitch,
- int width, int height)
-{
- unsigned int nextlineSrc = srcPitch / sizeof(Uint16);
- Uint16 *p = (Uint16 *)srcPtr;
- unsigned int nextlineDst = dstPitch / sizeof(Uint16);
- Uint16 *q = (Uint16 *)dstPtr;
-
- while(height--) {
- int i, ii;
- for(i = 0, ii = 0; i < width; ++i, ii += 2) {
- Uint16 A = *(p + i);
- Uint16 B = *(p + i + 1);
- Uint16 C = *(p + i + nextlineSrc);
- Uint16 D = *(p + i + nextlineSrc + 1);
- *(q + ii) = A;
- *(q + ii + 1) = (Uint16)INTERPOLATE(A, B);
- *(q + ii + nextlineDst) = (Uint16)INTERPOLATE(A, C);
- *(q + ii + nextlineDst + 1) = (Uint16)Q_INTERPOLATE(A, B, C, D);
- }
- p += nextlineSrc;
- q += nextlineDst << 1;
- }
-}
-
-
-// NEED_OPTIMIZE
-static void MULT(Uint16 c, float* r, float* g, float* b, float alpha) {
- *r += alpha * ((c & RED_MASK565 ) >> 11);
- *g += alpha * ((c & GREEN_MASK565) >> 5);
- *b += alpha * ((c & BLUE_MASK565 ) >> 0);
-}
-
-static Uint16 MAKE_RGB565(float r, float g, float b) {
- return (Uint16)
- (((((Uint8)r) << 11) & RED_MASK565 ) |
- ((((Uint8)g) << 5) & GREEN_MASK565) |
- ((((Uint8)b) << 0) & BLUE_MASK565 ));
-}
-
-FUNCINLINE static ATTRINLINE float CUBIC_WEIGHT(float x) {
- // P(x) = { x, x>0 | 0, x<=0 }
- // P(x + 2) ^ 3 - 4 * P(x + 1) ^ 3 + 6 * P(x) ^ 3 - 4 * P(x - 1) ^ 3
- double r = 0.;
- if(x + 2 > 0) r += pow(x + 2, 3);
- if(x + 1 > 0) r += -4 * pow(x + 1, 3);
- if(x > 0) r += 6 * pow(x , 3);
- if(x - 1 > 0) r += -4 * pow(x - 1, 3);
- return (float)r / 6;
-}
-
-void filter_bicubic(Uint8 *srcPtr, Uint32 srcPitch,
- Uint8 *dstPtr, Uint32 dstPitch,
- int width, int height)
-{
- unsigned int nextlineSrc = srcPitch / sizeof(Uint16);
- Uint16 *p = (Uint16 *)srcPtr;
- unsigned int nextlineDst = dstPitch / sizeof(Uint16);
- Uint16 *q = (Uint16 *)dstPtr;
- int dx = width << 1, dy = height << 1;
- float fsx = (float)width / dx;
- float fsy = (float)height / dy;
- float v = 0.0f;
- int j = 0;
- for(; j < dy; ++j) {
- float u = 0.0f;
- int iv = (int)v;
- float decy = v - iv;
- int i = 0;
- for(; i < dx; ++i) {
- int iu = (int)u;
- float decx = u - iu;
- float r, g, b;
- int m;
- r = g = b = 0.;
- for(m = -1; m <= 2; ++m) {
- float r1 = CUBIC_WEIGHT(decy - m);
- int n;
- for(n = -1; n <= 2; ++n) {
- float r2 = CUBIC_WEIGHT(n - decx);
- Uint16* pIn = p + (iu + n) + (iv + m) * nextlineSrc;
- MULT(*pIn, &r, &g, &b, r1 * r2);
- }
- }
- *(q + i) = MAKE_RGB565(r, g, b);
- u += fsx;
- }
- q += nextlineDst;
- v += fsy;
- }
-}
diff --git a/src/sdl/filter/filters.h b/src/sdl/filter/filters.h
deleted file mode 100644
index c4a84b4c..00000000
--- a/src/sdl/filter/filters.h
+++ /dev/null
@@ -1,212 +0,0 @@
-#ifndef __FILTERS_H__
-#define __FILTERS_H__
-
-#ifdef _MSC_VER
-#pragma warning(disable : 4514 4214 4244)
-#endif
-
-#include "SDL.h"
-
-#ifdef _MSC_VER
-#pragma warning(default : 4214 4244)
-#endif
-
-typedef enum {
- FILTER_2XSAI = 0,
- FILTER_SUPER2XSAI,
- FILTER_SUPEREAGLE,
- FILTER_ADVMAME2X ,
- FILTER_TV2X ,
- FILTER_NORMAL2X ,
- FILTER_BILINEAR ,
- FILTER_DOTMATRIX ,
- FILTER_NUM ,
-} t_filter;
-
-typedef void (*filter_2)(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height);
-SDL_Surface *filter_2x(SDL_Surface *src, SDL_Rect *srcclp, filter_2 filter);
-SDL_Surface *filter_2xe(SDL_Surface *src, SDL_Rect *srcclp, filter_2 filter,Uint8 R, Uint8 G, Uint8 B);
-//Alam_GBC: Header file based on sms_sdl's filter.h
-//Note: need 3 lines at the bottom and top?
-
-//int filter_init_2xsai(SDL_PixelFormat *BitFormat);
-#define FILTER(src,dst) (Uint8 *)(src->pixels)+src->pitch*3, (Uint32)src->pitch, (Uint8 *)dst->pixels, (Uint32)dst->pitch, src->w, src->h-6
-#define SDLFILTER(src,dst) (Uint8 *)src->pixels, (Uint32)src->pitch, (Uint8 *)dst->pixels, (Uint32)dst->pitch, src->w, src->h
-int filter_init_2xsai(SDL_PixelFormat *BitFormat); //unless?
-void filter_scan50(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height);
-void filter_scan100(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height);
-
-void filter_2xsai(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height);
-void filter_super2xsai(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height);
-void filter_supereagle(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height);
-void filter_advmame2x(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height);
-void filter_tv2x(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height);
-void filter_normal2x(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height);
-void filter_bilinear(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height);
-void filter_dotmatrix(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height);
-void filter_bicubic(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height);
-void lq2x16(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height);
-void hq2x16(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height);
-
-void filter_hq2x(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height);
-void lq2x32(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height);
-void hq2x32(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height);
-
-#ifdef FILTERS
-typedef struct filter_s { filter_2 filter; int bpp; } filter_t;
-#define NUMFILTERS 13
-static filter_t filtermode[NUMFILTERS+1] = {
- {NULL , 0}, //None
- {filter_normal2x , 16}, //2xNormal
- {filter_advmame2x , 16}, //AdvMAME2x
- {filter_tv2x , 16}, //TV2x
- {filter_bilinear , 16}, //Bilinear
- {filter_dotmatrix , 16}, //DotMatrix
- {lq2x16 , 16}, //16LQ2x
- {hq2x16 , 16}, //16HQ2x
- {lq2x32 , 32}, //32LQ2x
- {hq2x32 , 32}, //32HQ2x
-// {filter_bicubic , 16}, //Slow Bicubic
- // BAD
- {filter_2xsai , 16}, //2xSAI
- {filter_super2xsai, 16}, //Super2xSAI
- {filter_supereagle, 16}, //SuperEagle
-};
-CV_PossibleValue_t CV_Filters[] = {{ 0, "None"}, { 1, "2xNormal"},
- { 2, "AdvMAME2x"}, { 3, "TV2x"}, { 4, "Bilinear"} , { 5, "DotMatrix"},
- { 6, "16LQ2x"}, { 7, "16HQ2x"}, { 8, "32LQ2x"} , { 9, "32HQ2x"},
- {10, "2xSAI"}, {11, "Super2xSAI"}, {12, "SuperEagle"}, {0, NULL},};
-static void Filterchange(void);
-consvar_t cv_filter = {"filter", "None", CV_CALL|CV_NOINIT, CV_Filters,Filterchange,0,NULL,NULL,0,0,NULL};
-static filter_2 blitfilter = NULL;
-static SDL_Surface *preSurface = NULL;
-static SDL_Surface *f2xSurface = NULL;
-
-static void Filterchange(void)
-{
- if(blitfilter) // only filtering?
- {
- int i=0;
- for(;i < NUMFILTERS; i++)//find old filter
- {
- if(filtermode[i].filter == blitfilter) //Found it
- break; //Stop
- }
- if(i < NUMFILTERS && filtermode[i].bpp == filtermode[cv_filter.value].bpp) //Easy to swap?
- blitfilter = filtermode[cv_filter.value].filter; // Swap with new filter
- }
-}
-
-FUNCINLINE static ATTRINLINE void FilterBlit(SDL_Surface *froSurface)
-{
- if(froSurface && blitfilter && preSurface && f2xSurface)
- {
- SDL_Rect dstclp = {0,3,0,0};
- int lockedpre = 0, lockedf2x = 0, blitpre = 0;
- blitpre = SDL_BlitSurface(froSurface,NULL,preSurface,&dstclp);
- if(SDL_MUSTLOCK(preSurface)) lockedpre = SDL_LockSurface(preSurface);
- if(SDL_MUSTLOCK(f2xSurface)) lockedf2x = SDL_LockSurface(f2xSurface);
- if(lockedpre == 0 && preSurface->pixels && lockedf2x == 0 && f2xSurface->pixels && blitpre == 0)
- {
- blitfilter(FILTER(preSurface,f2xSurface));
- if(SDL_MUSTLOCK(preSurface)) SDL_UnlockSurface(preSurface);
- if(SDL_MUSTLOCK(f2xSurface)) SDL_UnlockSurface(f2xSurface);
- }
- }
- else
- {
- blitfilter = NULL;
- if(preSurface) SDL_FreeSurface(preSurface);
- preSurface = NULL;
- if(f2xSurface) SDL_FreeSurface(f2xSurface);
- f2xSurface = NULL;
- }
-}
-
-FUNCINLINE static ATTRINLINE int Setupf2x(int width, int height, int bpp)
-{
- blitfilter = NULL;
- if(preSurface) SDL_FreeSurface(preSurface);
- preSurface = NULL;
- if(f2xSurface) SDL_FreeSurface(f2xSurface);
- f2xSurface = NULL;
- if( !(width%2) && !(height%2) && width >= BASEVIDWIDTH*2 && height >= BASEVIDHEIGHT*2 && cv_filter.value
- && cv_filter.value <= NUMFILTERS && filtermode[cv_filter.value].filter && filtermode[cv_filter.value].bpp)
- {
- int hwidth = width/2 + 6;
- int heighth = height/2 + 6;
- int hbpp = filtermode[cv_filter.value].bpp;
- switch(hbpp)
- {
- case 8:
- preSurface = SDL_CreateRGBSurface(SDL_SWSURFACE,hwidth,heighth, 8,0x00000000,0x00000000,0x00000000,0x00);
- f2xSurface = SDL_CreateRGBSurface(SDL_HWSURFACE, width,height , 8,0x00000000,0x00000000,0x00000000,0x00);
- case 15:
- preSurface = SDL_CreateRGBSurface(SDL_SWSURFACE,hwidth,heighth,15,0x00007C00,0x000003E0,0x0000001F,0x00);
- f2xSurface = SDL_CreateRGBSurface(SDL_HWSURFACE, width,height ,15,0x00007C00,0x000003E0,0x0000001F,0x00);
- break;
- case 16:
- preSurface = SDL_CreateRGBSurface(SDL_SWSURFACE,hwidth,heighth,16,0x0000F800,0x000007E0,0x0000001F,0x00);
- f2xSurface = SDL_CreateRGBSurface(SDL_HWSURFACE, width,height ,16,0x0000F800,0x000007E0,0x0000001F,0x00);
- break;
- case 24:
- preSurface = SDL_CreateRGBSurface(SDL_SWSURFACE,hwidth,heighth,24,0x00FF0000,0x0000FF00,0x000000FF,0x00);
- f2xSurface = SDL_CreateRGBSurface(SDL_HWSURFACE, width,height ,24,0x00FF0000,0x0000FF00,0x000000FF,0x00);
- break;
- case 32:
- preSurface = SDL_CreateRGBSurface(SDL_SWSURFACE,hwidth,heighth,32,0x00FF0000,0x0000FF00,0x000000FF,0x00);
- f2xSurface = SDL_CreateRGBSurface(SDL_HWSURFACE, width,height ,32,0x00FF0000,0x0000FF00,0x000000FF,0x00);
- break;
- default:
- //I_Error("Filter help");
- break;
- }
- if(preSurface && f2xSurface)
- {
- blitfilter = filtermode[cv_filter.value].filter;
- if(bpp < hbpp) bpp = hbpp;
- }
- else
- {
- if(preSurface) SDL_FreeSurface(preSurface);
- preSurface = NULL;
- if(f2xSurface) SDL_FreeSurface(f2xSurface);
- f2xSurface = NULL;
- }
- }
- return bpp;
-}
-#else
-
-#ifdef __GNUC__ // __attribute__ ((X))
-#if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
-#define FUNCINLINE __attribute__((always_inline))
-#endif
-#define FUNCNOINLINE __attribute__((noinline))
-#elif defined(_MSC_VER)
-#define inline __inline
-#define ATTRNORETURN __declspec(noreturn)
-#define ATTRINLINE __forceinline
-#if _MSC_VER > 1200
-#define ATTRNOINLINE __declspec(noinline)
-#endif
-#endif
-
-
-
-#ifndef FUNCINLINE
-#define FUNCINLINE
-#endif
-#ifndef FUNCNOINLINE
-#define FUNCNOINLINE
-#endif
-#ifndef ATTRINLINE
-#define ATTRINLINE inline
-#endif
-#ifndef ATTRNOINLINE
-#define ATTRNOINLINE
-#endif
-
-#endif
-
-#endif
diff --git a/src/sdl/filter/hq2x.c b/src/sdl/filter/hq2x.c
deleted file mode 100644
index acdbcb16..00000000
--- a/src/sdl/filter/hq2x.c
+++ /dev/null
@@ -1,3125 +0,0 @@
-//hq2x filter demo program
-//----------------------------------------------------------
-//Copyright (C) 2003 MaxSt ( maxst@hiend3d.com )
-
-//This program is free software; you can redistribute it and/or
-//modify it under the terms of the GNU Lesser General Public
-//License as published by the Free Software Foundation; either
-//version 2.1 of the License, or (at your option) any later version.
-//
-//This program is distributed in the hope that it will be useful,
-//but WITHOUT ANY WARRANTY; without even the implied warranty of
-//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-//Lesser General Public License for more details.
-//
-//You should have received a copy of the GNU Lesser General Public
-//License along with this program; if not, write to the Free Software
-//Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-#include "filters.h"
-#include
-#ifdef __GNUC__
-#include
-#endif
-
-
-#if (defined(__GNUC__) && defined(__i386__)) || (defined(_MSC_VER) && defined(_X86_))
-#define HQ2XASM
-#endif
-
-#ifdef _MSC_VER
-//#define HQ2XMMXASM
-#endif
-
-static int LUT16to32[65536];
-static int RGBtoYUV[65536];
-#ifdef HQ2XMMXASM
-#include "SDL_cpuinfo.h"
-static SDL_bool hasMMX = 0;
-const Sint64 reg_blank = 0;
-const Sint64 const3 = 0x0000000300030003;
-const Sint64 const5 = 0x0000000500050005;
-const Sint64 const6 = 0x0000000600060006;
-const Sint64 const14 = 0x0000000E000E000E;
-const Sint64 tr3eshold = 0x0000000000300706;
-#endif
-static int YUV1, YUV2;
-const int Ymask = 0x00FF0000;
-const int Umask = 0x0000FF00;
-const int Vmask = 0x000000FF;
-const int trY = 0x00300000;
-const int trU = 0x00000700;
-const int trV = 0x00000006;
-
-FUNCINLINE static ATTRINLINE void Interp1(Uint8 * pc, int c1, int c2)
-{
-#ifdef HQ2XASM
- //*((int*)pc) = (c1*3+c2)/4;
-#ifdef __GNUC__
- int c3 = c1;
- __asm__("shl $2, %1; add %2, %1; sub %3, %1; shr $2, %1":"=d"(*((int*)pc)):"d"(c1),"r"(c2),"r"(c3):"memory");
-#else
- __asm
- {
- mov eax, pc
- mov edx, c1
- shl edx, 2
- add edx, c2
- sub edx, c1
- shr edx, 2
- mov [eax], edx
- }
-#endif
-#else
- *((int*)pc) = (c1*3+c2) >> 2;
-#endif
-}
-
-FUNCINLINE static ATTRINLINE void Interp2(Uint8 * pc, int c1, int c2, int c3)
-{
-#ifdef HQ2XASM
-// *((int*)pc) = (c1*2+c2+c3) >> 2;
-#ifdef __GNUC__
- __asm__("shl $1, %1; add %2, %1; add %3, %1; shr $2, %1":"=d"(*((int*)pc)):"d"(c1),"r"(c2),"r"(c3):"memory");
-#else
- __asm
- {
- mov eax, pc
- mov edx, c1
- shl edx, 1
- add edx, c2
- add edx, c3
- shr edx, 2
- mov [eax], edx
- }
-#endif
-#else
- *((int*)pc) = (c1*2+c2+c3) >> 2;
-#endif
-}
-
-#if 0
-static inline void Interp5(Uint8 * pc, int c1, int c2)
-{
-#ifdef HQ2XASM
- //*((int*)pc) = (c1+c2)/2;
-#ifdef __GNUC__
- __asm__("add %2, %1; shr $1, %1":"=d"(*((int*)pc)):"d"(c1),"r"(c2):"memory");
-#else
- __asm
- {
- mov eax, pc
- mov edx, c1
- add edx, c2
- shr edx, 1
- mov [eax], edx
- }
-#endif
-#else
- *((int*)pc) = (c1+c2) >> 1;
-#endif
-}
-#endif
-
-FUNCINLINE static ATTRINLINE void Interp6(Uint8 * pc, int c1, int c2, int c3)
-{
-#ifdef HQ2XMMXASM
- //*((int*)pc) = (c1*5+c2*2+c3)/8;
- if(hasMMX)
-#ifdef __GNUC__
- __asm__("movd %1, %%mm1; movd %2, %%mm2, movd %3, %%mm3; punpcklbw $_reg_blank, %%mm1; punpcklbw $_reg_blank, %%mm2; punpcklbw $_reg_blank, %%mm3; pmullw $_const5, %%mm1; psllw $1, %%mm2; paddw %%mm3, %%mm1; paddw %%mm2, %%mm1; psrlw $3, %%mm1; packuswb $_reg_blank, %%mm1; movd %%mm1, %0" : "=r"(*((int*)pc)) : "r" (c1),"r" (c2),"r" (c3) : "memory");
-#else
- __asm
- {
- mov eax, pc
- movd mm1, c1
- movd mm2, c2
- movd mm3, c3
- punpcklbw mm1, reg_blank
- punpcklbw mm2, reg_blank
- punpcklbw mm3, reg_blank
- pmullw mm1, const5
- psllw mm2, 1
- paddw mm1, mm3
- paddw mm1, mm2
- psrlw mm1, 3
- packuswb mm1, reg_blank
- movd [eax], mm1
- }
-#endif
- else
-#endif
- *((int*)pc) = ((((c1 & 0x00FF00)*5 + (c2 & 0x00FF00)*2 + (c3 & 0x00FF00) ) & 0x0007F800) +
- (((c1 & 0xFF00FF)*5 + (c2 & 0xFF00FF)*2 + (c3 & 0xFF00FF) ) & 0x07F807F8)) >> 3;
-}
-
-FUNCINLINE static ATTRINLINE void Interp7(Uint8 * pc, int c1, int c2, int c3)
-{
-#ifdef HQ2XMMXASM
- //*((int*)pc) = (c1*6+c2+c3)/8;
- if(hasMMX)
-#ifdef __GNUC__
- __asm__("movd %1, %%mm1; movd %2, %%mm2, movd %3, %%mm3; punpcklbw $_reg_blank, %%mm1; punpcklbw $_reg_blank, %%mm2; punpcklbw $_reg_blank, %%mm3; pmull2 $_const6, %%mm1; padw %%mm3, %%mm2; paddw %%mm2, %%mm1; psrlw $3, %%mm1; packuswb $_reg_blank, %%mm1; movd %%mm1, %0 " : "=r" (*((int*)pc)): "r"(c1), "r"(c2), "r"(c3) : "memory");
-#else
- __asm
- {
- mov eax, pc
- movd mm1, c1
- movd mm2, c2
- movd mm3, c3
- punpcklbw mm1, reg_blank
- punpcklbw mm2, reg_blank
- punpcklbw mm3, reg_blank
- pmullw mm1, const6
- paddw mm2, mm3
- paddw mm1, mm2
- psrlw mm1, 3
- packuswb mm1, reg_blank
- movd [eax], mm1
- }
-#endif
- else
-#endif
- *((int*)pc) = ((((c1 & 0x00FF00)*6 + (c2 & 0x00FF00) + (c3 & 0x00FF00) ) & 0x0007F800) +
- (((c1 & 0xFF00FF)*6 + (c2 & 0xFF00FF) + (c3 & 0xFF00FF) ) & 0x07F807F8)) >> 3;
-}
-
-FUNCINLINE static ATTRINLINE void Interp9(Uint8 * pc, int c1, int c2, int c3)
-{
-#ifdef HQ2XMMXASM
- //*((int*)pc) = (c1*2+(c2+c3)*3)/8;
- if(hasMMX)
-#ifdef __GNUC__
- __asm__("movd %1, %%mm1; movd %2, %%mm2, movd %3, %%mm3; punpcklbw $_reg_blank, %%mm1; punpcklbw $_reg_blank, %%mm2; punpcklbw $_reg_blank, %%mm3; psllw $1, %%mm1; paddw %%mm3, %%mm2; pmullw $_const3, %%mm2; padw %%mm2, %%mm1; psrlw $3, %%mm1; packuswb $_reg_blank, %%mm1; movd %%mm1, %0;" : "=r"(*((int*)pc)) : "r" (c1),"r" (c2),"r" (c3) : "memory");
-#else
- __asm
- {
- mov eax, pc
- movd mm1, c1
- movd mm2, c2
- movd mm3, c3
- punpcklbw mm1, reg_blank
- punpcklbw mm2, reg_blank
- punpcklbw mm3, reg_blank
- psllw mm1, 1
- paddw mm2, mm3
- pmullw mm2, const3
- paddw mm1, mm2
- psrlw mm1, 3
- packuswb mm1, reg_blank
- movd [eax], mm1
- }
-#endif
- else
-#endif
- *((int*)pc) = ((((c1 & 0x00FF00)*2 + ((c2 & 0x00FF00) + (c3 & 0x00FF00))*3 ) & 0x0007F800) +
- (((c1 & 0xFF00FF)*2 + ((c2 & 0xFF00FF) + (c3 & 0xFF00FF))*3 ) & 0x07F807F8)) >> 3;
-}
-
-FUNCINLINE static ATTRINLINE void Interp10(Uint8 * pc, int c1, int c2, int c3)
-{
-#ifdef HQ2XMMXASM
- //*((int*)pc) = (c1*14+c2+c3)/16;
- if(hasMMX)
-#ifdef __GNUC__
- __asm__("movd %1, %%mm1; movd %2, %%mm2, movd %3, %%mm3; punpcklbw $_reg_blank, %%mm1; punpcklbw $_reg_blank, %%mm2; punpcklbw $_reg_blank, %%mm3; pmullw $_const14, %%mm1; paddw %%mm3, %%mm2; paddw %%mm2, %%mm1; psrlw $4, %%mm1; packuswb $_req_blank, %%mm1; movd %%mm1, %0;" : "=r"(*((int*)pc)) : "r" (c1),"r" (c2),"r" (c3) : "memory");
-#else
- __asm
- {
- mov eax, pc
- movd mm1, c1
- movd mm2, c2
- movd mm3, c3
- punpcklbw mm1, reg_blank
- punpcklbw mm2, reg_blank
- punpcklbw mm3, reg_blank
- pmullw mm1, const14
- paddw mm2, mm3
- paddw mm1, mm2
- psrlw mm1, 4
- packuswb mm1, reg_blank
- movd [eax], mm1
- }
-#endif
- else
-#endif
- *((int*)pc) = ((((c1 & 0x00FF00)*14 + (c2 & 0x00FF00) + (c3 & 0x00FF00) ) & 0x000FF000) +
- (((c1 & 0xFF00FF)*14 + (c2 & 0xFF00FF) + (c3 & 0xFF00FF) ) & 0x0FF00FF0)) >> 4;
-}
-#define PIXEL00_0 *((int*)(pOut)) = c[5];
-#define PIXEL00_10 Interp1(pOut, c[5], c[1]);
-#define PIXEL00_11 Interp1(pOut, c[5], c[4]);
-#define PIXEL00_12 Interp1(pOut, c[5], c[2]);
-#define PIXEL00_20 Interp2(pOut, c[5], c[4], c[2]);
-#define PIXEL00_21 Interp2(pOut, c[5], c[1], c[2]);
-#define PIXEL00_22 Interp2(pOut, c[5], c[1], c[4]);
-#define PIXEL00_60 Interp6(pOut, c[5], c[2], c[4]);
-#define PIXEL00_61 Interp6(pOut, c[5], c[4], c[2]);
-#define PIXEL00_70 Interp7(pOut, c[5], c[4], c[2]);
-#define PIXEL00_90 Interp9(pOut, c[5], c[4], c[2]);
-#define PIXEL00_100 Interp10(pOut, c[5], c[4], c[2]);
-#define PIXEL01_0 *((int*)(pOut+4)) = c[5];
-#define PIXEL01_10 Interp1(pOut+4, c[5], c[3]);
-#define PIXEL01_11 Interp1(pOut+4, c[5], c[2]);
-#define PIXEL01_12 Interp1(pOut+4, c[5], c[6]);
-#define PIXEL01_20 Interp2(pOut+4, c[5], c[2], c[6]);
-#define PIXEL01_21 Interp2(pOut+4, c[5], c[3], c[6]);
-#define PIXEL01_22 Interp2(pOut+4, c[5], c[3], c[2]);
-#define PIXEL01_60 Interp6(pOut+4, c[5], c[6], c[2]);
-#define PIXEL01_61 Interp6(pOut+4, c[5], c[2], c[6]);
-#define PIXEL01_70 Interp7(pOut+4, c[5], c[2], c[6]);
-#define PIXEL01_90 Interp9(pOut+4, c[5], c[2], c[6]);
-#define PIXEL01_100 Interp10(pOut+4, c[5], c[2], c[6]);
-#define PIXEL10_0 *((int*)(pOut+BpL)) = c[5];
-#define PIXEL10_10 Interp1(pOut+BpL, c[5], c[7]);
-#define PIXEL10_11 Interp1(pOut+BpL, c[5], c[8]);
-#define PIXEL10_12 Interp1(pOut+BpL, c[5], c[4]);
-#define PIXEL10_20 Interp2(pOut+BpL, c[5], c[8], c[4]);
-#define PIXEL10_21 Interp2(pOut+BpL, c[5], c[7], c[4]);
-#define PIXEL10_22 Interp2(pOut+BpL, c[5], c[7], c[8]);
-#define PIXEL10_60 Interp6(pOut+BpL, c[5], c[4], c[8]);
-#define PIXEL10_61 Interp6(pOut+BpL, c[5], c[8], c[4]);
-#define PIXEL10_70 Interp7(pOut+BpL, c[5], c[8], c[4]);
-#define PIXEL10_90 Interp9(pOut+BpL, c[5], c[8], c[4]);
-#define PIXEL10_100 Interp10(pOut+BpL, c[5], c[8], c[4]);
-#define PIXEL11_0 *((int*)(pOut+BpL+4)) = c[5];
-#define PIXEL11_10 Interp1(pOut+BpL+4, c[5], c[9]);
-#define PIXEL11_11 Interp1(pOut+BpL+4, c[5], c[6]);
-#define PIXEL11_12 Interp1(pOut+BpL+4, c[5], c[8]);
-#define PIXEL11_20 Interp2(pOut+BpL+4, c[5], c[6], c[8]);
-#define PIXEL11_21 Interp2(pOut+BpL+4, c[5], c[9], c[8]);
-#define PIXEL11_22 Interp2(pOut+BpL+4, c[5], c[9], c[6]);
-#define PIXEL11_60 Interp6(pOut+BpL+4, c[5], c[8], c[6]);
-#define PIXEL11_61 Interp6(pOut+BpL+4, c[5], c[6], c[8]);
-#define PIXEL11_70 Interp7(pOut+BpL+4, c[5], c[6], c[8]);
-#define PIXEL11_90 Interp9(pOut+BpL+4, c[5], c[6], c[8]);
-#define PIXEL11_100 Interp10(pOut+BpL+4, c[5], c[6], c[8]);
-
-#ifdef _MSC_VER
-#pragma warning(disable: 4035)
-#endif
-
-FUNCINLINE static ATTRINLINE int Diff(Uint32 w1, Uint32 w2)
-{
-#ifdef HQ2XMMXASM
- if(hasMMX)
- {
-#ifdef __GNUC__
- int diffresult = 0;
- if(w1 != w2)
- __asm__("movd %3+%1*4, %%mm1; movq %%mm1, %%mm5; movd %3+%2*4, %%mm2; psubusb %%mm2, %%mm1; psubusb %%mm5, %%mm2; por %%mm2, %%mm1; psubusb $_treshold, %%mm1; movd %%mm1, %0" : "=c" (diffresult):"d" (w1),"q" (w2),"c" (RGBtoYUV) : "memory");
- return diffresult;
-#else
- __asm
- {
- xor eax,eax
- mov ebx,w1
- mov edx,w2
- cmp ebx,edx
- je FIN
- mov ecx,offset RGBtoYUV
- movd mm1,[ecx + ebx*4]
- movq mm5,mm1
- movd mm2,[ecx + edx*4]
- psubusb mm1,mm2
- psubusb mm2,mm5
- por mm1,mm2
- psubusb mm1,treshold
- movd eax,mm1
-FIN:
- }// returns result in eax register
-#endif
- }
- else
-#endif
- {
- YUV1 = RGBtoYUV[w1];
- YUV2 = RGBtoYUV[w2];
- return ( ( abs((YUV1 & Ymask) - (YUV2 & Ymask)) > trY ) ||
- ( abs((YUV1 & Umask) - (YUV2 & Umask)) > trU ) ||
- ( abs((YUV1 & Vmask) - (YUV2 & Vmask)) > trV ) );
- }
-}
-
-
-#ifdef _MSC_VER
-#pragma warning(default: 4035)
-#endif
-
-
-static void hq2x_32( Uint8 * pIn, Uint8 * pOut, int Xres, int Yres, int BpL )
-{
- int i, j, k;
- int prevline, nextline;
- int w[10];
- int c[10];
-
- // +----+----+----+
- // | | | |
- // | w1 | w2 | w3 |
- // +----+----+----+
- // | | | |
- // | w4 | w5 | w6 |
- // +----+----+----+
- // | | | |
- // | w7 | w8 | w9 |
- // +----+----+----+
-
- for (j=0; j0) prevline = -Xres*2; else prevline = 0;
- if (j0)
- {
- w[1] = *((Uint16*)(pIn + prevline - 2));
- w[4] = *((Uint16*)(pIn - 2));
- w[7] = *((Uint16*)(pIn + nextline - 2));
- }
- else
- {
- w[1] = w[2];
- w[4] = w[5];
- w[7] = w[8];
- }
-
- if (i trY ) ||
- ( abs((YUV1 & Umask) - (YUV2 & Umask)) > trU ) ||
- ( abs((YUV1 & Vmask) - (YUV2 & Vmask)) > trV ) )
- pattern |= flag;
- }
- flag <<= 1;
- }
- }
-
- for (k=1; k<=9; k++)
- c[k] = LUT16to32[w[k]];
-
- switch (pattern)
- {
- case 0:
- case 1:
- case 4:
- case 32:
- case 128:
- case 5:
- case 132:
- case 160:
- case 33:
- case 129:
- case 36:
- case 133:
- case 164:
- case 161:
- case 37:
- case 165:
- {
- PIXEL00_20
- PIXEL01_20
- PIXEL10_20
- PIXEL11_20
- break;
- }
- case 2:
- case 34:
- case 130:
- case 162:
- {
- PIXEL00_22
- PIXEL01_21
- PIXEL10_20
- PIXEL11_20
- break;
- }
- case 16:
- case 17:
- case 48:
- case 49:
- {
- PIXEL00_20
- PIXEL01_22
- PIXEL10_20
- PIXEL11_21
- break;
- }
- case 64:
- case 65:
- case 68:
- case 69:
- {
- PIXEL00_20
- PIXEL01_20
- PIXEL10_21
- PIXEL11_22
- break;
- }
- case 8:
- case 12:
- case 136:
- case 140:
- {
- PIXEL00_21
- PIXEL01_20
- PIXEL10_22
- PIXEL11_20
- break;
- }
- case 3:
- case 35:
- case 131:
- case 163:
- {
- PIXEL00_11
- PIXEL01_21
- PIXEL10_20
- PIXEL11_20
- break;
- }
- case 6:
- case 38:
- case 134:
- case 166:
- {
- PIXEL00_22
- PIXEL01_12
- PIXEL10_20
- PIXEL11_20
- break;
- }
- case 20:
- case 21:
- case 52:
- case 53:
- {
- PIXEL00_20
- PIXEL01_11
- PIXEL10_20
- PIXEL11_21
- break;
- }
- case 144:
- case 145:
- case 176:
- case 177:
- {
- PIXEL00_20
- PIXEL01_22
- PIXEL10_20
- PIXEL11_12
- break;
- }
- case 192:
- case 193:
- case 196:
- case 197:
- {
- PIXEL00_20
- PIXEL01_20
- PIXEL10_21
- PIXEL11_11
- break;
- }
- case 96:
- case 97:
- case 100:
- case 101:
- {
- PIXEL00_20
- PIXEL01_20
- PIXEL10_12
- PIXEL11_22
- break;
- }
- case 40:
- case 44:
- case 168:
- case 172:
- {
- PIXEL00_21
- PIXEL01_20
- PIXEL10_11
- PIXEL11_20
- break;
- }
- case 9:
- case 13:
- case 137:
- case 141:
- {
- PIXEL00_12
- PIXEL01_20
- PIXEL10_22
- PIXEL11_20
- break;
- }
- case 18:
- case 50:
- {
- PIXEL00_22
- if (Diff(w[2], w[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_20
- PIXEL11_21
- break;
- }
- case 80:
- case 81:
- {
- PIXEL00_20
- PIXEL01_22
- PIXEL10_21
- if (Diff(w[6], w[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 72:
- case 76:
- {
- PIXEL00_21
- PIXEL01_20
- if (Diff(w[8], w[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_20
- }
- PIXEL11_22
- break;
- }
- case 10:
- case 138:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_20
- }
- PIXEL01_21
- PIXEL10_22
- PIXEL11_20
- break;
- }
- case 66:
- {
- PIXEL00_22
- PIXEL01_21
- PIXEL10_21
- PIXEL11_22
- break;
- }
- case 24:
- {
- PIXEL00_21
- PIXEL01_22
- PIXEL10_22
- PIXEL11_21
- break;
- }
- case 7:
- case 39:
- case 135:
- {
- PIXEL00_11
- PIXEL01_12
- PIXEL10_20
- PIXEL11_20
- break;
- }
- case 148:
- case 149:
- case 180:
- {
- PIXEL00_20
- PIXEL01_11
- PIXEL10_20
- PIXEL11_12
- break;
- }
- case 224:
- case 228:
- case 225:
- {
- PIXEL00_20
- PIXEL01_20
- PIXEL10_12
- PIXEL11_11
- break;
- }
- case 41:
- case 169:
- case 45:
- {
- PIXEL00_12
- PIXEL01_20
- PIXEL10_11
- PIXEL11_20
- break;
- }
- case 22:
- case 54:
- {
- PIXEL00_22
- if (Diff(w[2], w[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_20
- PIXEL11_21
- break;
- }
- case 208:
- case 209:
- {
- PIXEL00_20
- PIXEL01_22
- PIXEL10_21
- if (Diff(w[6], w[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 104:
- case 108:
- {
- PIXEL00_21
- PIXEL01_20
- if (Diff(w[8], w[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- PIXEL11_22
- break;
- }
- case 11:
- case 139:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- PIXEL01_21
- PIXEL10_22
- PIXEL11_20
- break;
- }
- case 19:
- case 51:
- {
- if (Diff(w[2], w[6]))
- {
- PIXEL00_11
- PIXEL01_10
- }
- else
- {
- PIXEL00_60
- PIXEL01_90
- }
- PIXEL10_20
- PIXEL11_21
- break;
- }
- case 146:
- case 178:
- {
- PIXEL00_22
- if (Diff(w[2], w[6]))
- {
- PIXEL01_10
- PIXEL11_12
- }
- else
- {
- PIXEL01_90
- PIXEL11_61
- }
- PIXEL10_20
- break;
- }
- case 84:
- case 85:
- {
- PIXEL00_20
- if (Diff(w[6], w[8]))
- {
- PIXEL01_11
- PIXEL11_10
- }
- else
- {
- PIXEL01_60
- PIXEL11_90
- }
- PIXEL10_21
- break;
- }
- case 112:
- case 113:
- {
- PIXEL00_20
- PIXEL01_22
- if (Diff(w[6], w[8]))
- {
- PIXEL10_12
- PIXEL11_10
- }
- else
- {
- PIXEL10_61
- PIXEL11_90
- }
- break;
- }
- case 200:
- case 204:
- {
- PIXEL00_21
- PIXEL01_20
- if (Diff(w[8], w[4]))
- {
- PIXEL10_10
- PIXEL11_11
- }
- else
- {
- PIXEL10_90
- PIXEL11_60
- }
- break;
- }
- case 73:
- case 77:
- {
- if (Diff(w[8], w[4]))
- {
- PIXEL00_12
- PIXEL10_10
- }
- else
- {
- PIXEL00_61
- PIXEL10_90
- }
- PIXEL01_20
- PIXEL11_22
- break;
- }
- case 42:
- case 170:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_10
- PIXEL10_11
- }
- else
- {
- PIXEL00_90
- PIXEL10_60
- }
- PIXEL01_21
- PIXEL11_20
- break;
- }
- case 14:
- case 142:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_10
- PIXEL01_12
- }
- else
- {
- PIXEL00_90
- PIXEL01_61
- }
- PIXEL10_22
- PIXEL11_20
- break;
- }
- case 67:
- {
- PIXEL00_11
- PIXEL01_21
- PIXEL10_21
- PIXEL11_22
- break;
- }
- case 70:
- {
- PIXEL00_22
- PIXEL01_12
- PIXEL10_21
- PIXEL11_22
- break;
- }
- case 28:
- {
- PIXEL00_21
- PIXEL01_11
- PIXEL10_22
- PIXEL11_21
- break;
- }
- case 152:
- {
- PIXEL00_21
- PIXEL01_22
- PIXEL10_22
- PIXEL11_12
- break;
- }
- case 194:
- {
- PIXEL00_22
- PIXEL01_21
- PIXEL10_21
- PIXEL11_11
- break;
- }
- case 98:
- {
- PIXEL00_22
- PIXEL01_21
- PIXEL10_12
- PIXEL11_22
- break;
- }
- case 56:
- {
- PIXEL00_21
- PIXEL01_22
- PIXEL10_11
- PIXEL11_21
- break;
- }
- case 25:
- {
- PIXEL00_12
- PIXEL01_22
- PIXEL10_22
- PIXEL11_21
- break;
- }
- case 26:
- case 31:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- if (Diff(w[2], w[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_22
- PIXEL11_21
- break;
- }
- case 82:
- case 214:
- {
- PIXEL00_22
- if (Diff(w[2], w[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_21
- if (Diff(w[6], w[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 88:
- case 248:
- {
- PIXEL00_21
- PIXEL01_22
- if (Diff(w[8], w[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- if (Diff(w[6], w[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 74:
- case 107:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- PIXEL01_21
- if (Diff(w[8], w[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- PIXEL11_22
- break;
- }
- case 27:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- PIXEL01_10
- PIXEL10_22
- PIXEL11_21
- break;
- }
- case 86:
- {
- PIXEL00_22
- if (Diff(w[2], w[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_21
- PIXEL11_10
- break;
- }
- case 216:
- {
- PIXEL00_21
- PIXEL01_22
- PIXEL10_10
- if (Diff(w[6], w[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 106:
- {
- PIXEL00_10
- PIXEL01_21
- if (Diff(w[8], w[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- PIXEL11_22
- break;
- }
- case 30:
- {
- PIXEL00_10
- if (Diff(w[2], w[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_22
- PIXEL11_21
- break;
- }
- case 210:
- {
- PIXEL00_22
- PIXEL01_10
- PIXEL10_21
- if (Diff(w[6], w[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 120:
- {
- PIXEL00_21
- PIXEL01_22
- if (Diff(w[8], w[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- PIXEL11_10
- break;
- }
- case 75:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- PIXEL01_21
- PIXEL10_10
- PIXEL11_22
- break;
- }
- case 29:
- {
- PIXEL00_12
- PIXEL01_11
- PIXEL10_22
- PIXEL11_21
- break;
- }
- case 198:
- {
- PIXEL00_22
- PIXEL01_12
- PIXEL10_21
- PIXEL11_11
- break;
- }
- case 184:
- {
- PIXEL00_21
- PIXEL01_22
- PIXEL10_11
- PIXEL11_12
- break;
- }
- case 99:
- {
- PIXEL00_11
- PIXEL01_21
- PIXEL10_12
- PIXEL11_22
- break;
- }
- case 57:
- {
- PIXEL00_12
- PIXEL01_22
- PIXEL10_11
- PIXEL11_21
- break;
- }
- case 71:
- {
- PIXEL00_11
- PIXEL01_12
- PIXEL10_21
- PIXEL11_22
- break;
- }
- case 156:
- {
- PIXEL00_21
- PIXEL01_11
- PIXEL10_22
- PIXEL11_12
- break;
- }
- case 226:
- {
- PIXEL00_22
- PIXEL01_21
- PIXEL10_12
- PIXEL11_11
- break;
- }
- case 60:
- {
- PIXEL00_21
- PIXEL01_11
- PIXEL10_11
- PIXEL11_21
- break;
- }
- case 195:
- {
- PIXEL00_11
- PIXEL01_21
- PIXEL10_21
- PIXEL11_11
- break;
- }
- case 102:
- {
- PIXEL00_22
- PIXEL01_12
- PIXEL10_12
- PIXEL11_22
- break;
- }
- case 153:
- {
- PIXEL00_12
- PIXEL01_22
- PIXEL10_22
- PIXEL11_12
- break;
- }
- case 58:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_70
- }
- if (Diff(w[2], w[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_70
- }
- PIXEL10_11
- PIXEL11_21
- break;
- }
- case 83:
- {
- PIXEL00_11
- if (Diff(w[2], w[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_70
- }
- PIXEL10_21
- if (Diff(w[6], w[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_70
- }
- break;
- }
- case 92:
- {
- PIXEL00_21
- PIXEL01_11
- if (Diff(w[8], w[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_70
- }
- if (Diff(w[6], w[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_70
- }
- break;
- }
- case 202:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_70
- }
- PIXEL01_21
- if (Diff(w[8], w[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_70
- }
- PIXEL11_11
- break;
- }
- case 78:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_70
- }
- PIXEL01_12
- if (Diff(w[8], w[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_70
- }
- PIXEL11_22
- break;
- }
- case 154:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_70
- }
- if (Diff(w[2], w[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_70
- }
- PIXEL10_22
- PIXEL11_12
- break;
- }
- case 114:
- {
- PIXEL00_22
- if (Diff(w[2], w[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_70
- }
- PIXEL10_12
- if (Diff(w[6], w[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_70
- }
- break;
- }
- case 89:
- {
- PIXEL00_12
- PIXEL01_22
- if (Diff(w[8], w[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_70
- }
- if (Diff(w[6], w[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_70
- }
- break;
- }
- case 90:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_70
- }
- if (Diff(w[2], w[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_70
- }
- if (Diff(w[8], w[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_70
- }
- if (Diff(w[6], w[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_70
- }
- break;
- }
- case 55:
- case 23:
- {
- if (Diff(w[2], w[6]))
- {
- PIXEL00_11
- PIXEL01_0
- }
- else
- {
- PIXEL00_60
- PIXEL01_90
- }
- PIXEL10_20
- PIXEL11_21
- break;
- }
- case 182:
- case 150:
- {
- PIXEL00_22
- if (Diff(w[2], w[6]))
- {
- PIXEL01_0
- PIXEL11_12
- }
- else
- {
- PIXEL01_90
- PIXEL11_61
- }
- PIXEL10_20
- break;
- }
- case 213:
- case 212:
- {
- PIXEL00_20
- if (Diff(w[6], w[8]))
- {
- PIXEL01_11
- PIXEL11_0
- }
- else
- {
- PIXEL01_60
- PIXEL11_90
- }
- PIXEL10_21
- break;
- }
- case 241:
- case 240:
- {
- PIXEL00_20
- PIXEL01_22
- if (Diff(w[6], w[8]))
- {
- PIXEL10_12
- PIXEL11_0
- }
- else
- {
- PIXEL10_61
- PIXEL11_90
- }
- break;
- }
- case 236:
- case 232:
- {
- PIXEL00_21
- PIXEL01_20
- if (Diff(w[8], w[4]))
- {
- PIXEL10_0
- PIXEL11_11
- }
- else
- {
- PIXEL10_90
- PIXEL11_60
- }
- break;
- }
- case 109:
- case 105:
- {
- if (Diff(w[8], w[4]))
- {
- PIXEL00_12
- PIXEL10_0
- }
- else
- {
- PIXEL00_61
- PIXEL10_90
- }
- PIXEL01_20
- PIXEL11_22
- break;
- }
- case 171:
- case 43:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- PIXEL10_11
- }
- else
- {
- PIXEL00_90
- PIXEL10_60
- }
- PIXEL01_21
- PIXEL11_20
- break;
- }
- case 143:
- case 15:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- PIXEL01_12
- }
- else
- {
- PIXEL00_90
- PIXEL01_61
- }
- PIXEL10_22
- PIXEL11_20
- break;
- }
- case 124:
- {
- PIXEL00_21
- PIXEL01_11
- if (Diff(w[8], w[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- PIXEL11_10
- break;
- }
- case 203:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- PIXEL01_21
- PIXEL10_10
- PIXEL11_11
- break;
- }
- case 62:
- {
- PIXEL00_10
- if (Diff(w[2], w[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_11
- PIXEL11_21
- break;
- }
- case 211:
- {
- PIXEL00_11
- PIXEL01_10
- PIXEL10_21
- if (Diff(w[6], w[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 118:
- {
- PIXEL00_22
- if (Diff(w[2], w[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_12
- PIXEL11_10
- break;
- }
- case 217:
- {
- PIXEL00_12
- PIXEL01_22
- PIXEL10_10
- if (Diff(w[6], w[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 110:
- {
- PIXEL00_10
- PIXEL01_12
- if (Diff(w[8], w[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- PIXEL11_22
- break;
- }
- case 155:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- PIXEL01_10
- PIXEL10_22
- PIXEL11_12
- break;
- }
- case 188:
- {
- PIXEL00_21
- PIXEL01_11
- PIXEL10_11
- PIXEL11_12
- break;
- }
- case 185:
- {
- PIXEL00_12
- PIXEL01_22
- PIXEL10_11
- PIXEL11_12
- break;
- }
- case 61:
- {
- PIXEL00_12
- PIXEL01_11
- PIXEL10_11
- PIXEL11_21
- break;
- }
- case 157:
- {
- PIXEL00_12
- PIXEL01_11
- PIXEL10_22
- PIXEL11_12
- break;
- }
- case 103:
- {
- PIXEL00_11
- PIXEL01_12
- PIXEL10_12
- PIXEL11_22
- break;
- }
- case 227:
- {
- PIXEL00_11
- PIXEL01_21
- PIXEL10_12
- PIXEL11_11
- break;
- }
- case 230:
- {
- PIXEL00_22
- PIXEL01_12
- PIXEL10_12
- PIXEL11_11
- break;
- }
- case 199:
- {
- PIXEL00_11
- PIXEL01_12
- PIXEL10_21
- PIXEL11_11
- break;
- }
- case 220:
- {
- PIXEL00_21
- PIXEL01_11
- if (Diff(w[8], w[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_70
- }
- if (Diff(w[6], w[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 158:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_70
- }
- if (Diff(w[2], w[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_22
- PIXEL11_12
- break;
- }
- case 234:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_70
- }
- PIXEL01_21
- if (Diff(w[8], w[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- PIXEL11_11
- break;
- }
- case 242:
- {
- PIXEL00_22
- if (Diff(w[2], w[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_70
- }
- PIXEL10_12
- if (Diff(w[6], w[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 59:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- if (Diff(w[2], w[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_70
- }
- PIXEL10_11
- PIXEL11_21
- break;
- }
- case 121:
- {
- PIXEL00_12
- PIXEL01_22
- if (Diff(w[8], w[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- if (Diff(w[6], w[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_70
- }
- break;
- }
- case 87:
- {
- PIXEL00_11
- if (Diff(w[2], w[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_21
- if (Diff(w[6], w[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_70
- }
- break;
- }
- case 79:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- PIXEL01_12
- if (Diff(w[8], w[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_70
- }
- PIXEL11_22
- break;
- }
- case 122:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_70
- }
- if (Diff(w[2], w[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_70
- }
- if (Diff(w[8], w[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- if (Diff(w[6], w[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_70
- }
- break;
- }
- case 94:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_70
- }
- if (Diff(w[2], w[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- if (Diff(w[8], w[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_70
- }
- if (Diff(w[6], w[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_70
- }
- break;
- }
- case 218:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_70
- }
- if (Diff(w[2], w[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_70
- }
- if (Diff(w[8], w[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_70
- }
- if (Diff(w[6], w[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 91:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- if (Diff(w[2], w[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_70
- }
- if (Diff(w[8], w[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_70
- }
- if (Diff(w[6], w[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_70
- }
- break;
- }
- case 229:
- {
- PIXEL00_20
- PIXEL01_20
- PIXEL10_12
- PIXEL11_11
- break;
- }
- case 167:
- {
- PIXEL00_11
- PIXEL01_12
- PIXEL10_20
- PIXEL11_20
- break;
- }
- case 173:
- {
- PIXEL00_12
- PIXEL01_20
- PIXEL10_11
- PIXEL11_20
- break;
- }
- case 181:
- {
- PIXEL00_20
- PIXEL01_11
- PIXEL10_20
- PIXEL11_12
- break;
- }
- case 186:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_70
- }
- if (Diff(w[2], w[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_70
- }
- PIXEL10_11
- PIXEL11_12
- break;
- }
- case 115:
- {
- PIXEL00_11
- if (Diff(w[2], w[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_70
- }
- PIXEL10_12
- if (Diff(w[6], w[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_70
- }
- break;
- }
- case 93:
- {
- PIXEL00_12
- PIXEL01_11
- if (Diff(w[8], w[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_70
- }
- if (Diff(w[6], w[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_70
- }
- break;
- }
- case 206:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_70
- }
- PIXEL01_12
- if (Diff(w[8], w[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_70
- }
- PIXEL11_11
- break;
- }
- case 205:
- case 201:
- {
- PIXEL00_12
- PIXEL01_20
- if (Diff(w[8], w[4]))
- {
- PIXEL10_10
- }
- else
- {
- PIXEL10_70
- }
- PIXEL11_11
- break;
- }
- case 174:
- case 46:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_10
- }
- else
- {
- PIXEL00_70
- }
- PIXEL01_12
- PIXEL10_11
- PIXEL11_20
- break;
- }
- case 179:
- case 147:
- {
- PIXEL00_11
- if (Diff(w[2], w[6]))
- {
- PIXEL01_10
- }
- else
- {
- PIXEL01_70
- }
- PIXEL10_20
- PIXEL11_12
- break;
- }
- case 117:
- case 116:
- {
- PIXEL00_20
- PIXEL01_11
- PIXEL10_12
- if (Diff(w[6], w[8]))
- {
- PIXEL11_10
- }
- else
- {
- PIXEL11_70
- }
- break;
- }
- case 189:
- {
- PIXEL00_12
- PIXEL01_11
- PIXEL10_11
- PIXEL11_12
- break;
- }
- case 231:
- {
- PIXEL00_11
- PIXEL01_12
- PIXEL10_12
- PIXEL11_11
- break;
- }
- case 126:
- {
- PIXEL00_10
- if (Diff(w[2], w[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- if (Diff(w[8], w[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- PIXEL11_10
- break;
- }
- case 219:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- PIXEL01_10
- PIXEL10_10
- if (Diff(w[6], w[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 125:
- {
- if (Diff(w[8], w[4]))
- {
- PIXEL00_12
- PIXEL10_0
- }
- else
- {
- PIXEL00_61
- PIXEL10_90
- }
- PIXEL01_11
- PIXEL11_10
- break;
- }
- case 221:
- {
- PIXEL00_12
- if (Diff(w[6], w[8]))
- {
- PIXEL01_11
- PIXEL11_0
- }
- else
- {
- PIXEL01_60
- PIXEL11_90
- }
- PIXEL10_10
- break;
- }
- case 207:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- PIXEL01_12
- }
- else
- {
- PIXEL00_90
- PIXEL01_61
- }
- PIXEL10_10
- PIXEL11_11
- break;
- }
- case 238:
- {
- PIXEL00_10
- PIXEL01_12
- if (Diff(w[8], w[4]))
- {
- PIXEL10_0
- PIXEL11_11
- }
- else
- {
- PIXEL10_90
- PIXEL11_60
- }
- break;
- }
- case 190:
- {
- PIXEL00_10
- if (Diff(w[2], w[6]))
- {
- PIXEL01_0
- PIXEL11_12
- }
- else
- {
- PIXEL01_90
- PIXEL11_61
- }
- PIXEL10_11
- break;
- }
- case 187:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- PIXEL10_11
- }
- else
- {
- PIXEL00_90
- PIXEL10_60
- }
- PIXEL01_10
- PIXEL11_12
- break;
- }
- case 243:
- {
- PIXEL00_11
- PIXEL01_10
- if (Diff(w[6], w[8]))
- {
- PIXEL10_12
- PIXEL11_0
- }
- else
- {
- PIXEL10_61
- PIXEL11_90
- }
- break;
- }
- case 119:
- {
- if (Diff(w[2], w[6]))
- {
- PIXEL00_11
- PIXEL01_0
- }
- else
- {
- PIXEL00_60
- PIXEL01_90
- }
- PIXEL10_12
- PIXEL11_10
- break;
- }
- case 237:
- case 233:
- {
- PIXEL00_12
- PIXEL01_20
- if (Diff(w[8], w[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_100
- }
- PIXEL11_11
- break;
- }
- case 175:
- case 47:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_100
- }
- PIXEL01_12
- PIXEL10_11
- PIXEL11_20
- break;
- }
- case 183:
- case 151:
- {
- PIXEL00_11
- if (Diff(w[2], w[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_100
- }
- PIXEL10_20
- PIXEL11_12
- break;
- }
- case 245:
- case 244:
- {
- PIXEL00_20
- PIXEL01_11
- PIXEL10_12
- if (Diff(w[6], w[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_100
- }
- break;
- }
- case 250:
- {
- PIXEL00_10
- PIXEL01_10
- if (Diff(w[8], w[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- if (Diff(w[6], w[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 123:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- PIXEL01_10
- if (Diff(w[8], w[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- PIXEL11_10
- break;
- }
- case 95:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- if (Diff(w[2], w[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_10
- PIXEL11_10
- break;
- }
- case 222:
- {
- PIXEL00_10
- if (Diff(w[2], w[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_10
- if (Diff(w[6], w[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 252:
- {
- PIXEL00_21
- PIXEL01_11
- if (Diff(w[8], w[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- if (Diff(w[6], w[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_100
- }
- break;
- }
- case 249:
- {
- PIXEL00_12
- PIXEL01_22
- if (Diff(w[8], w[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_100
- }
- if (Diff(w[6], w[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 235:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- PIXEL01_21
- if (Diff(w[8], w[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_100
- }
- PIXEL11_11
- break;
- }
- case 111:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_100
- }
- PIXEL01_12
- if (Diff(w[8], w[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- PIXEL11_22
- break;
- }
- case 63:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_100
- }
- if (Diff(w[2], w[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_11
- PIXEL11_21
- break;
- }
- case 159:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- if (Diff(w[2], w[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_100
- }
- PIXEL10_22
- PIXEL11_12
- break;
- }
- case 215:
- {
- PIXEL00_11
- if (Diff(w[2], w[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_100
- }
- PIXEL10_21
- if (Diff(w[6], w[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 246:
- {
- PIXEL00_22
- if (Diff(w[2], w[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- PIXEL10_12
- if (Diff(w[6], w[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_100
- }
- break;
- }
- case 254:
- {
- PIXEL00_10
- if (Diff(w[2], w[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- if (Diff(w[8], w[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- if (Diff(w[6], w[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_100
- }
- break;
- }
- case 253:
- {
- PIXEL00_12
- PIXEL01_11
- if (Diff(w[8], w[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_100
- }
- if (Diff(w[6], w[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_100
- }
- break;
- }
- case 251:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- PIXEL01_10
- if (Diff(w[8], w[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_100
- }
- if (Diff(w[6], w[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 239:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_100
- }
- PIXEL01_12
- if (Diff(w[8], w[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_100
- }
- PIXEL11_11
- break;
- }
- case 127:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_100
- }
- if (Diff(w[2], w[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_20
- }
- if (Diff(w[8], w[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_20
- }
- PIXEL11_10
- break;
- }
- case 191:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_100
- }
- if (Diff(w[2], w[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_100
- }
- PIXEL10_11
- PIXEL11_12
- break;
- }
- case 223:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_20
- }
- if (Diff(w[2], w[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_100
- }
- PIXEL10_10
- if (Diff(w[6], w[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_20
- }
- break;
- }
- case 247:
- {
- PIXEL00_11
- if (Diff(w[2], w[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_100
- }
- PIXEL10_12
- if (Diff(w[6], w[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_100
- }
- break;
- }
- case 255:
- {
- if (Diff(w[4], w[2]))
- {
- PIXEL00_0
- }
- else
- {
- PIXEL00_100
- }
- if (Diff(w[2], w[6]))
- {
- PIXEL01_0
- }
- else
- {
- PIXEL01_100
- }
- if (Diff(w[8], w[4]))
- {
- PIXEL10_0
- }
- else
- {
- PIXEL10_100
- }
- if (Diff(w[6], w[8]))
- {
- PIXEL11_0
- }
- else
- {
- PIXEL11_100
- }
- break;
- }
- }
- pIn+=2;
- pOut+=8;
- }
- pOut+=BpL;
- }
-}
-
-FUNCINLINE static ATTRINLINE void InitLUTs(void)
-{
- int i, j, k, r, g, b, Y, u, v;
-
-#ifdef HQ2XMMXASM
- hasMMX = SDL_HasMMX();
-#endif
-
- for (i=0; i<65536; i++)
- LUT16to32[i] = ((i & 0xF800) << 8) + ((i & 0x07E0) << 5) + ((i & 0x001F) << 3);
-
- for (i=0; i<32; i++)
- for (j=0; j<64; j++)
- for (k=0; k<32; k++)
- {
- r = i << 3;
- g = j << 2;
- b = k << 3;
- Y = (r + g + b) >> 2;
- u = 128 + ((r - b) >> 2);
- v = 128 + ((-r + 2*g -b)>>3);
- RGBtoYUV[ (i << 11) + (j << 5) + k ] = (Y<<16) + (u<<8) + v;
- }
-}
-
-void filter_hq2x(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr, Uint32 dstPitch, int width, int height)
-{
- static Uint8 doneLUT = 1;
- (void)srcPitch;
- if(doneLUT) InitLUTs();
- else doneLUT = 0;
- hq2x_32( srcPtr, dstPtr, width, height, dstPitch );
-}
diff --git a/src/sdl/filter/hq2x.h b/src/sdl/filter/hq2x.h
deleted file mode 100644
index 49c0b268..00000000
--- a/src/sdl/filter/hq2x.h
+++ /dev/null
@@ -1,1824 +0,0 @@
-case 0 :
-case 1 :
-case 4 :
-case 5 :
-case 32 :
-case 33 :
-case 36 :
-case 37 :
-case 128 :
-case 129 :
-case 132 :
-case 133 :
-case 160 :
-case 161 :
-case 164 :
-case 165 :
-{
- P0 = I211(4, 1, 3);
- P1 = I211(4, 1, 5);
- P2 = I211(4, 3, 7);
- P3 = I211(4, 5, 7);
-} break;
-case 2 :
-case 34 :
-case 130 :
-case 162 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 2);
- P2 = I211(4, 3, 7);
- P3 = I211(4, 5, 7);
-} break;
-case 3 :
-case 35 :
-case 131 :
-case 163 :
-{
- P0 = I31(4, 3);
- P1 = I31(4, 2);
- P2 = I211(4, 3, 7);
- P3 = I211(4, 5, 7);
-} break;
-case 6 :
-case 38 :
-case 134 :
-case 166 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 5);
- P2 = I211(4, 3, 7);
- P3 = I211(4, 5, 7);
-} break;
-case 7 :
-case 39 :
-case 135 :
-case 167 :
-{
- P0 = I31(4, 3);
- P1 = I31(4, 5);
- P2 = I211(4, 3, 7);
- P3 = I211(4, 5, 7);
-} break;
-case 8 :
-case 12 :
-case 136 :
-case 140 :
-{
- P0 = I31(4, 0);
- P1 = I211(4, 1, 5);
- P2 = I31(4, 6);
- P3 = I211(4, 5, 7);
-} break;
-case 9 :
-case 13 :
-case 137 :
-case 141 :
-{
- P0 = I31(4, 1);
- P1 = I211(4, 1, 5);
- P2 = I31(4, 6);
- P3 = I211(4, 5, 7);
-} break;
-case 10 :
-case 138 :
-{
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- P3 = I211(4, 5, 7);
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I211(4, 1, 3);
- }
-} break;
-case 11 :
-case 139 :
-{
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- P3 = I211(4, 5, 7);
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
-} break;
-case 14 :
-case 142 :
-{
- P2 = I31(4, 6);
- P3 = I211(4, 5, 7);
- if (MUL) {
- P0 = I31(4, 0);
- P1 = I31(4, 5);
- } else {
- P0 = I332(1, 3, 4);
- P1 = I521(4, 1, 5);
- }
-} break;
-case 15 :
-case 143 :
-{
- P2 = I31(4, 6);
- P3 = I211(4, 5, 7);
- if (MUL) {
- P0 = IC(4);
- P1 = I31(4, 5);
- } else {
- P0 = I332(1, 3, 4);
- P1 = I521(4, 1, 5);
- }
-} break;
-case 16 :
-case 17 :
-case 48 :
-case 49 :
-{
- P0 = I211(4, 1, 3);
- P1 = I31(4, 2);
- P2 = I211(4, 3, 7);
- P3 = I31(4, 8);
-} break;
-case 18 :
-case 50 :
-{
- P0 = I31(4, 0);
- P2 = I211(4, 3, 7);
- P3 = I31(4, 8);
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 19 :
-case 51 :
-{
- P2 = I211(4, 3, 7);
- P3 = I31(4, 8);
- if (MUR) {
- P0 = I31(4, 3);
- P1 = I31(4, 2);
- } else {
- P0 = I521(4, 1, 3);
- P1 = I332(1, 5, 4);
- }
-} break;
-case 20 :
-case 21 :
-case 52 :
-case 53 :
-{
- P0 = I211(4, 1, 3);
- P1 = I31(4, 1);
- P2 = I211(4, 3, 7);
- P3 = I31(4, 8);
-} break;
-case 22 :
-case 54 :
-{
- P0 = I31(4, 0);
- P2 = I211(4, 3, 7);
- P3 = I31(4, 8);
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 23 :
-case 55 :
-{
- P2 = I211(4, 3, 7);
- P3 = I31(4, 8);
- if (MUR) {
- P0 = I31(4, 3);
- P1 = IC(4);
- } else {
- P0 = I521(4, 1, 3);
- P1 = I332(1, 5, 4);
- }
-} break;
-case 24 :
-case 66 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- P3 = I31(4, 8);
-} break;
-case 25 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- P3 = I31(4, 8);
-} break;
-case 26 :
-case 31 :
-case 95 :
-{
- P2 = I31(4, 6);
- P3 = I31(4, 8);
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 27 :
-case 75 :
-{
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- P3 = I31(4, 8);
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
-} break;
-case 28 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 1);
- P2 = I31(4, 6);
- P3 = I31(4, 8);
-} break;
-case 29 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 1);
- P2 = I31(4, 6);
- P3 = I31(4, 8);
-} break;
-case 30 :
-case 86 :
-{
- P0 = I31(4, 0);
- P2 = I31(4, 6);
- P3 = I31(4, 8);
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 40 :
-case 44 :
-case 168 :
-case 172 :
-{
- P0 = I31(4, 0);
- P1 = I211(4, 1, 5);
- P2 = I31(4, 7);
- P3 = I211(4, 5, 7);
-} break;
-case 41 :
-case 45 :
-case 169 :
-case 173 :
-{
- P0 = I31(4, 1);
- P1 = I211(4, 1, 5);
- P2 = I31(4, 7);
- P3 = I211(4, 5, 7);
-} break;
-case 42 :
-case 170 :
-{
- P1 = I31(4, 2);
- P3 = I211(4, 5, 7);
- if (MUL) {
- P0 = I31(4, 0);
- P2 = I31(4, 7);
- } else {
- P0 = I332(1, 3, 4);
- P2 = I521(4, 3, 7);
- }
-} break;
-case 43 :
-case 171 :
-{
- P1 = I31(4, 2);
- P3 = I211(4, 5, 7);
- if (MUL) {
- P0 = IC(4);
- P2 = I31(4, 7);
- } else {
- P0 = I332(1, 3, 4);
- P2 = I521(4, 3, 7);
- }
-} break;
-case 46 :
-case 174 :
-{
- P1 = I31(4, 5);
- P2 = I31(4, 7);
- P3 = I211(4, 5, 7);
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I611(4, 1, 3);
- }
-} break;
-case 47 :
-case 175 :
-{
- P1 = I31(4, 5);
- P2 = I31(4, 7);
- P3 = I211(4, 5, 7);
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I1411(4, 1, 3);
- }
-} break;
-case 56 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 2);
- P2 = I31(4, 7);
- P3 = I31(4, 8);
-} break;
-case 57 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 2);
- P2 = I31(4, 7);
- P3 = I31(4, 8);
-} break;
-case 58 :
-{
- P2 = I31(4, 7);
- P3 = I31(4, 8);
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I611(4, 1, 3);
- }
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I611(4, 1, 5);
- }
-} break;
-case 59 :
-{
- P2 = I31(4, 7);
- P3 = I31(4, 8);
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I611(4, 1, 5);
- }
-} break;
-case 60 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 1);
- P2 = I31(4, 7);
- P3 = I31(4, 8);
-} break;
-case 61 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 1);
- P2 = I31(4, 7);
- P3 = I31(4, 8);
-} break;
-case 62 :
-{
- P0 = I31(4, 0);
- P2 = I31(4, 7);
- P3 = I31(4, 8);
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 63 :
-{
- P2 = I31(4, 7);
- P3 = I31(4, 8);
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I1411(4, 1, 3);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 64 :
-case 65 :
-case 68 :
-case 69 :
-{
- P0 = I211(4, 1, 3);
- P1 = I211(4, 1, 5);
- P2 = I31(4, 6);
- P3 = I31(4, 8);
-} break;
-case 67 :
-{
- P0 = I31(4, 3);
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- P3 = I31(4, 8);
-} break;
-case 70 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 5);
- P2 = I31(4, 6);
- P3 = I31(4, 8);
-} break;
-case 71 :
-{
- P0 = I31(4, 3);
- P1 = I31(4, 5);
- P2 = I31(4, 6);
- P3 = I31(4, 8);
-} break;
-case 72 :
-case 76 :
-{
- P0 = I31(4, 0);
- P1 = I211(4, 1, 5);
- P3 = I31(4, 8);
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I211(4, 3, 7);
- }
-} break;
-case 73 :
-case 77 :
-{
- P1 = I211(4, 1, 5);
- P3 = I31(4, 8);
- if (MDL) {
- P0 = I31(4, 1);
- P2 = I31(4, 6);
- } else {
- P0 = I521(4, 3, 1);
- P2 = I332(3, 7, 4);
- }
-} break;
-case 74 :
-case 107 :
-case 123 :
-{
- P1 = I31(4, 2);
- P3 = I31(4, 8);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
-} break;
-case 78 :
-{
- P1 = I31(4, 5);
- P3 = I31(4, 8);
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I611(4, 3, 7);
- }
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I611(4, 1, 3);
- }
-} break;
-case 79 :
-{
- P1 = I31(4, 5);
- P3 = I31(4, 8);
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I611(4, 3, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
-} break;
-case 80 :
-case 81 :
-{
- P0 = I211(4, 1, 3);
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I211(4, 5, 7);
- }
-} break;
-case 82 :
-case 214 :
-case 222 :
-{
- P0 = I31(4, 0);
- P2 = I31(4, 6);
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 83 :
-{
- P0 = I31(4, 3);
- P2 = I31(4, 6);
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I611(4, 5, 7);
- }
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I611(4, 1, 5);
- }
-} break;
-case 84 :
-case 85 :
-{
- P0 = I211(4, 1, 3);
- P2 = I31(4, 6);
- if (MDR) {
- P1 = I31(4, 1);
- P3 = I31(4, 8);
- } else {
- P1 = I521(4, 5, 1);
- P3 = I332(5, 7, 4);
- }
-} break;
-case 87 :
-{
- P0 = I31(4, 3);
- P2 = I31(4, 6);
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I611(4, 5, 7);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 88 :
-case 248 :
-case 250 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 2);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
-} break;
-case 89 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 2);
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I611(4, 3, 7);
- }
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I611(4, 5, 7);
- }
-} break;
-case 90 :
-{
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I611(4, 3, 7);
- }
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I611(4, 5, 7);
- }
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I611(4, 1, 3);
- }
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I611(4, 1, 5);
- }
-} break;
-case 91 :
-{
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I611(4, 3, 7);
- }
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I611(4, 5, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I611(4, 1, 5);
- }
-} break;
-case 92 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 1);
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I611(4, 3, 7);
- }
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I611(4, 5, 7);
- }
-} break;
-case 93 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 1);
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I611(4, 3, 7);
- }
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I611(4, 5, 7);
- }
-} break;
-case 94 :
-{
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I611(4, 3, 7);
- }
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I611(4, 5, 7);
- }
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I611(4, 1, 3);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 96 :
-case 97 :
-case 100 :
-case 101 :
-{
- P0 = I211(4, 1, 3);
- P1 = I211(4, 1, 5);
- P2 = I31(4, 3);
- P3 = I31(4, 8);
-} break;
-case 98 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 2);
- P2 = I31(4, 3);
- P3 = I31(4, 8);
-} break;
-case 99 :
-{
- P0 = I31(4, 3);
- P1 = I31(4, 2);
- P2 = I31(4, 3);
- P3 = I31(4, 8);
-} break;
-case 102 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 5);
- P2 = I31(4, 3);
- P3 = I31(4, 8);
-} break;
-case 103 :
-{
- P0 = I31(4, 3);
- P1 = I31(4, 5);
- P2 = I31(4, 3);
- P3 = I31(4, 8);
-} break;
-case 104 :
-case 108 :
-{
- P0 = I31(4, 0);
- P1 = I211(4, 1, 5);
- P3 = I31(4, 8);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
-} break;
-case 105 :
-case 109 :
-{
- P1 = I211(4, 1, 5);
- P3 = I31(4, 8);
- if (MDL) {
- P0 = I31(4, 1);
- P2 = IC(4);
- } else {
- P0 = I521(4, 3, 1);
- P2 = I332(3, 7, 4);
- }
-} break;
-case 106 :
-case 120 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 2);
- P3 = I31(4, 8);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
-} break;
-case 110 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 5);
- P3 = I31(4, 8);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
-} break;
-case 111 :
-{
- P1 = I31(4, 5);
- P3 = I31(4, 8);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I1411(4, 1, 3);
- }
-} break;
-case 112 :
-case 113 :
-{
- P0 = I211(4, 1, 3);
- P1 = I31(4, 2);
- if (MDR) {
- P2 = I31(4, 3);
- P3 = I31(4, 8);
- } else {
- P2 = I521(4, 7, 3);
- P3 = I332(5, 7, 4);
- }
-} break;
-case 114 :
-{
- P0 = I31(4, 0);
- P2 = I31(4, 3);
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I611(4, 5, 7);
- }
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I611(4, 1, 5);
- }
-} break;
-case 115 :
-{
- P0 = I31(4, 3);
- P2 = I31(4, 3);
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I611(4, 5, 7);
- }
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I611(4, 1, 5);
- }
-} break;
-case 116 :
-case 117 :
-{
- P0 = I211(4, 1, 3);
- P1 = I31(4, 1);
- P2 = I31(4, 3);
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I611(4, 5, 7);
- }
-} break;
-case 118 :
-{
- P0 = I31(4, 0);
- P2 = I31(4, 3);
- P3 = I31(4, 8);
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 119 :
-{
- P2 = I31(4, 3);
- P3 = I31(4, 8);
- if (MUR) {
- P0 = I31(4, 3);
- P1 = IC(4);
- } else {
- P0 = I521(4, 1, 3);
- P1 = I332(1, 5, 4);
- }
-} break;
-case 121 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 2);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I611(4, 5, 7);
- }
-} break;
-case 122 :
-{
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
- if (MDR) {
- P3 = I31(4, 8);
- } else {
- P3 = I611(4, 5, 7);
- }
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I611(4, 1, 3);
- }
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I611(4, 1, 5);
- }
-} break;
-case 124 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 1);
- P3 = I31(4, 8);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
-} break;
-case 125 :
-{
- P1 = I31(4, 1);
- P3 = I31(4, 8);
- if (MDL) {
- P0 = I31(4, 1);
- P2 = IC(4);
- } else {
- P0 = I521(4, 3, 1);
- P2 = I332(3, 7, 4);
- }
-} break;
-case 126 :
-{
- P0 = I31(4, 0);
- P3 = I31(4, 8);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 127 :
-{
- P3 = I31(4, 8);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I1411(4, 1, 3);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 144 :
-case 145 :
-case 176 :
-case 177 :
-{
- P0 = I211(4, 1, 3);
- P1 = I31(4, 2);
- P2 = I211(4, 3, 7);
- P3 = I31(4, 7);
-} break;
-case 146 :
-case 178 :
-{
- P0 = I31(4, 0);
- P2 = I211(4, 3, 7);
- if (MUR) {
- P1 = I31(4, 2);
- P3 = I31(4, 7);
- } else {
- P1 = I332(1, 5, 4);
- P3 = I521(4, 5, 7);
- }
-} break;
-case 147 :
-case 179 :
-{
- P0 = I31(4, 3);
- P2 = I211(4, 3, 7);
- P3 = I31(4, 7);
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I611(4, 1, 5);
- }
-} break;
-case 148 :
-case 149 :
-case 180 :
-case 181 :
-{
- P0 = I211(4, 1, 3);
- P1 = I31(4, 1);
- P2 = I211(4, 3, 7);
- P3 = I31(4, 7);
-} break;
-case 150 :
-case 182 :
-{
- P0 = I31(4, 0);
- P2 = I211(4, 3, 7);
- if (MUR) {
- P1 = IC(4);
- P3 = I31(4, 7);
- } else {
- P1 = I332(1, 5, 4);
- P3 = I521(4, 5, 7);
- }
-} break;
-case 151 :
-case 183 :
-{
- P0 = I31(4, 3);
- P2 = I211(4, 3, 7);
- P3 = I31(4, 7);
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I1411(4, 1, 5);
- }
-} break;
-case 152 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- P3 = I31(4, 7);
-} break;
-case 153 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- P3 = I31(4, 7);
-} break;
-case 154 :
-{
- P2 = I31(4, 6);
- P3 = I31(4, 7);
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I611(4, 1, 3);
- }
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I611(4, 1, 5);
- }
-} break;
-case 155 :
-{
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- P3 = I31(4, 7);
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
-} break;
-case 156 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 1);
- P2 = I31(4, 6);
- P3 = I31(4, 7);
-} break;
-case 157 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 1);
- P2 = I31(4, 6);
- P3 = I31(4, 7);
-} break;
-case 158 :
-{
- P2 = I31(4, 6);
- P3 = I31(4, 7);
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I611(4, 1, 3);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 159 :
-{
- P2 = I31(4, 6);
- P3 = I31(4, 7);
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I1411(4, 1, 5);
- }
-} break;
-case 184 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 2);
- P2 = I31(4, 7);
- P3 = I31(4, 7);
-} break;
-case 185 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 2);
- P2 = I31(4, 7);
- P3 = I31(4, 7);
-} break;
-case 186 :
-{
- P2 = I31(4, 7);
- P3 = I31(4, 7);
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I611(4, 1, 3);
- }
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I611(4, 1, 5);
- }
-} break;
-case 187 :
-{
- P1 = I31(4, 2);
- P3 = I31(4, 7);
- if (MUL) {
- P0 = IC(4);
- P2 = I31(4, 7);
- } else {
- P0 = I332(1, 3, 4);
- P2 = I521(4, 3, 7);
- }
-} break;
-case 188 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 1);
- P2 = I31(4, 7);
- P3 = I31(4, 7);
-} break;
-case 189 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 1);
- P2 = I31(4, 7);
- P3 = I31(4, 7);
-} break;
-case 190 :
-{
- P0 = I31(4, 0);
- P2 = I31(4, 7);
- if (MUR) {
- P1 = IC(4);
- P3 = I31(4, 7);
- } else {
- P1 = I332(1, 5, 4);
- P3 = I521(4, 5, 7);
- }
-} break;
-case 191 :
-{
- P2 = I31(4, 7);
- P3 = I31(4, 7);
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I1411(4, 1, 3);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I1411(4, 1, 5);
- }
-} break;
-case 192 :
-case 193 :
-case 196 :
-case 197 :
-{
- P0 = I211(4, 1, 3);
- P1 = I211(4, 1, 5);
- P2 = I31(4, 6);
- P3 = I31(4, 5);
-} break;
-case 194 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- P3 = I31(4, 5);
-} break;
-case 195 :
-{
- P0 = I31(4, 3);
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- P3 = I31(4, 5);
-} break;
-case 198 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 5);
- P2 = I31(4, 6);
- P3 = I31(4, 5);
-} break;
-case 199 :
-{
- P0 = I31(4, 3);
- P1 = I31(4, 5);
- P2 = I31(4, 6);
- P3 = I31(4, 5);
-} break;
-case 200 :
-case 204 :
-{
- P0 = I31(4, 0);
- P1 = I211(4, 1, 5);
- if (MDL) {
- P2 = I31(4, 6);
- P3 = I31(4, 5);
- } else {
- P2 = I332(3, 7, 4);
- P3 = I521(4, 7, 5);
- }
-} break;
-case 201 :
-case 205 :
-{
- P0 = I31(4, 1);
- P1 = I211(4, 1, 5);
- P3 = I31(4, 5);
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I611(4, 3, 7);
- }
-} break;
-case 202 :
-{
- P1 = I31(4, 2);
- P3 = I31(4, 5);
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I611(4, 3, 7);
- }
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I611(4, 1, 3);
- }
-} break;
-case 203 :
-{
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- P3 = I31(4, 5);
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
-} break;
-case 206 :
-{
- P1 = I31(4, 5);
- P3 = I31(4, 5);
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I611(4, 3, 7);
- }
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I611(4, 1, 3);
- }
-} break;
-case 207 :
-{
- P2 = I31(4, 6);
- P3 = I31(4, 5);
- if (MUL) {
- P0 = IC(4);
- P1 = I31(4, 5);
- } else {
- P0 = I332(1, 3, 4);
- P1 = I521(4, 1, 5);
- }
-} break;
-case 208 :
-case 209 :
-{
- P0 = I211(4, 1, 3);
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
-} break;
-case 210 :
-case 216 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
-} break;
-case 211 :
-{
- P0 = I31(4, 3);
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
-} break;
-case 212 :
-case 213 :
-{
- P0 = I211(4, 1, 3);
- P2 = I31(4, 6);
- if (MDR) {
- P1 = I31(4, 1);
- P3 = IC(4);
- } else {
- P1 = I521(4, 5, 1);
- P3 = I332(5, 7, 4);
- }
-} break;
-case 215 :
-{
- P0 = I31(4, 3);
- P2 = I31(4, 6);
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I1411(4, 1, 5);
- }
-} break;
-case 217 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
-} break;
-case 218 :
-{
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I611(4, 3, 7);
- }
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I611(4, 1, 3);
- }
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I611(4, 1, 5);
- }
-} break;
-case 219 :
-{
- P1 = I31(4, 2);
- P2 = I31(4, 6);
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
-} break;
-case 220 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 1);
- if (MDL) {
- P2 = I31(4, 6);
- } else {
- P2 = I611(4, 3, 7);
- }
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
-} break;
-case 221 :
-{
- P0 = I31(4, 1);
- P2 = I31(4, 6);
- if (MDR) {
- P1 = I31(4, 1);
- P3 = IC(4);
- } else {
- P1 = I521(4, 5, 1);
- P3 = I332(5, 7, 4);
- }
-} break;
-case 223 :
-{
- P2 = I31(4, 6);
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I1411(4, 1, 5);
- }
-} break;
-case 224 :
-case 225 :
-case 228 :
-case 229 :
-{
- P0 = I211(4, 1, 3);
- P1 = I211(4, 1, 5);
- P2 = I31(4, 3);
- P3 = I31(4, 5);
-} break;
-case 226 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 2);
- P2 = I31(4, 3);
- P3 = I31(4, 5);
-} break;
-case 227 :
-{
- P0 = I31(4, 3);
- P1 = I31(4, 2);
- P2 = I31(4, 3);
- P3 = I31(4, 5);
-} break;
-case 230 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 5);
- P2 = I31(4, 3);
- P3 = I31(4, 5);
-} break;
-case 231 :
-{
- P0 = I31(4, 3);
- P1 = I31(4, 5);
- P2 = I31(4, 3);
- P3 = I31(4, 5);
-} break;
-case 232 :
-case 236 :
-{
- P0 = I31(4, 0);
- P1 = I211(4, 1, 5);
- if (MDL) {
- P2 = IC(4);
- P3 = I31(4, 5);
- } else {
- P2 = I332(3, 7, 4);
- P3 = I521(4, 7, 5);
- }
-} break;
-case 233 :
-case 237 :
-{
- P0 = I31(4, 1);
- P1 = I211(4, 1, 5);
- P3 = I31(4, 5);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I1411(4, 3, 7);
- }
-} break;
-case 234 :
-{
- P1 = I31(4, 2);
- P3 = I31(4, 5);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
- if (MUL) {
- P0 = I31(4, 0);
- } else {
- P0 = I611(4, 1, 3);
- }
-} break;
-case 235 :
-{
- P1 = I31(4, 2);
- P3 = I31(4, 5);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I1411(4, 3, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
-} break;
-case 238 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 5);
- if (MDL) {
- P2 = IC(4);
- P3 = I31(4, 5);
- } else {
- P2 = I332(3, 7, 4);
- P3 = I521(4, 7, 5);
- }
-} break;
-case 239 :
-{
- P1 = I31(4, 5);
- P3 = I31(4, 5);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I1411(4, 3, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I1411(4, 1, 3);
- }
-} break;
-case 240 :
-case 241 :
-{
- P0 = I211(4, 1, 3);
- P1 = I31(4, 2);
- if (MDR) {
- P2 = I31(4, 3);
- P3 = IC(4);
- } else {
- P2 = I521(4, 7, 3);
- P3 = I332(5, 7, 4);
- }
-} break;
-case 242 :
-{
- P0 = I31(4, 0);
- P2 = I31(4, 3);
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
- if (MUR) {
- P1 = I31(4, 2);
- } else {
- P1 = I611(4, 1, 5);
- }
-} break;
-case 243 :
-{
- P0 = I31(4, 3);
- P1 = I31(4, 2);
- if (MDR) {
- P2 = I31(4, 3);
- P3 = IC(4);
- } else {
- P2 = I521(4, 7, 3);
- P3 = I332(5, 7, 4);
- }
-} break;
-case 244 :
-case 245 :
-{
- P0 = I211(4, 1, 3);
- P1 = I31(4, 1);
- P2 = I31(4, 3);
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I1411(4, 5, 7);
- }
-} break;
-case 246 :
-{
- P0 = I31(4, 0);
- P2 = I31(4, 3);
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I1411(4, 5, 7);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 247 :
-{
- P0 = I31(4, 3);
- P2 = I31(4, 3);
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I1411(4, 5, 7);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I1411(4, 1, 5);
- }
-} break;
-case 249 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 2);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I1411(4, 3, 7);
- }
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
-} break;
-case 251 :
-{
- P1 = I31(4, 2);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I1411(4, 3, 7);
- }
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
-} break;
-case 252 :
-{
- P0 = I31(4, 0);
- P1 = I31(4, 1);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I1411(4, 5, 7);
- }
-} break;
-case 253 :
-{
- P0 = I31(4, 1);
- P1 = I31(4, 1);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I1411(4, 3, 7);
- }
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I1411(4, 5, 7);
- }
-} break;
-case 254 :
-{
- P0 = I31(4, 0);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I1411(4, 5, 7);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 255 :
-{
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I1411(4, 3, 7);
- }
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I1411(4, 5, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I1411(4, 1, 3);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I1411(4, 1, 5);
- }
-} break;
diff --git a/src/sdl/filter/interp.h b/src/sdl/filter/interp.h
deleted file mode 100644
index e994387f..00000000
--- a/src/sdl/filter/interp.h
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- * This file is part of the Advance project.
- *
- * Copyright (C) 2003 Andrea Mazzoleni
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * In addition, as a special exception, Andrea Mazzoleni
- * gives permission to link the code of this program with
- * the MAME library (or with modified versions of MAME that use the
- * same license as MAME), and distribute linked combinations including
- * the two. You must obey the GNU General Public License in all
- * respects for all of the code used other than MAME. If you modify
- * this file, you may extend this exception to your version of the
- * file, but you are not obligated to do so. If you do not wish to
- * do so, delete this exception statement from your version.
- */
-
-#ifndef __INTERP_H
-#define __INTERP_H
-
-/***************************************************************************/
-/* Basic types */
-
-/***************************************************************************/
-/* interpolation */
-
-static Uint32 interp_mask[2] = {0xF81F,0x07E0};
-static Uint32 interp_bits_per_pixel = 16;
-
-#define INTERP_16_MASK_1(v) (v & interp_mask[0])
-#define INTERP_16_MASK_2(v) (v & interp_mask[1])
-
-FUNCINLINE static ATTRINLINE Uint16 interp_16_521(Uint16 p1, Uint16 p2, Uint16 p3)
-{
- return (Uint16)(INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*5 + INTERP_16_MASK_1(p2)*2 + INTERP_16_MASK_1(p3)*1) / 8)
- | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*5 + INTERP_16_MASK_2(p2)*2 + INTERP_16_MASK_2(p3)*1) / 8));
-}
-
-FUNCINLINE static ATTRINLINE Uint16 interp_16_332(Uint16 p1, Uint16 p2, Uint16 p3)
-{
- return (Uint16)(INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*3 + INTERP_16_MASK_1(p2)*3 + INTERP_16_MASK_1(p3)*2) / 8)
- | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*3 + INTERP_16_MASK_2(p2)*3 + INTERP_16_MASK_2(p3)*2) / 8));
-}
-
-FUNCINLINE static ATTRINLINE Uint16 interp_16_611(Uint16 p1, Uint16 p2, Uint16 p3)
-{
- return (Uint16)(INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*6 + INTERP_16_MASK_1(p2) + INTERP_16_MASK_1(p3)) / 8)
- | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*6 + INTERP_16_MASK_2(p2) + INTERP_16_MASK_2(p3)) / 8));
-}
-
-/*
-FUNCINLINE static ATTRINLINE Uint16 interp_16_71(Uint16 p1, Uint16 p2)
-{
- return (Uint16)(INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*7 + INTERP_16_MASK_1(p2)) / 8)
- | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*7 + INTERP_16_MASK_2(p2)) / 8));
-}
-*/
-
-FUNCINLINE static ATTRINLINE Uint16 interp_16_211(Uint16 p1, Uint16 p2, Uint16 p3)
-{
- return (Uint16)(INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*2 + INTERP_16_MASK_1(p2) + INTERP_16_MASK_1(p3)) / 4)
- | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*2 + INTERP_16_MASK_2(p2) + INTERP_16_MASK_2(p3)) / 4));
-}
-
-/*
-FUNCINLINE static ATTRINLINE Uint16 interp_16_772(Uint16 p1, Uint16 p2, Uint16 p3)
-{
- return (Uint16)(INTERP_16_MASK_1(((INTERP_16_MASK_1(p1) + INTERP_16_MASK_1(p2))*7 + INTERP_16_MASK_1(p3)*2) / 16)
- | INTERP_16_MASK_2(((INTERP_16_MASK_2(p1) + INTERP_16_MASK_2(p2))*7 + INTERP_16_MASK_2(p3)*2) / 16));
-}
-
-FUNCINLINE static ATTRINLINE Uint16 interp_16_11(Uint16 p1, Uint16 p2)
-{
- return (Uint16)(INTERP_16_MASK_1((INTERP_16_MASK_1(p1) + INTERP_16_MASK_1(p2)) / 2)
- | INTERP_16_MASK_2((INTERP_16_MASK_2(p1) + INTERP_16_MASK_2(p2)) / 2));
-}
-*/
-
-FUNCINLINE static ATTRINLINE Uint16 interp_16_31(Uint16 p1, Uint16 p2)
-{
- return (Uint16)(INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*3 + INTERP_16_MASK_1(p2)) / 4)
- | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*3 + INTERP_16_MASK_2(p2)) / 4));
-}
-
-FUNCINLINE static ATTRINLINE Uint16 interp_16_1411(Uint16 p1, Uint16 p2, Uint16 p3)
-{
- return (Uint16)(INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*14 + INTERP_16_MASK_1(p2) + INTERP_16_MASK_1(p3)) / 16)
- | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*14 + INTERP_16_MASK_2(p2) + INTERP_16_MASK_2(p3)) / 16));
-}
-
-/*
-FUNCINLINE static ATTRINLINE Uint16 interp_16_431(Uint16 p1, Uint16 p2, Uint16 p3)
-{
- return (Uint16)(INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*4 + INTERP_16_MASK_1(p2)*3 + INTERP_16_MASK_1(p3)) / 8)
- | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*4 + INTERP_16_MASK_2(p2)*3 + INTERP_16_MASK_2(p3)) / 8));
-}
-
-FUNCINLINE static ATTRINLINE Uint16 interp_16_53(Uint16 p1, Uint16 p2)
-{
- return (Uint16)(INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*5 + INTERP_16_MASK_1(p2)*3) / 8)
- | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*5 + INTERP_16_MASK_2(p2)*3) / 8));
-}
-
-FUNCINLINE static ATTRINLINE Uint16 interp_16_151(Uint16 p1, Uint16 p2)
-{
- return (Uint16)(INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*15 + INTERP_16_MASK_1(p2)) / 16)
- | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*15 + INTERP_16_MASK_2(p2)) / 16));
-}
-
-FUNCINLINE static ATTRINLINE Uint16 interp_16_97(Uint16 p1, Uint16 p2)
-{
- return (Uint16)(INTERP_16_MASK_1((INTERP_16_MASK_1(p1)*9 + INTERP_16_MASK_1(p2)*7) / 16)
- | INTERP_16_MASK_2((INTERP_16_MASK_2(p1)*9 + INTERP_16_MASK_2(p2)*7) / 16));
-}
-*/
-
-#define INTERP_32_MASK_1(v) (v & 0xFF00FF)
-#define INTERP_32_MASK_2(v) (v & 0x00FF00)
-
-FUNCINLINE static ATTRINLINE Uint32 interp_32_521(Uint32 p1, Uint32 p2, Uint32 p3)
-{
- return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*5 + INTERP_32_MASK_1(p2)*2 + INTERP_32_MASK_1(p3)*1) / 8)
- | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*5 + INTERP_32_MASK_2(p2)*2 + INTERP_32_MASK_2(p3)*1) / 8);
-}
-
-FUNCINLINE static ATTRINLINE Uint32 interp_32_332(Uint32 p1, Uint32 p2, Uint32 p3)
-{
- return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*3 + INTERP_32_MASK_1(p2)*3 + INTERP_32_MASK_1(p3)*2) / 8)
- | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*3 + INTERP_32_MASK_2(p2)*3 + INTERP_32_MASK_2(p3)*2) / 8);
-}
-
-FUNCINLINE static ATTRINLINE Uint32 interp_32_211(Uint32 p1, Uint32 p2, Uint32 p3)
-{
- return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*2 + INTERP_32_MASK_1(p2) + INTERP_32_MASK_1(p3)) / 4)
- | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*2 + INTERP_32_MASK_2(p2) + INTERP_32_MASK_2(p3)) / 4);
-}
-
-FUNCINLINE static ATTRINLINE Uint32 interp_32_611(Uint32 p1, Uint32 p2, Uint32 p3)
-{
- return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*6 + INTERP_32_MASK_1(p2) + INTERP_32_MASK_1(p3)) / 8)
- | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*6 + INTERP_32_MASK_2(p2) + INTERP_32_MASK_2(p3)) / 8);
-}
-
-/*
-FUNCINLINE static ATTRINLINE Uint32 interp_32_71(Uint32 p1, Uint32 p2)
-{
- return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*7 + INTERP_32_MASK_1(p2)) / 8)
- | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*7 + INTERP_32_MASK_2(p2)) / 8);
-}
-
-FUNCINLINE static ATTRINLINE Uint32 interp_32_772(Uint32 p1, Uint32 p2, Uint32 p3)
-{
- return INTERP_32_MASK_1(((INTERP_32_MASK_1(p1) + INTERP_32_MASK_1(p2))*7 + INTERP_32_MASK_1(p3)*2) / 16)
- | INTERP_32_MASK_2(((INTERP_32_MASK_2(p1) + INTERP_32_MASK_2(p2))*7 + INTERP_32_MASK_2(p3)*2) / 16);
-}
-
-FUNCINLINE static ATTRINLINE Uint32 interp_32_11(Uint32 p1, Uint32 p2)
-{
- return INTERP_32_MASK_1((INTERP_32_MASK_1(p1) + INTERP_32_MASK_1(p2)) / 2)
- | INTERP_32_MASK_2((INTERP_32_MASK_2(p1) + INTERP_32_MASK_2(p2)) / 2);
-}
-*/
-
-FUNCINLINE static ATTRINLINE Uint32 interp_32_31(Uint32 p1, Uint32 p2)
-{
- return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*3 + INTERP_32_MASK_1(p2)) / 4)
- | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*3 + INTERP_32_MASK_2(p2)) / 4);
-}
-
-FUNCINLINE static ATTRINLINE Uint32 interp_32_1411(Uint32 p1, Uint32 p2, Uint32 p3)
-{
- return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*14 + INTERP_32_MASK_1(p2) + INTERP_32_MASK_1(p3)) / 16)
- | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*14 + INTERP_32_MASK_2(p2) + INTERP_32_MASK_2(p3)) / 16);
-}
-
-/*
-FUNCINLINE static ATTRINLINE Uint32 interp_32_431(Uint32 p1, Uint32 p2, Uint32 p3)
-{
- return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*4 + INTERP_32_MASK_1(p2)*3 + INTERP_32_MASK_1(p3)) / 8)
- | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*4 + INTERP_32_MASK_2(p2)*3 + INTERP_32_MASK_2(p3)) / 8);
-}
-
-FUNCINLINE static ATTRINLINE Uint32 interp_32_53(Uint32 p1, Uint32 p2)
-{
- return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*5 + INTERP_32_MASK_1(p2)*3) / 8)
- | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*5 + INTERP_32_MASK_2(p2)*3) / 8);
-}
-
-FUNCINLINE static ATTRINLINE Uint32 interp_32_151(Uint32 p1, Uint32 p2)
-{
- return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*15 + INTERP_32_MASK_1(p2)) / 16)
- | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*15 + INTERP_32_MASK_2(p2)) / 16);
-}
-
-FUNCINLINE static ATTRINLINE Uint32 interp_32_97(Uint32 p1, Uint32 p2)
-{
- return INTERP_32_MASK_1((INTERP_32_MASK_1(p1)*9 + INTERP_32_MASK_1(p2)*7) / 16)
- | INTERP_32_MASK_2((INTERP_32_MASK_2(p1)*9 + INTERP_32_MASK_2(p2)*7) / 16);
-}
-*/
-
-/***************************************************************************/
-/* diff */
-
-#define INTERP_Y_LIMIT (0x30*4)
-#define INTERP_U_LIMIT (0x07*4)
-#define INTERP_V_LIMIT (0x06*8)
-
-static int interp_16_diff(Uint16 p1, Uint16 p2)
-{
- int r, g, b;
- int y, u, v;
-
- if (p1 == p2)
- return 0;
-
- if (interp_bits_per_pixel == 16) {
- b = (int)((p1 & 0x1F) - (p2 & 0x1F)) << 3;
- g = (int)((p1 & 0x7E0) - (p2 & 0x7E0)) >> 3;
- r = (int)((p1 & 0xF800) - (p2 & 0xF800)) >> 8;
- } else {
- b = (int)((p1 & 0x1F) - (p2 & 0x1F)) << 3;
- g = (int)((p1 & 0x3E0) - (p2 & 0x3E0)) >> 2;
- r = (int)((p1 & 0x7C00) - (p2 & 0x7C00)) >> 7;
- }
-
- y = r + g + b;
- u = r - b;
- v = -r + 2*g - b;
-
- if (y < -INTERP_Y_LIMIT || y > INTERP_Y_LIMIT)
- return 1;
-
- if (u < -INTERP_U_LIMIT || u > INTERP_U_LIMIT)
- return 1;
-
- if (v < -INTERP_V_LIMIT || v > INTERP_V_LIMIT)
- return 1;
-
- return 0;
-}
-
-static int interp_32_diff(Uint32 p1, Uint32 p2)
-{
- int r, g, b;
- int y, u, v;
-
- if ((p1 & 0xF8F8F8) == (p2 & 0xF8F8F8))
- return 0;
-
- b = (int)((p1 & 0xFF) - (p2 & 0xFF));
- g = (int)((p1 & 0xFF00) - (p2 & 0xFF00)) >> 8;
- r = (int)((p1 & 0xFF0000) - (p2 & 0xFF0000)) >> 16;
-
- y = r + g + b;
- u = r - b;
- v = -r + 2*g - b;
-
- if (y < -INTERP_Y_LIMIT || y > INTERP_Y_LIMIT)
- return 1;
-
- if (u < -INTERP_U_LIMIT || u > INTERP_U_LIMIT)
- return 1;
-
- if (v < -INTERP_V_LIMIT || v > INTERP_V_LIMIT)
- return 1;
-
- return 0;
-}
-
-/*
-static void interp_set(Uint32 bits_per_pixel)
-{
- interp_bits_per_pixel = bits_per_pixel;
-
- switch (bits_per_pixel) {
- case 15 :
- interp_mask[0] = 0x7C1F;
- interp_mask[1] = 0x03E0;
- break;
- case 16 :
- interp_mask[0] = 0xF81F;
- interp_mask[1] = 0x07E0;
- break;
- case 32 :
- interp_mask[0] = 0xFF00FF;
- interp_mask[1] = 0x00FF00;
- break;
- }
-}
-*/
-
-#endif
diff --git a/src/sdl/filter/lq2x.c b/src/sdl/filter/lq2x.c
deleted file mode 100644
index 8d06fa8c..00000000
--- a/src/sdl/filter/lq2x.c
+++ /dev/null
@@ -1,564 +0,0 @@
-#include "filters.h"
-#include "interp.h"
-
-static void hq2x_16_def(Uint16* dst0, Uint16* dst1, const Uint16* src0, const Uint16* src1, const Uint16* src2, Uint32 count)
-{
- Uint32 i;
-
- for(i=0;i0) {
- c[0] = src0[-1];
- c[3] = src1[-1];
- c[6] = src2[-1];
- } else {
- c[0] = c[1];
- c[3] = c[4];
- c[6] = c[7];
- }
-
- if (i0) {
- c[0] = src0[-1];
- c[3] = src1[-1];
- c[6] = src2[-1];
- } else {
- c[0] = c[1];
- c[3] = c[4];
- c[6] = c[7];
- }
-
- if (i0) {
- c[0] = src0[-1];
- c[3] = src1[-1];
- c[6] = src2[-1];
- } else {
- c[0] = c[1];
- c[3] = c[4];
- c[6] = c[7];
- }
-
- if (i0) {
- c[0] = src0[-1];
- c[3] = src1[-1];
- c[6] = src2[-1];
- } else {
- c[0] = c[1];
- c[3] = c[4];
- c[6] = c[7];
- }
-
- if (i> 1);
-
- Uint16 *src0 = (Uint16 *)srcPtr;
- Uint16 *src1 = src0 + (srcPitch >> 1);
- Uint16 *src2 = src1 + (srcPitch >> 1);
- int count = height-2;
-
- hq2x_16_def(dst0, dst1, src0, src0, src1, width);
-
- while(count) {
- dst0 += dstPitch;
- dst1 += dstPitch;
- hq2x_16_def(dst0, dst1, src0, src1, src2, width);
- src0 = src1;
- src1 = src2;
- src2 += srcPitch >> 1;
- --count;
- }
- dst0 += dstPitch;
- dst1 += dstPitch;
- hq2x_16_def(dst0, dst1, src0, src1, src1, width);
-}
-
-void hq2x32(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr,
- Uint32 dstPitch, int width, int height)
-{
- Uint32 *dst0 = (Uint32 *)dstPtr;
- Uint32 *dst1 = dst0 + (dstPitch >> 2);
-
- Uint32 *src0 = (Uint32 *)srcPtr;
- Uint32 *src1 = src0 + (srcPitch >> 2);
- Uint32 *src2 = src1 + (srcPitch >> 2);
- int count = height-2;
-
- hq2x_32_def(dst0, dst1, src0, src0, src1, width);
-
- while(count) {
- dst0 += dstPitch >> 1;
- dst1 += dstPitch >> 1;
- hq2x_32_def(dst0, dst1, src0, src1, src2, width);
- src0 = src1;
- src1 = src2;
- src2 += srcPitch >> 2;
- --count;
- }
- dst0 += dstPitch >> 1;
- dst1 += dstPitch >> 1;
- hq2x_32_def(dst0, dst1, src0, src1, src1, width);
-}
-
-void lq2x16(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr,
- Uint32 dstPitch, int width, int height)
-{
- Uint16 *dst0 = (Uint16 *)dstPtr;
- Uint16 *dst1 = dst0 + (dstPitch >> 1);
-
- Uint16 *src0 = (Uint16 *)srcPtr;
- Uint16 *src1 = src0 + (srcPitch >> 1);
- Uint16 *src2 = src1 + (srcPitch >> 1);
- int count = height-2;
-
- lq2x_16_def(dst0, dst1, src0, src0, src1, width);
-
- while(count) {
- dst0 += dstPitch;
- dst1 += dstPitch;
- lq2x_16_def(dst0, dst1, src0, src1, src2, width);
- src0 = src1;
- src1 = src2;
- src2 += srcPitch >> 1;
- --count;
- }
- dst0 += dstPitch;
- dst1 += dstPitch;
- lq2x_16_def(dst0, dst1, src0, src1, src1, width);
-}
-
-void lq2x32(Uint8 *srcPtr, Uint32 srcPitch, Uint8 *dstPtr,
- Uint32 dstPitch, int width, int height)
-{
- Uint32 *dst0 = (Uint32 *)dstPtr;
- Uint32 *dst1 = dst0 + (dstPitch >> 2);
-
- Uint32 *src0 = (Uint32 *)srcPtr;
- Uint32 *src1 = src0 + (srcPitch >> 2);
- Uint32 *src2 = src1 + (srcPitch >> 2);
- int count = height-2;
-
- lq2x_32_def(dst0, dst1, src0, src0, src1, width);
-
- while(count) {
- dst0 += dstPitch >> 1;
- dst1 += dstPitch >> 1;
- lq2x_32_def(dst0, dst1, src0, src1, src2, width);
- src0 = src1;
- src1 = src2;
- src2 += srcPitch >> 2;
- --count;
- }
- dst0 += dstPitch >> 1;
- dst1 += dstPitch >> 1;
- lq2x_32_def(dst0, dst1, src0, src1, src1, width);
-}
-
-/*
-static inline void hq2x_init(Uint32 bits_per_pixel)
-{
- interp_set(bits_per_pixel);
-}
-*/
diff --git a/src/sdl/filter/lq2x.h b/src/sdl/filter/lq2x.h
deleted file mode 100644
index 094c2b5a..00000000
--- a/src/sdl/filter/lq2x.h
+++ /dev/null
@@ -1,1284 +0,0 @@
-case 0 :
-case 2 :
-case 4 :
-case 6 :
-case 8 :
-case 12 :
-case 16 :
-case 20 :
-case 24 :
-case 28 :
-case 32 :
-case 34 :
-case 36 :
-case 38 :
-case 40 :
-case 44 :
-case 48 :
-case 52 :
-case 56 :
-case 60 :
-case 64 :
-case 66 :
-case 68 :
-case 70 :
-case 96 :
-case 98 :
-case 100 :
-case 102 :
-case 128 :
-case 130 :
-case 132 :
-case 134 :
-case 136 :
-case 140 :
-case 144 :
-case 148 :
-case 152 :
-case 156 :
-case 160 :
-case 162 :
-case 164 :
-case 166 :
-case 168 :
-case 172 :
-case 176 :
-case 180 :
-case 184 :
-case 188 :
-case 192 :
-case 194 :
-case 196 :
-case 198 :
-case 224 :
-case 226 :
-case 228 :
-case 230 :
-{
- P0 = IC(0);
- P1 = IC(0);
- P2 = IC(0);
- P3 = IC(0);
-} break;
-case 1 :
-case 5 :
-case 9 :
-case 13 :
-case 17 :
-case 21 :
-case 25 :
-case 29 :
-case 33 :
-case 37 :
-case 41 :
-case 45 :
-case 49 :
-case 53 :
-case 57 :
-case 61 :
-case 65 :
-case 69 :
-case 97 :
-case 101 :
-case 129 :
-case 133 :
-case 137 :
-case 141 :
-case 145 :
-case 149 :
-case 153 :
-case 157 :
-case 161 :
-case 165 :
-case 169 :
-case 173 :
-case 177 :
-case 181 :
-case 185 :
-case 189 :
-case 193 :
-case 197 :
-case 225 :
-case 229 :
-{
- P0 = IC(1);
- P1 = IC(1);
- P2 = IC(1);
- P3 = IC(1);
-} break;
-case 3 :
-case 35 :
-case 67 :
-case 99 :
-case 131 :
-case 163 :
-case 195 :
-case 227 :
-{
- P0 = IC(2);
- P1 = IC(2);
- P2 = IC(2);
- P3 = IC(2);
-} break;
-case 7 :
-case 39 :
-case 71 :
-case 103 :
-case 135 :
-case 167 :
-case 199 :
-case 231 :
-{
- P0 = IC(3);
- P1 = IC(3);
- P2 = IC(3);
- P3 = IC(3);
-} break;
-case 10 :
-case 138 :
-{
- P1 = IC(0);
- P2 = IC(0);
- P3 = IC(0);
- if (MUL) {
- P0 = IC(0);
- } else {
- P0 = I211(0, 1, 3);
- }
-} break;
-case 11 :
-case 27 :
-case 75 :
-case 139 :
-case 155 :
-case 203 :
-{
- P1 = IC(2);
- P2 = IC(2);
- P3 = IC(2);
- if (MUL) {
- P0 = IC(2);
- } else {
- P0 = I211(2, 1, 3);
- }
-} break;
-case 14 :
-case 142 :
-{
- P2 = IC(0);
- P3 = IC(0);
- if (MUL) {
- P0 = IC(0);
- P1 = IC(0);
- } else {
- P0 = I332(1, 3, 0);
- P1 = I31(0, 1);
- }
-} break;
-case 15 :
-case 143 :
-case 207 :
-{
- P2 = IC(4);
- P3 = IC(4);
- if (MUL) {
- P0 = IC(4);
- P1 = IC(4);
- } else {
- P0 = I332(1, 3, 4);
- P1 = I31(4, 1);
- }
-} break;
-case 18 :
-case 22 :
-case 30 :
-case 50 :
-case 54 :
-case 62 :
-case 86 :
-case 118 :
-{
- P0 = IC(0);
- P2 = IC(0);
- P3 = IC(0);
- if (MUR) {
- P1 = IC(0);
- } else {
- P1 = I211(0, 1, 5);
- }
-} break;
-case 19 :
-case 51 :
-{
- P2 = IC(2);
- P3 = IC(2);
- if (MUR) {
- P0 = IC(2);
- P1 = IC(2);
- } else {
- P0 = I31(2, 1);
- P1 = I332(1, 5, 2);
- }
-} break;
-case 23 :
-case 55 :
-case 119 :
-{
- P2 = IC(3);
- P3 = IC(3);
- if (MUR) {
- P0 = IC(3);
- P1 = IC(3);
- } else {
- P0 = I31(3, 1);
- P1 = I332(1, 5, 3);
- }
-} break;
-case 26 :
-{
- P2 = IC(0);
- P3 = IC(0);
- if (MUL) {
- P0 = IC(0);
- } else {
- P0 = I211(0, 1, 3);
- }
- if (MUR) {
- P1 = IC(0);
- } else {
- P1 = I211(0, 1, 5);
- }
-} break;
-case 31 :
-case 95 :
-{
- P2 = IC(4);
- P3 = IC(4);
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 42 :
-case 170 :
-{
- P1 = IC(0);
- P3 = IC(0);
- if (MUL) {
- P0 = IC(0);
- P2 = IC(0);
- } else {
- P0 = I332(1, 3, 0);
- P2 = I31(0, 3);
- }
-} break;
-case 43 :
-case 171 :
-case 187 :
-{
- P1 = IC(2);
- P3 = IC(2);
- if (MUL) {
- P0 = IC(2);
- P2 = IC(2);
- } else {
- P0 = I332(1, 3, 2);
- P2 = I31(2, 3);
- }
-} break;
-case 46 :
-case 174 :
-{
- P1 = IC(0);
- P2 = IC(0);
- P3 = IC(0);
- if (MUL) {
- P0 = IC(0);
- } else {
- P0 = I611(0, 1, 3);
- }
-} break;
-case 47 :
-case 175 :
-{
- P1 = IC(4);
- P2 = IC(4);
- P3 = IC(4);
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I1411(4, 1, 3);
- }
-} break;
-case 58 :
-case 154 :
-case 186 :
-{
- P2 = IC(0);
- P3 = IC(0);
- if (MUL) {
- P0 = IC(0);
- } else {
- P0 = I611(0, 1, 3);
- }
- if (MUR) {
- P1 = IC(0);
- } else {
- P1 = I611(0, 1, 5);
- }
-} break;
-case 59 :
-{
- P2 = IC(2);
- P3 = IC(2);
- if (MUL) {
- P0 = IC(2);
- } else {
- P0 = I211(2, 1, 3);
- }
- if (MUR) {
- P1 = IC(2);
- } else {
- P1 = I611(2, 1, 5);
- }
-} break;
-case 63 :
-{
- P2 = IC(4);
- P3 = IC(4);
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I1411(4, 1, 3);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 72 :
-case 76 :
-case 104 :
-case 106 :
-case 108 :
-case 110 :
-case 120 :
-case 124 :
-{
- P0 = IC(0);
- P1 = IC(0);
- P3 = IC(0);
- if (MDL) {
- P2 = IC(0);
- } else {
- P2 = I211(0, 3, 7);
- }
-} break;
-case 73 :
-case 77 :
-case 105 :
-case 109 :
-case 125 :
-{
- P1 = IC(1);
- P3 = IC(1);
- if (MDL) {
- P0 = IC(1);
- P2 = IC(1);
- } else {
- P0 = I31(1, 3);
- P2 = I332(3, 7, 1);
- }
-} break;
-case 74 :
-{
- P1 = IC(0);
- P3 = IC(0);
- if (MDL) {
- P2 = IC(0);
- } else {
- P2 = I211(0, 3, 7);
- }
- if (MUL) {
- P0 = IC(0);
- } else {
- P0 = I211(0, 1, 3);
- }
-} break;
-case 78 :
-case 202 :
-case 206 :
-{
- P1 = IC(0);
- P3 = IC(0);
- if (MDL) {
- P2 = IC(0);
- } else {
- P2 = I611(0, 3, 7);
- }
- if (MUL) {
- P0 = IC(0);
- } else {
- P0 = I611(0, 1, 3);
- }
-} break;
-case 79 :
-{
- P1 = IC(4);
- P3 = IC(4);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I611(4, 3, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
-} break;
-case 80 :
-case 208 :
-case 210 :
-case 216 :
-{
- P0 = IC(0);
- P1 = IC(0);
- P2 = IC(0);
- if (MDR) {
- P3 = IC(0);
- } else {
- P3 = I211(0, 5, 7);
- }
-} break;
-case 81 :
-case 209 :
-case 217 :
-{
- P0 = IC(1);
- P1 = IC(1);
- P2 = IC(1);
- if (MDR) {
- P3 = IC(1);
- } else {
- P3 = I211(1, 5, 7);
- }
-} break;
-case 82 :
-case 214 :
-case 222 :
-{
- P0 = IC(0);
- P2 = IC(0);
- if (MDR) {
- P3 = IC(0);
- } else {
- P3 = I211(0, 5, 7);
- }
- if (MUR) {
- P1 = IC(0);
- } else {
- P1 = I211(0, 1, 5);
- }
-} break;
-case 83 :
-case 115 :
-{
- P0 = IC(2);
- P2 = IC(2);
- if (MDR) {
- P3 = IC(2);
- } else {
- P3 = I611(2, 5, 7);
- }
- if (MUR) {
- P1 = IC(2);
- } else {
- P1 = I611(2, 1, 5);
- }
-} break;
-case 84 :
-case 212 :
-{
- P0 = IC(0);
- P2 = IC(0);
- if (MDR) {
- P1 = IC(0);
- P3 = IC(0);
- } else {
- P1 = I31(0, 5);
- P3 = I332(5, 7, 0);
- }
-} break;
-case 85 :
-case 213 :
-case 221 :
-{
- P0 = IC(1);
- P2 = IC(1);
- if (MDR) {
- P1 = IC(1);
- P3 = IC(1);
- } else {
- P1 = I31(1, 5);
- P3 = I332(5, 7, 1);
- }
-} break;
-case 87 :
-{
- P0 = IC(3);
- P2 = IC(3);
- if (MDR) {
- P3 = IC(3);
- } else {
- P3 = I611(3, 5, 7);
- }
- if (MUR) {
- P1 = IC(3);
- } else {
- P1 = I211(3, 1, 5);
- }
-} break;
-case 88 :
-case 248 :
-case 250 :
-{
- P0 = IC(0);
- P1 = IC(0);
- if (MDL) {
- P2 = IC(0);
- } else {
- P2 = I211(0, 3, 7);
- }
- if (MDR) {
- P3 = IC(0);
- } else {
- P3 = I211(0, 5, 7);
- }
-} break;
-case 89 :
-case 93 :
-{
- P0 = IC(1);
- P1 = IC(1);
- if (MDL) {
- P2 = IC(1);
- } else {
- P2 = I611(1, 3, 7);
- }
- if (MDR) {
- P3 = IC(1);
- } else {
- P3 = I611(1, 5, 7);
- }
-} break;
-case 90 :
-{
- if (MDL) {
- P2 = IC(0);
- } else {
- P2 = I611(0, 3, 7);
- }
- if (MDR) {
- P3 = IC(0);
- } else {
- P3 = I611(0, 5, 7);
- }
- if (MUL) {
- P0 = IC(0);
- } else {
- P0 = I611(0, 1, 3);
- }
- if (MUR) {
- P1 = IC(0);
- } else {
- P1 = I611(0, 1, 5);
- }
-} break;
-case 91 :
-{
- if (MDL) {
- P2 = IC(2);
- } else {
- P2 = I611(2, 3, 7);
- }
- if (MDR) {
- P3 = IC(2);
- } else {
- P3 = I611(2, 5, 7);
- }
- if (MUL) {
- P0 = IC(2);
- } else {
- P0 = I211(2, 1, 3);
- }
- if (MUR) {
- P1 = IC(2);
- } else {
- P1 = I611(2, 1, 5);
- }
-} break;
-case 92 :
-{
- P0 = IC(0);
- P1 = IC(0);
- if (MDL) {
- P2 = IC(0);
- } else {
- P2 = I611(0, 3, 7);
- }
- if (MDR) {
- P3 = IC(0);
- } else {
- P3 = I611(0, 5, 7);
- }
-} break;
-case 94 :
-{
- if (MDL) {
- P2 = IC(0);
- } else {
- P2 = I611(0, 3, 7);
- }
- if (MDR) {
- P3 = IC(0);
- } else {
- P3 = I611(0, 5, 7);
- }
- if (MUL) {
- P0 = IC(0);
- } else {
- P0 = I611(0, 1, 3);
- }
- if (MUR) {
- P1 = IC(0);
- } else {
- P1 = I211(0, 1, 5);
- }
-} break;
-case 107 :
-case 123 :
-{
- P1 = IC(2);
- P3 = IC(2);
- if (MDL) {
- P2 = IC(2);
- } else {
- P2 = I211(2, 3, 7);
- }
- if (MUL) {
- P0 = IC(2);
- } else {
- P0 = I211(2, 1, 3);
- }
-} break;
-case 111 :
-{
- P1 = IC(4);
- P3 = IC(4);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I1411(4, 1, 3);
- }
-} break;
-case 112 :
-case 240 :
-{
- P0 = IC(0);
- P1 = IC(0);
- if (MDR) {
- P2 = IC(0);
- P3 = IC(0);
- } else {
- P2 = I31(0, 7);
- P3 = I332(5, 7, 0);
- }
-} break;
-case 113 :
-case 241 :
-{
- P0 = IC(1);
- P1 = IC(1);
- if (MDR) {
- P2 = IC(1);
- P3 = IC(1);
- } else {
- P2 = I31(1, 7);
- P3 = I332(5, 7, 1);
- }
-} break;
-case 114 :
-{
- P0 = IC(0);
- P2 = IC(0);
- if (MDR) {
- P3 = IC(0);
- } else {
- P3 = I611(0, 5, 7);
- }
- if (MUR) {
- P1 = IC(0);
- } else {
- P1 = I611(0, 1, 5);
- }
-} break;
-case 116 :
-{
- P0 = IC(0);
- P1 = IC(0);
- P2 = IC(0);
- if (MDR) {
- P3 = IC(0);
- } else {
- P3 = I611(0, 5, 7);
- }
-} break;
-case 117 :
-{
- P0 = IC(1);
- P1 = IC(1);
- P2 = IC(1);
- if (MDR) {
- P3 = IC(1);
- } else {
- P3 = I611(1, 5, 7);
- }
-} break;
-case 121 :
-{
- P0 = IC(1);
- P1 = IC(1);
- if (MDL) {
- P2 = IC(1);
- } else {
- P2 = I211(1, 3, 7);
- }
- if (MDR) {
- P3 = IC(1);
- } else {
- P3 = I611(1, 5, 7);
- }
-} break;
-case 122 :
-{
- if (MDL) {
- P2 = IC(0);
- } else {
- P2 = I211(0, 3, 7);
- }
- if (MDR) {
- P3 = IC(0);
- } else {
- P3 = I611(0, 5, 7);
- }
- if (MUL) {
- P0 = IC(0);
- } else {
- P0 = I611(0, 1, 3);
- }
- if (MUR) {
- P1 = IC(0);
- } else {
- P1 = I611(0, 1, 5);
- }
-} break;
-case 126 :
-{
- P0 = IC(0);
- P3 = IC(0);
- if (MDL) {
- P2 = IC(0);
- } else {
- P2 = I211(0, 3, 7);
- }
- if (MUR) {
- P1 = IC(0);
- } else {
- P1 = I211(0, 1, 5);
- }
-} break;
-case 127 :
-{
- P3 = IC(4);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I211(4, 3, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I1411(4, 1, 3);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I211(4, 1, 5);
- }
-} break;
-case 146 :
-case 150 :
-case 178 :
-case 182 :
-case 190 :
-{
- P0 = IC(0);
- P2 = IC(0);
- if (MUR) {
- P1 = IC(0);
- P3 = IC(0);
- } else {
- P1 = I332(1, 5, 0);
- P3 = I31(0, 5);
- }
-} break;
-case 147 :
-case 179 :
-{
- P0 = IC(2);
- P2 = IC(2);
- P3 = IC(2);
- if (MUR) {
- P1 = IC(2);
- } else {
- P1 = I611(2, 1, 5);
- }
-} break;
-case 151 :
-case 183 :
-{
- P0 = IC(3);
- P2 = IC(3);
- P3 = IC(3);
- if (MUR) {
- P1 = IC(3);
- } else {
- P1 = I1411(3, 1, 5);
- }
-} break;
-case 158 :
-{
- P2 = IC(0);
- P3 = IC(0);
- if (MUL) {
- P0 = IC(0);
- } else {
- P0 = I611(0, 1, 3);
- }
- if (MUR) {
- P1 = IC(0);
- } else {
- P1 = I211(0, 1, 5);
- }
-} break;
-case 159 :
-{
- P2 = IC(4);
- P3 = IC(4);
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I1411(4, 1, 5);
- }
-} break;
-case 191 :
-{
- P2 = IC(4);
- P3 = IC(4);
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I1411(4, 1, 3);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I1411(4, 1, 5);
- }
-} break;
-case 200 :
-case 204 :
-case 232 :
-case 236 :
-case 238 :
-{
- P0 = IC(0);
- P1 = IC(0);
- if (MDL) {
- P2 = IC(0);
- P3 = IC(0);
- } else {
- P2 = I332(3, 7, 0);
- P3 = I31(0, 7);
- }
-} break;
-case 201 :
-case 205 :
-{
- P0 = IC(1);
- P1 = IC(1);
- P3 = IC(1);
- if (MDL) {
- P2 = IC(1);
- } else {
- P2 = I611(1, 3, 7);
- }
-} break;
-case 211 :
-{
- P0 = IC(2);
- P1 = IC(2);
- P2 = IC(2);
- if (MDR) {
- P3 = IC(2);
- } else {
- P3 = I211(2, 5, 7);
- }
-} break;
-case 215 :
-{
- P0 = IC(3);
- P2 = IC(3);
- if (MDR) {
- P3 = IC(3);
- } else {
- P3 = I211(3, 5, 7);
- }
- if (MUR) {
- P1 = IC(3);
- } else {
- P1 = I1411(3, 1, 5);
- }
-} break;
-case 218 :
-{
- if (MDL) {
- P2 = IC(0);
- } else {
- P2 = I611(0, 3, 7);
- }
- if (MDR) {
- P3 = IC(0);
- } else {
- P3 = I211(0, 5, 7);
- }
- if (MUL) {
- P0 = IC(0);
- } else {
- P0 = I611(0, 1, 3);
- }
- if (MUR) {
- P1 = IC(0);
- } else {
- P1 = I611(0, 1, 5);
- }
-} break;
-case 219 :
-{
- P1 = IC(2);
- P2 = IC(2);
- if (MDR) {
- P3 = IC(2);
- } else {
- P3 = I211(2, 5, 7);
- }
- if (MUL) {
- P0 = IC(2);
- } else {
- P0 = I211(2, 1, 3);
- }
-} break;
-case 220 :
-{
- P0 = IC(0);
- P1 = IC(0);
- if (MDL) {
- P2 = IC(0);
- } else {
- P2 = I611(0, 3, 7);
- }
- if (MDR) {
- P3 = IC(0);
- } else {
- P3 = I211(0, 5, 7);
- }
-} break;
-case 223 :
-{
- P2 = IC(4);
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I211(4, 5, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I211(4, 1, 3);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I1411(4, 1, 5);
- }
-} break;
-case 233 :
-case 237 :
-{
- P0 = IC(1);
- P1 = IC(1);
- P3 = IC(1);
- if (MDL) {
- P2 = IC(1);
- } else {
- P2 = I1411(1, 3, 7);
- }
-} break;
-case 234 :
-{
- P1 = IC(0);
- P3 = IC(0);
- if (MDL) {
- P2 = IC(0);
- } else {
- P2 = I211(0, 3, 7);
- }
- if (MUL) {
- P0 = IC(0);
- } else {
- P0 = I611(0, 1, 3);
- }
-} break;
-case 235 :
-{
- P1 = IC(2);
- P3 = IC(2);
- if (MDL) {
- P2 = IC(2);
- } else {
- P2 = I1411(2, 3, 7);
- }
- if (MUL) {
- P0 = IC(2);
- } else {
- P0 = I211(2, 1, 3);
- }
-} break;
-case 239 :
-{
- P1 = IC(4);
- P3 = IC(4);
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I1411(4, 3, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I1411(4, 1, 3);
- }
-} break;
-case 242 :
-{
- P0 = IC(0);
- P2 = IC(0);
- if (MDR) {
- P3 = IC(0);
- } else {
- P3 = I211(0, 5, 7);
- }
- if (MUR) {
- P1 = IC(0);
- } else {
- P1 = I611(0, 1, 5);
- }
-} break;
-case 243 :
-{
- P0 = IC(2);
- P1 = IC(2);
- if (MDR) {
- P2 = IC(2);
- P3 = IC(2);
- } else {
- P2 = I31(2, 7);
- P3 = I332(5, 7, 2);
- }
-} break;
-case 244 :
-{
- P0 = IC(0);
- P1 = IC(0);
- P2 = IC(0);
- if (MDR) {
- P3 = IC(0);
- } else {
- P3 = I1411(0, 5, 7);
- }
-} break;
-case 245 :
-{
- P0 = IC(1);
- P1 = IC(1);
- P2 = IC(1);
- if (MDR) {
- P3 = IC(1);
- } else {
- P3 = I1411(1, 5, 7);
- }
-} break;
-case 246 :
-{
- P0 = IC(0);
- P2 = IC(0);
- if (MDR) {
- P3 = IC(0);
- } else {
- P3 = I1411(0, 5, 7);
- }
- if (MUR) {
- P1 = IC(0);
- } else {
- P1 = I211(0, 1, 5);
- }
-} break;
-case 247 :
-{
- P0 = IC(3);
- P2 = IC(3);
- if (MDR) {
- P3 = IC(3);
- } else {
- P3 = I1411(3, 5, 7);
- }
- if (MUR) {
- P1 = IC(3);
- } else {
- P1 = I1411(3, 1, 5);
- }
-} break;
-case 249 :
-{
- P0 = IC(1);
- P1 = IC(1);
- if (MDL) {
- P2 = IC(1);
- } else {
- P2 = I1411(1, 3, 7);
- }
- if (MDR) {
- P3 = IC(1);
- } else {
- P3 = I211(1, 5, 7);
- }
-} break;
-case 251 :
-{
- P1 = IC(2);
- if (MDL) {
- P2 = IC(2);
- } else {
- P2 = I1411(2, 3, 7);
- }
- if (MDR) {
- P3 = IC(2);
- } else {
- P3 = I211(2, 5, 7);
- }
- if (MUL) {
- P0 = IC(2);
- } else {
- P0 = I211(2, 1, 3);
- }
-} break;
-case 252 :
-{
- P0 = IC(0);
- P1 = IC(0);
- if (MDL) {
- P2 = IC(0);
- } else {
- P2 = I211(0, 3, 7);
- }
- if (MDR) {
- P3 = IC(0);
- } else {
- P3 = I1411(0, 5, 7);
- }
-} break;
-case 253 :
-{
- P0 = IC(1);
- P1 = IC(1);
- if (MDL) {
- P2 = IC(1);
- } else {
- P2 = I1411(1, 3, 7);
- }
- if (MDR) {
- P3 = IC(1);
- } else {
- P3 = I1411(1, 5, 7);
- }
-} break;
-case 254 :
-{
- P0 = IC(0);
- if (MDL) {
- P2 = IC(0);
- } else {
- P2 = I211(0, 3, 7);
- }
- if (MDR) {
- P3 = IC(0);
- } else {
- P3 = I1411(0, 5, 7);
- }
- if (MUR) {
- P1 = IC(0);
- } else {
- P1 = I211(0, 1, 5);
- }
-} break;
-case 255 :
-{
- if (MDL) {
- P2 = IC(4);
- } else {
- P2 = I1411(4, 3, 7);
- }
- if (MDR) {
- P3 = IC(4);
- } else {
- P3 = I1411(4, 5, 7);
- }
- if (MUL) {
- P0 = IC(4);
- } else {
- P0 = I1411(4, 1, 3);
- }
- if (MUR) {
- P1 = IC(4);
- } else {
- P1 = I1411(4, 1, 5);
- }
-} break;
diff --git a/src/sdl/filter/main.c b/src/sdl/filter/main.c
deleted file mode 100644
index 98ab1541..00000000
--- a/src/sdl/filter/main.c
+++ /dev/null
@@ -1,15 +0,0 @@
-#include "filters.h"
-
-int main(int argc, char *argv[])
-{
- SDL_Surface *src = NULL;
- SDL_Surface *dst = NULL;
- src = SDL_LoadBMP("src.bmp"); //load
- if(!src) return -1; //check
- dst = filter_2x(src, NULL, hq2x32); //prcoess
- SDL_FreeSurface(src); //free
- if(!dst) return 0; //error
- SDL_SaveBMP(dst, "dst.bmp"); //save
- SDL_FreeSurface(dst); //free
- return 1; //good
-}
diff --git a/src/sdl/hwsym_sdl.c b/src/sdl/hwsym_sdl.c
index 43c71f7b..44ddf830 100644
--- a/src/sdl/hwsym_sdl.c
+++ b/src/sdl/hwsym_sdl.c
@@ -29,7 +29,7 @@
#pragma warning(disable : 4214 4244)
#endif
-#ifdef SDL
+#ifdef HAVE_SDL
#include "SDL.h"
diff --git a/src/sdl/i_cdmus.c b/src/sdl/i_cdmus.c
index adab39c9..fc35eb9c 100644
--- a/src/sdl/i_cdmus.c
+++ b/src/sdl/i_cdmus.c
@@ -1,588 +1,38 @@
-// Emacs style mode select -*- C++ -*-
-//-----------------------------------------------------------------------------
-//
-// Copyright (C) 1998-2000 by DooM Legacy Team.
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//-----------------------------------------------------------------------------
-/// \file
-/// \brief cd music interface
-///
-
-#ifdef SDL
-
-#if defined (DC) || defined (_WIN32_WCE) || defined(GP2X) || defined(_PS3)
-#define NOSDLCD
-#endif
-
-#include
-#ifndef NOSDLCD
-
-#ifdef _MSC_VER
-#pragma warning(disable : 4214 4244)
-#endif
-
-#include "SDL.h"
-
-#ifdef _MSC_VER
-#pragma warning(default : 4214 4244)
-#endif
-
-#endif
-
-#include "../doomtype.h"
-#include "../i_sound.h"
#include "../command.h"
-#include "../m_argv.h"
#include "../s_sound.h"
+#include "../i_sound.h"
-#define MAX_CD_TRACKS 256
+//
+// CD MUSIC I/O
+//
-#ifdef _XBOX
-INT32 SDL_SYS_CDInit(void)
-{
- return(0);
-}
-
-void SDL_SYS_CDQuit(void)
-{
- return;
-}
-#endif
-
-UINT8 cdaudio_started = 0; // for system startup/shutdown
+UINT8 cdaudio_started = 0;
consvar_t cd_volume = {"cd_volume","31",CV_SAVE,soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cdUpdate = {"cd_update","1",CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
-#ifndef NOSDLCD
-static SDL_bool cdValid = SDL_FALSE;
-static SDL_bool cdPlaying = SDL_FALSE;
-static SDL_bool wasPlaying = SDL_FALSE;
-static SDL_bool cdEnabled = SDL_FALSE;
-static SDL_bool playLooping = SDL_FALSE;
-static Uint8 playTrack = 0;
-static Uint8 maxTrack = MAX_CD_TRACKS-1;
-static Uint8 cdRemap[MAX_CD_TRACKS];
-static INT32 cdvolume = -1;
-static SDL_CD *cdrom = NULL;
-static CDstatus cdStatus = CD_ERROR;
-/**************************************************************************
- *
- * function: CDAudio_GetAudioDiskInfo
- *
- * description:
- * set number of tracks if CD is available
- *
- **************************************************************************/
-static INT32 CDAudio_GetAudioDiskInfo(void)
+void I_InitCD(void){}
+
+void I_StopCD(void){}
+
+void I_PauseCD(void){}
+
+void I_ResumeCD(void){}
+
+void I_ShutdownCD(void){}
+
+void I_UpdateCD(void){}
+
+void I_PlayCD(UINT8 track, UINT8 looping)
{
- cdValid = SDL_FALSE;
- maxTrack = 0;
-
- if (!cdrom)
- return 0;//Alam: Lies!
-
- cdStatus = SDL_CDStatus(cdrom);
-
- if (!CD_INDRIVE(cdStatus))
- {
- CONS_Printf("%s", M_GetText("No CD in drive\n"));
- return -1;
- }
-
- if (cdStatus == CD_ERROR)
- {
- CONS_Printf(M_GetText("CD Error: %s\n"), SDL_GetError());
- return -1;
- }
-
- cdValid = SDL_TRUE;
- maxTrack = (Uint8)cdrom->numtracks;
-
- return 0;
-}
-
-
-/**************************************************************************
- *
- * function: I_EjectCD
- *
- * description:
- *
- *
- **************************************************************************/
-static void I_EjectCD(void)
-{
- if (!cdrom || !cdEnabled)
- return; // no cd init'd
-
- I_StopCD();
-
- if (SDL_CDEject(cdrom))
- CONS_Printf("%s", M_GetText("CD eject failed\n"));
-}
-
-/**************************************************************************
- *
- * function: Command_Cd_f
- *
- * description:
- * handles all CD commands from the console
- *
- **************************************************************************/
-static void Command_Cd_f (void)
-{
- const char *command;
- size_t ret, n;
-
- if (!cdaudio_started)
- return;
-
- if (COM_Argc() < 2)
- {
- CONS_Printf ("%s", M_GetText("cd [on] [off] [remap] [reset] [select]\n"
- " [open] [info] [play