diff --git a/src/include/86box/86box.h b/src/include/86box/86box.h index 30a7542dc..28c370e78 100644 --- a/src/include/86box/86box.h +++ b/src/include/86box/86box.h @@ -122,9 +122,6 @@ extern int cpu, /* (C) cpu type */ cpu_use_dynarec, /* (C) cpu uses/needs Dyna */ fpu_type; /* (C) fpu type */ extern int time_sync; /* (C) enable time sync */ -extern int network_type; /* (C) net provider type */ -extern int network_card; /* (C) net interface num */ -extern char network_host[522]; /* (C) host network intf */ extern int hdd_format_type; /* (C) hard disk file format */ extern int confirm_reset, /* (C) enable reset confirmation */ confirm_exit, /* (C) enable exit confirmation */ diff --git a/src/include/86box/network.h b/src/include/86box/network.h index f38db801a..967c581b1 100644 --- a/src/include/86box/network.h +++ b/src/include/86box/network.h @@ -58,6 +58,7 @@ #define NET_MAX_FRAME 1518 #define NET_QUEUE_LEN 8 #define NET_CARD_MAX 4 +#define NET_HOST_INTF_MAX 64 /* Supported network cards. */ enum { @@ -141,7 +142,7 @@ extern "C" { /* Global variables. */ extern int nic_do_log; /* config */ extern int network_ndev; -extern netdev_t network_devs[32]; +extern netdev_t network_devs[NET_HOST_INTF_MAX]; /* Function prototypes. */ diff --git a/src/machine/machine_table.c b/src/machine/machine_table.c index c1704bf25..0bb80c916 100644 --- a/src/machine/machine_table.c +++ b/src/machine/machine_table.c @@ -11082,6 +11082,44 @@ const machine_t machines[] = { .snd_device = NULL, .net_device = NULL }, + /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC + firmware. */ + { + .name = "[VIA Apollo Pro 133A] BCM GT694VA", + .internal_name = "gt694va", + .type = MACHINE_TYPE_SLOT1, + .chipset = MACHINE_CHIPSET_VIA_APOLLO_PRO_133A, + .init = machine_at_gt694va_init, + .pad = 0, + .pad0 = 0, + .pad1 = MACHINE_AVAILABLE, + .pad2 = 0, + .cpu = { + .package = CPU_PKG_SLOT1, + .block = CPU_BLOCK_NONE, + .min_bus = 66666667, + .max_bus = 133333333, + .min_voltage = 1300, + .max_voltage = 3500, + .min_multi = 1.5, + .max_multi = 8.0 + }, + .bus_flags = MACHINE_PS2_AGP, + .flags = MACHINE_IDE_DUAL | MACHINE_SOUND, + .ram = { + .min = 8192, + .max = 3145728, + .step = 8192 + }, + .nvrmask = 255, + .kbc = KBC_UNKNOWN, + .kbc_p1 = 0, + .gpio = 0, + .device = &es1371_onboard_device, + .vid_device = NULL, + .snd_device = NULL, + .net_device = NULL + }, /* Slot 1/2 machines */ /* 440GX */ @@ -11634,44 +11672,6 @@ const machine_t machines[] = { .snd_device = NULL, .net_device = NULL }, - /* Has a Winbond W83977EF Super I/O chip with on-chip KBC with AMIKey-2 KBC - firmware. */ - { - .name = "[VIA Apollo Pro 133A] BCM GT694VA", - .internal_name = "gt694va", - .type = MACHINE_TYPE_SOCKET370, - .chipset = MACHINE_CHIPSET_VIA_APOLLO_PRO_133A, - .init = machine_at_gt694va_init, - .pad = 0, - .pad0 = 0, - .pad1 = MACHINE_AVAILABLE, - .pad2 = 0, - .cpu = { - .package = CPU_PKG_SOCKET370, - .block = CPU_BLOCK_NONE, - .min_bus = 66666667, - .max_bus = 133333333, - .min_voltage = 1300, - .max_voltage = 3500, - .min_multi = 1.5, - .max_multi = 8.0 - }, - .bus_flags = MACHINE_PS2_AGP, - .flags = MACHINE_IDE_DUAL | MACHINE_SOUND, - .ram = { - .min = 16384, - .max = 3145728, - .step = 8192 - }, - .nvrmask = 255, - .kbc = KBC_UNKNOWN, - .kbc_p1 = 0, - .gpio = 0, - .device = &es1371_onboard_device, - .vid_device = NULL, - .snd_device = NULL, - .net_device = NULL - }, /* Miscellaneous/Fake/Hypervisor machines */ /* Has a Winbond W83977F Super I/O chip with on-chip KBC with AMIKey-2 KBC diff --git a/src/network/net_pcap.c b/src/network/net_pcap.c index d695d4992..0baa16186 100644 --- a/src/network/net_pcap.c +++ b/src/network/net_pcap.c @@ -354,6 +354,9 @@ net_pcap_prepare(netdev_t *list) } for (dev=devlist; dev!=NULL; dev=dev->next) { + if (i >= (NET_HOST_INTF_MAX - 1)) + break; + /** * we initialize the strings to NULL first for strncpy */ diff --git a/src/network/network.c b/src/network/network.c index 714037b4c..58ff2516d 100644 --- a/src/network/network.c +++ b/src/network/network.c @@ -121,11 +121,8 @@ netcard_conf_t net_cards_conf[NET_CARD_MAX]; int net_card_current = 0; /* Global variables. */ -int network_type; int network_ndev; -int network_card; -char network_host[522]; -netdev_t network_devs[32]; +netdev_t network_devs[NET_HOST_INTF_MAX]; /* Local variables. */ diff --git a/src/win/win_settings.c b/src/win/win_settings.c index 91dce4547..365532ead 100644 --- a/src/win/win_settings.c +++ b/src/win/win_settings.c @@ -99,7 +99,7 @@ static int temp_float, temp_fm_driver; /* Network category */ static int temp_net_type, temp_net_card; -static char temp_pcap_dev[522]; +static char temp_pcap_dev[128]; /* Ports category */ static int temp_lpt_devices[PARALLEL_MAX]; @@ -340,13 +340,13 @@ win_settings_init(void) temp_fm_driver = fm_driver; /* Network category */ - temp_net_type = network_type; + temp_net_type = net_cards_conf[0].net_type; memset(temp_pcap_dev, 0, sizeof(temp_pcap_dev)); #ifdef ENABLE_SETTINGS_LOG - assert(sizeof(temp_pcap_dev) == sizeof(network_host)); + assert(sizeof(temp_pcap_dev) == sizeof(net_cards_conf[0].host_dev_name)); #endif - memcpy(temp_pcap_dev, network_host, sizeof(network_host)); - temp_net_card = network_card; + memcpy(temp_pcap_dev, net_cards_conf[0].host_dev_name, sizeof(net_cards_conf[0].host_dev_name)); + temp_net_card = net_cards_conf[0].device_num; /* Ports category */ for (i = 0; i < PARALLEL_MAX; i++) { @@ -466,9 +466,9 @@ win_settings_changed(void) i = i || (fm_driver != temp_fm_driver); /* Network category */ - i = i || (network_type != temp_net_type); - i = i || strcmp(temp_pcap_dev, network_host); - i = i || (network_card != temp_net_card); + i = i || (net_cards_conf[i].net_type != temp_net_type); + i = i || strcmp(temp_pcap_dev, net_cards_conf[0].host_dev_name); + i = i || (net_cards_conf[0].device_num != temp_net_card); /* Ports category */ for (j = 0; j < PARALLEL_MAX; j++) { @@ -558,10 +558,10 @@ win_settings_save(void) fm_driver = temp_fm_driver; /* Network category */ - network_type = temp_net_type; - memset(network_host, '\0', sizeof(network_host)); - strcpy(network_host, temp_pcap_dev); - network_card = temp_net_card; + net_cards_conf[i].net_type = temp_net_type; + memset(net_cards_conf[0].host_dev_name, '\0', sizeof(net_cards_conf[0].host_dev_name)); + strcpy(net_cards_conf[0].host_dev_name, temp_pcap_dev); + net_cards_conf[0].device_num = temp_net_card; /* Ports category */ for (i = 0; i < PARALLEL_MAX; i++) { @@ -1814,8 +1814,8 @@ win_settings_network_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam) lptsTemp = (LPTSTR) malloc(512 * sizeof(WCHAR)); settings_add_string(hdlg, IDC_COMBO_NET_TYPE, (LPARAM) L"None"); - settings_add_string(hdlg, IDC_COMBO_NET_TYPE, (LPARAM) L"PCap"); settings_add_string(hdlg, IDC_COMBO_NET_TYPE, (LPARAM) L"SLiRP"); + settings_add_string(hdlg, IDC_COMBO_NET_TYPE, (LPARAM) L"PCap"); settings_set_cur_sel(hdlg, IDC_COMBO_NET_TYPE, temp_net_type); settings_enable_window(hdlg, IDC_COMBO_PCAP, temp_net_type == NET_TYPE_PCAP);