Guides:MAME - bitbanger

From Wah!ki
Jump to navigation Jump to search

bitbanger

I'd not heard of this term before it appeared in MAME but 'bit banging' is slang for any method of data transmission that employs software as a substitute for dedicated hardware. This aligns with this MAME device well as it seems like a general purpose device which sort of caught me out on the usage front, so we'll run with that.

The device itself is a general purpose device that can be attached to a driver(tbc?) as required, in most cases (so far, 2021 APR) i have only used it with a null_modem device, using it to create a unix socket that is then used for further transmissions.

Support

To work out if bitbanger is supported by the device you are attaching review the mame code (as of 0.230) for an entry similar to this in null_modem.cpp

void null_modem_device::device_add_mconfig(machine_config &config)
{
	BITBANGER(config, m_stream, 0);
}

External Connection

Tools like tcpser, netcat or socat can be used to provide further functionality in combination with the socket.


Pass through your Bash Shell

Connecting a bitbanger device to your local bash shell is possible by leaning on socat, this allows you to experience dumb terminals in all their glory like the tv955 driver. This method was documented by the glasstty blog so i've played with it and captured it here.

NB: make sure you understand the security implications of this process and take appropriate measures

  • Using socat provide access over tcp to your bash shell, this will provide unauthenticated tcp access to the local session on <port>.

$ socat tcp-l:<port>,reuseaddr,fork exec:/bin/bash,pty,setsid,setpgid,stderr,ctty

The rest of the process is to configure your selected driver to have a null_modem attached and add a bit banger device, some example will be provided in the following table

driver null_modem bitbanger
ct486 -board2:comat:serport1 null_modem -bitb socket.<ipaddress>:<port>
tv955 -mainboard null_modem -bitb socket.<ipaddress>:<port>

Other use cases


References

These references are applicable to bitbanger and general serial/modem comms while I was setting up a BBS in MAME