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
Lightguns Arcade1Up Try the site in https mode Site News

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

  

Author Topic: MAME Hooker, need help with script  (Read 2732 times)

0 Members and 1 Guest are viewing this topic.

NaokiS

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 14
  • Last login:April 18, 2013, 06:42:14 pm
MAME Hooker, need help with script
« on: December 11, 2011, 05:19:54 pm »
Hey guys.

I may be jumping in the deep end here, but I'd love to know how to do this, especially for future. Basically it started out with curiosity into how MAME handles LED Segment display. I got enough to figure out that it sends the data as 7 or 16-bit binary and works in a spiral fashion inwards (For 7 segment it starts at the top, goes clock wise and then 64 is the middle segment). that's fine, I get that, but now my curiosity has lead to wonder how to use this info and use MAME hooker to display this using a real 7/16-segment display.

Reading through the manual and tutorials, I assume I'm gonna need xoring and buffering, but that still leaves me with two problems:
  • XOR turns the output off, which isn't usefull at all since I need the LED on. I wondered if using the equivilent of IF commands to reverse this would work (i.e. BMO n=1 0 and vice versa).
  • I've assumed Ineed to make a seperate script to process segment displays, though while I can understand the process, I can't figure out how to script it. Since MAME outputs the combined binary data, MH receives it and would send it to the script to process it. XORing this value (i.e. 127) would lead me to say which bits are used and not, then I just need to reverse the results to power the lights.

I'm guessing I just need to be taught* how to use buffer and scripting effectivly to accomplish this goal, unless there's and easier way to do this.

Any help availible?

*=I don't want to be told the answer, I wanna understand WHY it's the answer.

Thanks,

NaokiS

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 14
  • Last login:April 18, 2013, 06:42:14 pm
Re: MAME Hooker, need help with script
« Reply #1 on: December 20, 2011, 07:44:09 pm »
Ok, I figured 7 segment displays was easy if I send the data to the parallel port in RAW (problem would still persist for USB interfaces like PacDrive and that).

No help availible?

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9273
  • Last login:August 31, 2025, 06:21:11 pm
  • ...
Re: MAME Hooker, need help with script
« Reply #2 on: December 21, 2011, 09:53:25 am »
Ok, I figured 7 segment displays was easy if I send the data to the parallel port in RAW (problem would still persist for USB interfaces like PacDrive and that).

No help availible?

Howard doesn't venture out of the Software forum very often.
I'm sure if you post in there, he will see it and respond.

Unfortunately there aren't a lot of people on here using MAMEhooker.
It's been on my to-do list for a long while, but there are some big projects in front of it.  :-\

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19433
  • Last login:Today at 11:17:34 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MAME Hooker, need help with script
« Reply #3 on: December 21, 2011, 12:14:07 pm »
You are lucky I happened to see "mamehooker" in the recent replies for this forum. 

Just for future record, whenever you have a software-related problem you should always post it to the software forum because the more knowledgable guys (myself included) check that section more often as it's easier to read due to infrequency of posts.

I would love to help you, but you aren't giving me nearly enough info. 

You have three things going on:

1.  The hardware interface.  (And no, connecting it to the parallel port is NOT enough info, one would need to know what data is sent to the display to set what segments).

2.  The game in question

3.  The outputs in question



See my first clue is that you are talking about segmented displays as if mame all handles them the same and as if the data is merged into one byte.  I know for a fact that this is not the case.  Because mame supports the on the fly rendering of segmented digits for the artwork system, each digit gets it's own output, one byte each.  For some examples of the values, download some of the display files for mamehooker that use segmented displays... the images are named after the outputted mame value. 

Mame's output of digits is supposed to match real hardware, it should work instantly on any arcade based segmented display.  You just set one digit at a time, not all at once  (which should be impossible on a parallel connection anyway... only one byte at a time afterall)  Please note that segmented displays typically have a controller chip.. this is what I am referring to. 



But in case you've figured all of this out and the specific Xor issue you are talking about is indeed your issue, this is how Xoring works....

You first set a seperate buffer to the maximum value (in this case 255 as it's a byte)
You then xor that buffer with your value, it will invert any dis-similar bits. 

If the value it gives you is the opposite of what you wanted, then don't xor, just use the given value. 

If that doesn't work, you can try setting your initial buffer to 0 instead of 255, or xoring your value again with 255. 


Now if you are saying you want to manually hook up a output line to each segment on a digit then it can be done, but it will probably have to be done manually. 

I'm a little tired atm... please post this over in the software forum if you need more help or have an admin move it for you.