Not sure if I should ask this in the main VideoNuLA thread but it's perhaps a bit niche so I'll start here anyway, since I believe Rob is reading this thread occasionally as well...
Thanks to Kieran's b-em changes I'm doing some work to tidy up the VideoNuLA support in STEM. It seems to me that if the support ROM is *not* present, pressing BREAK or CTRL-BREAK leaves VideoNuLA's settings unaltered - so if I've run (e.g.) the ATTR2 program, then do CTRL-BREAK and MODE 0, I get a garbled screen. I assume the support ROM does ?&FE22=&40 on reset to avoid this.
It is tempting to have STEM do ?&FE22=&40 on reset as well, but on a machine without a VideoNuLA that will poke the regular ULA control register and potentially upset things - though, I think, only until the OS next updates this on vsync - but still, it has an ugly glitch-like effect (at least judging from BeebEm).
So my question is, is it possible to reset VideoNuLA in a way which is invisible/safe if the machine actually just has the regular ULA? STEM has this problem here as it supports both cases, whereas the support ROM can reasonably assume you actually have a VideoNuLA if you've installed it.
The obvious thing to do would be for STEM to record when it turns VideoNuLA on and use that to decide what to do on reset, but unfortunately my ROM workspace byte at &DF0+X is already bursting at the seams and I'm not aware of anywhere else I can reliably store this information across CTRL-BREAK. I can think of various special case hacks but I'd rather not go there if I can help it...
I hope this makes sense, I appreciate it might be quite waffly. (Another good reason to keep it out of the main VideoNuLA thread I guess.
ETA: I'm sure it's not unreasonable to assume anyone using STEM with VideoNuLA will have the support ROM installed anyway, but all the same, I'd like to handle the case where the support ROM isn't present nicely if it's possible.
ETA2: I have observed that under no-VideoNuLA-support emulators, having the support ROM loaded seems to make BREAK/CTRL-BREAK slow - I've occasionally had trouble booting discs because I don't hold SHIFT long enough. I find myself wondering if this is in some way an artefact caused by the emulator responding to this reset operation hitting the regular ULA - could that be the case? Or does this happen on a real machine? Just curious, it's obviously not sensible to load the support ROM on a machine without VideoNuLA normally so I kind of deserve all I get.