Previous 199869 Revisions Next

r32893 Thursday 23rd October, 2014 at 07:26:29 UTC by Miodrag Milanović
Added -listnetwork option to list available network adapters
[src/emu]clifront.c clifront.h
[src/osd]osdcore.h osdnet.c

trunk/src/emu/clifront.c
r241404r241405
6363   { CLICOMMAND_GETSOFTLIST ";glist",  "0",       OPTION_COMMAND,    "retrieve software list by name" },
6464   { CLICOMMAND_VERIFYSOFTLIST ";vlist", "0",     OPTION_COMMAND,    "verify software list by name" },
6565   { CLICOMMAND_LIST_MIDI_DEVICES ";mlist", "0",  OPTION_COMMAND,    "list available MIDI I/O devices" },
66   { CLICOMMAND_LIST_NETWORK_ADAPTERS ";nlist", "0",  OPTION_COMMAND,    "list available network adapters" },
6667   { NULL }
6768};
6869
r241404r241405
784785
785786
786787//-------------------------------------------------
788//  listnetworkadapters - output the list of network
789//  adapters available in the current system to be used
790//-------------------------------------------------
791
792void cli_frontend::listnetworkadapters(const char *gamename)
793{
794   m_osd.network_init();
795   osd_list_network_adapters();
796   m_osd.network_exit();
797}
798
799
800//-------------------------------------------------
787801//  verifyroms - verify the ROM sets of one or
788802//  more games
789803//-------------------------------------------------
r241404r241405
16411655      { CLICOMMAND_GETSOFTLIST,   &cli_frontend::getsoftlist },
16421656      { CLICOMMAND_VERIFYSOFTLIST,    &cli_frontend::verifysoftlist },
16431657      { CLICOMMAND_LIST_MIDI_DEVICES, &cli_frontend::listmididevices },
1658      { CLICOMMAND_LIST_NETWORK_ADAPTERS, &cli_frontend::listnetworkadapters },
16441659   };
16451660
16461661   // find the command
trunk/src/emu/clifront.h
r241404r241405
5050#define CLICOMMAND_GETSOFTLIST          "getsoftlist"
5151#define CLICOMMAND_VERIFYSOFTLIST       "verifysoftlist"
5252#define CLICOMMAND_LIST_MIDI_DEVICES    "listmidi"
53#define CLICOMMAND_LIST_NETWORK_ADAPTERS "listnetwork"
5354
5455
5556//**************************************************************************
r241404r241405
102103   void getsoftlist(const char *gamename = "*");
103104   void verifysoftlist(const char *gamename = "*");
104105   void listmididevices(const char *gamename = "*");
106   void listnetworkadapters(const char *gamename = "*");
105107
106108private:
107109   // internal helpers
trunk/src/osd/osdcore.h
r241404r241405
884884int osd_read_midi_channel(osd_midi_device *dev, UINT8 *pOut);
885885void osd_write_midi_channel(osd_midi_device *dev, UINT8 data);
886886
887
888void osd_list_network_adapters(void);
889
887890/***************************************************************************
888891    UNCATEGORIZED INTERFACES
889892***************************************************************************/
trunk/src/osd/osdnet.c
r241404r241405
105105{
106106   return netdev_list.count();
107107}
108
109void osd_list_network_adapters(void)
110{
111   #ifdef USE_NETWORK
112   int num_devs = netdev_list.count();
113
114   if (num_devs == 0)
115   {
116      printf("No network adapters were found\n");
117      return;
118   }
119
120   printf("Available network adapters:\n");
121   const netdev_entry_t *entry = netdev_first();
122   while(entry) {   
123      printf("   %s\n", entry->description);
124      entry = entry->m_next;
125   }
126   
127   #else
128   printf("Network is not supported in this build\n");
129   #endif
130}
131


Previous 199869 Revisions Next


© 1997-2024 The MAME Team