Hello!
So, I was working on a project, and then a situation hit me that I think could be a real tripping hazard for 7800 programmers.
If I remember right, if you have more cycles of calculations than the space between VBlank starting and MARIA's next screen drawing routine, then on real hardware, you'll have some issues. I think (correct me if I'm wrong) that MARIA will go ahead and start drawing the next frame, interrupting whatever calculation you're on, but when she returns, you may have some register corruption. I think I remember running into something like this a few years ago.
Since this seems to be a valid situation that emulation does not trap (maybe it indicates that an issue is present with some subtle graphics glitches), I was wondering:
1) How many cycles are there between when VBLank starts (let's assume a worst-case scenario, when MARIA's last DLL is full of data), and when MARIA starts drawing the next frame? Is that an easy number to derive or estimate?
2) Is there any way in emulation or with a tool to see how many cycles some code is using in order to make sure you end up under that threshold?
What would be perfect is if I could press a button in prosystem and have it give a count of the cycles between MSTAT reads/writes/BIT commands. If it was over the cycle threshold in 1, put the color in red, if under, put it in green.
I know the 7800 community is limited, but I wonder how other programmers deal with this issue.
Optimization is the solution, sure, but how do you know when you've surpassed the threshold, or how close you are?
I guess the other possibility is to disable MARIA drawing when calculations take longer than expected, but I'm thinking that's more of a workaround than a correct solution.
Thoughts?
-John













