Build Your Own Arcade Controls Forum

Main => Software Forum => Topic started by: WindDrake on February 28, 2016, 03:29:14 pm

Title: Mame/Mamehooker Issue - Missing Outputs (Gorf)
Post by: WindDrake on February 28, 2016, 03:29:14 pm
Hey all.

Short one here. I've got a PC up and running, using an Ultimarc Pacdrive to drive a Gorf cabinet's rank and Quark (Joystick) Laser lamps, as well as the coin counters.

Mamehooker is only showing Lamps 0-5 (Ranks), and seems to be missing the Quark Laser lamp and both coin counter outputs.

It's easy enough to simulate the counter outputs, but the Quark Laser works in a very specific way. Any idea how to get MAME to spit out that input?

Thanks. :)
Title: Re: Mame/Mamehooker Issue - Missing Outputs (Gorf)
Post by: WindDrake on February 28, 2016, 07:22:56 pm
I think I know what's up.

(http://i.imgur.com/n6BFtvs.png)

That is our output section for Gorf, from the schematics. Two 8-bit latches.

And here's the original Astrocde.c from MAME, the section on Gorf's specific IO.

Code: [Select]
/*************************************
 *
 *  Gorf specific input/output
 *
 *************************************/

READ8_MEMBER(astrocde_state::gorf_io_1_r)
{
UINT8 data = (offset >> 8) & 1;

switch ((offset >> 9) & 7)
{
case 0: machine().bookkeeping().coin_counter_w(0, data);     break;
case 1: machine().bookkeeping().coin_counter_w(1, data);     break;
case 2: m_sparkle[0] = data;    break;
case 3: m_sparkle[1] = data;    break;
case 4: m_sparkle[2] = data;    break;
case 5: m_sparkle[3] = data;    break;
case 6:
m_astrocade_sound1->set_output_gain(0, data ? 0.0 : 1.0);
#if USE_FAKE_VOTRAX
m_samples->set_output_gain(0, data ? 1.0 : 0.0);
#else
m_votrax->set_output_gain(0, data ? 1.0 : 0.0);
#endif
break;
case 7: osd_printf_debug("io_1:%d\n", data); break;
}
return 0xff;
}


READ8_MEMBER(astrocde_state::gorf_io_2_r)
{
UINT8 data = (offset >> 8) & 1;

switch ((offset >> 9) & 7)
{
case 0: output().set_lamp_value(0, data); break;
case 1: output().set_lamp_value(1, data); break;
case 2: output().set_lamp_value(2, data); break;
case 3: output().set_lamp_value(3, data); break;
case 4: output().set_lamp_value(4, data); break;
case 5: output().set_lamp_value(5, data); break;
case 6: /* n/c */                       break;
case 7: osd_printf_debug("io_2:%d\n", data); break;
}
return 0xff;
}

We can see that these latch outputs all match up with the outputs on our schematic. Except one.

Case 6 on gorf_io_2_r? Well, we know it's not case 7 since we're not getting OSD popups whenever we cycle the trigger (fire). I'm hoping that case 6 is indeed our Quark Laser output. I've changed that line to read..
Code: [Select]
case 6: output().set_lamp_value(6, data); break;

And I'm compiling a base MAME64 to see if it gives me an output in MameHooker.
Title: Re: Mame/Mamehooker Issue - Missing Outputs (Gorf)
Post by: WindDrake on February 28, 2016, 07:33:40 pm
No output. However, changing case 7 to..
Code: [Select]
case 7: output().set_lamp_value(7, data); break;

Does make an active output. It goes high when you're playing, and low when you are dead. This may be what I'm looking for.

Edit: Yep, this is it. Comparing it against another Gorf cabinet shows that is the proper behavior. My cabinet is a bad example as it has one bad IO Custom IC (the whole reason I'm doing this). Glad it was easy.
Title: Re: Mame/Mamehooker Issue - Missing Outputs (Gorf)
Post by: Howard_Casto on February 28, 2016, 08:45:20 pm
I've got a Gorf machine and my boards are fried, but I'm pretty sure the laser lamp is purely mechanical, or at least partially so.  That may be why it isn't implemented. 
Title: Re: Mame/Mamehooker Issue - Missing Outputs (Gorf)
Post by: WindDrake on February 29, 2016, 01:06:51 pm
Howard,

Changing that internal debug output into a real lamp output in Mame creates the proper output. As I mentioned, I verified this behavior on my actual Gorf.

The output on the board is an address latched output, the lamp drive itself coming from the Rank board just like the coin counter and rank lamp drives.

Another thing I had to do was to add a lamp output (since its a convenient digital output) to the two coin counters in code, so that I could pass the counter drive to the driver board.

Compiled Mame after adding the hiscore and GroovyMame diffs, and it's working fine. :) Hoping to have this project wrapped up soon.

For clarification - my Gorf boardset had a blown IO custom, and replacements are about impossible to find.

I built a small PC running Win7 x64, on an SSD, and using ATOM_15 and CrtEmudriver. Then I built a PacDrive and iPac2 based adapter set that plugs into the harness where you'd normally connect to the Game board in the stack.

Boots in ~9sec, about the time the tube takes to warm up. It's almost indistinguishable from a real boardset. :)