KungFuFlash
KungFuFlash copied to clipboard
Plugin or Overlay system
Several suggestions in the issue list require either more C64 code space than currently is space for or more ARM code than is currently space for in the 48kB ARM / 16kB C64 area. It would be great to find some consensus how to approach such a plugin system and how this eases development.
A plugin or overlay system would be useful to allow easier development of addons/plugins/menu replacement.
I have prepared a first shot of this, as a prototype, where a file extension ARM is supported in the menu that loads 64kB of statically compiled ARM code into the dat_buffer and jumps to the start address while keeping the usb and/or c64 interface interrupt running. I am using this approach to run sd2iec code after an initial ATN signal is detected from the ARM's idle loop (using the 100 pin DEVEBOX). I anticipate for ease of development no re-use of code or symbol reuse between the plugin and the main code, just a jump subroutine to dat_buffer address and a return at the end of the code to go back into the main_loop. The return exit code would then allow the main loop to do a restart to menu or other actions as already defined in the code. It is needed however to pass somehow which part of the bss/data sections are freely available for the plugin without affecting the main loop. I don't have a solution for that yet. It would be possible to link the ARM code statically to not use the TCM RAM at all, except for the stack, that is a simple but somewhat inefficient solution.
C64 code support may already be possible through the EasyFlash API I am not aware of that. But it may help development to be able to replace the 16kB of C64 menu code by an external file, or bank switch that with a loaded file.