Removed USE_NETWORK selectivity.

This commit is contained in:
waltje
2017-10-01 16:56:15 -04:00
parent 2dbf5409c0
commit a01eb7ef34
6 changed files with 17 additions and 128 deletions

View File

@@ -8,7 +8,7 @@
#
# Modified Makefile for Win32 (MinGW32) environment.
#
# Version: @(#)Makefile.mingw 1.0.49 2017/09/29
# Version: @(#)Makefile.mingw 1.0.50 2017/10/01
#
# Authors: Miran Grca, <mgrca8@gmail.com>
# Fred N. van Kempen, <decwiz@yahoo.com>
@@ -80,9 +80,6 @@ endif
ifndef PAS16
PAS16 := n
endif
ifndef NETWORK
NETWORK := y
endif
ifndef X64
X64 := n
endif
@@ -194,19 +191,6 @@ MUNTOBJ := midi_mt32.o \
Tables.o TVA.o TVF.o TVP.o sha1.o c_interface.o
endif
ifeq ($(NETWORK), y)
CFLAGS += -DUSE_NETWORK
RFLAGS += -DUSE_NETWORK
NETOBJ := network.o \
net_pcap.o \
net_slirp.o \
bootp.o ip_icmp.o misc.o socket.o tcp_timer.o cksum.o \
ip_input.o queue.o tcp_input.o debug.o ip_output.o \
sbuf.o tcp_output.o udp.o if.o mbuf.o slirp.o tcp_subr.o \
net_ne2000.o
endif
# Options for the DEV branch.
ifeq ($(DEV_BRANCH), y)
CFLAGS += -DDEV_BRANCH
@@ -306,6 +290,14 @@ SCSIOBJ := scsi.o \
scsi_bios_command.o scsi_device.o scsi_disk.o \
scsi_buslogic.o scsi_aha154x.o
NETOBJ := network.o \
net_pcap.o \
net_slirp.o \
bootp.o ip_icmp.o misc.o socket.o tcp_timer.o cksum.o \
ip_input.o queue.o tcp_input.o debug.o ip_output.o \
sbuf.o tcp_output.o udp.o if.o mbuf.o slirp.o tcp_subr.o \
net_ne2000.o
SNDOBJ := sound.o \
openal.o \
dbopl.o nukedopl.o \
@@ -376,9 +368,7 @@ LIBS := -mwindows \
-lopenal.dll \
-lddraw -ldinput8 -ldxguid -ld3d9 -ld3dx9 \
-lcomctl32 -lwinmm
ifeq ($(NETWORK), y)
LIBS += -lkernel32 -lwsock32 -liphlpapi -lpsapi
endif
LIBS += -static -lstdc++ -lgcc
LIBS += -Wl,--large-address-aware

View File

@@ -8,7 +8,7 @@
*
* Configuration file handler.
*
* Version: @(#)config.c 1.0.8 2017/09/30
* Version: @(#)config.c 1.0.9 2017/10/01
*
* Authors: Sarah Walker,
* Miran Grca, <mgrca8@gmail.com>
@@ -44,9 +44,7 @@
#include "hdd/hdc_ide.h"
#include "machine/machine.h"
#include "mouse.h"
#ifdef USE_NETWORK
#include "network/network.h"
#endif
#include "scsi/scsi.h"
#include "win/plat_joystick.h"
#include "win/plat_midi.h"
@@ -701,7 +699,6 @@ load_sound(void)
}
#ifdef USE_NETWORK
/* Load "Network" section. */
static void
load_network(void)
@@ -757,7 +754,6 @@ load_network(void)
else
network_card = 0;
}
#endif
/* Load "Ports" section. */
@@ -1477,10 +1473,8 @@ config_load(wchar_t *fn)
/* Sound */
load_sound();
#ifdef USE_NETWORK
/* Network */
load_network();
#endif
/* Ports (COM & LPT) */
load_ports();
@@ -1891,7 +1885,6 @@ save_sound(void)
}
#ifdef USE_NETWORK
/* Save "Network" section. */
static void
save_network(void)
@@ -1935,7 +1928,6 @@ save_network(void)
delete_section_if_empty(cat);
}
#endif
/* Save "Ports" section. */
@@ -2273,10 +2265,8 @@ config_save(void)
/* Sound */
save_sound();
#ifdef USE_NETWORK
/* Network */
save_network();
#endif
/* Ports (COM & LPT) */
save_ports();

View File

@@ -8,12 +8,14 @@
*
* Emulation core dispatcher.
*
* Version: @(#)pc.c 1.0.14 2017/09/30
* Version: @(#)pc.c 1.0.15 2017/10/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016,2017 Miran Grca.
* Copyright 2017 Fred N. van Kempen.
*/
#include <stdio.h>
#include <stdint.h>
@@ -53,9 +55,7 @@
#include "machine/machine.h"
#include "sound/midi.h"
#include "mouse.h"
#ifdef USE_NETWORK
#include "network/network.h"
#endif
#include "nvr.h"
#include "pic.h"
#include "pit.h"
@@ -591,9 +591,7 @@ void resetpchard_init(void)
ide_reset();
scsi_card_init();
#ifdef USE_NETWORK
network_reset();
#endif
sound_card_init();
if (mpu401_standalone_enable)
@@ -776,7 +774,5 @@ void closepc(void)
lpt1_device_close();
device_close_all();
midi_close();
#ifdef USE_NETWORK
network_close();
#endif
}

View File

@@ -8,7 +8,7 @@
*
* Windows resource script.
*
* Version: @(#)86Box.rc 1.0.11 2017/09/30
* Version: @(#)86Box.rc 1.0.12 2017/10/01
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
@@ -135,11 +135,9 @@ BEGIN
# ifdef ENABLE_SERIAL_LOG
MENUITEM "Enable Serial Port logs\tCtrl+F3", IDM_LOG_SERIAL
# endif
#ifdef USE_NETWORK
# ifdef ENABLE_NIC_LOG
MENUITEM "Enable Network logs\tCtrl+F9", IDM_LOG_NIC
# endif
#endif
# ifdef ENABLE_LOG_COMMANDS
# ifdef ENABLE_LOG_TOGGLES
MENUITEM SEPARATOR
@@ -343,7 +341,6 @@ BEGIN
BS_AUTOCHECKBOX | WS_TABSTOP,7,99,94,10
END
#ifdef USE_NETWORK
DLG_CFG_NETWORK DIALOG DISCARDABLE 97, 0, 267, 63
STYLE DS_CONTROL | WS_CHILD
FONT 9, "Segoe UI"
@@ -361,7 +358,6 @@ BEGIN
WS_TABSTOP
PUSHBUTTON "Configure",IDC_CONFIGURE_NET,214,43,46,12
END
#endif
DLG_CFG_PORTS DIALOG DISCARDABLE 97, 0, 267, 61
STYLE DS_CONTROL | WS_CHILD
@@ -534,26 +530,17 @@ END
177 ICON DISCARDABLE "win/icons/removable_disk_active.ico"
192 ICON DISCARDABLE "win/icons/hard_disk.ico"
193 ICON DISCARDABLE "win/icons/hard_disk_active.ico"
#ifdef USE_NETWORK
208 ICON DISCARDABLE "win/icons/network.ico"
209 ICON DISCARDABLE "win/icons/network_active.ico"
#endif
256 ICON DISCARDABLE "win/icons/machine.ico"
257 ICON DISCARDABLE "win/icons/display.ico"
258 ICON DISCARDABLE "win/icons/input_devices.ico"
259 ICON DISCARDABLE "win/icons/sound.ico"
#ifdef USE_NETWORK
260 ICON DISCARDABLE "win/icons/network.ico"
261 ICON DISCARDABLE "win/icons/ports.ico"
262 ICON DISCARDABLE "win/icons/other_peripherals.ico"
263 ICON DISCARDABLE "win/icons/hard_disk.ico"
264 ICON DISCARDABLE "win/icons/removable_devices.ico"
#else
260 ICON DISCARDABLE "win/icons/ports.ico"
261 ICON DISCARDABLE "win/icons/other_peripherals.ico"
262 ICON DISCARDABLE "win/icons/hard_disk.ico"
263 ICON DISCARDABLE "win/icons/removable_devices.ico"
#endif
384 ICON DISCARDABLE "win/icons/floppy_525_empty.ico"
385 ICON DISCARDABLE "win/icons/floppy_525_empty_active.ico"
400 ICON DISCARDABLE "win/icons/floppy_35_empty.ico"
@@ -644,7 +631,6 @@ BEGIN
BOTTOMMARGIN, 109
END
#ifdef USE_NETWORK
DLG_CFG_NETWORK, DIALOG
BEGIN
LEFTMARGIN, 7
@@ -652,7 +638,6 @@ BEGIN
TOPMARGIN, 7
BOTTOMMARGIN, 56
END
#endif
DLG_CFG_PORTS, DIALOG
BEGIN
@@ -721,18 +706,11 @@ BEGIN
IDS_2066 "Display"
IDS_2067 "Input devices"
IDS_2068 "Sound"
#ifdef USE_NETWORK
IDS_2069 "Network"
IDS_2070 "Ports (COM & LPT)"
IDS_2071 "Other peripherals"
IDS_2072 "Hard disks"
IDS_2073 "Removable devices"
#else
IDS_2069 "Ports (COM & LPT)"
IDS_2070 "Other peripherals"
IDS_2071 "Hard disks"
IDS_2072 "Removable devices"
#endif
IDS_2074 "Use CTRL+ALT+PAGE DOWN to return to windowed mode"
IDS_2075 "CD-ROM images (*.ISO;*.CUE)\0*.ISO;*.CUE\0All files (*.*)\0*.*\0"
IDS_2076 "Host CD/DVD Drive (%c:)"
@@ -816,11 +794,9 @@ END
STRINGTABLE DISCARDABLE
BEGIN
#ifdef USE_NETWORK
IDS_2139 "PCap failed to set up because it may not be initialized"
IDS_2140 "No PCap devices found"
IDS_2141 "Invalid PCap device"
#endif
IDS_2142 "&Notify disk change"
IDS_2143 "Type"
IDS_2144 "Standard 2-button joystick(s)"

View File

@@ -8,7 +8,7 @@
*
* The Emulator's Windows core.
*
* Version: @(#)win.c 1.0.13 2017/09/30
* Version: @(#)win.c 1.0.14 2017/10/01
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
@@ -50,9 +50,7 @@
#include "../hdd/hdc_ide.h"
#include "../scsi/scsi.h"
#include "../scsi/scsi_disk.h"
#ifdef USE_NETWORK
# include "../network/network.h"
#endif
#include "../network/network.h"
#include "../video/video.h"
#include "../video/vid_ega.h"
#include "../sound/sound.h"
@@ -943,7 +941,6 @@ void create_hd_tip(int part)
wcscpy(sbTips[part], tempTip);
}
#ifdef USE_NETWORK
void create_network_tip(int part)
{
WCHAR tempTip[512];
@@ -957,7 +954,6 @@ void create_network_tip(int part)
sbTips[part] = (WCHAR *) malloc((wcslen(tempTip) << 1) + 2);
wcscpy(sbTips[part], tempTip);
}
#endif
void update_tip(int meaning)
{
@@ -1087,7 +1083,6 @@ void destroy_tips(void)
sbTips = NULL;
}
#ifdef USE_NETWORK
int display_network_icon(void)
{
if (network_card == 0)
@@ -1106,7 +1101,6 @@ int display_network_icon(void)
}
}
}
#endif
void update_status_bar_panes(HWND hwnds)
{
@@ -1119,9 +1113,7 @@ void update_status_bar_panes(HWND hwnds)
int c_ide_pio = 0;
int c_ide_dma = 0;
int c_scsi = 0;
#ifdef USE_NETWORK
int do_net = 0;
#endif
sb_ready = 0;
@@ -1132,9 +1124,7 @@ void update_status_bar_panes(HWND hwnds)
c_ide_pio = hdd_count(HDD_BUS_IDE_PIO_ONLY);
c_ide_dma = hdd_count(HDD_BUS_IDE_PIO_AND_DMA);
c_scsi = hdd_count(HDD_BUS_SCSI);
#ifdef USE_NETWORK
do_net = display_network_icon();
#endif
if (sb_parts > 0)
{
@@ -1237,12 +1227,10 @@ void update_status_bar_panes(HWND hwnds)
{
sb_parts++;
}
#ifdef USE_NETWORK
if (do_net)
{
sb_parts++;
}
#endif
sb_parts++;
iStatusWidths = (int *) malloc(sb_parts * sizeof(int));
@@ -1350,7 +1338,6 @@ void update_status_bar_panes(HWND hwnds)
sb_part_meanings[sb_parts] = SB_HDD | HDD_BUS_SCSI;
sb_parts++;
}
#ifdef USE_NETWORK
if (do_net)
{
edge += SB_ICON_WIDTH;
@@ -1358,7 +1345,6 @@ void update_status_bar_panes(HWND hwnds)
sb_part_meanings[sb_parts] = SB_NETWORK;
sb_parts++;
}
#endif
if (sb_parts)
{
iStatusWidths[sb_parts - 1] += (24 - SB_ICON_WIDTH);
@@ -1419,13 +1405,11 @@ void update_status_bar_panes(HWND hwnds)
sb_part_icons[i] = 192;
create_hd_tip(i);
break;
#ifdef USE_NETWORK
case SB_NETWORK:
/* Hard disk */
sb_part_icons[i] = 208;
create_network_tip(i);
break;
#endif
case SB_TEXT:
/* Status text */
SendMessage(hwnds, SB_SETTEXT, i | SBT_NOBORDERS, (LPARAM) L"");
@@ -1480,12 +1464,10 @@ HWND EmulatorStatusBar(HWND hwndParent, int idStatus, HINSTANCE hinst)
hIcon[i] = LoadIconEx((PCTSTR) i);
}
#ifdef USE_NETWORK
for (i = 208; i < 210; i++)
{
hIcon[i] = LoadIconEx((PCTSTR) i);
}
#endif
for (i = 384; i < 386; i++)
{
@@ -1564,12 +1546,10 @@ void reset_menus(void)
# ifdef ENABLE_SERIAL_LOG
CheckMenuItem(menu, IDM_LOG_SERIAL, MF_UNCHECKED);
# endif
#ifdef USE_NETWORK
# ifdef ENABLE_NIC_LOG
/*FIXME: should be network_setlog(1:0) */
CheckMenuItem(menu, IDM_LOG_NIC, MF_UNCHECKED);
# endif
#endif
#endif
CheckMenuItem(menu, IDM_VID_FORCE43, MF_UNCHECKED);
@@ -1618,12 +1598,10 @@ void reset_menus(void)
# ifdef ENABLE_SERIAL_LOG
CheckMenuItem(menu, IDM_LOG_SERIAL, serial_do_log ? MF_CHECKED : MF_UNCHECKED);
# endif
#ifdef USE_NETWORK
# ifdef ENABLE_NIC_LOG
/*FIXME: should be network_setlog(1:0) */
CheckMenuItem(menu, IDM_LOG_NIC, nic_do_log ? MF_CHECKED : MF_UNCHECKED);
# endif
#endif
#endif
CheckMenuItem(menu, IDM_VID_FORCE43, force_43 ? MF_CHECKED : MF_UNCHECKED);
@@ -1745,9 +1723,7 @@ int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpsz
init_cdrom_host_drives();
#ifdef USE_NETWORK
network_init();
#endif
hwndStatus = EmulatorStatusBar(hwnd, IDC_STATUS, hThisInstance);
@@ -2291,7 +2267,6 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
break;
#endif
#ifdef USE_NETWORK
#ifdef ENABLE_NIC_LOG
case IDM_LOG_NIC:
/*FIXME: should be network_setlog() */
@@ -2300,7 +2275,6 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
break;
#endif
#endif
#endif
#ifdef ENABLE_LOG_BREAKPOINT
case IDM_LOG_BREAKPOINT:
@@ -2372,9 +2346,7 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
/* pclog_w(L"NVR path: %s\n", nvr_path); */
mem_resize();
rom_load_bios(romset);
#ifdef USE_NETWORK
network_init();
#endif
reset_menus();
update_status_bar_panes(hwndStatus);
resetpchard_init();

View File

@@ -8,7 +8,7 @@
*
* Windows 86Box Settings dialog handler.
*
* Version: @(#)win_settings.c 1.0.14 2017/09/30
* Version: @(#)win_settings.c 1.0.15 2017/10/01
*
* Author: Miran Grca, <mgrca8@gmail.com>
* Copyright 2016,2017 Miran Grca.
@@ -42,9 +42,7 @@
#include "../hdd/hdc.h"
#include "../hdd/hdc_ide.h"
#include "../scsi/scsi.h"
#ifdef USE_NETWORK
#include "../network/network.h"
#endif
#include "../sound/sound.h"
#include "../sound/midi.h"
#include "../sound/snd_dbopl.h"
@@ -70,11 +68,9 @@ static int temp_mouse, temp_joystick;
static int temp_sound_card, temp_midi_device, temp_mpu401, temp_SSI2001, temp_GAMEBLASTER, temp_GUS, temp_opl3_type;
static int temp_float;
#ifdef USE_NETWORK
/* Network category */
static int temp_net_type, temp_net_card;
static char temp_pcap_dev[520];
#endif
/* Ports category */
static char temp_lpt1_device_name[16];
@@ -105,9 +101,7 @@ static int settings_sound_to_list[20], settings_list_to_sound[20];
static int settings_midi_to_list[20], settings_list_to_midi[20];
static int settings_mouse_to_list[20], settings_list_to_mouse[20];
static int settings_scsi_to_list[20], settings_list_to_scsi[20];
#ifdef USE_NETWORK
static int settings_network_to_list[20], settings_list_to_network[20];
#endif
/* This does the initial read of global variables into the temporary ones. */
@@ -146,13 +140,11 @@ static void win_settings_init(void)
temp_opl3_type = opl3_type;
temp_float = sound_is_float;
#ifdef USE_NETWORK
/* Network category */
temp_net_type = network_type;
memset(temp_pcap_dev, 0, sizeof(temp_pcap_dev));
strcpy(temp_pcap_dev, network_pcap);
temp_net_card = network_card;
#endif
/* Ports category */
strncpy(temp_lpt1_device_name, lpt1_device_name, sizeof(temp_lpt1_device_name) - 1);
@@ -219,12 +211,10 @@ static int win_settings_changed(void)
i = i || (opl3_type != temp_opl3_type);
i = i || (sound_is_float != temp_float);
#ifdef USE_NETWORK
/* Network category */
i = i || (network_type != temp_net_type);
i = i || strcmp(temp_pcap_dev, network_pcap);
i = i || (network_card != temp_net_card);
#endif
/* Ports category */
i = i || strncmp(temp_lpt1_device_name, lpt1_device_name, sizeof(temp_lpt1_device_name) - 1);
@@ -327,13 +317,11 @@ static void win_settings_save(void)
opl3_type = temp_opl3_type;
sound_is_float = temp_float;
#ifdef USE_NETWORK
/* Network category */
network_type = temp_net_type;
memset(network_pcap, '\0', sizeof(network_pcap));
strcpy(network_pcap, temp_pcap_dev);
network_card = temp_net_card;
#endif
/* Ports category */
strncpy(lpt1_device_name, temp_lpt1_device_name, sizeof(temp_lpt1_device_name) - 1);
@@ -1704,7 +1692,6 @@ static BOOL CALLBACK win_settings_peripherals_proc(HWND hdlg, UINT message, WPAR
}
#ifdef USE_NETWORK
int net_ignore_message = 0;
static void network_recalc_combos(HWND hdlg)
@@ -1904,7 +1891,6 @@ static BOOL CALLBACK win_settings_network_proc(HWND hdlg, UINT message, WPARAM w
return FALSE;
}
#endif
static BOOL win_settings_hard_disks_image_list_init(HWND hwndList)
{
@@ -4267,18 +4253,11 @@ cdrom_bus_skip:
#define SETTINGS_PAGE_VIDEO 1
#define SETTINGS_PAGE_INPUT 2
#define SETTINGS_PAGE_SOUND 3
#ifdef USE_NETWORK
#define SETTINGS_PAGE_NETWORK 4
#define SETTINGS_PAGE_PORTS 5
#define SETTINGS_PAGE_PERIPHERALS 6
#define SETTINGS_PAGE_HARD_DISKS 7
#define SETTINGS_PAGE_REMOVABLE_DEVICES 8
#else
#define SETTINGS_PAGE_PORTS 4
#define SETTINGS_PAGE_PERIPHERALS 5
#define SETTINGS_PAGE_HARD_DISKS 6
#define SETTINGS_PAGE_REMOVABLE_DEVICES 7
#endif
void win_settings_show_child(HWND hwndParent, DWORD child_id)
{
@@ -4309,11 +4288,9 @@ void win_settings_show_child(HWND hwndParent, DWORD child_id)
case SETTINGS_PAGE_SOUND:
hwndChildDialog = CreateDialog(hinstance, (LPCWSTR)DLG_CFG_SOUND, hwndParent, win_settings_sound_proc);
break;
#ifdef USE_NETWORK
case SETTINGS_PAGE_NETWORK:
hwndChildDialog = CreateDialog(hinstance, (LPCWSTR)DLG_CFG_NETWORK, hwndParent, win_settings_network_proc);
break;
#endif
case SETTINGS_PAGE_PORTS:
hwndChildDialog = CreateDialog(hinstance, (LPCWSTR)DLG_CFG_PORTS, hwndParent, win_settings_ports_proc);
break;
@@ -4345,11 +4322,7 @@ static BOOL win_settings_main_image_list_init(HWND hwndList)
GetSystemMetrics(SM_CYSMICON),
ILC_MASK | ILC_COLOR32, 1, 1);
#ifdef USE_NETWORK
for (i = 0; i < 9; i++)
#else
for (i = 0; i < 8; i++)
#endif
{
hiconItem = LoadIcon(hinstance, (LPCWSTR) (256 + i));
ImageList_AddIcon(hSmall, hiconItem);
@@ -4369,11 +4342,7 @@ static BOOL win_settings_main_insert_categories(HWND hwndList)
lvI.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_STATE;
lvI.stateMask = lvI.iSubItem = lvI.state = 0;
#ifdef USE_NETWORK
for (i = 0; i < 9; i++)
#else
for (i = 0; i < 8; i++)
#endif
{
lvI.pszText = win_language_get_settings_category(i);
lvI.iItem = i;
@@ -4419,11 +4388,7 @@ static BOOL CALLBACK win_settings_main_proc(HWND hdlg, UINT message, WPARAM wPar
if ((((LPNMHDR)lParam)->code == LVN_ITEMCHANGED) && (((LPNMHDR)lParam)->idFrom == IDC_SETTINGSCATLIST))
{
category = -1;
#ifdef USE_NETWORK
for (i = 0; i < 9; i++)
#else
for (i = 0; i < 8; i++)
#endif
{
h = GetDlgItem(hdlg, IDC_SETTINGSCATLIST);
j = ListView_GetItemState(h, i, LVIS_SELECTED);