ZiNc 0.8
Input Plugin Docs
-----------------

This is a brief technical document on how to write a ZiNc controller plugin.
The basic concepts are similar to controller plugins for PSEmuPro/ePSXe,
so you should be able to port those plugins to ZiNc fairly easily.

A ZiNc input plugin is a Win32 .DLL or Linux .so shared object which
exports the following entry points:

ZN_JammaOpen
============

long ZN_JammaOpen(HWND hwnd, vendor_id_t vendor_ID, game_id_t game_ID, char *cfg_file);

hwnd: the HWND to the window for the renderer (Win32)

vendor_ID: vendor ID for the current game (see game_defines.h).

game_ID: game ID for the current game (see game_defines.h)

char *cfg_file: name of the configuration file


For Linux, the first parameter is different, but has the same meaning:

long ZN_JammaOpen(void *display, vendor_id_t vendor_ID, game_id_t game_ID, char *cfg_file);

display: X11 Display pointer to the window for the renderer (Linux).


ZN_JammaClose
============

long ZN_JammaClose(void)

Closes the plugin.


ZN_JammaRead
============

ZN_JammaRead(jamma_t *data)

Reads the inputs (called once per frame).  The jamma_t structure
is defined in controller_defines.h as follows:

typedef struct
{
	unsigned long	controls;
	unsigned long	players[4];
	unsigned long	reserved[10];
} jamma_t;


controls is the coin and other special controls.  These are defined by
the JAMMA_CTRL_* #defines in controller_defines.h

players[4] is an array of inputs, 1 per player.  These inputs are 
defined as follows:

bit 15: START
bits 12-14: additional buttons for player
bit 11: UP
bit 10: DOWN
bit 9: LEFT
bit 8: RIGHT
bits 0-7: first 8 buttons for player
