trunk/src/emu/clifront.c
r241404 | r241405 | |
63 | 63 | { CLICOMMAND_GETSOFTLIST ";glist", "0", OPTION_COMMAND, "retrieve software list by name" }, |
64 | 64 | { CLICOMMAND_VERIFYSOFTLIST ";vlist", "0", OPTION_COMMAND, "verify software list by name" }, |
65 | 65 | { 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" }, |
66 | 67 | { NULL } |
67 | 68 | }; |
68 | 69 | |
r241404 | r241405 | |
784 | 785 | |
785 | 786 | |
786 | 787 | //------------------------------------------------- |
| 788 | // listnetworkadapters - output the list of network |
| 789 | // adapters available in the current system to be used |
| 790 | //------------------------------------------------- |
| 791 | |
| 792 | void 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 | //------------------------------------------------- |
787 | 801 | // verifyroms - verify the ROM sets of one or |
788 | 802 | // more games |
789 | 803 | //------------------------------------------------- |
r241404 | r241405 | |
1641 | 1655 | { CLICOMMAND_GETSOFTLIST, &cli_frontend::getsoftlist }, |
1642 | 1656 | { CLICOMMAND_VERIFYSOFTLIST, &cli_frontend::verifysoftlist }, |
1643 | 1657 | { CLICOMMAND_LIST_MIDI_DEVICES, &cli_frontend::listmididevices }, |
| 1658 | { CLICOMMAND_LIST_NETWORK_ADAPTERS, &cli_frontend::listnetworkadapters }, |
1644 | 1659 | }; |
1645 | 1660 | |
1646 | 1661 | // find the command |
trunk/src/emu/clifront.h
r241404 | r241405 | |
50 | 50 | #define CLICOMMAND_GETSOFTLIST "getsoftlist" |
51 | 51 | #define CLICOMMAND_VERIFYSOFTLIST "verifysoftlist" |
52 | 52 | #define CLICOMMAND_LIST_MIDI_DEVICES "listmidi" |
| 53 | #define CLICOMMAND_LIST_NETWORK_ADAPTERS "listnetwork" |
53 | 54 | |
54 | 55 | |
55 | 56 | //************************************************************************** |
r241404 | r241405 | |
102 | 103 | void getsoftlist(const char *gamename = "*"); |
103 | 104 | void verifysoftlist(const char *gamename = "*"); |
104 | 105 | void listmididevices(const char *gamename = "*"); |
| 106 | void listnetworkadapters(const char *gamename = "*"); |
105 | 107 | |
106 | 108 | private: |
107 | 109 | // internal helpers |
trunk/src/osd/osdnet.c
r241404 | r241405 | |
105 | 105 | { |
106 | 106 | return netdev_list.count(); |
107 | 107 | } |
| 108 | |
| 109 | void 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 | |