I downloaded the source for MAME, it is written in C, so theoretically you could add your custom C code for the network part. I’m not sure, but I think kaillera attempts the same, although the guys at kaillera have not released the source so we cannot see at which level kaillera hooks into MAME for the network play. if anybody has time and is interested in attempting to do something like this, hit me up. My C is a bit rusty but it’s all there.