Shared Library on Saturn

vbt

Staff member
What would be the way to make libraries on saturn ? I'd like to split my growing binary into multiple files, a main FBA binary and a .so file for earch driver. Does someone knows a wy to do this on saturn ? I've only found a smal tutorial for gcc but it's don't apply fully on saturn :

http://www.ehuss.net/shared/
 
vbt said:
What would be the way to make libraries on saturn ? I'd like to split my growing binary into multiple files, a main FBA binary and a .so file for earch driver. Does someone knows a wy to do this on saturn ? I've only found a smal tutorial for gcc but it's don't apply fully on saturn :

http://www.ehuss.net/shared/

With KOS on the Dreamcast, there's some code to handle such things. You may find that it could be useful for what you're doing as well. I don't really know how hard it would be to port to Saturn, as I have almost no experience in programming on the Saturn.

Other than that, your best bet may be to make a fully-functional binary for each of the drivers with its start address far enough up in RAM so that it doesn't interfere with the main binary. This would become problematic if the driver binaries would ever have to call back to the main binary though or vice versa (since they would essentially be two separate programs in this case).
 
The method described by BlueCrab is probably the simplest. You can use simple jump tables at predefined addresses to locate the functions at runtime, which is a lot easier than full-blown dynamic libraries.
 
Older consoles with limited memory are not good targets for shared libraries or the like. As the others suggested, use a little planning to divide up the memory between the main code and any code overlays. The overlays can use fixed entry points, or - more flexible - use ONE fixed entry point (the very start of the file) which merely returns a pointer to a table of vectors for the functions in the file.
 
Back
Top