Right now the q*bert knocker isn't finished as I still need a solenoid.
BUT I've been getting alot of questions about it so I'm going to do a summary. A better writeup with pics will be on my website ONCE I get my cab done (technically, my cab will never be done:))
OK.
Two things you need, hardware and software.
Hardware:I am hooking the knocker up to the parallel port.
Building it can be found here:
http://www.hut.fi/Misc/Electronics/circuits/parallel_output.htmlI hooked up the relay to the 1st data pin. That's why in software I only output "0x01", only need to output to that pin.
I'm using the safe new design half way down the page.
Someone with electronics expertise can you tell me if I need I to ground to the parallel port as in the schematic I see two grounds. I know that isn't the best thing. Since I am hooking up to my 5v line on my computer I should just be able to hook up to just that ground and only have one pin in use on the lpt port.
I assume I hook up the PC's 5v line to the Vcc and the ground to the ground in the schematic.
Softwaregottlieb_knocker is found in "src\sndhrdw\gottlieb.c"
Here's the original function
void gottlieb_knocker(void)
{
if (Machine->samples)
{
if (!strcmp(Machine->gamedrv->name,"reactor")) /* reactor */
{
}
else /* qbert */
sample_start(0,44,0);
}
}
Assuming VCMame (Visual C++ Mame) I will change too
#include <conio.h>
...
void gottlieb_knocker(void)
{
if (Machine->samples)
{
if (!strcmp(Machine->gamedrv->name,"reactor")) /* reactor */
{
}
else
{ /* qbert */
//sample_start(0,44,0);
_outp(0x378,0x01);
//use _outp(0x378,0xFF); to be safe and output to all 8 pins
}
}
}
A couple of things.
If you still want the sample to be played uncomment the sample line.
I'm not sure how _outp() works yet. I don;t know it if permanently turns the knocker on or if I have to do a _outp(0x378,0x00); in there too. Won't know until I have hardware:) With that said the above code is untested.
I will reply here if I get the solenoid and have it working with anything new I've learned.
In my cabinet I plan on mounting a strong bord, like oak, to the interior where the solenoid hits. I'm sure it isn;t a powerful solenoid, BUT MDF dents easily so after awhile it might hurt the cab to the poit the solenoid doesn't hit the cab. Of course, that's only if I do mad q*berting. Just a thought, I might for now just hit the inside of the cab, if it becomes a problem then deal with it:)
Note: Check out the rest of that guys site, lots of electronic schematics to do cool stuff, like one people here might be interested, a vga to tv converter.
http://www.hut.fi/Misc/Electronics/circuits/vga2tv/vga2palntsc.htmlI'm not going to try that, I'l like to though...