Well... for one, I see three memory-related code sections at mc1000.c... Memory Banking
, Memory Maps
and setup memory banking
... I (still) don't get exactly the difference.
Someone REALLY should set up a M.E.S.S. programming tutorial somewhere.
First, Memory Maps are used to describe a range of addresses belonging to a CPU. In the case of the Z80, they can be Program addresses, or I/O addresses. Program addresses are typically used by things like ROM, RAM, video RAM, and some devices. I/O addresses are typically used for things like direct access to peripherals like audio / video chips, cassette interfaces, disk drives, keyboards, joysticks, and so on. Each entry in the memory map contains a starting address, an ending address, and a Read, Write, or Read + Write handler. The purpose of the handler is to handle reads and writes from those addresses.
Memory banking is a technique that was used by some computers, game consoles, and arcade machines to expand the amount of memory that the CPU can use beyond the normal amount. This is accomplished by swapping different sections of RAM and ROM, or "banks", into the same address range at different times. If you need further explanation, don't hesitate to ask.
Setting up memory banking is necessary in the MACHINE_RESET or MACHINE_START functions, because the emulated machine needs to know to what area of ROM or RAM a bank is pointing when it starts up. Again, if you need a more in-depth explanation, feel free to ask.