Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raw Input Support - raphnetraw #356

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ FORCE_GLES3 ?= 0
LLE ?= 0
HAVE_PARALLEL_RSP ?= 0
HAVE_PARALLEL_RDP ?= 0
HAVE_RAPHNET_INPUT ?= 0

SYSTEM_MINIZIP ?= 0
SYSTEM_LIBPNG ?= 0
Expand Down Expand Up @@ -313,7 +314,7 @@ else ifneq (,$(findstring AMLG,$(platform)))
else
GL_LIB := -lGLESv2
endif

HAVE_NEON = 1
WITH_DYNAREC=arm
COREFLAGS += -DUSE_GENERIC_GLESV2 -DOS_LINUX
Expand Down Expand Up @@ -514,7 +515,7 @@ else
TARGET := $(TARGET_NAME)_libretro.dll
LDFLAGS += -shared -static-libgcc -static-libstdc++ -Wl,--version-script=$(LIBRETRO_DIR)/link.T #-static -lmingw32 -lSDL2main -lSDL2 -mwindows -lm -ldinput8 -ldxguid -ldxerr8 -luser32 -lgdi32 -lwinmm -limm32 -lole32 -loleaut32 -lshell32 -lversion -luuid -lsdl2_net -lsdl2 -lws2_32 -lSetupapi -lIPHLPAPI
GL_LIB := -lopengl32

ifeq ($(MSYSTEM),MINGW64)
CC ?= x86_64-w64-mingw32-gcc
CXX ?= x86_64-w64-mingw32-g++
Expand Down Expand Up @@ -543,7 +544,7 @@ ifeq ($(STATIC_LINKING), 1)
ifneq (,$(findstring win,$(platform)))
TARGET := $(TARGET:.dll=.lib)
else ifneq ($(platform), $(filter $(platform), osx ios))
TARGET := $(TARGET:.dylib=.a)
TARGET := $(TARGET:.dylib=.a)
else
TARGET := $(TARGET:.so=.a)
endif
Expand Down
35 changes: 32 additions & 3 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ AUDIO_LIBRETRO_DIR = $(ROOT_DIR)/custom/mupen64plus-core/plugin/audio_libretro
VIDEODIR_GLIDEN64 = $(ROOT_DIR)/GLideN64
VIDEODIR_ANGRYLION = $(ROOT_DIR)/mupen64plus-video-angrylion
VIDEODIR_PARALLEL = $(ROOT_DIR)/mupen64plus-video-paraLLEl
INPUTDIR_RAPHNET = $(ROOT_DIR)/mupen64plus-input-raphnetraw

MINIZIP_DIR = $(CORE_DIR)/subprojects/minizip
HIDAPI_DIR = $(ROOT_DIR)/custom/dependencies/hidapi
LIBPNG_DIR = $(ROOT_DIR)/custom/dependencies/libpng
XXHASH_DIR = $(ROOT_DIR)/xxHash
ZLIB_DIR = $(ROOT_DIR)/custom/dependencies/libzlib
Expand All @@ -20,8 +22,10 @@ INCFLAGS += \
-I$(ROOT_DIR)/custom/mupen64plus-core \
-I$(ROOT_DIR)/custom/android/include \
-I$(ROOT_DIR)/custom/GLideN64 \
-I$(ROOT_DIR)/custom/mupen64plus-input-raphnetraw \
-I$(VIDEODIR_GLIDEN64)/src \
-I$(VIDEODIR_GLIDEN64)/src/osal \
-I$(INPUTDIR_RAPHNET)/src \
-I$(CORE_DIR)/src \
-I$(CORE_DIR)/src/api \
-I$(AUDIO_LIBRETRO_DIR) \
Expand All @@ -30,6 +34,7 @@ INCFLAGS += \
-I$(VIDEODIR_GLIDEN64)/src/inc

MINIZIP_INCFLAGS = -I$(MINIZIP_DIR)
HIDAPI_INCFLAGS = -I$(HIDAPI_DIR)/hidapi
LIBPNG_INCFLAGS = -I$(LIBPNG_DIR)
XXHASH_INCFLAGS = -I$(XXHASH_DIR)
ZLIB_INCFLAGS = -I$(ZLIB_DIR)
Expand Down Expand Up @@ -260,7 +265,7 @@ SOURCES_C += $(LIBRETRO_DIR)/libretro.c \
$(ROOT_DIR)/custom/mupen64plus-core/api/vidext_libretro.c \
$(LIBRETRO_COMM_DIR)/glsm/glsm.c


SOURCES_CXX += \
$(VIDEODIR_GLIDEN64)/src/Combiner.cpp \
$(VIDEODIR_GLIDEN64)/src/CombinerKey.cpp \
Expand Down Expand Up @@ -401,6 +406,30 @@ SOURCES_C += $(VIDEODIR_ANGRYLION)/interface.c \
$(VIDEODIR_ANGRYLION)/n64video.c
endif

# raphnetraw and hidapi
# FIXME windows build untested and probably incomplete
ifeq ($(HAVE_RAPHNET_INPUT), 1)
CFLAGS += -DHAVE_RAPHNET_INPUT
CXXFLAGS += -DHAVE_RAPHNET_INPUT
INCFLAGS += $(HIDAPI_INCFLAGS)

SOURCES_C += $(ROOT_DIR)/custom/mupen64plus-input-raphnetraw/plugin_front.c \
$(ROOT_DIR)/custom/mupen64plus-input-raphnetraw/plugin_back.c \
$(INPUTDIR_RAPHNET)/src/hexdump.c \
$(INPUTDIR_RAPHNET)/src/gcn64lib.c \
$(INPUTDIR_RAPHNET)/src/gcn64.c

ifneq (,$(findstring win,$(platform)))
LDFLAGS += -lsetupapi -Lhidapi/windows
SOURCES_C += $(INPUTDIR_RAPHNET)/src/osal_dynamiclib_win32.c \
$(HIDAPI_DIR)/windows/hid.c
else
LDFLAGS += -ludev -ldl -Lhidapi/linux
SOURCES_C += $(INPUTDIR_RAPHNET)/src/osal_dynamiclib_unix.c \
$(HIDAPI_DIR)/linux/hid.c
endif
endif

SOURCES_C += \
$(RSPDIR)/src/alist.c \
$(RSPDIR)/src/alist_audio.c \
Expand Down Expand Up @@ -505,12 +534,12 @@ else ifeq ($(GLES),1)
GLFLAGS += -DEGL -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DGLES2
LDFLAGS += $(EGL_LIB)
SOURCES_C += $(LIBRETRO_COMM_DIR)/glsym/glsym_es2.c

ifeq ($(ANDROID),1)
SOURCES_CXX += $(VIDEODIR_GLIDEN64)/src/Graphics/OpenGLContext/GraphicBuffer/GraphicBufferWrapper.cpp \
$(VIDEODIR_GLIDEN64)/src/Graphics/OpenGLContext/GraphicBuffer/PublicApi/android_hardware_buffer_compat.cpp
endif
else
else
ifeq (,$(findstring win,$(platform)))
GLFLAGS += -DCORE
endif
Expand Down
33 changes: 33 additions & 0 deletions custom/dependencies/hidapi/.appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
os: Visual Studio 2015

environment:
matrix:
- BUILD_ENV: msbuild
arch: x64
- BUILD_ENV: msbuild
arch: Win32
- BUILD_ENV: cygwin

install:
- cmd: if %BUILD_ENV%==cygwin (
C:\cygwin64\setup-x86_64.exe --quiet-mode --no-shortcuts --upgrade-also --packages autoconf,automake )

build_script:
- cmd: if %BUILD_ENV%==msbuild (
msbuild .\windows\hidapi.sln /p:Configuration=Release /p:Platform=%arch% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" )
- cmd: if %BUILD_ENV%==cygwin (
C:\cygwin64\bin\bash -exlc "cd $APPVEYOR_BUILD_FOLDER; ./bootstrap; ./configure; make" )

artifacts:
# Win32 artifacts
- path: .\windows\Release\hidapi.dll
- path: .\windows\Release\hidapi.lib
- path: .\windows\Release\hidapi.pdb
- path: .\windows\Release\hidtest.exe
- path: .\windows\Release\hidtest.pdb
# x64 artifacts
- path: .\windows\x64\Release\hidapi.dll
- path: .\windows\x64\Release\hidapi.lib
- path: .\windows\x64\Release\hidapi.pdb
- path: .\windows\x64\Release\hidtest.exe
- path: .\windows\x64\Release\hidtest.pdb
25 changes: 25 additions & 0 deletions custom/dependencies/hidapi/.builds/alpine.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
image: alpine/edge
packages:
- autoconf
- automake
- libtool
- eudev-dev
- libusb-dev
- linux-headers
sources:
- https://github.com/libusb/hidapi
tasks:
- setup: |
cd hidapi
./bootstrap
./configure
- build: |
cd hidapi
make
make DESTDIR=$PWD/root install
make clean
- build-manual: |
cd hidapi/linux
make -f Makefile-manual
cd ../libusb
make -f Makefile-manual
24 changes: 24 additions & 0 deletions custom/dependencies/hidapi/.builds/archlinux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
image: archlinux
packages:
- autoconf
- automake
- libtool
- libusb
- libudev0
sources:
- https://github.com/libusb/hidapi
tasks:
- setup: |
cd hidapi
./bootstrap
./configure
- build: |
cd hidapi
make
make DESTDIR=$PWD/root install
make clean
- build-manual: |
cd hidapi/linux
make -f Makefile-manual
cd ../libusb
make -f Makefile-manual
22 changes: 22 additions & 0 deletions custom/dependencies/hidapi/.builds/fedora-mingw.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
image: fedora/latest
packages:
- autoconf
- automake
- libtool
- mingw64-gcc
- mingw64-gcc-c++
sources:
- https://github.com/libusb/hidapi
tasks:
- setup: |
cd hidapi
./bootstrap
mingw64-configure
- build: |
cd hidapi
make
make DESTDIR=$PWD/root install
make clean
- build-manual: |
cd hidapi/windows
make -f Makefile-manual OS=MINGW CC=x86_64-w64-mingw32-gcc
23 changes: 23 additions & 0 deletions custom/dependencies/hidapi/.builds/freebsd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
image: freebsd/latest
packages:
- autoconf
- automake
- gmake
- libiconv
- libtool
- pkgconf
sources:
- https://github.com/libusb/hidapi
tasks:
- setup: |
cd hidapi
./bootstrap
./configure
- build: |
cd hidapi
make
make DESTDIR=$PWD/root install
make clean
- build-manual: |
cd hidapi/libusb
gmake -f Makefile-manual
33 changes: 33 additions & 0 deletions custom/dependencies/hidapi/.cirrus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
alpine_task:
container:
image: alpine:latest
install_script: apk add autoconf automake g++ gcc libusb-dev libtool linux-headers eudev-dev make musl-dev
script:
- ./bootstrap
- ./configure || { cat config.log; exit 1; }
- make
- make install

freebsd11_task:
freebsd_instance:
image: freebsd-11-2-release-amd64
install_script:
- pkg install -y
autoconf automake libiconv libtool pkgconf
script:
- ./bootstrap
- ./configure || { cat config.log; exit 1; }
- make
- make install

freebsd12_task:
freebsd_instance:
image: freebsd-12-1-release-amd64
install_script:
- pkg install -y
autoconf automake libiconv libtool pkgconf
script:
- ./bootstrap
- ./configure || { cat config.log; exit 1; }
- make
- make install
7 changes: 7 additions & 0 deletions custom/dependencies/hidapi/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
* text=auto

*.sln text eol=crlf
*.vcproj text eol=crlf

bootstrap text eol=lf
configure.ac text eol=lf
Loading