Skip to content

Commit

Permalink
Remove SDL1 support (mupen64plus#45)
Browse files Browse the repository at this point in the history
* build: remove executable permissions from Makefile

* build: remove SDL1 support

* src: remove SDL1 code path
  • Loading branch information
orbea authored Nov 3, 2024
1 parent 7573056 commit 7255911
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 39 deletions.
28 changes: 11 additions & 17 deletions projects/unix/Makefile
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -149,23 +149,6 @@ ifeq ($(OS), OSX)
endif
endif

# test for presence of SDL
ifeq ($(origin SDL_CFLAGS) $(origin SDL_LDLIBS), undefined undefined)
SDL_CONFIG = $(CROSS_COMPILE)sdl2-config
ifeq ($(shell which $(SDL_CONFIG) 2>/dev/null),)
SDL_CONFIG = $(CROSS_COMPILE)sdl-config
ifeq ($(shell which $(SDL_CONFIG) 2>/dev/null),)
$(error No SDL development libraries found!)
else
$(warning Using SDL 1.2 libraries)
endif
endif
SDL_CFLAGS += $(shell $(SDL_CONFIG) --cflags)
SDL_LDLIBS += $(shell $(SDL_CONFIG) --libs)
endif
CFLAGS += $(SDL_CFLAGS)
LDLIBS += $(SDL_LDLIBS)

# test for essential build dependencies
ifeq ($(origin PKG_CONFIG), undefined)
PKG_CONFIG = $(CROSS_COMPILE)pkg-config
Expand All @@ -174,6 +157,17 @@ ifeq ($(origin PKG_CONFIG), undefined)
endif
endif

# test for presence of SDL
ifeq ($(origin SDL_CFLAGS) $(origin SDL_LDLIBS), undefined undefined)
ifeq ($(shell $(PKG_CONFIG) --modversion sdl2 2>/dev/null),)
$(error No SDL2 development libraries found!)
endif
SDL_CFLAGS += $(shell $(PKG_CONFIG) --cflags sdl2)
SDL_LDLIBS += $(shell $(PKG_CONFIG) --libs sdl2)
endif
CFLAGS += $(SDL_CFLAGS)
LDLIBS += $(SDL_LDLIBS)

# test for presence of speexdsp
ifneq ($(NO_SPEEX), 1)
ifeq ($(origin SPEEX_CFLAGS) $(origin SPEEX_LDLIBS), undefined undefined)
Expand Down
2 changes: 0 additions & 2 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@
They tend to rely on a default frequency, apparently, never the same one ;)*/
#define DEFAULT_FREQUENCY 33600

#if SDL_VERSION_ATLEAST(2,0,0)
#define SDL_MixAudio(A, B, C, D) SDL_MixAudioFormat(A, B, AUDIO_S16SYS, C, D)
#endif

/* local variables */
static void (*l_DebugCallback)(void *, int, const char *) = NULL;
Expand Down
20 changes: 0 additions & 20 deletions src/sdl_backend.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,6 @@
#define N64_SAMPLE_BYTES 4
#define SDL_SAMPLE_BYTES 4

/* For SDL < 1.3 */
#if !SDL_VERSION_ATLEAST(1,3,0)
#define SDL_AUDIO_MASK_BITSIZE (0xFF)
#define SDL_AUDIO_MASK_DATATYPE (1<<8)
#define SDL_AUDIO_MASK_ENDIAN (1<<12)
#define SDL_AUDIO_MASK_SIGNED (1<<15)
#define SDL_AUDIO_BITSIZE(x) (x & SDL_AUDIO_MASK_BITSIZE)
#define SDL_AUDIO_ISFLOAT(x) (x & SDL_AUDIO_MASK_DATATYPE)
#define SDL_AUDIO_ISBIGENDIAN(x) (x & SDL_AUDIO_MASK_ENDIAN)
#define SDL_AUDIO_ISSIGNED(x) (x & SDL_AUDIO_MASK_SIGNED)
#define SDL_AUDIO_ISINT(x) (!SDL_AUDIO_ISFLOAT(x))
#define SDL_AUDIO_ISLITTLEENDIAN(x) (!SDL_AUDIO_ISBIGENDIAN(x))
#define SDL_AUDIO_ISUNSIGNED(x) (!SDL_AUDIO_ISSIGNED(x))
#endif

#if SDL_VERSION_ATLEAST(2,0,0)
#define SDL_LockAudio() SDL_LockAudioDevice(sdl_backend->device)
#define SDL_UnlockAudio() SDL_UnlockAudioDevice(sdl_backend->device)
#define SDL_PauseAudio(A) SDL_PauseAudioDevice(sdl_backend->device, A)
Expand All @@ -61,10 +45,6 @@
struct sdl_backend
{
SDL_AudioDeviceID device;
#else
struct sdl_backend
{
#endif
m64p_handle config;

struct circular_buffer primary_buffer;
Expand Down

0 comments on commit 7255911

Please sign in to comment.