Main > Main Forum
LED-Wiz USB LED and Output Control Device now available. *Blinky lights*
MikeQ:
RandyT,
I don't know if your still following this post or not but we really need a direct API!!!! :)
I'm running into problems make lights blink fast while mame is running. Mame apparently grabs a lot cycles and prevents the LED-WIZ clipboard poll-er from emptying the clipboard. I have a timer that fires every 250ms and sends an LWZ-SBA to the LED-WIZ. These appear to get backed up and I get stuck in my routine that waits for the clipboard to empty. While I'm stuck, the next timer fires and boom, corrupted stack.
The clipboard is a nice way to get stuff up and working quickly but doesn't seem to offer the flexibility of a direct API.
Other than that I'm very happy with the LED-WIZ.
RandyT:
--- Quote from: MikeQ on December 20, 2005, 10:44:32 pm ---RandyT,
I don't know if your still following this post or not but we really need a direct API!!!! :)
I'm running into problems make lights blink fast while mame is running. Mame apparently grabs a lot cycles and prevents the LED-WIZ clipboard poll-er from emptying the clipboard. I have a timer that fires every 250ms and sends an LWZ-SBA to the LED-WIZ. These appear to get backed up and I get stuck in my routine that waits for the clipboard to empty. While I'm stuck, the next timer fires and boom, corrupted stack.
The clipboard is a nice way to get stuff up and working quickly but doesn't seem to offer the flexibility of a direct API.
Other than that I'm very happy with the LED-WIZ.
--- End quote ---
The sequence should go like this:
Enable timer
timer fires
disable timer
send LED-Wiz command
Monitor clipboard until empty (with an additional timer if necessary, disabling when done)
repeat
You shouldn't have any problems if you use this logic, but MAME will probably take precedence. If you are already doing this, I don't understand how a timer is firing when it shouldn't be.
I will look into a simple API, most likely with just a couple commands that mirror the most direct ones from the software, and try to send you something within the next day or so. But in the meantime, try the above and see if that does any better.
RandyT
MikeQ:
Ya, stupid mistake. I was working on this without enough sleep. I fixed this late last night first my mutexing the timer callback so I couldn't get into the function if I was already in it. Then I resorted to killing the timer. Once this is working, I still have the problem that mame doesn't seem to allow the polling to happen very often. I'm not able to blink things very fast. Very fast being 5-10 times a second.
A simple interface in a couple days would be great.
RandyT:
--- Quote from: MikeQ on December 21, 2005, 08:20:12 am ---Ya, stupid mistake. I was working on this without enough sleep. I fixed this late last night first my mutexing the timer callback so I couldn't get into the function if I was already in it. Then I resorted to killing the timer. Once this is working, I still have the problem that mame doesn't seem to allow the polling to happen very often. I'm not able to blink things very fast. Very fast being 5-10 times a second.
A simple interface in a couple days would be great.
--- End quote ---
This is because the timer in the version of the software you have is polling only 10 times a second. I have increased this polling frequency in the version I am currently working on.
I'll keep you updated.
RandyT
MikeQ:
So I abondoned (for now), doing flashing stuff during a game. However, I have it coded up now to do flashy stuff while sitting at the mame32 menu and this works well since nothing else is really going on. If anyone is interested, I'll post video. I'm not sure how much people are interested in seeing this stuff.