I use MAP/EOM to change memory mapping, like here: https://github.com/MEGA65/open…_m65/mega65_map_helpers.s
- https://github.com/MEGA65/mega65-user-guide (download the PDF from main directory; note, that some additional methods described here might be incomplete and not work under XEMU)
There are basically three things:
- setting up an actual memory layout with mapping (see above)
- port bits of $00/$01 (for C64 compatibility reasons)
- some bits at $d030, too
The latter two may have some effect more or less independently of the first (enabling some ROM areas here and there) which is meant for fast accessing the Kernal and DOS code etc. so you also need to put them out of the way in order to access all the RAM.
The concept of banking is rather virtual and meant for Basic applications only, thus it's better not to think in 64K banks (like on C128 or CBM-II series), but consider the 1 MB address space as a whole instead, which is more flexible (although a bit more complicated, too).
On a C65 that's 128K RAM + 128K ROM + another 256K empty space (left over for cartridges both containing RAM and ROM, but finally not populated in real) + another 512K RAM if having an expansion.
The DMA access can extend that up to 8 MB if available. (That might seemingly be translated as having up to 128 "banks" in Basic when using PEEK and POKE which also apply DMA.)
If you want to see the first 64K contiguously (as you see it in the C64 mode), the mapping is simply all zeroes:
(Don't forget about setting the $01 and $d030 bits and later an EOM, too!)
Or return back to the default layout (in native mode):
(But these are just some examples, of course.)
Also, if I remember well, on C65 there is no such feature (unlike the other CBM machines) that you can read from ROM and write to RAM being on the same address at the same time, because of the mapping which is an integral part of the 4510 CPU (unlike the C64 or the C128 which have their own separate PLA or MMU).
How will it be handled on the MEGA65?
Maybe, at least in C64 mode, it could be partly changed somehow, for better C64 compatibility (as C64 programs often rely on this feature).
The MEGA65 makes accessing memory in other banks much easier than on C65: You can use the 32-bit ZP indirect addressing to have a 32-bit pointer in ZP, and then use:
to access memory anywhere in the memory map, without having to mess with the memory map. Also largely solves those situations where you want to write to some memory that isn't currently visible due to ROM being over the top.