For example purposes, consider a 128K SRAM with the lowest 64K mapped into 6502 address space. You'd like the ability to map the remaining 64K of RAM, one of four 16K chunks at a time, into address space at $8000..$BFFF. It seems to me that this would require controlling the A16, A15, and A14 address lines on the RAM and a mechanism or method for changing those lines only during an access into the 'banked' $8000..$BFFF address space.
Code:
6502 address space < 16K block 0 > < 16K block 1 > < 16K block 2 > < 16K block 3 > < 16K block 4>
$08000..0BFFF='010' $08000..0BFFF='010' $10000..13FFF='100' $14000..17FFF='101' $18000..1BFFF='110' $1C000..1FFFF='111'
While this type of memory management capability would be relatively simple to implement in the "soft decoder" portion of the PIC Loader/Decoder IC used in my small 65C02 systems, I'm not sure how you might implement this same capability in hardware. I suppose you could use a small EPROM as a decoder with CPU.A15, CPU.A14, and 3 bits from your VIA as inputs on the EPROM address lines along with five 4-byte tables inside the EPROM. Three bits in each byte would be used to drive the SRAM A16, A15, and A14 lines on a cycle-per-cycle basis with accesses to the $8000..$BFFF address space, where CPU.A15 = 1 and CPU.A14 = 0, producing either '010', '100', '101', '110', or '111' on those SRAM address lines, depending on the value of the three bits from your VIA. Of course, the remaining five bits of each byte could be used for "chip selects". In this case you might want to expand the size of the EPROM decoder tables to 256 bytes each using CPU A15..A8 plus 3 VIA bits as EPROM address inputs in order to produce "chip select" resolution down to a single page.
More later... Cheerful regards, Mike