With this in mind and from a very quick look at the 32016 tube implementation, you may be able to improve things a bit by eliminating your (8-bit) read/write trampolines.
There are a few different ways to do this, one of them as follows, mostly in device_reset():
- Install your ram_device directly into the memory map.
- Install the ROM shadow over it, overwriting the RAM read handler for the relevant range.
- Install a write tap in the RAM region.
The tap logic does the following:
- Re-installs the ram_device, overwriting the ROM shadow.
- Deletes itself.