Thanks you to everyone for the responses. Any encouragement is always welcome.
Just a quick update: This thread is going off on two tangents.
Yep. They usually do
.
But seriously, this topic is about context switching in the AMOS framework. What we can do with extending AMOS with context switching in place should really branch into other specific topics. They will need to come together at some time in the future so I know what's needed in the framework.
I assume he's talking about the 4-color super-hires modes
Spot on
Back to earth, I can see now why we might need both
Set Ecs and
Set Aga as context switchers. Which is mainly the sort of stuff I needed to know to pursue this concept.
Bear in mind that context switching need not be a total replacement of the existing V2.0 AMOS data structures. Only those parts that require extra data storage outside of the existing limits.
As an example, and food for thought, consider the problem of 6 bitplane addresses in the current structure. This doesn't necessarily mean setting up yet another fixed array of 8 bitplane addresses and switching context to that. As I made plain earlier in this thread, let's not make the same mistakes as the original AMOS did. Instead consider using the first address of those 6 bitplane pointers as a pointer to a simple linked list containing just two long words:
That's infinitely extensible (okay, okay, it's probably a bad example for extensibility) but you get the idea? The code to handle the pointers just needs to check for an AGA flag and switch to code to handle the linked list instead of the fixed array. At the bare minimum suggested above, the memory needed is 8 bytes which fits neatly with the Amiga's
AllocMem() base unit of allocation (8 byte chunks). And it doesn't actually extend the existing structure at all. It just adds some temporary extra storage (which is fine as long as the programmer remembers to clear it down afterwards!). I'm particularly bad at pulling examples out of thin air. So take the above with the proverbial grain of salt. But I hope it gives you some idea of where we should go with this.
The same sort of approach should be applied to the code as well. Whilst we're not as concerned about memory usage as we used to be, it may well be preferable to switch code blocks as required, or switch within existing code, rather than have (up to) three sets of routines permanently switched depending on context.
In any case, it's time to emphasise what we're doing and where we're going with all this:
- First, we fix the bugs!
- Second, we fix the compiler!
- Third, we add context switching and all hell breaks loose!
What I wanted to promote here is the realisation that any work done on AGA and specialised ECS modes must take into account how those modes are going to be integrated into the AMOS instruction set.
Before anyone gets too far down those tracks, think hard about what the AMOS instructions would look like:
- Would the majority of the existing AMOS graphics instruction set suit with only different parameter range checking? Eg. is Screen Open still suitable in its current format or does it need a different format added?
- Think carefully about the format of any new graphics instructions you would need. Do they fit the AMOS "look and feel"?
- How far is "too far" in trying to integrate instructions that may be too specialised for "everyday" AMOS usage?
- What impact does any specialised screen mode have on the existing instruction set? Eg. How difficult is it to print text to, etc.? Note that AMOS Pro V2.0 already checks for an AGA chip set to ensure that your sprites don't suddenly appear in Hires. Apply the same sort of thinking to what you might affect.
I'll be getting on with documenting how AMOS fits all this together so you've all got a clear picture of what's involved. If you haven't looked into this yourselves, some of it is quite interesting and highly relevant to our plans for AMOS.