Most old games were coded without knowledge of the timing of MZX. The reason that old consoles rely so heavily on exact timing is that the devs of those games knew the system inside and out... but MZX was until relatively recently a big black box. Anyone who relied on timing must have done so completely by accident (and once the timing of MZX became known, people stopped busy looping) so I can't imagine it'd be common at all.
I think preempting the Lua VM in the case of recompiled robots is the way to go, while robots written natively in Lua should not be preempted. No new games should be writing busy loops without waiting, and you make a lot of language features unsafe by preempting the Lua VM (for instance, Lua's equivalent of try/catch blocks are implicitly re-entrant, meaning you can't yield inside a try block). But for recompiling robots, again, it should be completely safe to preempt the VM as long as the recompiler avoids any of the implicitly re-entrant language features.
MZX 2.81h+lua Lua support in MZX
#122
Posted 14 June 2008 - 09:26 PM
I agree that the robot multitasking should be purely cooperative, and I think that for new robots there should be a warning thrown out if idle loops are used. We've already gotten most people to stop using them though.
MZX actually originally had a mechanism to bail out if loops were done too much but it seemed redundant to me with a 40 commands per cycle limitation so I removed it for performance/complexity issues (this already shows that old games have been able to cope with a timing change)
MZX actually originally had a mechanism to bail out if loops were done too much but it seemed redundant to me with a 40 commands per cycle limitation so I removed it for performance/complexity issues (this already shows that old games have been able to cope with a timing change)
~ ex0 has a kickass battle engine, without it you sux0rz! without it you sux0rz! ~
"The fact that I say I've one of the best, is called honesty." -Akwende
"Megazeux is not ment to be just ASCII, it is ANSI!" - T-bone6
"I hate it when you get all exo on me." - emalkay
Exophase can what Rubi-cant.
exoware is ware ur ware is exoware
ps. not loking 4 new membrs kthx
"The fact that I say I've one of the best, is called honesty." -Akwende
"Megazeux is not ment to be just ASCII, it is ANSI!" - T-bone6
"I hate it when you get all exo on me." - emalkay
Exophase can what Rubi-cant.
exoware is ware ur ware is exoware
ps. not loking 4 new membrs kthx

Help





