http://pastebin.com/9n34bACk
Here's what I have so far:
http://pastebin.com/iqxsiBm4
In the new version, when it sets the function's environment (when creating the coroutine), it passes a modified version of the term API that saves pixels to a buffer, so that the 'pause program' can draw over the screen, then redraw the original program's interface.
In other words, when you pause the program, it needs to know what the screen looked like when it was paused. And to do that, I've modified term.write() to add its text to a buffer, then write to the screen.
That works fine, but the program I'm testing with (my File Manager) has a call to paintutils. And for some reason, paintutils still has access to the original term functions.
I don't really want to pass a completely rewritten paintutils API (but I assume that would fix the problem, with paintutils anyway. Other APIs could have the same problem too)
Any ideas?
Edited by HPWebcamAble, 25 October 2015 - 09:38 PM.












