Difference between revisions of "Guides:MAME - Networking"

From Wah!ki
Jump to navigation Jump to search
Line 1: Line 1:
 
just notes here
 
just notes here
  
 +
== (Ether)net Networking in MAME ==
 +
Support was added back in ~2012 but the documentation is fragmented.
  
compile with USE_NETWORK=1 (became default in 0.154?)
+
Very basically you will
 
+
* give the MAME machine a static ip internally,
OSD_NET_USE_TAPTUN=1 might be required as well to pull in the source, dunno man I don't do c stuff
+
on the host
 +
* tweak some ipv4 network behavior
 +
* create a basic tap device
 +
* route traffic out the hosts eth int
  
<nowiki>
+
== List MAME Networks ==
#if defined(OSD_NET_USE_TAPTUN)
+
mame -listnetwork will display available devices as per below
</nowiki>
 
 
 
mame -listnetworks (should show the available devices, not just TAP/TUN ?)
 
 
  <nowiki>
 
  <nowiki>
 
$ ./mame -listnetwork
 
$ ./mame -listnetwork
Line 18: Line 20:
  
  
tap/tun device
+
=== tap device setup ==
 +
==== Manual setup ====
  
  
 +
==== MAME Script ====
 +
MAME has a script in the git repo /src/osd/sdl/tunsetup.sh
  
dos ne2000
+
NOTE: be mind of this script, it will not honor existing tap perms nor kernel settings and will just blindly run its own
* ne2000.com 0x60
 
  
 +
==== MAME Setup ====
 +
In the in-game UI
 +
* open the Network Devices menu and select "TAP/TUN Device"
 +
* Confirm the IRQ under machine configuration is correct
  
Drivers/Software
+
 
 +
===== IRQs =====
 +
Just a note on my config,
 +
ISA1 svga_s1, ISA2, sblaster_16 (IRQ5) isa4 ne2000. The IRQ used by the ne2000 adapter would only work on IRQ2/9
 +
 
 +
 
 +
==== DOS Setup ====
 +
Load the ne2000 drivers from in autoexec.bat, try auto discovery first
 +
<nowiki>
 +
c:\PATH\TO\NE2000.COM 0x60
 +
</nowiki>
 +
 
 +
A decent test suite of tools while getting setup is the mTCP project, refer to their doco to setup the config etc. but remove LEASE_TIME from the ip settings to set a static ip for use with the applications otherwise the applications will throw a lease expired warning and exit
 +
 
 +
== Drivers/Software ==
 
* https://dos.retro.software/downloads/category/300-ne2000-compatible-nic-drivers
 
* https://dos.retro.software/downloads/category/300-ne2000-compatible-nic-drivers
 
* https://www.brutman.com/mTCP/mTCP.html
 
* https://www.brutman.com/mTCP/mTCP.html
  
 +
 +
== References ==
 +
* https://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=115314
 +
* https://www.naturalborncoder.com/virtualization/2014/10/17/understanding-tun-tap-interfaces/
 +
* https://virt.kernelnewbies.org/MacVTap
 +
* https://github.com/mamedev/mame/tree/2ca5f3a386a1ca63433d6d13bb66f5e46fb2a854/src/osd/modules/netdev
 +
* https://dfarq.homeip.net/using-an-ne2000-network-card-in-dos/
 +
* http://mess.redump.net/howto/apollo
 +
* https://www.brutman.com/mTCP/
 +
 +
 +
== NOT NEEDED ==
 +
kept for reference for the time being
 +
 +
 +
compile with USE_NETWORK=1 (became default in 0.154?)
 +
 +
OSD_NET_USE_TAPTUN=1 might be required as well to pull in the source, dunno man I don't do c stuff
 +
 +
<nowiki>
 +
#if defined(OSD_NET_USE_TAPTUN)
 +
</nowiki>
  
  
Line 46: Line 90:
 
sudo ip tuntap del dev mametap0 mode tap
 
sudo ip tuntap del dev mametap0 mode tap
 
</nowiki>
 
</nowiki>
 
 
References
 
* https://forums.bannister.org/ubbthreads.php?ubb=showflat&Number=115314
 
* https://www.naturalborncoder.com/virtualization/2014/10/17/understanding-tun-tap-interfaces/
 
* https://virt.kernelnewbies.org/MacVTap
 
* https://github.com/mamedev/mame/tree/2ca5f3a386a1ca63433d6d13bb66f5e46fb2a854/src/osd/modules/netdev
 
* https://dfarq.homeip.net/using-an-ne2000-network-card-in-dos/
 
* http://mess.redump.net/howto/apollo
 
* https://www.brutman.com/mTCP/
 

Revision as of 13:31, 20 March 2021

just notes here

(Ether)net Networking in MAME

Support was added back in ~2012 but the documentation is fragmented.

Very basically you will

  • give the MAME machine a static ip internally,

on the host

  • tweak some ipv4 network behavior
  • create a basic tap device
  • route traffic out the hosts eth int

List MAME Networks

mame -listnetwork will display available devices as per below

$ ./mame -listnetwork
Available network adapters:
    TAP/TUN Device


= tap device setup

Manual setup

MAME Script

MAME has a script in the git repo /src/osd/sdl/tunsetup.sh

NOTE: be mind of this script, it will not honor existing tap perms nor kernel settings and will just blindly run its own

MAME Setup

In the in-game UI

  • open the Network Devices menu and select "TAP/TUN Device"
  • Confirm the IRQ under machine configuration is correct


IRQs

Just a note on my config, ISA1 svga_s1, ISA2, sblaster_16 (IRQ5) isa4 ne2000. The IRQ used by the ne2000 adapter would only work on IRQ2/9


DOS Setup

Load the ne2000 drivers from in autoexec.bat, try auto discovery first

c:\PATH\TO\NE2000.COM 0x60

A decent test suite of tools while getting setup is the mTCP project, refer to their doco to setup the config etc. but remove LEASE_TIME from the ip settings to set a static ip for use with the applications otherwise the applications will throw a lease expired warning and exit

Drivers/Software


References


NOT NEEDED

kept for reference for the time being


compile with USE_NETWORK=1 (became default in 0.154?)

OSD_NET_USE_TAPTUN=1 might be required as well to pull in the source, dunno man I don't do c stuff

#if defined(OSD_NET_USE_TAPTUN)


sudo ip link add link enp4s0 name mametap0 type macvtap
sudo ip link set mametap0 address 00:00:1B:4A:3A:F2 up
ip link show mametap0

sudo ip link delete mametap0

sudo ip tuntap del dev mametap0 mode tap group netdev
sudo ip tuntap del dev mametap0 mode tap