Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Nov 2003 12:10:19 -0800 (PST)
From:      Travis Poppe <tlp@LiquidX.org>
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/59558: [FIX PORT] Patched to support newer xmame versions
Message-ID:  <200311212010.hALKAJYd008193@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/59558; it has been noted by GNATS.

From: Travis Poppe <tlp@LiquidX.org>
To: freebsd-gnats-submit@FreeBSD.org
Cc:  
Subject: Re: ports/59558: [FIX PORT] Patched to support newer xmame versions
Date: Fri, 21 Nov 2003 13:04:21 -0700 (MST)

 I'm not sure if you meant for me to submit the diff that fixes xmame
 compatibility, or if you wanted me to submit a diff to make my port use
 %%DOCSDIR%%
 
 I have re-submitted my fixed port as an sh archive, and below is the
 unified diff to fix xmame compatibility. Hope it works this time :-)
 
 diff -urNp gxmame-0.33/src/gxmame.h gxmame-0.33.7274fixed/src/gxmame.h
 --- gxmame-0.33/src/gxmame.h	2003-05-29 21:41:28.000000000 +0100
 +++ gxmame-0.33.7274fixed/src/gxmame.h	2003-09-21 00:43:38.000000000 +0100
 @@ -519,6 +519,7 @@ typedef struct _xmame_game_options {
  	gboolean mouse;			/* Enable/disable mouse (if supported) */
  	gboolean hotrod;		/* Enable HotRod joystick support */
  	gboolean hotrodse;		/* Select HotRod SE joystick support */
 +	gboolean newhotrodusage;	/* 0.74.1 has new hotrod options */
  	gboolean usbpspad;		/* The Joystick(s) are USB PS Game Pads */
  	gboolean rapidfire;		/* Enable rapid-fire support for joysticks */
 
 @@ -645,6 +646,8 @@ typedef struct _xmame_available_options
  	gboolean list_mixer_plugins;	/* list mixer plugins */
  	gboolean keyboard_leds;		/* use keyboard leds */
  	gboolean dirty;			/* dirty not in 0.61 pr1 */
 +	gboolean newx11modeusage;	/* for 0.72.1 -x11-mode changes */
 +	gboolean newhotrodusage;	/* for 0.74.1 -hotrod[se] changes */
  	gboolean xvext;			/* xv extension 0.60 + patch from
  					   Alastair M. Robinson*/
  	gboolean vidix;			/* another target from Alastair M. Robinson
 diff -urNp gxmame-0.33/src/mameio.c gxmame-0.33.7274fixed/src/mameio.c
 --- gxmame-0.33/src/mameio.c	2003-05-29 21:32:26.000000000 +0100
 +++ gxmame-0.33.7274fixed/src/mameio.c	2003-09-21 00:43:38.000000000 +0100
 @@ -32,8 +32,6 @@
  #include <unistd.h>
  #define BUFFER_SIZE 1000
 
 -
 -
  gboolean create_game_list_file(void)
  {
  	FILE *xmame_pipe=NULL;
 @@ -957,6 +955,18 @@ gboolean get_mame_options(void)
  	version=atof(p);
  	g_free(opt);
 
 +	/* version 0.72.1 introduces new syntax for the -x11-mode option */
 +	if (version>=0.72)
 +		available_options.newx11modeusage=TRUE;
 +	else
 +		available_options.newx11modeusage=FALSE;
 +
 +	/* version 0.74.1 introduces new syntax for -hotrod[se] options */
 +	if (version>=0.74)
 +		available_options.newhotrodusage=TRUE;
 +	else
 +		available_options.newhotrodusage=FALSE;
 +
  	/* do not test anymore if the executable is valid since its already tested previously  */
  	/* to be able to load the 0.68 options */
  	if (version==0.68)
 @@ -989,7 +999,16 @@ gboolean get_mame_options(void)
  	available_options.list_mixer_plugins = FALSE;
  	available_options.keyboard_leds = FALSE;
  	available_options.dirty = FALSE;
 -	available_options.xvext = FALSE;
 +	if (version>=0.72)
 +	{
 +		available_options.xvext=TRUE;
 +		available_options.fullscreen=TRUE;
 +	}
 +	else
 +	{
 +		available_options.xvext = FALSE;
 +		available_options.fullscreen = FALSE;
 +	}
  	available_options.vidix = FALSE;
  	available_options.yuv = FALSE;
  	available_options.yv12 = FALSE;
 @@ -999,7 +1018,7 @@ gboolean get_mame_options(void)
  	available_options.x11joyname = FALSE;
  	available_options.joydevname = FALSE;
  	available_options.video_mode = FALSE;
 -	available_options.fullscreen = FALSE;
 +
  	available_options.cfgname = FALSE;
  	available_options.grabmouse = FALSE;
  	available_options.grabkeyboard = FALSE;
 diff -urNp gxmame-0.33/src/options.c gxmame-0.33.7274fixed/src/options.c
 --- gxmame-0.33/src/options.c	2003-06-08 19:48:37.000000000 +0100
 +++ gxmame-0.33.7274fixed/src/options.c	2003-09-21 00:45:33.000000000 +0100
 @@ -34,6 +34,7 @@
  #include <gtk/gtk.h>
 
  #include "gxmame.h"
 +#include "mameio.h"
  #include "options.h"
  #include "io.h"
  #include "callbacks.h"
 @@ -6267,6 +6268,7 @@ char *create_Renderer_Related_options_st
  			*vidix=NULL,
  			*geometry = NULL,
  			*newext = NULL;
 +		int	x11mode = 0;
 
  		if (available_options.mitshm)
  		{
 @@ -6276,7 +6278,21 @@ char *create_Renderer_Related_options_st
  		/* put the new extention option (xv and vidix) in a string*/
  		if (target->xvgeom_flag && strcmp(target->geometry,""))
  			geometry = g_strdup_printf("-geometry %s",target->geometry);
 -		newext =  g_strdup_printf("%s "					/* fullscreen */
 +		/* 0.72 removes -fullscreen option in favour of new */
 +		/* -x11-mode values */
 +		if (available_options.newx11modeusage)
 +		{
 +			newext =  g_strdup_printf("%s "					/* geometry */
 +					  "%s "					/* yuv */
 +					  "%s",					/* yv12 */
 +					  geometry?geometry:"",
 +					  available_options.yuv?((target->yuv)?"-yuv":"-noyuv"):"",
 +					  available_options.yv12?((target->yv12)?"-yv12":"-noyv12"):""
 +					);
 +		}
 +		else
 +		{
 +			newext =  g_strdup_printf("%s "					/* fullscreen */
  					  "%s "					/* geometry */
  					  "%s "					/* yuv */
  					  "%s",					/* yv12 */
 @@ -6285,6 +6301,7 @@ char *create_Renderer_Related_options_st
  					  available_options.yuv?((target->yuv)?"-yuv":"-noyuv"):"",
  					  available_options.yv12?((target->yv12)?"-yv12":"-noyv12"):""
  					);
 +		}
 
  		if (available_options.xvext)
  		{
 @@ -6304,8 +6321,47 @@ char *create_Renderer_Related_options_st
 
 
  		Video_Mode_option = create_Video_Mode_Related_options_string();
 -
 -		option_string = g_strdup_printf ("-x11-mode %i "
 +
 +		/* 0.72 introduces new usage of -x11-mode: */
 +		/* 0 = normal windowed */
 +		/* 1 = DGA fullscreen */
 +		/* 2 = Xv windowed */
 +		/* 3 = Xv fullscreen */
 +		if (available_options.newx11modeusage)
 +		{
 +			x11mode=target->x11_mode;
 +			if (target->xvext)
 +			{
 +				x11mode=2;
 +				if (target->xvfullscreen)
 +					x11mode=3;
 +			}
 +
 +			option_string = g_strdup_printf ("-x11-mode %i "
 +						"-%scursor "
 +						"%s "				/* mitshm */
 +						"%s "				/* vidix */
 +						"%s "				/* newext */
 +						"-%sxsync "
 +						"-%sprivatecmap "
 +						"-%sxil "
 +						"-%smtxil "
 +						"%s ",				/* Video mode */
 +						x11mode,
 +						(target->cursor)?"":"no",
 +						mitshm?mitshm:"",
 +						vidix?vidix:"",
 +						newext?newext:"",
 +						(target->xsync)?"":"no",
 +						(target->privatecmap)?"":"no",
 +						(target->xil)?"":"no",
 +						(target->mtxil)?"":"no",
 +						Video_Mode_option?Video_Mode_option:""
 +						);
 +		}
 +		else
 +		{
 +			option_string = g_strdup_printf ("-x11-mode %i "
  						"-%scursor "
  						"%s "				/* mitshm */
  						"%s "				/* xvext */
 @@ -6327,7 +6383,8 @@ char *create_Renderer_Related_options_st
  						(target->xil)?"":"no",
  						(target->mtxil)?"":"no",
  						Video_Mode_option?Video_Mode_option:""
 -						);
 +						);
 +		}
  		g_free(Video_Mode_option);
  		g_free(xvext);
  		g_free(vidix);
 @@ -6551,7 +6608,46 @@ char *create_Input_Related_options_strin
  				(target->winkeys)?"":"no"
  				);
  	}
 -	option_string = g_strdup_printf ("-joytype %i "
 +//AJB
 +	if (available_options.newhotrodusage)
 +	{
 +		option_string = g_strdup_printf ("-joytype %i "
 +				"-%sanalogstick "
 +				"%s "					/* joy */
 +				"-%smouse "
 +				"%s "
 +				"%s "
 +				"-%susbpspad "
 +				"-%srapidfire "
 +				"%s "					/* trackball1 */
 +				"%s "					/* trackball2 */
 +				"%s "					/* trackball3 */
 +				"%s "					/* trackball4 */
 +				"%s "					/* x11_options*/
 +				"%s " 					/* grabkeyboard */
 +				"%s "					/* keymap */
 +				"%s ",					/* ugcicoin */
 +				target->joytype,
 +				(target->analogstick)?"":"no",
 +				joy?joy:"",
 +				(target->mouse)?"":"no",
 +				(target->hotrod)?"-ctrlr HotRod":"",
 +				(target->hotrodse)?"-ctrlr HotRodSE":"",
 +				(target->usbpspad)?"":"no",
 +				(target->rapidfire)?"":"no",
 +				trackball1?trackball1:"",
 +				trackball2?trackball2:"",
 +				trackball3?trackball3:"",
 +				trackball4?trackball4:"",
 +				x11_options?x11_options:"",
 +				available_options.grabkeyboard?((target->grabkeyboard)?"-grabkeyboard":"-nograbkeyboard"):"",
 +				keymap?keymap:"",
 +				available_options.ugcicoin?((target->ugcicoin)?"-ugcicoin":"-nougcicoin"):""
 +				);
 +	}
 +	else
 +	{
 +		option_string = g_strdup_printf ("-joytype %i "
  				"-%sanalogstick "
  				"%s "					/* joy */
  				"-%smouse "
 @@ -6584,6 +6680,7 @@ char *create_Input_Related_options_strin
  				keymap?keymap:"",
  				available_options.ugcicoin?((target->ugcicoin)?"-ugcicoin":"-nougcicoin"):""
  				);
 +	}
 
  	g_free(joy);
  	g_free(trackball1);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200311212010.hALKAJYd008193>