Symoon wrote: ↑
Sun Jun 03, 2018 5:20 am
Actually all the rest of the data loading is done with similar risk, that's the price for high speed
There is nothing to do in case of misinterpretation: no possible re-read of the signal, and no time for self-correction (like CRC or parity) before next data has to be read. The loading would crash anyway if any value is mis-read.
Not counting the (lack of) available memory left in page 1 when loading the main program!
Data validation and correction is for slow-loaders, pfah!
Putting aside the notion of validation and correction for a moment, I agree that your reasoning is correct for non-end-of-audio signals
However, for the end of audio signal it does not cost anything to do a validation since the signal is supposed to be finished anyway.
The only test needed is only activated after a 9 is detected and it does not need to run in any other case so it would not slow regular signal interpretation. Now, that would lengthen the code a bit for sure and that indeed could be a reason to decide not to implement it, but technically this does not slow loading and makes user experience much better in case of bad audio (a "bad signal" message is slightly better than a crash
This said, maybe there is a way to both not add this "9 validation" system and
to avoid crashing.
Imagine that you can predict or slightly control which values are on the stack when this error happen, then you could use that to force the program to crash in predictable ways (like trigger a BRK, divide by zero, etc.) which could then be detected. That would allow the program to redirect the code to an RTS-correction routine of some kind which would then exit cleanly.
Possibly a bit tricky, but if it is doable, this is a nice bonus for users.
Now, going back to validation, it might be possible to add some form of validation if you have a few cycles and bytes to spare here or there.
But this said, I agree that the priority should be to get this working efficiently on as many machines as possible.
Once that is done, maybe there will still be some room for validation.
In any case, I want to restate that I think you are doing an excellent job and that I have no intention to tell you what to do. I am just a fairy whispering ideas in your ear.