Open rickcollette opened 3 years ago
Is there any more detail I can provide to help this along? Or even a patreon or paypal to donate for the cause?
Sorry for waiting so long to respond, I'm really busy this days.
I think that what you want is having "overlays", and a way to load those overlays over existing code. This is not easy to implement, you would certainly need a specific linker configuration (to define memory areas with the base code and the overlayed code).
The same support could be used to write banked cartridges, were part of the code could be located in the "main" bank and other parts in secondary banks.
One posibility is add a way to specify the "bank" on which each PROC is placed:
' Load bank 1 somehow
EXEC MY_PROC_1
` Load bank 2 somehow
EXEC MY_PROC_2
PROC MY_PROC_1 [BANK "bank1"]
' code here....
ENDPROC
PROC MY_PROC_2 [BANK "bank2"]
' code here....
ENDPROC
You should be very careful to call procedures on one bank from another, only call banked procedures from the main code.
Some akin to dlopen in C - https://pubs.opengroup.org/onlinepubs/009696799/functions/dlopen.html would be great to have.
The advantage over a RUN "Dx:Filename.ext" is that you would not unload the initial program, keeping any vars you have set. If someone were to write a core application that was small - but contained all of the static vars required; and called modules via a dlopen-like method, it could become quite extendible.
Example of usage (though pretty nitch): BBS where the system is modular and would not require a sort of TSR to be present. Maybe an adventure game where you could add in modules for different games A text interpreter that called in modules to handle things differently
If this already exists; or there is some other way to handle this; I'd love to see it.