Yeah cfgs are a must... let's say you have a qbert knocker installed as input #1. You don't want it constantly on when you start a 1 player game in warlords or thumping 50 times a second when starting a round of t2. If nothing else, the ability to turn on/off various inputs is almost a requirement.
I agree, the detective work is the hardest part. Some of it is well documented though right in the driver itself. For others it's quite obvious once you get a look at the cabinet. Take digdug for example...... it has two lighted, volcano-style start buttons. It also has two light memory addresses defined in mame. Gee I wonder what those are for?
Now harder games would be games like afterburner and powerdift, who's outputs borderline on directx force feedback in their complexity. But starting with much simplier games and working up would be a solid plan.
This sounds like a good next task. I'll start looking into it. I was looking at gorf and it looks like gorf is in the astrocade driver and that the leds are associated with seawolf lights?
static WRITE8_HANDLER( seawolf2_lamps_w )
{
/* 0x42 = player 2 (left), 0x43 = player 1 (right) */
/* --x----- explosion */
/* ---x---- RELOAD (active low) */
/* ----x--- torpedo 1 available */
/* -----x-- torpedo 2 available */
/* ------x- torpedo 3 available */
/* -------x torpedo 4 available */
/* I'm only supporting the "RELOAD" lamp since we don't have enough leds ;-) */
set_led_status(offset^1,data & 0x10);
}
Nope, those are just the seawolf lights. Note it says seawolf2_lamps and not gorf.
The gorf memory address is defined in the driver, but used in the video driver (to control the bezel). They both have the same amount of lights though... not sure if they use the same memory address.
this is taken from the vidhw driver for astrocade:
READ8_HANDLER( gorf_io_2_r )
{
UINT8 data = offset >> 8;
offset &= 0xff;
offset = (offset << 3) + (data >> 1);
data = ~data & 0x01;
switch (offset)
{
case 0x00: artwork_show("lamp0", !data); break;
case 0x01: artwork_show("lamp1", !data); break;
case 0x02: artwork_show("lamp2", !data); break;
case 0x03: artwork_show("lamp3", !data); break;
case 0x04: artwork_show("lamp4", !data); break;
case 0x05: artwork_show("lamp5", !data); break;
#ifdef VERBOSE
default:
logerror("%04x: Latch IO2 %02x set to %d\n",activecpu_get_pc(),offset,data);
#endif
}
Notice the "io_2_r" part....
that tells us that the port is from an i/o port in the second bank of gorf inputs as defined by the standard driver.
Going back to the gorf section of the standard astrocade.c we find:
PORT_START_TAG("IN2")
PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY
PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY
PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY
PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY
PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) /* speech status */
We have two unaccounted ports.... luckily we know from the comments in the vidhw driver that gorf uses two ports for random generation. The first port is for drawing the starfield and various effects, the second is for the lamp dirver. And since we have a 20 offset, we know that 0x20 is the starfield and 0x40 is the lamp port.
The function to handle the lamps in the vidhw section is perfect for our purposes. It takes the 8 bits of data and spreads it into a simple 0 or 1 value for each of the 6 lamps. Simply add to the case statment a function call to whatever function we decide upon to control lamps and you are done.
Seawolf will be similar, but as you noticed, it's data is NOT in the vidhw section. This is because it doesn't have an artwork bezel to deal with and simply controls the keyboard led.
Again, it's a simple matter of taking the existing function and adding in a call to our function. A nice thing to do while you were at it would be to move the seawolf stuff to the vidhw file and go ahead and define some artwork layers to control. Then people without lights can use some sort of false bezel like you can with gorf.
Sorry to ramble, but you seemed confused. I thought a working example would help you learn how to navigate the i/o ports in mame.