Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modular loading and unloading of "addons" #51

Open
rickcollette opened this issue Nov 22, 2021 · 2 comments
Open

Modular loading and unloading of "addons" #51

rickcollette opened this issue Nov 22, 2021 · 2 comments

Comments

@rickcollette
Copy link

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.

@rickcollette
Copy link
Author

Is there any more detail I can provide to help this along? Or even a patreon or paypal to donate for the cause?

@dmsc
Copy link
Owner

dmsc commented Feb 11, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants