From acda9dea35fc30ff07b5c578555f509f73d7042c Mon Sep 17 00:00:00 2001 From: Themaister Date: Wed, 20 Jun 2012 00:44:40 +0200 Subject: [PATCH] Forgot to commit null drivers ... --- audio/null.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++ gfx/null.c | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++ input/null.c | 62 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 211 insertions(+) create mode 100644 audio/null.c create mode 100644 gfx/null.c create mode 100644 input/null.c diff --git a/audio/null.c b/audio/null.c new file mode 100644 index 0000000000..3d753a4873 --- /dev/null +++ b/audio/null.c @@ -0,0 +1,74 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2010-2012 - Hans-Kristian Arntzen + * + * RetroArch 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 Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch 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 RetroArch. + * If not, see . + */ + +#include "../general.h" +#include "../driver.h" + +static void *null_audio_init(const char *device, unsigned rate, unsigned latency) +{ + (void)device; + (void)rate; + (void)latency; + return (void*)-1; +} + +static void null_audio_free(void *data) +{ + (void)data; +} + +static ssize_t null_audio_write(void *data, const void *buf, size_t size) +{ + (void)data; + (void)buf; + + return size; +} + +static bool null_audio_stop(void *data) +{ + (void)data; + return true; +} + +static bool null_audio_start(void *data) +{ + (void)data; + return true; +} + +static void null_audio_set_nonblock_state(void *data, bool state) +{ + (void)data; + (void)state; +} + +static bool null_audio_use_float(void *data) +{ + (void)data; + return true; +} + +const audio_driver_t audio_null = { + null_audio_init, + null_audio_write, + null_audio_stop, + null_audio_start, + null_audio_set_nonblock_state, + null_audio_free, + null_audio_use_float, + "null", +}; + diff --git a/gfx/null.c b/gfx/null.c new file mode 100644 index 0000000000..b378471f83 --- /dev/null +++ b/gfx/null.c @@ -0,0 +1,75 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2010-2012 - Hans-Kristian Arntzen + * + * RetroArch 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 Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch 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 RetroArch. + * If not, see . + */ + +#include "../general.h" +#include "../driver.h" + +static void *null_gfx_init(const video_info_t *video, + const input_driver_t **input, void **input_data) +{ + *input = NULL; + *input_data = NULL; + (void)video; + + return (void*)-1; +} + +static bool null_gfx_frame(void *data, const void *frame, + unsigned width, unsigned height, unsigned pitch, const char *msg) +{ + (void)data; + (void)frame; + (void)width; + (void)height; + (void)pitch; + (void)msg; + + return true; +} + +static void null_gfx_set_nonblock_state(void *data, bool toggle) +{ + (void)data; + (void)toggle; +} + +static bool null_gfx_alive(void *data) +{ + (void)data; + return true; +} + +static bool null_gfx_focus(void *data) +{ + (void)data; + return true; +} + +static void null_gfx_free(void *data) +{ + (void)data; +} + +const video_driver_t video_null = { + null_gfx_init, + null_gfx_frame, + null_gfx_set_nonblock_state, + null_gfx_alive, + null_gfx_focus, + NULL, + null_gfx_free, + "null", +}; + diff --git a/input/null.c b/input/null.c new file mode 100644 index 0000000000..48ae092d88 --- /dev/null +++ b/input/null.c @@ -0,0 +1,62 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2010-2012 - Hans-Kristian Arntzen + * + * RetroArch 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 Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch 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 RetroArch. + * If not, see . + */ + +#include "../general.h" +#include "../driver.h" + +static void *null_input_init(void) +{ + return (void*)-1; +} + +static void null_input_poll(void *data) +{ + (void)data; +} + +static int16_t null_input_state(void *data, const struct snes_keybind **snes_keybinds, unsigned port, unsigned device, unsigned index, unsigned id) +{ + (void)data; + (void)snes_keybinds; + (void)port; + (void)device; + (void)index; + (void)id; + + return 0; +} + +static bool null_input_key_pressed(void *data, int key) +{ + (void)data; + (void)key; + + return false; +} + +static void null_input_free(void *data) +{ + (void)data; +} + +const input_driver_t input_null = { + null_input_init, + null_input_poll, + null_input_state, + null_input_key_pressed, + null_input_free, + "null", +}; +