mirror of
https://github.com/libretro/RetroArch
synced 2025-03-24 13:43:32 +00:00
Add null joypad driver
This commit is contained in:
parent
30ca42cb9d
commit
bab9ee307d
10
Makefile
10
Makefile
@ -134,6 +134,16 @@ $(OBJDIR)/tools/input_common_joyconfig.o: input/input_common.c
|
|||||||
@$(if $(Q), $(shell echo echo CC $<),)
|
@$(if $(Q), $(shell echo echo CC $<),)
|
||||||
$(Q)$(CC) $(CFLAGS) $(DEFINES) -MMD -DIS_JOYCONFIG -c -o $@ $<
|
$(Q)$(CC) $(CFLAGS) $(DEFINES) -MMD -DIS_JOYCONFIG -c -o $@ $<
|
||||||
|
|
||||||
|
$(OBJDIR)/tools/nullinput_joyconfig.o: input/nullinput.c
|
||||||
|
@mkdir -p $(dir $@)
|
||||||
|
@$(if $(Q), $(shell echo echo CC $<),)
|
||||||
|
$(Q)$(CC) $(CFLAGS) $(DEFINES) -MMD -DIS_JOYCONFIG -c -o $@ $<
|
||||||
|
|
||||||
|
$(OBJDIR)/tools/nullinput_joypad_joyconfig.o: input/nullinput_joypad.c
|
||||||
|
@mkdir -p $(dir $@)
|
||||||
|
@$(if $(Q), $(shell echo echo CC $<),)
|
||||||
|
$(Q)$(CC) $(CFLAGS) $(DEFINES) -MMD -DIS_JOYCONFIG -c -o $@ $<
|
||||||
|
|
||||||
$(OBJDIR)/tools/input_keymaps_joyconfig.o: input/input_keymaps.c
|
$(OBJDIR)/tools/input_keymaps_joyconfig.o: input/input_keymaps.c
|
||||||
@mkdir -p $(dir $@)
|
@mkdir -p $(dir $@)
|
||||||
@$(if $(Q), $(shell echo echo CC $<),)
|
@$(if $(Q), $(shell echo echo CC $<),)
|
||||||
|
@ -145,6 +145,7 @@ OBJ += frontend/frontend.o \
|
|||||||
gfx/nullgfx.o \
|
gfx/nullgfx.o \
|
||||||
audio/nullaudio.o \
|
audio/nullaudio.o \
|
||||||
input/nullinput.o \
|
input/nullinput.o \
|
||||||
|
input/nullinput_joypad.o \
|
||||||
input/osk/nullosk.o \
|
input/osk/nullosk.o \
|
||||||
playlist.o \
|
playlist.o \
|
||||||
movie.o \
|
movie.o \
|
||||||
@ -638,6 +639,8 @@ JOYCONFIG_OBJ += tools/retroarch-joyconfig.o \
|
|||||||
libretro-sdk/file/file_path.o \
|
libretro-sdk/file/file_path.o \
|
||||||
libretro-sdk/string/string_list.o \
|
libretro-sdk/string/string_list.o \
|
||||||
libretro-sdk/compat/compat.o \
|
libretro-sdk/compat/compat.o \
|
||||||
|
input/nullinput.o \
|
||||||
|
input/nullinput_joypad.o \
|
||||||
tools/input_context_joyconfig.o \
|
tools/input_context_joyconfig.o \
|
||||||
tools/input_common_joyconfig.o \
|
tools/input_common_joyconfig.o \
|
||||||
tools/input_keymaps_joyconfig.o
|
tools/input_keymaps_joyconfig.o
|
||||||
|
10
Makefile.win
10
Makefile.win
@ -171,6 +171,16 @@ $(OBJDIR)/tools/input_context_joyconfig.o: input/input_context.c
|
|||||||
@$(if $(Q), $(shell echo echo CC $<),)
|
@$(if $(Q), $(shell echo echo CC $<),)
|
||||||
$(Q)$(CC) $(CFLAGS) $(DEFINES) -MMD -DIS_JOYCONFIG -c -o $@ $<
|
$(Q)$(CC) $(CFLAGS) $(DEFINES) -MMD -DIS_JOYCONFIG -c -o $@ $<
|
||||||
|
|
||||||
|
$(OBJDIR)/tools/nullinput_joyconfig.o: input/nullinput.c
|
||||||
|
@mkdir -p $(dir $@)
|
||||||
|
@$(if $(Q), $(shell echo echo CC $<),)
|
||||||
|
$(Q)$(CC) $(CFLAGS) $(DEFINES) -MMD -DIS_JOYCONFIG -c -o $@ $<
|
||||||
|
|
||||||
|
$(OBJDIR)/tools/nullinput_joypad_joyconfig.o: input/nullinput_joypad.c
|
||||||
|
@mkdir -p $(dir $@)
|
||||||
|
@$(if $(Q), $(shell echo echo CC $<),)
|
||||||
|
$(Q)$(CC) $(CFLAGS) $(DEFINES) -MMD -DIS_JOYCONFIG -c -o $@ $<
|
||||||
|
|
||||||
$(OBJDIR)/%.o: %.cpp
|
$(OBJDIR)/%.o: %.cpp
|
||||||
@mkdir -p $(dir $@)
|
@mkdir -p $(dir $@)
|
||||||
@$(if $(Q), $(shell echo echo CXX $<),)
|
@$(if $(Q), $(shell echo echo CXX $<),)
|
||||||
|
@ -101,6 +101,7 @@ enum
|
|||||||
JOYPAD_APPLE_HID,
|
JOYPAD_APPLE_HID,
|
||||||
JOYPAD_APPLE_IOS,
|
JOYPAD_APPLE_IOS,
|
||||||
JOYPAD_QNX,
|
JOYPAD_QNX,
|
||||||
|
JOYPAD_NULL,
|
||||||
|
|
||||||
CAMERA_V4L2,
|
CAMERA_V4L2,
|
||||||
CAMERA_RWEBCAM,
|
CAMERA_RWEBCAM,
|
||||||
|
@ -370,6 +370,7 @@ INPUT
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "../input/nullinput.c"
|
#include "../input/nullinput.c"
|
||||||
|
#include "../input/nullinput_joypad.c"
|
||||||
|
|
||||||
/*============================================================
|
/*============================================================
|
||||||
STATE TRACKER
|
STATE TRACKER
|
||||||
|
@ -66,6 +66,7 @@ rarch_joypad_driver_t *joypad_drivers[] = {
|
|||||||
#ifdef __QNX__
|
#ifdef __QNX__
|
||||||
&qnx_joypad,
|
&qnx_joypad,
|
||||||
#endif
|
#endif
|
||||||
|
&null_joypad,
|
||||||
NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -62,6 +62,7 @@ extern rarch_joypad_driver_t apple_hid_joypad;
|
|||||||
extern rarch_joypad_driver_t apple_ios_joypad;
|
extern rarch_joypad_driver_t apple_ios_joypad;
|
||||||
extern rarch_joypad_driver_t android_joypad;
|
extern rarch_joypad_driver_t android_joypad;
|
||||||
extern rarch_joypad_driver_t qnx_joypad;
|
extern rarch_joypad_driver_t qnx_joypad;
|
||||||
|
extern rarch_joypad_driver_t null_joypad;
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
67
input/nullinput_joypad.c
Normal file
67
input/nullinput_joypad.c
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
/* RetroArch - A frontend for libretro.
|
||||||
|
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
||||||
|
* Copyright (C) 2011-2014 - Daniel De Matteis
|
||||||
|
* Copyright (C) 2013-2014 - CatalystG
|
||||||
|
*
|
||||||
|
* 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <boolean.h>
|
||||||
|
#include "input_context.h"
|
||||||
|
|
||||||
|
static const char *null_joypad_name(unsigned pad)
|
||||||
|
{
|
||||||
|
return "null";
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool null_joypad_init(void)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool null_joypad_button(unsigned port_num, uint16_t joykey)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int16_t null_joypad_axis(unsigned port_num, uint32_t joyaxis)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void null_joypad_poll(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool null_joypad_query_pad(unsigned pad)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static void null_joypad_destroy(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
rarch_joypad_driver_t null_joypad = {
|
||||||
|
null_joypad_init,
|
||||||
|
null_joypad_query_pad,
|
||||||
|
null_joypad_destroy,
|
||||||
|
null_joypad_button,
|
||||||
|
null_joypad_axis,
|
||||||
|
null_joypad_poll,
|
||||||
|
NULL,
|
||||||
|
null_joypad_name,
|
||||||
|
"null",
|
||||||
|
};
|
@ -210,6 +210,8 @@ const char *config_get_default_joypad(void)
|
|||||||
return "apple_ios";
|
return "apple_ios";
|
||||||
case JOYPAD_QNX:
|
case JOYPAD_QNX:
|
||||||
return "qnx";
|
return "qnx";
|
||||||
|
case JOYPAD_NULL:
|
||||||
|
return "null";
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user