-
Notifications
You must be signed in to change notification settings - Fork 54
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
Using a custom segment map #192
Comments
The main benefits of using segments are:
Remember there was no virtual memory in 1984, so the modern way of only loading the code that's actually needed wasn't available yet. The LaunchAPPLServer contains a few strategically placed calls to UnloadSeg. If you switch between different connection types, the unneeded code is unloaded to save a few kilobytes of RAM. |
This is good to know, thanks. I know the Mac was designed to load and unload small code segments, but I had been under the impression that Retro68 didn't support that and always loaded all code into RAM, probably from reading this March 2017 article:
So it sounds like that would be true when using the Is there any guidance for how to create a custom segment map? Presumably one should begin by copying the default one—which is not entirely straightforward since the default one is implemented in code rather than a copyable text file—but this seems to be a usable starting point:
It's not completely equivalent to the original since the resource IDs will be different, but it's the closest I could get since the segmap text file doesn't seem to offer the opportunity to specify what the resource IDs should be. Then, how should one add to this? Each segment appears to consist of one or more globs mentioning object files in a static library. I presume if one wanted to make a new segment with only specific objects from another static library foo.a one would use To reference object files of one's own application which are not part of a static library, such as x.o or y.cpp.obj, it appears that one just lists the object file name (with the Segment 1 is always created as:
which seems to say "include these four objects from libretrocrt.a and also include all of the other objects from libretrocrt.a." What's the purpose of listing those four objects separately? Does it enforce that those four objects are placed first in the code segment and in that order? If so, I can understand why start would need to be first, but what about the other three? Is this all documented somewhere, or could it be? Lack of official documentation is what compels people to seek out third-party articles which can be inaccurate or outdated. |
I see that LaunchAPPLServer uses a custom segment map. Is there any documentation that describes why one might make a custom segment map, what effects this has, and what criteria one would use when deciding what should go in each segment?
I assume that Retro68 loads all of the segments into memory at program start time regardless. Is that assumption correct?
I use third-party libraries in my app and with the default segment map all of their code is placed together with my app's code in the Main
CODE
segment. I tried using a custom segment map that put each library's code is in its ownCODE
segment, primarily in order to discover how big each library's code ends up being. This appeared to work fine. SeparateCODE
resources were created for each library and the app still appears to work fine. Is this a valid reason to create a custom segment map? Are there any problems one should anticipate when using a custom segment map?The text was updated successfully, but these errors were encountered: