rcmolina / MaxDuino

Unified firmware for tzxduino and casduino
https://www.va-de-retro.com/foros/viewtopic.php?t=5541&start=9999
88 stars 21 forks source link

Curious regular short-pulse glitches during long pauses #58

Closed stripwax closed 3 weeks ago

stripwax commented 1 month ago

I noticed yesterday that during a long pause there's a tiny glitch, a short up/down pulse, every second or so. I'm pretty sure this is because the 'long pause' treatment, which breaks a long pause into shorter parts to workaround Timer limitations, inadvertently triggers the "pinState = !pinState;" code.

I think this is coming from a really old change. See below:

old change (part 1) https://github.com/stripwax/MaxDuino/blob/9ea7e624c42e34805faa7eb3227487c27b31331e/MaxProcessing.ino

old change (part 2) https://github.com/stripwax/MaxDuino/blob/495e12c7aa6ab194d08f6d3447fabb055d8809d8/MaxProcessing.ino

In these changes, the original wasPauseBlock logic, which I think is only used specifically to ensure continuous long pauses with no pulses, was partially moved and then partially removed. (I ended up removing the last parts here, but only because at this point these parts were indeed unused - the original logic having been removed by the above commits):
https://github.com/stripwax/MaxDuino/blob/7fe060782c4ef64f63a202034186e20f83a8c621/MaxProcessing.ino

I'm keen to revert it locally and understand what needs to be re-tested. (I'll try and rework it first to do what I think it's supposed to do, and I'll retest a variety of loaders including ID15)

stripwax commented 1 month ago

My current testcase is Gilligan's Gold tzx, since it's sensitive to the sorts of pinstate flips that can cause inconsistent polarity between blocks. I think if my changes (work-in-progress) successfully still load Gilliigan's Gold, and (say) Starbike (The Edge) speedloader and one or two ID15 files, I'll feel confident.

stripwax commented 3 weeks ago

Marking this as closed, since the patches were merged already :-) thanks