KKTamu escribió: ↑12 Mar 2025 09:56
I know how to use the Shadow RAM, but I want to use the BIOS for FD READ.
To be honest, I don’t have the technical skills to directly control the FDC and read from the FD.
I'm sorry, i forgot you have to continuously keep reading from disk (don't have the luxury of read once and then forget)
KKTamu escribió: ↑12 Mar 2025 09:56
By the way, do you know why we have to map it with MMR in order to control bank switching for SUB I/O ($D430)?
Even though it’s only 4KB, it feels like a waste to put more pressure on the main memory.
Because bank switching is only mapped on SUB I/O (unlike i.e. vsync flag), and to access the address space of SUB you have to use MMR (and halt SUB). The only alternative that i can imagine is a SUB custom command (or two commands) to change bank from within SUB itself. That, or using MSR register to have mapping for SUB I/O and then another mapping for VRAM pages, and swap them rapidly.
Also, you have some bytes to waste on the last page of shadow RAM, where it collides with MAIN I/O

(i have tested and regardless of MMR mapping, MAIN I/O address are always working as expected)
Anyway, for the task (read disk and draw to bitplanes), it seems to me that mapping just 2 "pages" at a time (for VRAM), plus 1 fixed for SUB I/O, should be enough to do iterations for N bitplanes, and then at each iteration incrementing the MMR registers, and never touch mapped SUB I/O.
No need for the whole VRAM mapped, i think.
KKTamu escribió: ↑12 Mar 2025 09:56
Originally, I planned to map only VRAM with MMR and control SUB I/O through shared RAM, but no matter what I tried, I couldn’t switch the bank.
(Even when setting SUB RESTART and disabling MMR.)
I don't know if i understand that correctly.
Shared RAM is (*) 128bytes hardwired to both CPUs (MAIN & SUB, at different addresses), but you can only access it from MAIN when SUB is halted (if not, writes don't work, and reads are dummy $FF's). You can use it to execute custom commands (i.e. what i mentioned earlier as an alternative), and that should work. Current bank should not change while video mode doesn't change. If you return control to F-BASIC, then i don't know, maybe it changes, but under your code, should not change.
And MMR doesn't """"need""" to be disabled, it would just not work while SUB is running. But in any case, with MMR on MAIN code will execute slower
If you have some code that doesn't work i could try.
By the way, how do you name the main 6809 CPU? MAIN or WORK? We here are used to MAIN, but i have seen both forms on documentation.
(*) I'm sure you know this much better than me

, it's more like thinking out loud.