Author Topic: Battery Level  (Read 10024 times)

0 Members and 1 Guest are viewing this topic.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Battery Level
« on: November 29, 2010, 08:19:26 pm »
Does anybody know of a way to check the battery level without using a B_Call? If you have code, hex or mnemonics are fine. Thanks

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Battery Level
« Reply #1 on: November 29, 2010, 08:22:25 pm »
I have assembly ;D You want bit 0 of port 2. It's set if batteries are good, reset if they are low. So:
Code: [Select]
in a,($02)
rra
jr c,batt_good
batt_bad:
I think you get the general idea :)
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Battery Level
« Reply #2 on: November 29, 2010, 08:24:28 pm »
Oh, that is helpful, thanks. Is there a way to do a multi-level test? Like that B_Call that returns a value from 0 to 4?

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Battery Level
« Reply #3 on: November 29, 2010, 08:27:40 pm »
It involves weird not-completely-understood interrupt stuff. (Hardware timer 2 is involved. Read more at http://wikiti.brandonw.net/index.php?title=83Plus:BCALLs:5221)
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Battery Level
« Reply #4 on: November 29, 2010, 08:30:42 pm »
Uh-oh... I've never learned how to work with interrupts... I could never understand how to make them or set them up. I've read some tutorials, but it isn't working for me...

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Battery Level
« Reply #5 on: November 29, 2010, 08:34:27 pm »
Sig wipe!

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Battery Level
« Reply #6 on: November 29, 2010, 08:36:54 pm »
I believe it already exists:
http://www.ticalc.org/archives/files/fileinfo/415/41559.html
That one uses the B_Call which is what I am trying to avoid...

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Battery Level
« Reply #7 on: November 29, 2010, 08:37:26 pm »
Something tells me that that program uses the OS bcall. If it did otherwise its author would most likely have stated.
Xeda wants an OS-independent one for some unknown reason ;)
Edit: ninja'd
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Battery Level
« Reply #8 on: November 29, 2010, 08:41:32 pm »
Oh, I am working on that app and the program itself with all the calls (even the unused ones) is only about 2000 bytes of code. I figured I could add some more padding to the code and make it get a little closer to using the full 16384 bytes :D. I have been trying to make it independent of OS calls to make it a little faster and so that I can make the calls fit my needs.

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Battery Level
« Reply #9 on: November 29, 2010, 08:43:19 pm »
Ah, okay, that makes sense. Have you duplicated the font routines yet? ;D
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Battery Level
« Reply #10 on: November 29, 2010, 08:44:09 pm »
Nope :D I will be working on that one sometime, but examples would be cool.

SirCmpwn

  • Guest
Re: Battery Level
« Reply #11 on: November 29, 2010, 09:57:21 pm »
You can have the KnightOS font code, if you want.  Look at font.asm and text.asm in http://knightos.sourceforge.net

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Battery Level
« Reply #12 on: November 29, 2010, 10:01:58 pm »
Sweet, thanks!. I will look at that for sure!

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: Battery Level
« Reply #13 on: November 29, 2010, 11:06:01 pm »
Xeda, your best bet is to just go disassemble the bcall yourself because I don't think there is anyone who actually understands how it works.

Go into calcsys>Hex editor. Then switch to page 7b, 3b, or 1b respective to calcs. Goto 5221. Goto the address you are now looking at (address followed by page number). And have fun. You basically just did a manual bcall. :D
« Last Edit: November 29, 2010, 11:06:50 pm by thepenguin77 »
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: Battery Level
« Reply #14 on: November 29, 2010, 11:07:18 pm »
How do I switch the flash page in CalcSys? I never knew I could do that...