Added NE2000 network support.

NE2000 emulation originally from Bochs, ported by SA1988.
SLiRP originally from QEMU, ported by neozeed.
This commit is contained in:
SarahW 2017-07-31 10:10:36 +01:00
commit 6697e31929
57 changed files with 15460 additions and 9 deletions

View file

@ -49,6 +49,13 @@
#include "x86.h"
#include "paths.h"
#ifdef USE_NETWORKING
#include "nethandler.h"
#define NE2000 1
uint8_t ethif;
int inum;
#endif
int window_w, window_h, window_x, window_y, window_remember;
int start_in_fullscreen = 0;
@ -276,6 +283,10 @@ void initpc(int argc, char *argv[])
disc_init();
fdi_init();
img_init();
#ifdef USE_NETWORKING
vlan_reset(); //NETWORK
network_card_init(network_card_current);
#endif
//loadfont();
loadnvr();
@ -371,6 +382,12 @@ void resetpchard()
mouse_emu_init();
video_init();
speaker_init();
#ifdef USE_NETWORKING
vlan_reset(); //NETWORK
network_card_init(network_card_current);
#endif
sound_card_init(sound_card_current);
if (GUS)
device_add(&gus_device);
@ -757,6 +774,18 @@ void loadconfig(char *fn)
enable_sync = config_get_int(CFG_MACHINE, NULL, "enable_sync", 1);
#ifdef USE_NETWORKING
//network
ethif = config_get_int(CFG_GLOBAL, NULL, "netinterface", 1);
if (ethif >= inum)
inum = ethif + 1;
p = (char *)config_get_string(CFG_MACHINE, NULL, "netcard", "");
if (p)
network_card_current = network_card_get_from_internal_name(p);
else
network_card_current = 0;
#endif
for (d = 0; d < num_config_callbacks; ++d)
if (config_callbacks[d].loadconfig)
@ -874,6 +903,11 @@ void saveconfig(char *fn)
config_set_int(CFG_MACHINE, NULL, "enable_sync", enable_sync);
#ifdef USE_NETWORKING
config_set_int(CFG_GLOBAL, NULL, "netinterface", ethif);
config_set_string(CFG_MACHINE, NULL, "netcard", network_card_get_internal_name(network_card_current));
#endif
for (d = 0; d < num_config_callbacks; ++d)
if (config_callbacks[d].saveconfig)
config_callbacks[d].saveconfig();