Ah, Axe lets you do stuff like that? I guess it makes sense; that's the same type of division you would do in an ASM program divided among multiple files. Good to know.
_player1537 wrote:
I know you said that this wasn't your goal right now, but if you are going to do this so you can split programs up into multiple files, there is a better way to do so. I forget what the command is because it is a post-.3 command, but there is something that will include another source file's code inline with your current code. So you could have a source program that has the declarations of all of your data, and one for all of your main code, and one for your methods, as an example.

Yes, but that only works for Axe source files. It would be preferable to be able to find a way to incorporate timer functionality into Axe. The reason I needed to put BASIC code in was simply because of the calling program's timer functionality.

However, there are some issues with the way I'm doing things at the moment (in the Axe port, link below):

  • It fails to display the numbers correctly:

    Code:
    :For(U,1,length(L1
    :Output((U-1),1,{L1+U}►Frac
    :End

  • I think I need a real timer function and I'm not sure how to display the seconds/minutes.

    Code:
    :While S<10
    :getKey→K
    :.I need a better thing than Pause here
    :.Pause keeps me from escaping easily
    :.Maybe some sort of timer?
    :Pause 4500
    :S+1→S
    :Output(15,6,S►Dec
    :End


My code for the Axe port up until now: http://sc.cemetech.net/?xpi=bfb010f1c517eebc7fb3274f06b3f89b <-- Please help with optimizations and fixing broken code, if you can.
Quote:

It fails to display the numbers correctly:

Code:
:For(U,1,length(L1
:Output((U-1),1,{L1+U}►Frac
:End


Change ►Frac to ►Dec.
Quote:

Code:
:While S<10
:getKey→K
:.I need a better thing than Pause here
:.Pause keeps me from escaping easily
:.Maybe some sort of timer?
:Pause 4500
:S+1→S
:Output(15,6,S►Dec
:End

Try this:

Code:

:While S<10
:.Change the 4500 in the next line to change the delay
:Repeat (K != 0) or (O = 4500)
:getKey→K
:O+1→O
:End
:S+1→S
:Output(15,6,S►Dec
:End
Changing >Frac to >Dec will (As Techno just found out) display spaces if the number doesn't use up all 5 digits that can be displayed with bcall DispHL. What you want, I think, is something like: Disp A+48>Frac, where A is a number between 0 and 9. I don't have time to look at the second bit of code, though it looks like it should work. Also note that Pause 4500 will pause for about 4 seconds (I think), whereas that loop will last longer than 4 seconds, if it works in the first place.



Code:
:While S<10
:.Change the 4500 in the next line to change the delay
:While (!getKey(15) And (O < 4500
:O+1→O
:End
:S+1→S
:Output(15,6,S+48►Frac
:End
_player1537 wrote:
Changing >Frac to >Dec will (As Techno just found out) display spaces if the number doesn't use up all 5 digits that can be displayed with bcall DispHL. What you want, I think, is something like: Disp A+48>Frac, where A is a number between 0 and 9. I don't have time to look at the second bit of code, though it looks like it should work. Also note that Pause 4500 will pause for about 4 seconds (I think), whereas that loop will last longer than 4 seconds, if it works in the first place.

Well, the documentation says that in full-speed mode, it will be about 1 second with 4500. (I'm trying to get a timer.) Thanks for the other part, though. Smile
In my opinion, you shouldn't use Axe to do timers that work with seconds or minutes. You should be using another language (Like TI Basic) for stuff like that. Axe is more focused around rapid game development, where the pauses just need to be relative to the current game speed.
_player1537 wrote:
In my opinion, you shouldn't use Axe to do timers that work with seconds or minutes. You should be using another language (Like TI Basic) for stuff like that. Axe is more focused around rapid game development, where the pauses just need to be relative to the current game speed.

I must agree, but this doesn't have to be exact. It's just a fake cell phone program; it has no absolute need to keep track of time correctly.
With asm, you could use the timers to wait for exactly a second if you wanted, assuming it's on an 83+SE or higher.
Will_W wrote:
With asm, you could use the timers to wait for exactly a second if you wanted, assuming it's on an 83+SE or higher.

What's the code for doing so?
You could use ports 45-48 for a timer.
http://www.michaelv.org/programs/calcs/rtc.txt
This limits you to using a TI 83+SE or higher, but it would be a cool learning experience Smile
*bump*

Okay, so we judged today and my own rubric almost betrayed me. Razz I won by 5 points (there were 75 points possible total). Anyway, I plan to continue this as a real project. I am open to any suggestions, and *am* going to get the core functionality programmed with BASIC. The only non-BASIC part of my program at this point is a battery-status-checking program. I believe I will give up on Axe for the most part, but I'm hoping to use either Axe or even z80 assembly so I could enable program writeback functionality (for the contacts/address book part of my project).

Sadly, no matter what I do, I'm limited to an 83+SE or higher or an 84+ or higher for timer functions. I'm going to keep it restricted to 84+ models for now, but will simply make another version for those who have 83+(SE)s relatively soon (without a timer).

Finally, if somebody believes that one way of inter-calc - in TI-BASIC (sorry, calcNET addicts and devs... Sad ) - communication is best (for "SMS"), please suggest that as well. Right now, it does, quite simply, nothing with communication, but I'd like to change that.

Again, please suggest features! I'm hoping to upload this to TI-Calc very soon (the phone programs on the site aren't very good, IMHO). Smile

If anybody would also like the images, I will upload them, but here are the programs:

SourceCoder Links:
Here are some minor updates to VZW:

http://sc.cemetech.net/?xpi=a430500b0f02066f0637b09c722c5778
VZW
KermMartian has just edited this program. The source code now reads:
BASIC Code wrote:
::DCS6
:"03E2041757F256372632063777F213E726B2441776B204178EB28C17AEB253E7
:AxesOff
:FnOff
:PlotsOff
:Lbl A
:ClrDraw
:RecallPic 4
:DispGraph
:Asm(prgmVZWBATRY
:If not(Ans
:Then
:For(X,87,91,2
:Pxl-Change(1,X
:Pxl-Change(2,X
:Pxl-Change(3,X
:End:End
:Repeat K
:getKey→K:End
:If K=45:Then
:Text(28,1,"Press clear again to turn off!
:For(X,28,33
:Pxl-Change(X,0
:End:Repeat K
:getKey→K
:End
:If K=45:Then
:ClrHome
:Disp "Goodbye!
:Output(2,1,"
:Return:End
:End
:If K=11 or K=12
:prgmVZWCNTCT
:If K=13
:prgmVZWMENU
:If K=14 or K=15
:prgmVZWSMS
:If K=41
:Then
:" →Str1
:prgmVZWCALL
:End
:Goto A
Generated by SourceCoder, © 2005-2011 Cemetech
This is an automatic post from SourceCoder 2. Report abuse to admin@cemetech.net . You can disable these posts by unchecking the "Post on Update" box in the file's permissions.
Also a random optimization I noticed in the calling program:


Code:
  :If Z≤9
  :Output(8,16,Z
  :If Z>9
  :Output(8,15,Z
can become:
Code:
:Output(8,15+(Z≤9),Z
KermMartian wrote:
Also a random optimization I noticed in the calling program:


Code:
  :If Z≤9
  :Output(8,16,Z
  :If Z>9
  :Output(8,15,Z
can become:
Code:
:Output(8,15+(Z≤9),Z


Thanks, Kerm! I've optimized some other things as well, actually, myself. I did NOT notice that at all! I'm curious if anybody knows something they would really like to see in a program like this; I have no ideas.
I think that making it have a contact information module brings this program from the realm of the moderately amusing short-lived joke to genuinely useful, so I'd probably look more at that particular area if I were you. Let me know if you'd like me to continue glancing through for various optimizations.
KermMartian wrote:
I think that making it have a contact information module brings this program from the realm of the moderately amusing short-lived joke to genuinely useful, so I'd probably look more at that particular area if I were you. Let me know if you'd like me to continue glancing through for various optimizations.

Yeah, I'm going to look into ways to implement contacts ASAP. I've updated VZWMENU & VZWTOOLS. I'm thinking I have most optimizations completed, but if anybody would like to quickly scan through and see if there are any more, that would be great. Smile Now, to learn Axe/ASM more in-depth and use program writeback (SirCmpwn's code if Axe)... actually, I'll likely use AppVars instead (SirCmpwn has code for that too!).
With the third-party hybrid BASIC libraries available in Doors CS from Celtic III, you can easily use AppVars in BASIC. Smile
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 2 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement