Life would be easier if one could just assume 64-bit addressing. "nGB file? No problem, just mmap the whole thing". Instead I'm buggering around with mapping segments and checking the current access is in the mapped segment.
I remember doing similar tricks on a Z80 with 256kB RAM, which had four 16kB pages addressable at once.