Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news


  

Author Topic: MAMEInterop SDK v1.3 Released for Developers  (Read 16316 times)

0 Members and 1 Guest are viewing this topic.

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2942
  • 0x2b|~0x2b?
Re: MameInterop SDK v1.0 Released for Developers
« Reply #120 on: May 18, 2016, 11:17:14 pm »
I've got communication working. If you want to see it working before you attempt to implement it in code do the following:

1. Edit your mame.ini file with the following line:
Code: [Select]
#
# OSD OUTPUT OPTIONS
#
output                    network
2. Go to Programs and Features->Turn Windows features on or off and enable the Telnet Client.
3. Run "mame64.exe -verbose digdug" from the command line and it should prompt you to open the port in Windows Firewall
4. From another command line run "telnet 127.0.0.1 8000" and you should get the following output:
Code: [Select]
led1led05. When you exit Mame the command line should show something to the effect of:
Code: [Select]
tcp_server pointer was not allocated by the usernew TCP connection:[TCP, local:0.0.0.0 :8000, remote:127.0.0.1 :58377, status:open]
Average speed: 100.01% (18 seconds)
closing 1 active connectionsTCP connection closed:[TCP, local:0.0.0.0 :8000, remote:127.0.0.1 :58377, status:closed]

I have the Mame dll's working now but I have to add the ability to reconnect when games change. I'm also not sure if there is a start / end message when you launch and end a game. Also there doesn't appear to be an id for each message. Anyway now that you can get communication working we should hopefully be able to figure out exactly what is and isn't implemented in the new system.
« Last Edit: May 18, 2016, 11:35:49 pm by headkaze »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16400
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #121 on: May 19, 2016, 01:33:27 pm »
Ah ok, it was the ini entry that I was lacking.  That was driving me crazy.... tcp is so easy even an idiot like me can do it. 

Yeah I played with it a few and it seems like they killed a lot of features.  Start/stop is crucial imho. 

I'm not making much sense of the data it's feeding us either. IDs aren't crucial imho, but without them I might have to either rewrite portions of mamehooker's code or do what I do with other emulators and supply my own.  Let me play with it some more.......

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16400
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #122 on: May 19, 2016, 01:44:48 pm »
Yeah unless I'm missing something (which is completely possible) this new system is broken.  Try a game with 7-segment displays and it just keeps sending the name of the digit that is changed, it doesn't send the value.  Are we supposed to poll mame for the value?  If so why not just send the value along with the name since plain text it being sent?

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16400
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #123 on: May 20, 2016, 11:58:15 pm »
So I tried console mode for outputs and it is showing the values as expected.  Is the tcp system delimiting things with a null character?  Because if it is, there's your problem.   

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2942
  • 0x2b|~0x2b?
Re: MameInterop SDK v1.0 Released for Developers
« Reply #124 on: May 21, 2016, 11:50:03 am »
I'm receiving the data via Winsock's recv function which will return a precise length of the data received. I manually add a NULL character to the end of the buffer to pass it through the callback.

Eg. I will receive a packet of "6c 65 64 30" and then "6c 65 64 31" which translates to "led0" and "led1" in ASCII respectively. Also it's worth noting that I will occationally receive two sets of data in one packet (Eg. "led0led1").

What game are you using to test the segment display? Can you give an example of what the output is for console mode so I can compare my results?

Sometimes I will receive "Orientation(\\.\DISPLAY1)" when launching a game but again no start/stop messages. Also when MAME closes I need to re-establish a connection so even if there was a start message sent I might miss it. Right now I will poll for data every second so I can process the message pump incase the thread needs to quit. I can lower this value and it should improve reconnection and perhaps the combined data issue will be reduced too.

EDIT: I see what you're saying when you change the output to "console". I get:
Code: [Select]
led0 = 0
led0 = 1
This data makes more sense. So it appears the "network" output system is broken. So the next step I guess is to report the bug or patch to Mamedev.
« Last Edit: May 21, 2016, 12:02:07 pm by headkaze »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16400
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #125 on: May 21, 2016, 02:15:13 pm »
Yeah I apologize for my ignorance because c style overrides never made much sense to me, but unless I'm interpreting the source wrong there are two output functions, one (overridden) for the console and another for network.  The console one sends along "%s% = %d%/n" but the network one sends( I think) the name as a char string (they forget to null terminate) followed by the value as int32.  The problem with that is custom data types can't be passed with winsock and most of the easier connection methods.  I would like you to confirm this for me since, as you know, C programming isn't my area of expertise.  Personally I would rather get the data like the console prints it.... we can split a " = " fairly easy in any language.  Orientation could be used as a mamestart since it doesn't update, but those functions really need added back in. 


Any of the neogeo games would work as they have a 2 digit display for the credits.

I'll let you do a report fi that how you want to do it as I think some of those guys don't like me.  ;)

I think we could fix it fairly easily, but man, I haven't setup a mame compile environment in a good 5 years. 

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2942
  • 0x2b|~0x2b?
Re: MameInterop SDK v1.0 Released for Developers
« Reply #126 on: May 21, 2016, 04:42:22 pm »
the network one sends( I think) the name as a char string (they forget to null terminate) followed by the value as int32.
What particular line of code are you referring to?

As far as I can tell the data being sent is exactly as I described it in my previous post. ie. 4 bytes (eg. "led0" and "led1"). I do not receive any 32-bit integer following this data. The winsock recv function tells you how many bytes are received and it does not account for any NULL since it's a network stream of bytes. This is why you can receive two messages in one.

I think we could fix it fairly easily, but man, I haven't setup a mame compile environment in a good 5 years. 
You can always use Mame Compiler 64 ;) Anyway we don't necessarily need to come up with a patch we just need to verify the data is not being sent and report it.

EDIT: Just to be sure it isn't something I'm doing wrong I used PuTTy with logging enabled and I can confirm that I'm only receiving the output name and not the value.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16400
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #127 on: May 21, 2016, 05:41:31 pm »
Sorry man, I was reading it backwards. 

What I'm talking about is here in network.cpp:

Code: [Select]
virtual void notify(const char *outname, INT32 value) override { m_server->send_to_all((const uint8_t*)outname, strlen(outname)); }

So let me re-phrase that.  The original function is given the name and value, but the override just sends the value. 

Now if you look at console.cpp the notify function is like this:

Code: [Select]
virtual void notify(const char *outname, INT32 value) override { osd_printf_info("%s = %d\n", ((outname==nullptr) ? "none" : outname), value); }

So in this one the name and value are formatted and sent along to the console output as a string.

Yeah I'm using winsock as well btw... it's just easier, but I'm unsure if bytes received can be influenced by the variable type and the data. 

I thought originally that we had to poll mame to get the value, but afaict there aren't any functions to receive data. 

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16400
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #128 on: May 21, 2016, 05:46:19 pm »
So in addition to fixing that line, some sort of init and close signal needs to be sent on... well... the init and close functions.  I'm not sure the best way to implement that as the rom name would have to be pulled from somewhere... machine_init?  I think the rest of it is still there.

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2942
  • 0x2b|~0x2b?
Re: MameInterop SDK v1.0 Released for Developers
« Reply #129 on: May 21, 2016, 09:27:26 pm »
So in this one the name and value are formatted and sent along to the console output as a string.

So it needs to be changed to something like this:
Code: [Select]
virtual void notify(const char *outname, INT32 value) override
{
static char buf[256];
sprintf(buf, "%s = %d\n", ((outname==nullptr) ? "none" : outname), value);
m_server->send_to_all((const uint8_t*)buf, strlen(buf));
}

Yeah I'm using winsock as well btw... it's just easier, but I'm unsure if bytes received can be influenced by the variable type and the data.

No, it's just a stream of bytes.

I thought originally that we had to poll mame to get the value, but afaict there aren't any functions to receive data.

As far as I can tell the communication for the netwrok system is one way. I don't see why they would require us to read the name then send back a request for the value. It would just be extra work for something that works fine one way.

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2942
  • 0x2b|~0x2b?
Re: MameInterop SDK v1.0 Released for Developers
« Reply #130 on: May 21, 2016, 09:29:01 pm »
So in addition to fixing that line, some sort of init and close signal needs to be sent on... well... the init and close functions.  I'm not sure the best way to implement that as the rom name would have to be pulled from somewhere... machine_init?  I think the rest of it is still there.

The original output system sent machine.system().name.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16400
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #131 on: May 21, 2016, 09:57:25 pm »
Yeah but I was thinking that there was something goofy about getting the name.  It only works after certain stages of the init are completed or something.  I honestly don't know though.  Mame has changed so much since I used to submit any meaningful code. 

I think your solution is ideal and honestly I'm not sure why there is a console and network mode.  The console output could always be on and wouldn't hurt a thing and if nothing tries to connect to the server port the network happily sits there as well.  A simple "-outputs / -nooutputs" makes more sense to me.

Most of the other stuff is still in there.  I've gotten pause/unpause events and orientation.  That thing about sending multiple outputs at the same time needs fixed though.  Perhaps a null character at the end of each output as a delimiter.  I would say send them separately, but with some of the gambling games the lag introduced might make the outputs constantly behind. 

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2942
  • 0x2b|~0x2b?
Re: MameInterop SDK v1.0 Released for Developers
« Reply #132 on: May 23, 2016, 02:15:45 pm »
I think your solution is ideal and honestly I'm not sure why there is a console and network mode.  The console output could always be on and wouldn't hurt a thing and if nothing tries to connect to the server port the network happily sits there as well.  A simple "-outputs / -nooutputs" makes more sense to me.

We could in theory read stdout for outputs but that would require the client software to launch MAME and redirect its output. I wouldn't want the console output on by default though as in my experience it can effect performance. I think the server method is the way to go but we do need to get the formatting fixed.

Most of the other stuff is still in there.  I've gotten pause/unpause events and orientation.

I did notice the "pause" event although again the network message does not send the actual state so you can't tell between a pause or unpause.

So I guess the next step is we need to report this to Mamedev.
« Last Edit: June 03, 2016, 01:32:11 pm by headkaze »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16400
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #133 on: May 31, 2016, 03:42:54 pm »
Have you reported this yet?  Thinking on it more maybe we should fix the error ourselves so it'll be in the proper format.  You might have to school me on your compiler.  ;)

Arbee

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 48
Re: MameInterop SDK v1.0 Released for Developers
« Reply #134 on: June 03, 2016, 12:04:06 pm »
HeadKaze's patch in reply #129 looks like it does what you need as far as the message formatting.  If it tests out OK, please submit it.

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2942
  • 0x2b|~0x2b?
Re: MameInterop SDK v1.0 Released for Developers
« Reply #135 on: June 04, 2016, 11:54:37 am »
Have you reported this yet?  Thinking on it more maybe we should fix the error ourselves so it'll be in the proper format.  You might have to school me on your compiler.  ;)

There is really nothing to "school" you on Mame Compiler it's pretty straight forward. Today I added support for creating diff patches so it should make it even easier for us to submit changes going forward.

I have created a "mame0173_network.diff" patch and will submit it today. According to the Submission Guidelines all I have to do is e-mail it to them with an explaination.
« Last Edit: June 04, 2016, 11:57:25 am by headkaze »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16400
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #136 on: June 04, 2016, 12:16:02 pm »
Well that should help tremendously.  Don't be tempting me into adding source code again man.  Don't do it.  ;)


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16400
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #137 on: June 05, 2016, 04:22:39 pm »
I hate to keep spamming this thread, but I've got a question.

Could we set it up to where mame tries to connect to a port (with a reasonable timeout of course) and it doesn't start sending data until it finds a connection?  As-is, if the output app connects too early then it doesn't make a connection with mame and if it connects too late it might miss vital stuff like the rom name, ect.  We could do the old looking for windows stuff, but if mame is trying to get away from that the client app should as well. I could just be doing it wrong.

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2942
  • 0x2b|~0x2b?
Re: MameInterop SDK v1.0 Released for Developers
« Reply #138 on: June 08, 2016, 12:15:06 am »
As-is, if the output app connects too early then it doesn't make a connection with mame and if it connects too late it might miss vital stuff like the rom name, ect.

I've submitted the patch so let's see what feedback we get. If and when they update MAME I'll see if I can get the Mame Interop dll's to connect and re-connect reliably. Right now though I don't appear to be receiving any ROM name via the network connection method. Are you receiving this data?

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16400
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #139 on: June 08, 2016, 12:57:08 am »
No, it's not being sent.  I assumed you had added start/stop messages with your patch. 

Actually now that I tested it again... let's say I try to listen on port 8000..... mame crashes with an unspecified error. 

SteveBR

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 1
  • I want to build my own arcade controls!
Re: MameInterop SDK v1.0 Released for Developers
« Reply #140 on: June 13, 2016, 09:40:46 pm »

Hi headkaze, I didn't know where else to post this. I downloaded your coindrop1.3 program from many years ago and was trying to get it to work for personal use.  Is it possible to run it on Win 8/10?  If not is the source code available for the user to update the code? Thanks.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16400
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #141 on: July 29, 2016, 08:40:57 pm »
I apologize for cluttering the thread.  I've been busy and I was just wondering what the progress has been.  Is it in mame yet?  I've got everything on hold prior to a new release.

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2942
  • 0x2b|~0x2b?
Re: MameInterop SDK v1.0 Released for Developers
« Reply #142 on: July 31, 2016, 02:51:33 pm »
I apologize for cluttering the thread.  I've been busy and I was just wondering what the progress has been.  Is it in mame yet?  I've got everything on hold prior to a new release.

I submitted a patch but Mamedev never got back to me.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16400
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #143 on: August 02, 2016, 11:28:51 pm »
Well that's not good. 

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2942
  • 0x2b|~0x2b?
Re: MameInterop SDK v1.0 Released for Developers
« Reply #144 on: August 05, 2016, 12:28:23 am »
Just had a look at MAME 0176 source and it looks like they've applied my patch. Not sure what version they implemented it?

Anyway I will post an updated SDK soon.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16400
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #145 on: August 05, 2016, 12:51:05 am »
Cool.  We need to do one more patch most likely to add in stuff like the rom name and orientation back in.

arzoo

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1848
  • We are not in the 8th dimension. We are over NJ.
    • LEDBlinky
Re: MameInterop SDK v1.0 Released for Developers
« Reply #146 on: August 05, 2016, 09:00:16 am »
Just had a look at MAME 0176 source and it looks like they've applied my patch. Not sure what version they implemented it?

Anyway I will post an updated SDK soon.

That's great news - thanks!
Robots will kill you.



Arcade Addiction

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2942
  • 0x2b|~0x2b?
Re: MameInterop SDK v1.2 Released for Developers
« Reply #147 on: August 05, 2016, 09:46:19 pm »
I've updated the first post with MameInterop SDK v1.2 but we're not quite there yet. The reason I've released the update is so we can experiment with a working system and so we can get the next series of patches ready to send to Mamedev.

Howard: I've included an updated VB6 version of Mame.dll. I'm not sure if you're developing a separate system for Mame Hooker but my code should help with the re-connection issue you were having. Either way I'd appreciate it if you'd stick by and help us get this SDK working. If you'd like to help create an actual patch I recommend you get the latest version of Mame Compiler 64 which helps automate the process.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16400
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.2 Released for Developers
« Reply #148 on: August 06, 2016, 01:46:18 pm »
Yeah, no problem.  They've got me on a new thyroid medicine that's giving me trouble with vision/balance so I'm not much help in the coding dept. atm.  It's quite frustrating as I've got some new ideas lined up. 

I'm thinking we just about need some form of two-way communication via another port.  The old system was great in that you could jump in at any time and receive data.  Perhaps on the mame end the startup values (rom, orientation,ect) could be sent again whenever a valid connection is first established. 

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2942
  • 0x2b|~0x2b?
Re: MameInterop SDK v1.2 Released for Developers
« Reply #149 on: August 06, 2016, 03:48:40 pm »
Upon further investigation I've discovered that the original output system is still available in MAME.

Just set the following in mame.ini:

Code: [Select]
#
# OSD OUTPUT OPTIONS
#
output                    windows

I might still see if I can improve the network output system at some stage but for now this should get things working the way they were before.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16400
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.2 Released for Developers
« Reply #150 on: August 06, 2016, 04:10:35 pm »
That is a new feature I think.  I remember looking up the options when we first ran across this and windows wasn't one of them.  I could have just missed it though.

I think the network communication has potential anyway.  It allows the app to be on another pc... potentially a phone or tablet. 

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2942
  • 0x2b|~0x2b?
Re: MAMEInterop SDK v1.3 Released for Developers
« Reply #151 on: March 27, 2018, 04:51:10 pm »
MAMEInterop SDK v1.3 Released for Developers
- Finalized network output support / added support for inputs (pause)

Also for Howard I have included VB6 compatible dll's in dlls_vb6 folder (untested).

Thanks to R Belmont for his work on the network output system.

NOTE: I have created a patch to add the ability to send data to MAME. At the moment this only supports pausing / unpausing MAME. If you would like something added please let me know. I do not know when the changes will be publicly available but I will post here when it is. Either way these dll's are backwards compatible with current / older versions of MAME.

NOTE2: I have not had time to update all the examples. Use the C# example as a guide.
« Last Edit: March 27, 2018, 04:53:38 pm by headkaze »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16400
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MAMEInterop SDK v1.3 Released for Developers
« Reply #152 on: March 27, 2018, 10:30:36 pm »
Nice man.  I'll plug it into mamehooker this weekend and see how it goes. 

One of the things I was running into when trying to add force-feedback to some games was the fact that I couldn't (easily) set the limit switches, so that might be something worth looking into. 

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2942
  • 0x2b|~0x2b?
Re: MAMEInterop SDK v1.3 Released for Developers
« Reply #153 on: March 27, 2018, 10:46:19 pm »
Nice man.  I'll plug it into mamehooker this weekend and see how it goes. 

One of the things I was running into when trying to add force-feedback to some games was the fact that I couldn't (easily) set the limit switches, so that might be something worth looking into.

Cool let me know how you go.

I don't really know much about "limit switches" and force-feedback. I want to be careful not to encroach on plugin system territory. If there is a way in MAME that can set these values, and it doesn't make sense to use the plugin system to do it, let me know. I've only just sent the diff to Arbee to check out but if you want to get something added the sooner the better.

The input system is pretty basic right now. All you have is an "id" and "value". Right now the only id is IM_MAME_PAUSE but I can easily add more. All it does is:

Code: [Select]
// received a message
else if (message == im_mame_message)
{
switch(wparam)
{
case IM_MAME_PAUSE:
if (lparam == 1 && !output.machine().paused())
output.machine().pause();
else if (lparam == 0 && output.machine().paused())
output.machine().resume();
break;
}

return 0;
}
« Last Edit: March 27, 2018, 10:51:45 pm by headkaze »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16400
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MAMEInterop SDK v1.3 Released for Developers
« Reply #154 on: March 27, 2018, 10:54:07 pm »
Well I mean they are just regular old inputs in terms of how they behave, but on many games they aren't even hooked up due to the fact that they mess up the bootup sequence of some games.  I'm not really sure how to approach them since they aren't standardized like regular inputs are. 

Pause would definitely be the most useful.  Save states and other UI functions might be useful as well but I suppose it's one of those add it as the situation requires deals.... no need to add useless stuff. 

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2942
  • 0x2b|~0x2b?
Re: MAMEInterop SDK v1.3 Released for Developers
« Reply #155 on: March 28, 2018, 07:29:53 pm »
I updated the MAME patch slightly to output orientation for the network output system and also added save state load/save inputs.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16400
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MAMEInterop SDK v1.3 Released for Developers
« Reply #156 on: March 31, 2018, 03:46:21 pm »
Cool deal man.  Believe it or not I forgot that this weekend was Easter.  I will do some testing soon but It's probably going to have to wait until next week.  It's probably not necessary though as all of your stuff is generally top-notch. 

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2942
  • 0x2b|~0x2b?
Re: MAMEInterop SDK v1.3 Released for Developers
« Reply #157 on: May 08, 2018, 10:53:16 pm »
Looks like MAMEDev have applied the patch:cheers:

Jakobud

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1939
    • jakobud.com
Re: MAMEInterop SDK v1.3 Released for Developers
« Reply #158 on: May 09, 2018, 10:28:52 pm »
Super old thread but this is cool stuff. What could this be used for?
Jakobud 
Arcade Cabinet Plans and Dimensions http://jakobud.com

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2942
  • 0x2b|~0x2b?
Re: MAMEInterop SDK v1.3 Released for Developers
« Reply #159 on: May 11, 2018, 06:55:02 pm »
Super old thread but this is cool stuff. What could this be used for?

It's used in a number of applications such as MAMEHooker, CPWizard, LEDBlinky and others.

So any application that needs to know the game being launched. Also it can now pause and unpause MAME which is handy for applications like CPWizard which upon a keypress will pause MAME and display a menu with information about the current game.

  
 

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31