Previous Thread
Next Thread
Print Thread
Page 4 of 5 1 2 3 4 5
Re: SDLMAME 0.127 is up! [Re: R. Belmont] #44043 08/24/08 03:12 PM
Joined: May 2008
Posts: 4,899
Q
qmc2 Offline
Very Senior Member
Offline
Very Senior Member
Q
Joined: May 2008
Posts: 4,899
Originally Posted By R. Belmont

sizeof(int) != sizeof(long) on x64.

I know, but there are ancient OSs / platforms where this isn't always true. But it's questionable if you should care about them smile.


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!
Re: SDLMAME 0.127 is up! [Re: qmc2] #44044 08/24/08 04:35 PM
Joined: Feb 2007
Posts: 500
C
couriersud Offline
Senior Member
Offline
Senior Member
C
Joined: Feb 2007
Posts: 500
I would propose the following change. It should cover a lot of platforms and be easy to adapt for others.

Code:
diff -Nur /tmp/sdlmame0127/src/osd/sdl/output.c src/osd/sdl/output.c
--- /tmp/sdlmame0127/src/osd/sdl/output.c	2008-08-19 14:59:05.000000000 +0200
+++ src/osd/sdl/output.c	2008-08-24 18:14:31.000000000 +0200
@@ -29,6 +29,20 @@
 
 #define SDLMAME_OUTPUT	"/tmp/sdlmame_out"
 
+/*
+ * Using long/int should be sufficient on all
+ * architectures. 
+ */
+
+
+#ifdef PTR64
+#define PID_FMT "%ld"
+#define PID_CAST long
+#else
+#define PID_FMT "%d"
+#define PID_CAST int
+#endif
+
 //============================================================
 //  TYPEDEFS
 //============================================================
@@ -47,6 +61,15 @@
 static void notifier_callback(const char *outname, INT32 value, void *param);
 
 //============================================================
+//  osd_get_pid
+//============================================================
+
+PID_CAST osd_getpid(void)
+{
+	return (PID_CAST) getpid();
+}
+
+//============================================================
 //  sdloutput_init
 //============================================================
 
@@ -68,7 +91,7 @@
 		output = fdopen(fildes, "w");
 		
 		mame_printf_verbose("ouput: opened output notifier file %s\n", SDLMAME_OUTPUT);
-		fprintf(output, "MAME %d START %s\n", getpid(), machine->gamedrv->name);
+		fprintf(output, "MAME " PID_FMT " START %s\n", osd_getpid(), machine->gamedrv->name);
 		fflush(output);
 	}
 	
@@ -84,7 +107,7 @@
 {
 	if (output != NULL)
 	{
-		fprintf(output, "MAME %d STOP %s\n", getpid(), machine->gamedrv->name);
+		fprintf(output, "MAME " PID_FMT " STOP %s\n", osd_getpid(), machine->gamedrv->name);
 		fflush(output);
 		fclose(output);
 		output = NULL;
@@ -100,7 +123,7 @@
 {
 	if (output != NULL)
 	{
-		fprintf(output, "OUT %d %s %d\n", getpid(), outname, value);
+		fprintf(output, "OUT " PID_FMT " %s %d\n", osd_getpid(), outname, value);
 		fflush(output);
 	}
 }

Re: SDLMAME 0.127 is up! [Re: couriersud] #44046 08/24/08 05:05 PM
Joined: Mar 2001
Posts: 16,523
R
R. Belmont Online Content OP
Very Senior Member
OP Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,523
Looks good as usual, Couriersud smile

Re: SDLMAME 0.127 is up! [Re: R. Belmont] #44050 08/24/08 07:26 PM
Joined: Nov 1999
Posts: 662
B
Bletch Offline
Senior Member
Offline
Senior Member
B
Joined: Nov 1999
Posts: 662
Isn't having some awkward "pid casting" macros overkill? Wouldn't it be better to do something like:

Code:
  fprintf(output, "MAME %ld STOP %s\n", (long) getpid(), machine->gamedrv->name);

Re: SDLMAME 0.127 is up! [Re: Bletch] #44051 08/24/08 07:45 PM
Joined: Mar 2001
Posts: 16,523
R
R. Belmont Online Content OP
Very Senior Member
OP Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,523
Good point.

Re: SDLMAME 0.127 is up! [Re: Bletch] #44053 08/24/08 08:01 PM
Joined: Feb 2007
Posts: 500
C
couriersud Offline
Senior Member
Offline
Senior Member
C
Joined: Feb 2007
Posts: 500
Originally Posted By Bletch
Isn't having some awkward "pid casting" macros overkill?


I tried to take into account Vas's post about "pointer-size" pid_t. On weird platforms (sizeof(pid_t)>sizeof(long)) - if they exist at all - they may easily be adjusted.

Re: SDLMAME 0.127 is up! [Re: R. Belmont] #44069 08/25/08 01:24 PM
Joined: Sep 2004
Posts: 43
V
Van Ba Offline
Member
Offline
Member
V
Joined: Sep 2004
Posts: 43
I compiled SDLMAME on a MacPro with OS X 10.4.
I make only one change to the makefile (unix->macosx)
Now, MAME launches from terminal and runs well until I hit TAB to make OSD visible (to change video to pixel aspect, for example). After that, MAME locks up and the terminal display this error message:

Quote:
Exception raised during posting of notification. Ignored. exception: *** -[NSLayoutManager glyphRangeForTextContainer:]: given container does not appear in the list of containers for this NSLayoutManager.

and I have to force-quit.
The lock-up isn't immediate: it happens from a few seconds to nearly one minute after I dismiss OSD.
This is the first version showing this bug on my configuration. Currently I'm not able to compile and test using other platforms.

Re: SDLMAME 0.127 is up! [Re: Van Ba] #44073 08/25/08 02:28 PM
Joined: Mar 2001
Posts: 16,523
R
R. Belmont Online Content OP
Very Senior Member
OP Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,523
You're not using SDL 1.2.13 or greater. Older versions crashed on OS X when you pressed keys.

Re: SDLMAME 0.127 is up! [Re: R. Belmont] #44081 08/25/08 04:53 PM
Joined: Sep 2004
Posts: 43
V
Van Ba Offline
Member
Offline
Member
V
Joined: Sep 2004
Posts: 43
All right now. Thanks.

Re: SDLMAME 0.127 is up! [Re: MooglyGuy] #44125 08/26/08 05:14 PM
Joined: Oct 2006
Posts: 984
S
Stiletto Offline
Senior Member
Offline
Senior Member
S
Joined: Oct 2006
Posts: 984
Originally Posted By MooglyGuy
Originally Posted By R. Belmont
I don't know how fast SPARCs are though smile


For the purposes of MAME? Not very, unless you want to run old games.


Yep, used one or more of those in college. They were like PentiumII speed, if that. Slower if they used shared network drives.

Heh, here's a blast from the past. I forgot what a self-promoter I used to be: http://www.mail-archive.com/xmame@locutus.csres.utexas.edu/msg04753.html

- Stiletto

Page 4 of 5 1 2 3 4 5

Moderated by  R. Belmont 

Who's Online Now
1 registered members (Heihachi_73), 97 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,784
Posts115,597
Members4,908
Most Online890
Jan 17th, 2020
Powered by UBB.threads™ PHP Forum Software 7.7.3