The bankdev device is very powerful: it maps a sliding-window view of its own address map into the source address map.

The key is here:


That means that the number you pass to set_bank is multiplied by that to get where in the bankdev's address map is visible in the main address map.

So Z80 address 0 is 0 in the bankdev's map when set_bank(0), and Z80 address 0 is 0x10000 in the bankdev's map when set_bank(1). MAME crashes when you omit the RAM because it's not an additional 64K, it's the base 64K for CP/M mode where 100% of the 64K is usable RAM.

The bonus of all of this over conventional banking in MAME is that it's much faster when the bank view changes frequently, because it's only updating the base address of the sliding window. The "new" 2014 Apple II driver was about 3 times faster simply because I changed it to use bankdev instead of the old-style banking.