Well, some attempts have been made:
Alan Cox came up with some hacks for SDCC 3.5 to add some limited banking support (see Kernel/patches/SDCC), and myself got the Game Boy banking support working in MSX as is currently used in rlengine (see https://github.com/retrodeluxe/sdcc-msx).
All this I think is now more or less supported out of the box in SDCC 4.0. But is just static banking: you need to specify in the source in which bank something is compiled to, and still need to handle manually inter bank data access.
Doing it properly means compiling in a 24bit address space, and arranging the code and the data in pages that can be relocated by the linker when loading into memory. All calls and jumps should be inter bank when needed, and data access should also be inter bank when needed. This is done by a mix of code generation and dynamic linking.
After looking at the SDCC source code for a while, I don't think is worth even trying. IMO taking a cleaner compiler as starting point will be a much more pleasant experience.
Well, which compiler you're considering as the better point to start off?
Well, I could compile FUZIX to MSX 1 and MSX 2 targets using a Linux VM and lots of patience (almost 1h30m in my six-core Linuxbox). I tried it with openMSX, and it runs perfectly.
But unfortunately, the platform-msx2/Makefile uses MegaFlashROM SCC+ SD instead of Sunrise IDE.
I wanna try it into real hardware, but I don't have a MegaFlashROM SCC+ SD, but one Sunrise IDE compatible, a Tecnobytes IDE-Mapper interface (and 3 SD-Mappers, and 1 USB-Mapper...).
I really don't know how to add this option into platform-msx2/Makefile (I'm a newbie at Makefiles), so any help would be appreciated.
You need to add a driver for whatever hardware you want to use.
That is what contributors for other platforms have been doing.
I added the one for MegaFlashROM, and had the idea to add later the one for Sunrise IDE, but I never did.
Is not difficuly if you look at the existing MegaFlashROM driver. But you need yo sort of know what you are doing, and debugging can be quite laborious.
I can give some advise on this if you decide to try.
By the way, Filip Balyu recently contributed the driver for Sunrise IDE to the FUZIX tree, maybe you can give a try.
Awesome to see some people is contributing drivers!