niklasekstrom/a314

Implement more dynamic method for detecting A314 memory ranges

Closed this issue · 0 comments

The current code for deciding which memory ranges are provided by A314 is fairly inflexible, and it has proved to cause problems on several occasions.

As an example, an A500+ with a Vampire has both 2MB chip memory and 0.5MB slow mem at address 0xc00000. This combination was not anticipated and therefore didn't work correctly. A fix for this particular configuration was easy to make, but in general it would be nice to have a more dynamic method of detecting which memory ranges are provided by A314.

One method I have been considering is that when a314.device is starting it could disable interrupts (and maybe DMA as well?) and then put the A314's FPGA in a special detection mode, and read and write to potential A314-addresses, and at the same time communicate with the FPGA through the clock port, to find out if a particular address is handled by A314.

The reason why DMA might have to be disabled is that the blitter can write to memory, and a write by the blitter during the detection procedure could be mistaken for a write by the CPU. Disabling all DMA, even bitplanes, could make for a slightly annoying user experience, if the screen goes blank (for a short period). It may be possible to only disable blitter DMA, but this is still not completely unproblematic since the copper could start blitter DMA, so maybe disabling both blitter and copper DMA would work (this needs some experimentation).

Another method would be to have a configuration file that is stored in DEVS: or S:, that describes which memory ranges are mapped to A314. This is less dynamic but avoids performing the detection procedure each time the Amiga boots up.