Author Topic: Routines  (Read 256735 times)

0 Members and 1 Guest are viewing this topic.

SirCmpwn

  • Guest
Re: Routines
« Reply #150 on: March 21, 2010, 06:55:21 pm »
Really, that's all?  Then why do Celtic III and xLib mess with Mirage so much?
I don't know about Celtic, but xLib and MirageOS both use AppBackupScreen, which means they aren't happy together.

Excellent routine SirCmpwn! ;D

Why thank you!

SirCmpwn

  • Guest
Re: Routines
« Reply #151 on: March 21, 2010, 07:01:11 pm »
Also, I just updated the conversion program.  If you want to use numbers, then follow these steps to enable them:
1) Open prgmAXEMIRAG for editing
2) Where it first stores to Str2 (lots of hex), add the following text to the beginning of the string:
30313233343536373839   (30-39)
3) In the next line, where it stores to Str3, add the following text to the beginning of the string:
0123456789

This will enable you to use numbers in the program description.  Follow this format to add any character you like - simply add the hex value to the beginning of Str2, and the actual value to the beginning of Str3.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2906
  • Rating: +469/-17
    • View Profile
    • TI-Boy CE
Re: Routines
« Reply #152 on: March 21, 2010, 07:35:02 pm »
Oh yeah, messing with CmdShadow should mess up shells, but that is not one of the Axe data areas.
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

_player1537

  • Guest
Re: Routines
« Reply #153 on: March 21, 2010, 10:46:59 pm »
Ok, I made a couple of routines for anyone who wants them, the first one is like TI-Basic's input command, the second one displays a number without the spaces.
Input:
Code: [Select]
:.Input
:0→F→B
:Repeat F
:0→K
:Repeat K
:Output(0,{E844B},'?'►Frac
:getKey→K=9→F
:End
:K-1/10→A
:4-A→A
:If A=1
:K^10-4*3+A→A
:End
:If A=2
:K^10-6*3+A→A
:End
:If A=3
:K-1^10-7*3+A→A
:End
:If K=33
:0→A
:End
:If K≠9
:B*10+A→B→A
:sub(A)
:End
:End
:Return
This is the second part, it is used in the Input routine.
Code: [Select]
:Lbl A
:[000000→Pic99
:A→{Pic99}r
:If {Pic99}r>9
:1→{Pic99+2
:End
:If {Pic99}r>99
:2→{Pic99+2
:End
:If {Pic99}r>999
:3→{Pic99+2
:End
:If {Pic99}r>9999
:4→{Pic99+2
:End
:For(A,0,{Pic99+2
:Output(1+{Pic99+2}-A,{E844B},{Pic99}r^10+48►Frac
:{Pic99}r/10→{Pic99}r
:End

SirCmpwn

  • Guest
Re: Routines
« Reply #154 on: March 22, 2010, 09:23:55 am »
Nice!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55931
  • Rating: +3153/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: Routines
« Reply #155 on: March 22, 2010, 02:14:07 pm »
Interesting, altough I don't really understand what you mean by numbers without the spaces.

_player1537

  • Guest
Re: Routines
« Reply #156 on: March 22, 2010, 04:35:47 pm »
ok, say you have the number 12.  when you use 'Disp 12>Dec' it will ouput ('.'==' '(space))
...12
but with my routine (the second one) it will output
12
with out those spaces.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55931
  • Rating: +3153/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: Routines
« Reply #157 on: March 22, 2010, 11:05:46 pm »
where does the "..." part of "...12" comes from? I'm even more confused now :/
« Last Edit: March 22, 2010, 11:06:15 pm by DJ Omnimaga »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Routines
« Reply #158 on: March 22, 2010, 11:15:06 pm »
Well try this code in Axe

Output(0,0,12>Dec

Even though you said to display it at 0,0, which is the top left hand corner, it still displays about 3 spaces to the right of that.  Why is this?  Because Axe displays every number with 5 digits #####.  The number you give it is pushed to the very right of these 5 digits ###12 and the whole 5 digits is displayed at your coordinates. Since there are some empty digits there will be some spaces before the numbers start.  His routine is an alternate way of displaying numbers that is more like the output form Basic that we are all familiar with.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55931
  • Rating: +3153/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: Routines
« Reply #159 on: March 23, 2010, 01:11:51 am »
Ooooh I see now! Weird x.x, altough I can understand why it does that. But yea I guess it makes that routine more useful then.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Routines
« Reply #160 on: March 23, 2010, 02:38:22 am »
Yeah I belive that Axe does it that way because there is a built in BCALL to display text, and it helps having ti write nasty and memory consuming code for text manipulation :P

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Routines
« Reply #161 on: March 23, 2010, 11:54:51 am »
Yeah, there is actually a bcall I can use in combination with some other code to display numbers left to right, but it would be slower and more memory.  You will be able to do it in the next version by using Text(X,Y,NUM>Dec) I think, but you have to make sure you specify the graph coordinates instead of the cursor coordinates.  But still, there are advantages to displaying numbers right aligned.  If you think about it, practically all scores in video games are displayed right aligned (but usually the spaces are extra zeros instead) and since Axe is mostly game oriented, it seems to fit well.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55931
  • Rating: +3153/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • DJ Omnimaga Music
Re: Routines
« Reply #162 on: March 23, 2010, 01:29:35 pm »
Yeah, this is an issue I have with TI-BASIC sometimes. I want my HPs to be right-aligned so it looks better, but doing so would require me to use a lot of boolean logic to check if HP is higher than 10, higher than 100, higher than 1000, etc

Offline LordConiupiter

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 339
  • Rating: +3/-0
  • Just one of the thousands of Axe-fans...
    • View Profile
Re: Routines
« Reply #163 on: March 23, 2010, 03:14:05 pm »
Ok, I made a couple of routines for anyone who wants them, the first one is like TI-Basic's input command, the second one displays a number without the spaces.
Input:
Code: [Select]
:.Input
:0→F→B
:Repeat F
:0→K
:Repeat K
:Output(0,{E844B},'?'►Frac
:getKey→K=9→F
:End
:K-1/10→A
:4-A→A
:If A=1
:K^10-4*3+A→A
:End
:If A=2
:K^10-6*3+A→A
:End
:If A=3
:K-1^10-7*3+A→A
:End
:If K=33
:0→A
:End
:If K≠9
:B*10+A→B→A
:sub(A)
:End
:End
:Return
This is the second part, it is used in the Input routine.
Code: [Select]
:Lbl A
:[000000→Pic99
:A→{Pic99}r
:If {Pic99}r>9
:1→{Pic99+2
:End
:If {Pic99}r>99
:2→{Pic99+2
:End
:If {Pic99}r>999
:3→{Pic99+2
:End
:If {Pic99}r>9999
:4→{Pic99+2
:End
:For(A,0,{Pic99+2
:Output(1+{Pic99+2}-A,{E844B},{Pic99}r^10+48►Frac
:{Pic99}r/10→{Pic99}r
:End


It's not working for me!
the r's are [2nd][Angle]->3:r ?
the E's are [2nd][EE] ?
further I just typed everything in my calc as you posted it, but at 26% I get a 'BAD SYMBOL' error...
can you please guess what could've gone be wrong?
« Last Edit: March 23, 2010, 03:27:03 pm by LordConiupiter »
everytime that I was down, you would always come around, and get my feedback on the ground. (modified part from 'Seasons in the sun')

No matter how many errors are bothering you, always try to stay rel-Axe!

The HoMM project will be resumed as soon Axe 1.0.0 will be released!
Projects:
Code: [Select]
HoMM:   [==--------]    Project 'resumed': I'm suffering overwhelming new ideas being popped up in my dreams :P
tiDE:   [----------]    Explored and understood the main part of the code: just started writing a Tokenizer.



password of the week: uvanapererubupa (Any pronunciation is the right one ;) )   :D click me, and you'll be raided :D

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Routines
« Reply #164 on: March 23, 2010, 03:19:49 pm »
Hmm... I don't see any syntax errors... Are you sure you copied it correctly?  And did you upgrade to the newest version?
___Axe_Parser___
Today the calculator, tomorrow the world!