Omnimaga

Calculator Community => TI Calculators => ASM => Topic started by: ACagliano on April 26, 2010, 03:02:38 pm

Title: Battery Routine
Post by: ACagliano on April 26, 2010, 03:02:38 pm
There is a calc app called CLOCK that installs a hook that displays the time and date on the homescreen (and, if you want other menus, too). Is it possible to do the same with a battery meter? Have one displayed all the time on the homescreen If so, can someone make one, cuz that would be epic.
Title: Re: Battery Routine
Post by: calc84maniac on April 26, 2010, 03:08:52 pm
The problem with this is that we can't really read battery level very accurately. It's pretty much battery low/not-low (which the OS tells you on startup anyway)
Title: Re: Battery Routine
Post by: DJ Omnimaga on April 26, 2010, 03:51:51 pm
Wasn't there a routine that told you if batteries were getting low shortly before the calc starts telling you on Startup, though? I recall it returning low batt code even if the startup msg didn't display anywhere yet (even on Garbage collections)
Title: Re: Battery Routine
Post by: ACagliano on April 26, 2010, 04:15:44 pm
What about the battery indicators that return a 1-4 rating. If i could just have like a number 1-4 always on my screen, i'd be satisfied.
Title: Re: Battery Routine
Post by: Madskillz on April 26, 2010, 04:24:04 pm
Wasn't there a routine that told you if batteries were getting low shortly before the calc starts telling you on Startup, though? I recall it returning low batt code even if the startup msg didn't display anywhere yet (even on Garbage collections)
You have the interrupts to go by from and like calc said it's pretty inaccurate.
There seems to be something similar to what Omnimaga was talking about here:
http://www.ticalc.org/archives/files/fileinfo/358/35857.html

As well as something similar to what ACagliano was looking for here:
http://www.ticalc.org/archives/files/fileinfo/155/15595.html
However this is for the 83...but with the source included it should be a relatively easy thing to get working on an 83+/84+
I can look at it a little later tonight if you want.
Title: Re: Battery Routine
Post by: ACagliano on April 26, 2010, 06:11:39 pm
Yes, Madskillz. That would be perfect. Do you think you can port it to the 83+/84+?
Title: Re: Battery Routine
Post by: mapar007 on April 27, 2010, 12:15:52 pm
The problem with this is that we can't really read battery level very accurately. It's pretty much battery low/not-low (which the OS tells you on startup anyway)

There is bcall(_5221) which returns battery level on a scale from 1 to 4. I don't know how accurate it is, though.
Title: Re: Battery Routine
Post by: DJ Omnimaga on April 27, 2010, 12:28:34 pm
I think there are still routines on ticalc where the battery level is calculated based on contrast level x.x, I never understood why they exist considering the 83+ contrast won't even change at all even with weak batteries. If batteries are way too low the calc just shuts down by itself
Title: Re: Battery Routine
Post by: mapar007 on April 27, 2010, 12:34:09 pm
Most of them were bullshit. (while we're being honest, most stuff on ticalc is, and I must say I contributed some rubbish myself in my early days :) )
Title: Re: Battery Routine
Post by: DJ Omnimaga on April 27, 2010, 12:51:00 pm
yeah true I would say about 90% of the stuff on ticalc.org is crap. I'm happy the split most of it in their own directories now, but as TI user from the Calc.org era, I remember having to browse through 3000 BASIC games a lot. On some computers it would freeze Firefox/IE x.x

Didn't you once uploaded one of my own file back in the days? (I think it was like the day after I got my profile taken down, then I sent a file report to ticalc). Maybe it was someone else, though. The game in question was Mystique: La Larme Du Dragon :P
Title: Re: Battery Routine
Post by: mapar007 on April 27, 2010, 01:04:15 pm
No. Definitely not me. :)
Title: Re: Battery Routine
Post by: DJ Omnimaga on April 27, 2010, 01:22:48 pm
oh wait I think it was Silver Shadow, but even then I might be wrong. His email looks exactly like the guy first/last names and he was from France too. It reminds me when I first submitted a game of mine on a french TI site. My stuff would never get accepted because it lacked any readme x.x
Title: Re: Battery Routine
Post by: Madskillz on April 30, 2010, 07:57:39 pm
I got it ported over, however I have noticed a few things. He used the interrupts to get the battery level but I think he might be off on something though. I'll keep messing with it until I can get it to work. I see what he was doing, and the majority does look right. I just dont have a lot of experience with the interrupts. So I have been adding a lot of comments. I was busy with school earlier this week, but I just have one final next week so I think I could have it done by then.
Title: Re: Battery Routine
Post by: ACagliano on May 02, 2010, 09:29:49 am
Cool. Thank you.
Title: Re: Battery Routine
Post by: Silver Shadow on May 02, 2010, 09:39:41 am
oh wait I think it was Silver Shadow, but even then I might be wrong. His email looks exactly like the guy first/last names and he was from France too. It reminds me when I first submitted a game of mine on a french TI site. My stuff would never get accepted because it lacked any readme x.x
I guess it was me. Strange, I didn't remember me doing that with this particular game. I remember I submitted some files from a french site on to ticalc.org because I thought they could've been more widely available that way. Since I wasn't the author of those files, I put myself as "porter" in the author blanks.
A year or two ago, I realized that this was pretty stupid so I deleted those files from ticalc.org, leaving only my own programs.
Title: Re: Battery Routine
Post by: DJ Omnimaga on May 02, 2010, 12:36:21 pm
Yeah I think it was "Porter". I don,t remember if my name was listed because IIRC it was after my profile was gone. At first I thought it was in response to my file deletion, but I discovered it was the sole file available so I just asked ticalc to remove it too (they took a year XD)

There are a few others french files not available on ticalc.org, like Dazel 4 The Mastoc Quest and Zelda: The Hero Of Hyrule, which are available here now, though.

Btw back on the battery subject, I wonder if the oldest 83+ calcs have their contrast changing when batteries get lower? I know for the one I got (2001) and my SE, battery level won't make any difference on the display but for some old calcs it did.