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: LED control from Mame--in over my head again?  (Read 28723 times)

0 Members and 2 Guests are viewing this topic.

1UP

  • Token Junkie
  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2081
  • Last login:November 11, 2014, 01:37:18 am
  • Yes, that is a joystick in my pocket.
    • 1UPArcade
Re: LED control from Mame--in over my head again?
« Reply #40 on: March 13, 2010, 04:49:46 pm »
Quote
Don't tell me you've bought a ledwiz just for your guns.

The guns may have been a contributing factor, but I mainly wanted to be able to light the controls for each game, and have attract modes on my cab.

Quote
So disregard the other potential issues as I could get the ledw to flash a led fast enough for opwolf, which is quite impressive actually, both for the led and the device.

Yep, already tested that with a looped animation in LEDBlinky, and it was more than fast enough (with the solenoids even) to replicate the rapid fire in T2.

Quote
I'll add the global pulse speed for the next release, but in the mean time, you can make a ledwiz script, not a regular script and set the loop number to a value high enough to where it lasts longer than the overheat time and you should be golden.

What do you mean by an LED-Wiz script?  You mean something written for Andy's software?  How about a LEDBLinky lwax animation file?  Those are easy to make. :)

Free resource for building your own rotating control panels!

My other job...


1UP

  • Token Junkie
  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2081
  • Last login:November 11, 2014, 01:37:18 am
  • Yes, that is a joystick in my pocket.
    • 1UPArcade
Re: LED control from Mame--in over my head again?
« Reply #41 on: March 13, 2010, 05:29:57 pm »
Damn, I tried making an othunder.lwa file in the LED-Wiz software, that just flickers on and off.  I put that in my othunder.ini file as led0=lwa othunder 01 %s% but it just crashes MH when I run the game.  What am I missing?  :(

Free resource for building your own rotating control panels!

My other job...


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: LED control from Mame--in over my head again?
« Reply #42 on: March 13, 2010, 08:02:26 pm »
I don't have a clue.... poorly written script??  He changed the format??  I just pass the script along to the device, I don't have a clue in regards to it's format or anything.  I do know that you have to manually add the %s% bits inside the script because his software doesn't support it.  You also need to make sure the file loops.

I wouldn't sweat it man.  Next version I'll have the loop implemented on mamehooker scripts and they are a lot easier to write and I can confirm they work. 

1UP

  • Token Junkie
  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2081
  • Last login:November 11, 2014, 01:37:18 am
  • Yes, that is a joystick in my pocket.
    • 1UPArcade
Re: LED control from Mame--in over my head again?
« Reply #43 on: March 13, 2010, 09:02:47 pm »
I agree that your scripts are a lot easier to deal with.  I can tell at a glance what is going on now.  I was totally lost with the lwa script syntax...  I did try calling all of his demo scripts from MH and all of them crashed it.  So it wasn't just my poor scripting skills. :)

Any ETA on the next version?  I can hardly wait to start playing with this stuff.  I'm looking forward to any new developments on the T2 front as well.  Figures that the game I really wanted is the toughest to crack.  I mean Revolution X?  Just the intro makes me cringe...

Thanks!

Free resource for building your own rotating control panels!

My other job...


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: LED control from Mame--in over my head again?
« Reply #44 on: March 13, 2010, 09:49:09 pm »
Well I'm currently buttoning up the display files and getting their webpage ready.  Then I need to setup an examples page. 

Right now I'm currently trying to implement proper 7-segment display support for the display files like mame does.  Having issues with the renderer though. 

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: LED control from Mame--in over my head again?
« Reply #45 on: March 14, 2010, 08:58:08 am »
Well I'm currently buttoning up the display files and getting their webpage ready.  Then I need to setup an examples page.  

Right now I'm currently trying to implement proper 7-segment display support for the display files like mame does.  Having issues with the renderer though.  

There are 7-segment fonts you can get for Windows in ttf format. Probably the easiest way to output numbers like that.
« Last Edit: March 14, 2010, 09:03:25 am by headkaze »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: LED control from Mame--in over my head again?
« Reply #46 on: March 14, 2010, 08:18:36 pm »
Not really.  The numbers mame outputs are the raw bits you would send to a digit controller via serial connection. 

So you Don't get a "0" or a "1" you get a "63" and a "6" respectively.  Now I've already looked at the mame source and figured out the parsing, and like most serial devices it's just a one byte value and increasing powers of 2 indicate the state of led bars 0-6 up until digit 128, in which all of the positions are repeated, but with the decimal point lit.

Now one might say "but isn't 0-9 all you need?" Wel for most games it is and that's why I still managed to release the display files I did, using traditional numbered images, but some games also use letters and even shapes.  I have a dragon's lair scorebaord ready to go, but seeing as how it uses so many shapes and also text in the game it really makes more sense to try to at least make an image generator rather than using a font and a 255 position translation file.

Also I don't like the way fonts look... they look, well, like fonts! I made a very nice digit in photoshop added a subtle glow, and it looks photo-realistic.  I even made it greyscale so that it can be colored, like mame's digits are.  The problem is masking off the individual digits.  Since they have those little points on the edges I can't just use a rectangle.  Now I could make each segment a seperate image and layer them, but the idea was someone could take a picture of a scoreboard displaying an "8" and then take another picture with it off and make a font out of it.  This could be used in the mame artwork files as well, seeing as you can hook the outputs up to a series of numbered images just as easily as you can the built in digit renderer. 


Long story short, yeah you are right there are easier ways to do it, but I want to try to do a really nice job of it.  I might end up puting this to the side for now though. 

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: LED control from Mame--in over my head again?
« Reply #47 on: March 15, 2010, 11:24:05 am »
I'm not sure what drawing API you're using but I would imagine you could use rectangles if you have alpha channel support.

1UP

  • Token Junkie
  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2081
  • Last login:November 11, 2014, 01:37:18 am
  • Yes, that is a joystick in my pocket.
    • 1UPArcade
Re: LED control from Mame--in over my head again?
« Reply #48 on: March 15, 2010, 11:55:19 am »
Howard, I'm watching your site every day for a new release.  You're going to kill me with this display stuff you know.  Where am I going to find room for a second monitor on my cab?  :D

Free resource for building your own rotating control panels!

My other job...


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: LED control from Mame--in over my head again?
« Reply #49 on: March 15, 2010, 05:13:04 pm »
I'm not sure what drawing API you're using but I would imagine you could use rectangles if you have alpha channel support.

Well I'm trying not to use an alpha channel at all, that way if it's an odd scoreboard, (I've seen some with gel coloring half-way across the numbers ect...) It'll still work well.  I'm still trying to determine the simplest way for the user to make a font, once I figure that out I'll proceed with getting it working.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: LED control from Mame--in over my head again?
« Reply #50 on: March 15, 2010, 05:20:25 pm »
Howard, I'm watching your site every day for a new release.  You're going to kill me with this display stuff you know.  Where am I going to find room for a second monitor on my cab?  :D

It used to be a pain in the butt to find a small enough secondary monitor for cabs like ours, much less getting them working.  But now:

http://www.thinkgeek.com/computing/usb-gadgets/c609/

Sure the price is a little steep, but considering you don't have to fool it video cards and stuff it's well worth it.  they are small enough to where you can mount them under the marquee area on a folding hinge so that you can flip it up when not in use.  Of course that's a 16:9 display.....  I really need to con some sap... err I mean convince some loyal user to convert all the display files to a 16:9 format as well.  ;)

Myself I'm using a hacked psone monitor in the same manner, but that thing was obsolete before I even got it working. 

1UP

  • Token Junkie
  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2081
  • Last login:November 11, 2014, 01:37:18 am
  • Yes, that is a joystick in my pocket.
    • 1UPArcade
Re: LED control from Mame--in over my head again?
« Reply #51 on: March 15, 2010, 06:11:29 pm »
Actually....I wonder if there are apps around that will allow you to use a smartphone screen as an output device.  I've got 2 old PC phones and one PDA lying in a drawer doing nothing.

Free resource for building your own rotating control panels!

My other job...


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: LED control from Mame--in over my head again?
« Reply #52 on: March 15, 2010, 07:01:34 pm »
well yes and no...
Static images sure.... all bluetooth enabled phones have a standard hid interface, so mamehooker supports them right this instant.  The only problem is this serial interface is usually limited to sending files to save on your phone (mp3s images, ect), and not real-time streaming.

I doubt the screen resolution would be high enough to make out anything anyway.

But if we aren't worried about readibility, those tiny 1-3" picture frame keycahins are very hackable and it is now possible to stream video to them. If they ever go down to a reasonable price, I intend to make a control panel with a keychain embedded into the panel beneath each button to act as a label, like those fancy 300+ dollar keyboards.

1UP

  • Token Junkie
  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2081
  • Last login:November 11, 2014, 01:37:18 am
  • Yes, that is a joystick in my pocket.
    • 1UPArcade
Re: LED control from Mame--in over my head again?
« Reply #53 on: March 16, 2010, 02:39:13 am »
How do those PS1 screens look?  At least good enough for an instruction card/pinball DMD?  Looks like you can get a couple for less than that USB screen.  I would probably need 3 with my setup.

Free resource for building your own rotating control panels!

My other job...


1UP

  • Token Junkie
  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2081
  • Last login:November 11, 2014, 01:37:18 am
  • Yes, that is a joystick in my pocket.
    • 1UPArcade
Re: LED control from Mame--in over my head again?
« Reply #54 on: March 16, 2010, 03:17:10 am »
I did find an app that turns a PDA into a USB monitor.  Have to juice up the old phone to try it out.

Free resource for building your own rotating control panels!

My other job...


1UP

  • Token Junkie
  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2081
  • Last login:November 11, 2014, 01:37:18 am
  • Yes, that is a joystick in my pocket.
    • 1UPArcade
Re: LED control from Mame--in over my head again?
« Reply #55 on: March 16, 2010, 03:54:09 am »
Aw crap it doesn't work in Win7.  Have to try installing from XP later....

Free resource for building your own rotating control panels!

My other job...


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: LED control from Mame--in over my head again?
« Reply #56 on: March 16, 2010, 12:18:53 pm »
How do those PS1 screens look?  At least good enough for an instruction card/pinball DMD?  Looks like you can get a couple for less than that USB screen.  I would probably need 3 with my setup.

If you hack it for vga yes, if not it's a no on the instruction card.  You can't get a couple for less than the usb screen though because you'll need to get video cards as well, and not only that but compatable video cards (the screens run at near arcade resolutions).  The only card I could get to work is an ancient matrox video card.  It doesn't have any acceleration either so unless used in the right situation it slows your machine to a crawl.  So you can forget about linking three together.  That's why I didn't reccomend them.  ;)

1UP

  • Token Junkie
  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2081
  • Last login:November 11, 2014, 01:37:18 am
  • Yes, that is a joystick in my pocket.
    • 1UPArcade
Re: LED control from Mame--in over my head again?
« Reply #57 on: March 16, 2010, 02:15:35 pm »
Well, I'll keep experimenting with the PDA screens then.  They are low res (320x240 I think) but at least they're sharp, and small enough to fit in the space around my bezel.  So I would only need one in that situation.  Only question is whether they can be made to just boot up and enter the display app when I turn on the cab.  If I can keep power connected I think this won't be a problem--it'll just stay in memory.

Free resource for building your own rotating control panels!

My other job...


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: LED control from Mame--in over my head again?
« Reply #58 on: March 16, 2010, 07:07:37 pm »
Had another thought on on dual screen front.....  Remember the old school webcam pages that were just a bit of javascript that kept updating the image every few secs?  Well I can easily put a bit of code into mamehooker to save the display screen to a image  (part of it is already there for when I make preview shots.)  Since mamehooker already has a "state change" event I could have it save the image to file on the local machine.  Then all you'd need is a http server setup on your pc.

The DS, PSP cell phones and most pda's all have web browsers, so for the display files and simple things like instruction cards at least, this may be the easiest solution.   As for pinmame... it's so demanding you'd pretty much need a real monitor for that.


-edit-

I actually gave this a try at least on my local machine, and it works pretty well.  I implemented a save image feature for mh and linked it to the state change event in some ini files.  I then setup a html file with a little bit of java that automatically refreshes the image once every half second.  I first tired seawolf with my webpage open and it was pretty much a 1:1 experience with zero drops in "frames"  I also tried turbo, which if you look at it's display file is about as complex as it gets and while it wasn't 1:1 it was still very viewable and didn't stutter or anything.  Of course I can adjust the refresh rate to just about anything, but the faster I make it, the more processing power it takes.  I tried seawolf on every 1/10th of a second and it still did fine though.
There are ways around the process hog as well, like just hosting the image on the webserver and storing the actual webpage itself on the remote device.
Also keep in mind that the lower the resolution, the better the frame rate.  If your pdf only displays 320x240 then you set mamehooker's display size to 320x240 and it'll speed up things dramatically.

But keep in mind I tired it on the same machine as mame, which obviously could load the image really fast.  I have some laptops and netbooks to try it on and I'll do that once I setup a webserver on this machine and/or move the html file to a shared folder.  I want to try it on my DS as it'd be an ideal viewer, but finding a working webbrowser on the ds is more difficult than the coding I just did!


I also think this method might have potential for pinmame as well, but only if the dmd display was set to original size and a REALLY fast form capture routine was used.  Even then the host machine would have to be pretty beefy.
« Last Edit: March 16, 2010, 09:17:28 pm by Howard_Casto »

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: LED control from Mame--in over my head again?
« Reply #59 on: March 16, 2010, 11:00:04 pm »
This reminds me of GameEx's Game Extender feature which displays game art to a server or localhost to a secondary screen. I have CPW display to a secondary monitor (video) but I think it would be cool to be able to view controls on a mobile too. Heh if I ever get time to update CPW.. too bad your not a C# programmer Howard I've been thinking of handing on some of my MAME projects to keep them alive. I write games now so don't really have the time.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: LED control from Mame--in over my head again?
« Reply #60 on: March 16, 2010, 11:40:44 pm »
Yeah... strictly speaking a UDP protocol would be the fastest, most efficient method.  I'll probably implement that anyway, but the webpage thing is more universal as apps that actually do something useful on the DS, PSP, or random portable device are pretty slim.  

I did some more testing on my mom's netbook which, while brand new is a slow pos with even slower download rates in wireless mode.  If I set the refresh rate to once every half second and the image resolution to 320x240, the frame rate is barely acceptable on games like seawolf.  Faster games like turbo do a tad bit worse and super fast games like skydiver kill the poor thing.  

Luckily this was just a test, there are tons of things I can optimize.  First off I'm saving the images to bitmaps cause they are the fastest to save, but they are also the largest files to transfer.  I could cut the download speeds in half just by saving as jpg.  Of course there is a fine line there as it takes longer to save a compressed file as well.

Also the javascript itself seems to be the weak link.  It's a simple script that simply reloads the image constantly.  It would be better to have an intelligent script that checks crc or something but I'm not that talented a java programmer. :(

I can muddle through c#.... I've studied it a little in my time away, but yeah, I don't know if I'm competant enough with it to take over.


What kind of games are you working on?
« Last Edit: March 16, 2010, 11:42:24 pm by Howard_Casto »

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: LED control from Mame--in over my head again?
« Reply #61 on: March 17, 2010, 01:42:49 am »
What kind of games are you working on?

My website is in my sig.. we did 3 free games for the DS and now we're making our first indy game for iPhone which is a platformer. This is our first original game aswell all of the other were remakes (albeit written from scratch). Two in arm asm too  :o

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: LED control from Mame--in over my head again?
« Reply #62 on: March 17, 2010, 01:54:08 am »
Eeek... assembly is scary.  Yeah I noticed the site after I posted, you need a bigger sig.  ;)

The ones released look pretty cool.  I'll have to give them a go once I get some time to dl. 

1UP

  • Token Junkie
  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2081
  • Last login:November 11, 2014, 01:37:18 am
  • Yes, that is a joystick in my pocket.
    • 1UPArcade
Re: LED control from Mame--in over my head again?
« Reply #63 on: March 17, 2010, 04:34:12 am »
Cool stuff Howard.  I was also looking into a free program called ZoneScreen, which is kind of a VNC program with the addition that you can extend the desktop onto another network device--including a pocket pc--not just mirror it.  So you would be able to for example, drag a window off your desktop onto the PDA.  The other one I'd been trying was SideWindow, which apparently needs a very old version of XP to run, and I don't feel like rolling back any of my machines to SP1 for a test...also it was not free.

More stuff to play with this week while I wait for your next release with all the new toys. :)

(Still hoping for a brainstorm on the T2 stuff though...)
« Last Edit: March 17, 2010, 04:39:25 am by 1UP »

Free resource for building your own rotating control panels!

My other job...


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: LED control from Mame--in over my head again?
« Reply #64 on: March 17, 2010, 05:28:37 am »
I've got good news, but I need help......

I implemented a new class file for my gdi  handling that works much better and I'm now saving the display file as a jpg file with medium compression.  That seems to have done the trick speed-wise.  I can run a 640x480 display file off the net remotely.  BUT, there is still one issue.  Every now and again the javascript tries to load the image as it's being written and of course it errors.  The webpage keeps running but you get that classic red x for a second.  The script needs to be modified so that it uses the last image if there is an error, which will prevent this flickering.  Here's my script:


-----------------------------------------------------------

<html>
<body>
 <IMG src="test.jpg"  border="0" name="refresh">
      <script language="JavaScript" type="text/javascript">
      <!--
      var t = .1 // interval in seconds
      image = "test.jpg" //name of the image
      function Start() {
      tmp = new Date();
      tmp = "?" tmp.getTime()
      document.images["refresh"].src = image tmp
      setTimeout("Start()", t*1000)
      }
      Start();
      // -->
      </SCRIPT>
</body>
</html>
-------------------------------------------------------------


Any takers on putting some error handling in there? 

Except for real simple stuff, like above I'm lost with javascript so I don't really know how to fix this issue. 

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: LED control from Mame--in over my head again?
« Reply #65 on: March 17, 2010, 06:11:05 am »
Not sure but perhaps you could try this webcam java class? http://www.worldofjon.com/java/java5.html

1UP

  • Token Junkie
  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2081
  • Last login:November 11, 2014, 01:37:18 am
  • Yes, that is a joystick in my pocket.
    • 1UPArcade
Re: LED control from Mame--in over my head again?
« Reply #66 on: March 19, 2010, 02:13:08 am »
I believe, at least in HTML, there is a way to set a default image that appears in place of any missing image on a web page.  I think this can be set at the head of the script along with the background color etc.  Maybe if you wrote the frame to both places, it would be unlikely that both would be unavailable at the same time.  If the main image is not available, the default one would still be there from the previous write, and if the default image is the one being written, it doesn't matter because the main image is loaded.  At least that's how I think it might work...

Another possibility would be to have the image inside a frameless table, and set the background image of the table to be the duplicate image.   But either of these would create some additional overhead.

I think you're on the right track with this.  I've been playing with the virtual monitor stuff, and it does work, the frame rate and color depth is adequate, but so far I've yet to find a way to get it to log in to the server on bootup, or even handle the server shutting down when you power down the PC without having to interact with the device.  But it would be simple to get Pocket IE to launch full screen on startup, and load up the default web page which could be set to this page that Mame Hooker is writing to.
« Last Edit: March 19, 2010, 02:31:50 am by 1UP »

Free resource for building your own rotating control panels!

My other job...


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: LED control from Mame--in over my head again?
« Reply #67 on: March 19, 2010, 02:45:24 am »
I tried the script you linked to hk... it's not much help.  I did modify my script to have a bit of error handling, but it only helps the problem so much.  It seems that ie sometimes (not often but maybe once every 20 secs) is able to open an image file as it's being written.  There are, of course other alternatives.

It would require somene else to do the webpage end, because I suck at javascript, but a more bandwith saving technique might simply be to re-create the display file in html with the individual images in tact and incorporate a bit of javascript to constantly read a file that tells the status of each output.  It's easy in javascript to rapidly display/hide an image... that's how mouse-over events work.  I'm guessing it could take a while to load more complex displays, but once they are loaded everything should be in real time.

Of course this is all for animated display files.  Static displays like a marquee, instruction card, command.dat, ect.... that'd be child's play.  You wouldn't even have to constantly refresh the image.  (Mind you, you could.)  Instead the best bet would be to have a generic webpage with REALLY simple navigation.  The javascript, instead of constantly re-loading the image, would re-load the html files body, which would update the links.  It doesn't take any time to reload text and since you aren't refreshing the actual images, they wouldn't get constantly reloaded unless their address changed. 

I intend on adding generic file operations support to mamehooker tonight.  What you'd do is designate a folder where your webpage will be stored. You'd then keep all the non-generic stuff in a seperate sub-folder  Upon mame startup, you'd delete everything in that folder, copy the artwork from all your folders (marquee, flyer, cards, ect) into the folder and re-edit the html to the new link names.  So long as the link's have different names, the page should re-load them. 


Anyway, I FINALLY got my digit creator working just the way I want it, so a release is immenant.  Should be out by this weekend.

1UP

  • Token Junkie
  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2081
  • Last login:November 11, 2014, 01:37:18 am
  • Yes, that is a joystick in my pocket.
    • 1UPArcade
Re: LED control from Mame--in over my head again?
« Reply #68 on: March 19, 2010, 02:50:27 am »
 :applaud:  :cheers:

Free resource for building your own rotating control panels!

My other job...


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: LED control from Mame--in over my head again?
« Reply #69 on: March 19, 2010, 05:27:21 am »
Well, I would like to test the new image output with my ds, but I need help. 

The ds's webbrowser can't see networked files, so I need a webserver.  I need a SIMPLE webserver, that'll run on windows 7.  Any suggestions?

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: LED control from Mame--in over my head again?
« Reply #70 on: March 19, 2010, 12:03:27 pm »
The DS should be able to download the image using DS Wifi (which is included in devkitArm). There is an app to display jpg images on my website in the DS section.

What you could do is upload two images Eg. Image1.jpg, Image2.jpg and swap between them If you used a perl cgi script you should be able to attempt to lock the file before displaying, and if that fails display the other. Flash would be even better as you wouldn't need to refresh the whole page.

For a web server IIS is the native web server for Windows although not sure if all versions of Winows 7 would include it (XP Pro had it but XP Home didn't for example). You can always try the most popular web server Apache. I believe you get perl/cgi support as standard.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: LED control from Mame--in over my head again?
« Reply #71 on: March 19, 2010, 04:52:07 pm »
Well, that would mean I have to write an app for the ds though, which I'm not willing to do.  Html, only solution is best because it'll work on any portable. 

I don't know if perl is supported on the various ds browsers out there.  I think you can lock the file in javascript, or at least determine if it's corrupted or not, but again, my web-design skills suck. 

IIS and apache aren't simple.....  I want simple.  As in run an app and boom that folder is a webpage, no settings, no installation, no frills.  I downloaded one similar to this last night but it had win 7 issues. 

Thanks for the help though.

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: LED control from Mame--in over my head again?
« Reply #72 on: March 20, 2010, 02:28:27 am »
A browser doesn't need to support perl, the server executes it and displays html.

Apache is pretty much install and go.. IIS is more complicated to setup (suprise suprise). Not sure about a web server with no installation but I'm sure there are apps that can serve a simple picture to port 80. Perhaps something like Resin
« Last Edit: March 20, 2010, 02:35:37 am by headkaze »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: LED control from Mame--in over my head again?
« Reply #73 on: March 20, 2010, 03:15:20 am »
I'm not going to worry about it.  I've added functions to mh to both output the current image and output the current states to a text file.  That should be enough for somebody else to design a webpage we can all use.  I have to add the new gdi classes to the digit generator and then this puppy is ready for release.  Then barring udp support for daphne this will probably be the final version.  Of course the display files need updated and such, but that's not related to the app itself. 

1UP

  • Token Junkie
  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2081
  • Last login:November 11, 2014, 01:37:18 am
  • Yes, that is a joystick in my pocket.
    • 1UPArcade
Re: LED control from Mame--in over my head again?
« Reply #74 on: March 20, 2010, 05:53:02 pm »
Howard, will it be possible to have it write two images each time, if I wanted to try the route I described above?

Free resource for building your own rotating control panels!

My other job...


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: LED control from Mame--in over my head again?
« Reply #75 on: March 20, 2010, 06:52:52 pm »
I don't see why not.... any scripting even tcan have an infinate number of commands... that's what the commas are for

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: LED control from Mame--in over my head again?
« Reply #76 on: March 21, 2010, 05:16:51 pm »
Well I've started on the mame source again....

I honestly don't know how I'm gonna figure this out.  Terminator 2 strobes the data I need so quickly, even with logging it to txt it just turns out to be a incoheriant mess.

1UP

  • Token Junkie
  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2081
  • Last login:November 11, 2014, 01:37:18 am
  • Yes, that is a joystick in my pocket.
    • 1UPArcade
Re: LED control from Mame--in over my head again?
« Reply #77 on: March 21, 2010, 05:22:40 pm »
I thought the hacked driver already had the memory addresses needed.  Are you just trying to add the other outputs now?

Ah, just saw that you posted the new release.  Gonna do some playing now. :)
« Last Edit: March 21, 2010, 05:27:31 pm by 1UP »

Free resource for building your own rotating control panels!

My other job...


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: LED control from Mame--in over my head again?
« Reply #78 on: March 21, 2010, 05:55:07 pm »
I thought the hacked driver already had the memory addresses needed.  Are you just trying to add the other outputs now?

Ah, just saw that you posted the new release.  Gonna do some playing now. :)

The hacked driver isn't quite accurate as I found out.... doesn't get the exact data needed... had to try it before I discoverd that.   Besides that the addresses have changed since the driver got re-worked.   On top of that knowing that address XXXX is the output data and parting those two bytes into 16 bits and then deciferign said bits are two different things.  I'm currently working on the ladder.

I have made progress though!  You are the t2 expert so I'll ask you to confirm....  T2 had strobe lamps inside the machine and when a terminator got close and fired at you they flashed right?  Because I have those hooked up!  It seems that their status, the sound file status, and the status of the guns are all strobed into the same 16 bits.  There is a rather complicated bit sequence fired for each one prior to setting the bits, to make this possible.  Basically the data gets changed once to say "here comes this type of data" and then it's send again with the actual data. 

The strobe lamps were the easiest as all you have to do is read the data when bit 11 (2 to the 11th or 2048) is off.  This bit is on for all other data reads, so I get to cheat a little on that one.  They fire in the proper order in the driver board test in the dip menu and when I played a game I let a terminator fire away at me on the right side and the right strobe values flashed like crazy, so I'm guessing I have those completely figured out. 

Now the guns will be more difficult.  There seems to be two chunks of data that come with them, and I'm not sure what to do with it.  I'm also having trouble sorting it out from the sound data as yes, even the sound is sent through this same 16 bits.  Once I can find the magic bit setting to say "this is gun data" then I shouldn't have any problems finishing the hookup. 

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19399
  • Last login:March 16, 2024, 05:59:16 pm
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: LED control from Mame--in over my head again?
« Reply #79 on: March 21, 2010, 06:40:37 pm »
Lol this must be frustrating for you.....

I think I just figured out the gun leds (not recoil, just leds) as well.  The problem is I don't know what they do.  They seem to flash in the correct order in the driver test menu, but in-game I occasionally get the green led to flash, and that's about it. 

Still not any close to figuring out the actual recoil though....

I think it's break time.....