Omnimaga

Omnimaga => Completed => Our Projects => BatLib => Topic started by: Xeda112358 on April 12, 2011, 04:26:06 pm

Title: BatLib Default Modes
Post by: Xeda112358 on April 12, 2011, 04:26:06 pm
Okay, so currently, I would like to know if ReCode should automatically set Full or not. So, what is your opinion?
Title: Re: BatLib Default Modes
Post by: Munchor on April 13, 2011, 04:19:30 am
I think it should be 6MhZ, like in Axe, and the user can change it to 15MhZ.
Title: Re: BatLib Default Modes
Post by: ztrumpet on April 13, 2011, 03:55:06 pm
I voted for 6mhz also, as I think it's easier if the faster languages are in 6mhz mode on default, to avoid some conflicts between the 83+ and the 83+SE and above. :)
Title: Re: BatLib Default Modes
Post by: Xeda112358 on April 13, 2011, 06:34:01 pm
Hmm, okay. When I decided to make the regular commands run at max speed, I didn't disable that for ReCode which is why in the latest version it starts at 15MHz (if possible). So it looks like in the next version, default will be 6MHz :)
Title: Re: BatLib Default Modes
Post by: ztrumpet on April 13, 2011, 06:37:40 pm
Wait, are you talking about the entire program, or just the ReCode part?
Title: Re: BatLib Default Modes
Post by: Xeda112358 on April 13, 2011, 06:46:40 pm
Just the ReCode part :) I plan to keep the rest at max speed :)
Title: Re: BatLib Default Modes
Post by: TIfanx1999 on April 13, 2011, 07:02:10 pm
In my opinion, it should be set at 6Mhz by default. :)
Title: Re: BatLib Default Modes
Post by: ztrumpet on April 13, 2011, 08:11:31 pm
So would it be changing between 6mhz and 15mhz modes a lot if it was going between BatLib and ReCode and regular Basic?  Or would it always be set at 6mhz or 15mhz mode?
Title: Re: BatLib Default Modes
Post by: Xeda112358 on April 13, 2011, 10:18:55 pm
When it comes across a regular BatLib command, the code will be executed at 15MHz, but when it enters ReCode, I will make it so that drops down to 6MHz.
Title: Re: BatLib Default Modes
Post by: ztrumpet on April 13, 2011, 10:20:03 pm
Ah.  In that case, I retract my vote, as the speed would be different on the 83+ anyway.
15mhz mode all the way! ;D
Title: Re: BatLib Default Modes
Post by: mrmprog on April 13, 2011, 10:43:48 pm
Does the 15mhz mode drain the battery much faster?
Title: Re: BatLib Default Modes
Post by: Xeda112358 on April 14, 2011, 12:42:39 am
The answer is yes and no :)
It will use the same power to perform the same actions, so in that sense, no. However, since it performs at 2.5 times the speed, it will drain at 2.5 times the speed. So, in situations where you need speed (graphics and data crunching), either mode will use the same amount of energy, but 15MHz mode will do it faster. However, if your calc is idling, waiting for user input, at 15MHz you are just draining your batteries.

So with that in mind, I will go back and modify some routines. The routines that wait for user input, like the getkey routines and Pause will execute at 6MHz and the rest will remain at the users current setting. This is especially a good idea for Pause because in 15MHz mode, Pause 250 would pause for 1 second instead of 2.5 like it would at 6MHz.
Title: Re: BatLib Default Modes
Post by: willrandship on April 14, 2011, 12:49:43 am
Interrupts work faster too, right? And, doesn't sound get screwed up? There's lots of things that change in 15 mhz mode.
Title: Re: BatLib Default Modes
Post by: Xeda112358 on April 14, 2011, 12:55:05 am
Hmm, BatLib has interrupts turned off, so that isn't a problem at the moment, but I didn't know about the sound... I guess I should change the sound commands to 6MHz mode, too! Thanks!
Title: Re: BatLib Default Modes
Post by: Munchor on April 14, 2011, 04:33:46 am
I think the default both in BatLib and ReCode should be 6Mhz, however, if we use, let's say:

dim(X

It will make BatLib full.

If we did:

dim(40
Full
...
Stop

It would make ReCode 15mhz.
Title: Re: BatLib Default Modes
Post by: Xeda112358 on April 14, 2011, 10:35:29 am
Ah, but I think as long as the regular commands are actually crunching data, it should be at the speed of the rest of the program. BASIC programs execute at 15MHz if possible, so it makes no sense to draw a rectangle at 6MHz using dim(29 then to have it switch back to 15MHz mode to execute BASIC code :) At least in my opinion it makes sense that way...
Title: Re: BatLib Default Modes
Post by: ztrumpet on April 14, 2011, 08:49:00 pm
Ah, but I think as long as the regular commands are actually crunching data, it should be at the speed of the rest of the program. BASIC programs execute at 15MHz if possible, so it makes no sense to draw a rectangle at 6MHz using dim(29 then to have it switch back to 15MHz mode to execute BASIC code :) At least in my opinion it makes sense that way...
That's what I think too. :)
Title: Re: BatLib Default Modes
Post by: Munchor on April 15, 2011, 07:23:07 am
It's also better for new users who want full speed without having to set it.
Title: Re: BatLib Default Modes
Post by: Xeda112358 on April 15, 2011, 08:43:08 am
In the last update, I made ReCode start at 6MHz with the idea that it will run at the same speed on all calcs, initially. The user can then use Full if they need to. Also, a few commands are executed at 6MHz even in 15MHz mode for timing purposes or simply to save power as that was a concern :)
Title: Re: BatLib Default Modes
Post by: Munchor on April 17, 2011, 01:38:13 pm
In the last update, I made ReCode start at 6MHz with the idea that it will run at the same speed on all calcs, initially. The user can then use Full if they need to. Also, a few commands are executed at 6MHz even in 15MHz mode for timing purposes or simply to save power as that was a concern :)

Nice, I like it this way, it saves space and raises speed :D
Title: Re: BatLib Default Modes
Post by: Xeda112358 on April 17, 2011, 01:46:16 pm
:) I am trying to make my code smarter, now. There are in fact times when you want the calc to be slower and I tried making it so that at those times, BatLib is slower
Title: Re: BatLib Default Modes
Post by: DJ Omnimaga on April 29, 2011, 07:55:46 pm
6 MHz seems good to me. Games will run at similar speed on all calcs and there will be less risks of glitchy LCD results on certain calcs.