Advertisement
Guest User

libjvs work-in-progress API

a guest
Jan 12th, 2015
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.79 KB | None | 0 0
  1. struct JVS_IO {
  2.   BYTE node;
  3.   BOOL valid;
  4.   char ident[101];
  5.   BYTE cmdrev, jvsrev, commver;
  6.  
  7.   struct {
  8.     // read-only
  9.     BOOL has;
  10.     BYTE slots;
  11.     WORD *count;
  12.     // write-only
  13.     INT16 *subtract;
  14.   } coin;
  15.   struct {
  16.     // read-only
  17.     BOOL has;
  18.     BYTE slots;
  19.     DWORD *count;
  20.     // write-only
  21.     INT16 *subtract;
  22.   } medals;
  23.  
  24.   struct {
  25.     // read-only
  26.     BOOL has;
  27.     BYTE players, buttons;
  28.     BYTE *data;
  29.   } sw;
  30.   struct {
  31.     // read-only
  32.     BOOL has;
  33.     BYTE channels, bits;
  34.     WORD *data;
  35.   } analog_in;
  36.   struct {
  37.     // read-only
  38.     BOOL has;
  39.     BYTE channels;
  40.     WORD *data;
  41.   } rotary;
  42.   struct {
  43.     // read-only
  44.     BOOL has;
  45.     BYTE data;
  46.   } keycode;
  47.   struct {
  48.     // read-only
  49.     BOOL has;
  50.     BYTE channels, xbits,ybits;
  51.     WORD *x, *y;
  52.   } scrpos;
  53.   struct {
  54.     // read-only
  55.     BOOL has;
  56.     WORD count;
  57.     BYTE *data;
  58.   } miscsw;
  59.   struct {
  60.     // read-only
  61.     BOOL has;
  62.     BYTE slots;
  63.   } cardsys;
  64.   struct {
  65.     // read-only
  66.     BOOL has;
  67.     BYTE slots;
  68.     // write-only
  69.     // TODO
  70.   } general_out;
  71.   struct {
  72.     // read-only
  73.     BOOL has;
  74.     BYTE channels;
  75.     // write-only
  76.     WORD *data;
  77.   } analog_out;
  78.   struct {
  79.     // read-only
  80.     BOOL has;
  81.     BYTE width,height, type;
  82.     // write-only
  83.     // TODO
  84.   } char_out;
  85.   struct {
  86.     // read-only
  87.     BOOL has;
  88.   } backup;
  89. };
  90.  
  91. int jvs_setup(LPCTSTR portname);
  92. int jvs_shutdown();
  93.  
  94. ////////////
  95. // Helpful API
  96. ////////////
  97. // Get number of attached I/Os
  98. int jvs_io_count(void);
  99. // Get JVS_IO structure for one I/O node
  100. JVS_IO *jvs_io_get(BYTE node);
  101. // Update JVS_IO structure for one I/O node
  102. int jvs_io_update(BYTE node, JVS_IO *info);
  103. // Print out the structure information
  104. void jvs_io_dump(JVS_IO *info);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement