Previous Thread
Next Thread
Print Thread
Page 3 of 3 1 2 3
Joined: Apr 2015
Posts: 387
E
Senior Member
OP Offline
Senior Member
E
Joined: Apr 2015
Posts: 387
Originally Posted by Olivier Galibert
What you could do, and would have a chance to be accepted, is to create a communicate-with-frontend protocol through stdin/out activated with a command line option. Then you'd change the code to encode the rom check/loading/etc information so that the frontend can easily parse and display it in whichever way it wants.

If you're funky you can even try to pass the window handle from the frontend to mame through that protocol (os-dependent obviously, would work under linux, dunno windows or osx) to avoid window transitions.

But you'll have to do it cleanly if you want to have a chance to have it accepted, obviously.

Such a protocol is already in place - the lua console.
Why not use that? It is not enabled by default, non-power users don't use it (and probably aren't even aware of it, or what to do with it). It's pretty much a perfect fit, and it would avoid complicating the code base.

Joined: Apr 2005
Posts: 615
Likes: 6
Senior Member
Offline
Senior Member
Joined: Apr 2005
Posts: 615
Likes: 6
"Lua" is not a protocol

Edit: To elaborate a bit on this, before your inevitable backlash strikes:

A protocol needs a few things to be called a protocol. At least the following things are required:
  • a formal definition. This can be prose, code, pseudocode, flowcharts, etc.
  • special attention to interoperability between different implementations (i.e. windows vs linux, 32 vs 64 bit, big endinan vs. little endian, etc.)
  • At least two working "proof-of-concept" implementations that show that (and how) the protocol works.
True, you can do all these using the Lua interpreter in MAME (just as well you can use C/C++ to implement it), but simply stating "just use Lua!" is nothing even remotely similar to a "protocol".

I think when OG asked you to propose a protocol he wanted you to come up at least with the above mentioned points.

Last edited by Darkstar; 10/01/16 11:38 AM.
Joined: May 2009
Posts: 2,208
Likes: 355
J
Very Senior Member
Offline
Very Senior Member
J
Joined: May 2009
Posts: 2,208
Likes: 355
Originally Posted by Darkstar
"Lua" is not a protocol

Joined: Apr 2015
Posts: 387
E
Senior Member
OP Offline
Senior Member
E
Joined: Apr 2015
Posts: 387
Semantically, no.
But for all practical intents and purposes, yes - you could treat it like a protocol, in this case.
It sends and receives input, using an established standard.

Right?

Joined: Jun 2001
Posts: 519
Likes: 32
O
Senior Member
Offline
Senior Member
O
Joined: Jun 2001
Posts: 519
Likes: 32
Originally Posted by EoceneMiacid
Such a protocol is already in place - the lua console.
Why not use that? It is not enabled by default, non-power users don't use it (and probably aren't even aware of it, or what to do with it). It's pretty much a perfect fit, and it would avoid complicating the code base.

Why not. I don't remember lua being able to access stdin and I think it's initialized relatively late, but I'm sure you can fix that. It would have the advantage of every frontend being able to implement whichever functionality it wants. We'll await your PRs.

OG.

Joined: Apr 2015
Posts: 387
E
Senior Member
OP Offline
Senior Member
E
Joined: Apr 2015
Posts: 387
Originally Posted by Olivier Galibert
Originally Posted by EoceneMiacid
Such a protocol is already in place - the lua console.
Why not use that? It is not enabled by default, non-power users don't use it (and probably aren't even aware of it, or what to do with it). It's pretty much a perfect fit, and it would avoid complicating the code base.

Why not. I don't remember lua being able to access stdin and I think it's initialized relatively late, but I'm sure you can fix that. It would have the advantage of every frontend being able to implement whichever functionality it wants. We'll await your PRs.

OG.

lua can access stdin, you can send commands to it.

Ok, will do.

Joined: Mar 2001
Posts: 17,181
Likes: 211
R
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 17,181
Likes: 211
BGFX actually relies on SDL or DXGI passing it a window handle. In fact, I think I said much the same thing the last time someone came up with something like this.

Joined: Jun 2001
Posts: 519
Likes: 32
O
Senior Member
Offline
Senior Member
O
Joined: Jun 2001
Posts: 519
Likes: 32
Originally Posted by R. Belmont
BGFX actually relies on SDL or DXGI passing it a window handle. In fact, I think I said much the same thing the last time someone came up with something like this.

I was wondering, can you pass window handles between applications on windows or on osx? I know it's possible on linux (but you need to have opened the window in GL mode for bgfx/opengl iirc).

OG.

Joined: Apr 2005
Posts: 615
Likes: 6
Senior Member
Offline
Senior Member
Joined: Apr 2005
Posts: 615
Likes: 6
It works in Windows too. Many applications use it to "embed" other applications' window into their own UI. A non-gaming-related example is PuTTY and its various front-ends (SuperPuTTY and whatnot) but it (reportedly) also works for GL-enabled windows which is often used by "overlay"-type software (I think there's even a flag that can be passed to SDL which makes it attach to that window instead of creating its own. It's been a few years since I last used such features though)

Last edited by Darkstar; 10/02/16 10:45 AM.
Joined: Apr 2015
Posts: 387
E
Senior Member
OP Offline
Senior Member
E
Joined: Apr 2015
Posts: 387
Window embedding and all that stuff is another discussion entirely though, and not what I'm going for, personally.

I used to experiment with embedding MAME in the frontend back with Qt4 (Qt5 doesn't have that functionality anymore), but iirc it didn't work all that well, and impacted performance negatively.

Besides, on Linux, it isn't really necessary anyway - there are plenty of different window managers available, and many of them offer advanced configuration on a per-window basis, so you have total control over MAME's or any other window.

And then there's Wayland, which isn't widely adopted yet, but shows a ton of promise and is much nicer than the archaic X11 to develop for.

Of course this doesn't do Windows or Mac users any good.

Last edited by EoceneMiacid; 10/02/16 10:16 PM.
Page 3 of 3 1 2 3

Link Copied to Clipboard
Who's Online Now
2 members (Revenant, MrBogi), 45 guests, and 1 robot.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,310
Posts121,714
Members5,070
Most Online1,283
Dec 21st, 2022
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Forum hosted by www.retrogamesformac.com