set "command" to code? is this safe?
#1
Posted 24 October 2007 - 12:07 AM
Thanks, Ben
#2
Posted 24 October 2007 - 12:11 AM
you could raise it several times the default amount and not cause any slowdown on a modern computer, just if you start to get drastic like over 10x you need to be RESPONSIBLE with your cycles and make sure to end them with wait 1's so you don't suck all the juice.
The strict limit on commands per cycle is a safe guard against sloppy code. example:
:loop if spacepressed "pause" goto loop
that would cause lots of problems if you set commands too high, there's no need to check for that condition more than once per cycle, the solution is to add in a wait 1 to end the cycle
:loop if spacepressed "pause" wait 1 goto loop
The above situation is 99% of the reason why a novice mzxer should be careful when pushing the commands counter too high.
This post has been edited by Risu2112: 24 October 2007 - 12:15 AM
<Cybersilver> "All my sugestions are for FUTER VERSIONS. Say it with me Fu-ter futer. Yep..."
9-21-2009, SFMZX game play video: HERE
Risu2112
#3
Posted 24 October 2007 - 12:17 AM
#4
Posted 24 October 2007 - 12:36 AM
This is a good skill to learn now, because someday you're probably going to want to write engines that need extra cpu, and being in the habit of coding a wait into all of your non-terminating loops will be to your advantage. I'm not saying you need to always set commands high, because you don't, and you shouldn't when you don't need to. But you should learn to put in appropriate wait 1's even when you don't technically need to, just because it's a good practice.
"Loose loops sink ships! DON'T GOSSIP!"
..Ignorance is to be unaware of the truth.
....Incompetence is to be unable to grasp the truth.
......And escape is to run away from the truth.
It is useless to run, since the truth is right next to you.
-Wervyn
#5
Posted 24 October 2007 - 06:38 AM
#6
Posted 24 October 2007 - 11:26 AM
#7
Posted 24 October 2007 - 04:47 PM
that and most relatively complex globals and such will have enough subroutines so that it's almost impossible to determine what the maximum number of cycles is with the global.
<pyro1588> "welcome to australia, can i help you find what you're looking for?"
<Tox> pyro1588, I'm giving you the most reproachful of glares right now.
--------
Go show those nutty Koreans what us crazy Europeans are made of pirate.gif pirate.gif pirate.gif - Saike
<exophase> The old Commodore strategy of, "Go friggin' bankrupt!"
<wervyn> Go away! I'm writing the same engine I always do!
#8
Posted 24 October 2007 - 06:48 PM
<Cybersilver> "All my sugestions are for FUTER VERSIONS. Say it with me Fu-ter futer. Yep..."
9-21-2009, SFMZX game play video: HERE
Risu2112
#9
Posted 24 October 2007 - 07:53 PM
Risu2112, on Oct 24 2007, 01:48 PM, said:
I don't think so, if it's too many you'll know it. It wouldn't tell you where all those cycles are being spent. Maybe you want a profiler for that.
"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
#10
Posted 24 October 2007 - 08:31 PM
This post has been edited by Risu2112: 24 October 2007 - 09:11 PM
<Cybersilver> "All my sugestions are for FUTER VERSIONS. Say it with me Fu-ter futer. Yep..."
9-21-2009, SFMZX game play video: HERE
Risu2112
#11
Posted 25 October 2007 - 12:32 AM
Kom, on Oct 24 2007, 07:26 AM, said:
nah, I didn't have any issues with the game engine itself running too slow (though I never got too far to begin with...). Besides, wouldn't setting your commands back to 40 break your nifty pointy arrow thing?
... anywho, I find that my computer can handle commands set somewhere around 40000/50000 (if you didn't know, that would be written as "(40000)" ) without too much slowdown.
<phthalocyanine> they make experiences.
<Nadir> demos, more like
<Nadir> a glimpse into what could have been if mzx wasn't such a bore to work with
<Nadir> actually, i'm being unfair
<Nadir> i would have made mzx games if it was capable of running on more than 20 computers worldwide in 1998
<Nadir> >:D
<%Alice> functor
<%nooodl> i hear C++ has a thing called functors and they're completely different from Haskell functors...
<rorirover> the result is the most horrid thing in C++, it's basically black magic and it transforms any code you're writing into some eldritch monstrosity
#12
Posted 25 October 2007 - 01:05 AM
<Cybersilver> "All my sugestions are for FUTER VERSIONS. Say it with me Fu-ter futer. Yep..."
9-21-2009, SFMZX game play video: HERE
Risu2112

Help









