Previous Thread
Next Thread
Print Thread
Page 1 of 2 1 2
#99502 - 05/01/15 04:42 PM sdlmame won't respond to joystick if I compile  
Joined: Apr 2015
Posts: 23
dman777 Offline
Member
dman777  Offline
Member

Joined: Apr 2015
Posts: 23
I am still having problems getting sdlmame to respond my xbox 360 controller when I compile sdlmame manually. This is with clone from git and doing a simple 'make'.

I checked the make file, but I did not see any compile choices for the joystick.

This is for mame .159 and .159.

What is weird... I run gentoo and if I emerge sdlmame .148, the joystick works great on sdlmame with no issues. But if I compile .148 manually, then sdlmame is not responsive to the joystick again.

Here is what the ebuild is like for compileing it....

Code:
localhost four # cat /usr/portage/games-emulation/sdlmame/sdlmame-0.148_p1-r1.ebuild
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/games-emulation/sdlmame/sdlmame-0.148_p1-r1.ebuild,v 1.6 2015/04/08 18:10:41 mgorny Exp $

EAPI=5
PYTHON_COMPAT=( python2_7 )
inherit eutils flag-o-matic python-any-r1 games

MY_PV=${PV/.}
MY_CONF_PN=${PN/sdl}
MY_P=sdlmame${MY_PV}
MY_P=${MY_P%%_p*}
MY_CONF_VER="0.139"

# patches
SRC_URI="$(for PATCH_VER in $(seq 1 ${PV##*_p}) ; do echo "http://dev.gentoo.org/~hasufell/distfiles/${MY_P}u${PATCH_VER}_diff.zip"; done)"

DESCRIPTION="Multiple Arcade Machine Emulator (SDL)"
HOMEPAGE="http://mamedev.org/"
# Upstream doesn't allow fetching with unknown User-Agent such as wget
SRC_URI="$SRC_URI http://dev.gentoo.org/~hasufell/distfiles/${MY_P/sdl}s.zip"
if [[ ${PN} == "sdlmame" ]] ; then
	SRC_URI="$SRC_URI http://www.netswarm.net/misc/sdlmame-ui.bdf.gz"
fi

LICENSE="XMAME"
SLOT="0"
KEYWORDS="amd64 ~ppc x86"
IUSE="X alsa debug opengl"
REQUIRED_USE="debug? ( X )"

RDEPEND="dev-libs/expat
	media-libs/fontconfig
	media-libs/flac
	>=media-libs/libsdl-1.2.10[X,sound,joystick,opengl?,video]
	media-libs/sdl-ttf
	sys-libs/zlib
	virtual/jpeg
	alsa? ( media-libs/alsa-lib )
	X? (
		gnome-base/gconf
		x11-libs/gtk+:2
		x11-libs/libX11
		x11-libs/libXinerama
	)"
DEPEND="${RDEPEND}
	${PYTHON_DEPS}
	app-arch/unzip
	media-libs/alsa-lib
	virtual/pkgconfig
	X? ( x11-proto/xineramaproto )"

S=${WORKDIR}

# Function to disable a makefile option
disable_feature() {
	sed -i \
		-e "/$1.*=/s:^:# :" \
		"${S}"/makefile \
		|| die "sed failed"
}

# Function to enable a makefile option
enable_feature() {
	sed -i \
		-e "/^#.*$1.*=/s:^#::"  \
		"${S}"/${2:-makefile} \
		|| die "sed failed"
}

pkg_setup() {
	games_pkg_setup
	python-any-r1_pkg_setup
}

src_unpack() {
	default
	unpack ./mame.zip
	rm -f mame.zip
}

src_prepare() {
	if [[ $PV == *_p* ]] ; then
		edos2unix $(find $(grep +++ *diff | awk '{ print $2 }' | sort -u) 2>/dev/null) *diff
		einfo "Patching release with source updates"
		epatch ${MY_PV%%_p*}*.diff
	fi
	edos2unix src/osd/sdl/osdsdl.h

	epatch \
		"${FILESDIR}"/${P}-makefile.patch \
		"${FILESDIR}"/${P}-no-opengl.patch

	# Don't compile zlib and expat
	einfo "Disabling embedded libraries: expat, flac, jpeg, zlib"
	disable_feature BUILD_EXPAT
	disable_feature BUILD_FLAC
	disable_feature BUILD_JPEG
	disable_feature BUILD_ZLIB

	if use amd64; then
		einfo "Enabling 64-bit support"
		enable_feature PTR64
	fi

	if use ppc; then
		einfo "Enabling PPC support"
		enable_feature BIGENDIAN
	fi

	if use debug; then
		einfo "Enabling debug support"
		enable_feature DEBUG
	fi

	if ! use opengl ; then
		einfo "Disabling opengl support"
		enable_feature NO_OPENGL src/osd/sdl/sdl.mak
	fi

	if ! use alsa ; then
		einfo "Disabling alsa midi support"
		enable_feature NO_USE_MIDI src/osd/sdl/sdl.mak
	fi

	if ! use X ; then
		einfo "Disabling X support"
		enable_feature NO_X11 src/osd/sdl/sdl.mak
	fi
}

src_compile() {
	emake \
		TARGET="${PN#sdl}" \
		NAME="${PN}" \
		OPT_FLAGS='-DINI_PATH=\"\$$HOME/.'${PN}'\;'"${GAMES_SYSCONFDIR}/${PN}"'\"' \
		NO_DEBUGGER=$(usex debug "0" "1") default
}

src_install() {
        enable_feature DEBUG
    fi

    if ! use opengl ; then
        einfo "Disabling opengl support"
        enable_feature NO_OPENGL src/osd/sdl/sdl.mak
    fi

    if ! use alsa ; then
        einfo "Disabling alsa midi support"
        enable_feature NO_USE_MIDI src/osd/sdl/sdl.mak
    fi

    if ! use X ; then
        einfo "Disabling X support"
        enable_feature NO_X11 src/osd/sdl/sdl.mak
    fi
}

src_compile() {
	newgamesbin ${PN}$(use amd64 && echo 64)$(use debug && echo d) ${PN}

	newman src/osd/sdl/man/${PN#sdl}.6 ${PN}.6

	insinto "${GAMES_DATADIR}/${PN}"
	doins -r src/osd/sdl/keymaps
	[[ ${PN} == "sdlmame" ]] && newins sdlmame-ui.bdf ui.bdf

	insinto "${GAMES_SYSCONFDIR}/${PN}"
	doins "${FILESDIR}"/vector.ini

	sed \
		-e "s:@GAMES_SYSCONFDIR@:${GAMES_SYSCONFDIR}:" \
		-e "s:@GAMES_DATADIR@:${GAMES_DATADIR}:" \
		"${FILESDIR}/${MY_CONF_PN}-${MY_CONF_VER}".ini.in > "${D}/${GAMES_SYSCONFDIR}/${PN}/${MY_CONF_PN}".ini \
		|| die "sed failed"

	dodoc docs/{config,mame,newvideo}.txt
	if [[ ${PN} == "sdlmame" ]] ; then
		dodoc whatsnew*.txt
	else
		dodoc messnew*.txt
	fi

	keepdir \
		"${GAMES_DATADIR}/${PN}"/{ctrlr,cheats,roms,samples,artwork,crosshair} \
		"${GAMES_SYSCONFDIR}/${PN}"/{ctrlr,cheats}

	prepgamesdirs
}

pkg_postinst() {
	games_pkg_postinst

	elog "optional dependencies:"
	elog "  games-emulation/sdlmametools (development tools)"
	echo
	elog "It's strongly recommended that you change either the system-wide"
	elog "${MY_CONF_PN}.ini at \"${GAMES_SYSCONFDIR}/${PN}\" or use a per-user setup at \$HOME/.${PN}"

	if use opengl; then
		echo
		elog "You built ${PN} with opengl support and should set"
		elog "\"video\" to \"opengl\" in ${MY_CONF_PN}.ini to take advantage of that"
	fi
}




Last edited by dman777; 05/01/15 04:43 PM.
#99505 - 05/01/15 06:24 PM Re: sdlmame won't respond to joystick if I compile [Re: dman777]  
Joined: Mar 2001
Posts: 15,807
R. Belmont Online content
R. Belmont  Online Content

Very Senior Member

Joined: Mar 2001
Posts: 15,807
USA
Make sure you're running with -joystick. AFAIK the ebuild loads mame.ini from a non-standard location so it will be configured differently by default from a self-build version. I use an Xbox 360 joypad constantly with MAME and MESS on Linux and so I'm positive there are no compatibility issues.

#99506 - 05/01/15 07:29 PM Re: sdlmame won't respond to joystick if I compile [Re: dman777]  
Joined: Apr 2015
Posts: 23
dman777 Offline
Member
dman777  Offline
Member

Joined: Apr 2015
Posts: 23
ya, I even tried it with mame/sdlmame -joystick and no success. Did you compile yours manually with just 'make'? I am thinking I need to enable something in the compiler but I don't see anything relevent in the make file for config option.

Last edited by dman777; 05/01/15 07:30 PM.
#99507 - 05/01/15 07:32 PM Re: sdlmame won't respond to joystick if I compile [Re: dman777]  
Joined: Mar 2001
Posts: 15,807
R. Belmont Online content
R. Belmont  Online Content

Very Senior Member

Joined: Mar 2001
Posts: 15,807
USA
Yeah, I just used -joystick. If you run with -verbose does it detect your pad?

#99524 - 05/02/15 05:24 AM Re: sdlmame won't respond to joystick if I compile [Re: dman777]  
Joined: Apr 2015
Posts: 23
dman777 Offline
Member
dman777  Offline
Member

Joined: Apr 2015
Posts: 23
Just to confirm...you compiled yours with a -joystick? did you add it in the make file?


#99527 - 05/02/15 06:06 AM Re: sdlmame won't respond to joystick if I compile [Re: dman777]  
Joined: May 2008
Posts: 4,865
qmc2 Offline
qmc2  Offline

Very Senior Member

Joined: May 2008
Posts: 4,865
Germany
RB means the -joystick and -verbose command line options for the (already built) MAME/MESS binary... another option to ensure that it's NOT reading any ini file would be to use -noreadconfig together with -joystick and -verbose, so all other settings would definitely be at their default values.


A mind is like a parachute. It doesn't work unless it's open. [Frank Zappa]

We're searching for QMC2 translators and support for existing translations. Interested? See here!
#99536 - 05/02/15 09:01 AM Re: sdlmame won't respond to joystick if I compile [Re: dman777]  
Joined: Jan 2006
Posts: 3,685
etabeta78 Offline
Very Senior Member
etabeta78  Offline
Very Senior Member

Joined: Jan 2006
Posts: 3,685
Trondheim, Norway
and to make things even clearer: no compile option is needed to have the emulator compatible with joysticks. they do work by default, and if they don't work at your end, you probably have some runtime option set wrong wink

#99550 - 05/02/15 11:11 PM Re: sdlmame won't respond to joystick if I compile [Re: dman777]  
Joined: Apr 2015
Posts: 23
dman777 Offline
Member
dman777  Offline
Member

Joined: Apr 2015
Posts: 23
For the first time, I tried/compiled version .161 and made some success... joystick works when I run mame64 as root but not as none-root.

This is with both:
Code:
/usr/games/bin/mame64  -joystick -verbose -noreadconfig -rompath /mnt/samsung/roms/mame/roms



with root:

Code:
Joystick: Start initialization
Input: Adding Joy #0: Xbox Gamepad (userspace driver)
Joystick: Xbox Gamepad (userspace driver)
Joystick:   ...  6 axes, 11 buttons 1 hats 0 balls
Joystick:   ...  Physical id 0 mapped to logical id 1
Joystick: End initialization


with non root:

Code:
Joystick: Start initialization
Joystick: End initialization


Any suggestions since I run my set up from qmc2 in non root user?

#99551 - 05/03/15 01:35 AM Re: sdlmame won't respond to joystick if I compile [Re: dman777]  
Joined: Mar 2001
Posts: 15,807
R. Belmont Online content
R. Belmont  Online Content

Very Senior Member

Joined: Mar 2001
Posts: 15,807
USA
That's extremely odd, I run as a non-root user and I don't have any problems with the joystick.

#99564 - 05/03/15 09:51 AM Re: sdlmame won't respond to joystick if I compile [Re: dman777]  
Joined: Jan 2012
Posts: 33
floo Offline
Member
floo  Offline
Member

Joined: Jan 2012
Posts: 33
It looks like you are using xboxdrv. It might be some weird device permissions with that driver on gentoo. Try using xpad.

Page 1 of 2 1 2

Moderated by  R. Belmont 

Who's Online Now
5 registered members (mixmaster, ted, Monotremata, R. Belmont, 1 invisible), 25 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Shout Box
Forum Statistics
Forums9
Topics8,480
Posts110,308
Members4,770
Most Online225
May 26th, 2014
Powered by UBB.threads™ PHP Forum Software 7.6.0
Page Time: 0.074s Queries: 15 (0.025s) Memory: 5.0206 MB (Peak: 5.2685 MB) Zlib enabled. Server Time: 2018-01-18 19:58:43 UTC