Author Topic: Routines  (Read 293327 times)

0 Members and 1 Guest are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Routines
« Reply #300 on: June 08, 2010, 01:45:44 am »
Aaah ok thanks for the info.

So wow, until tonight, I did not even know what my game "Eat Nethams" was reading from x.x

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Routines
« Reply #301 on: June 08, 2010, 01:46:47 am »
Quick Side Question: Is ROM the same thing as the Archive?
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

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 #302 on: June 08, 2010, 02:00:12 am »
I don't think so.  Archive is a type of ROM, but not vise versa.  The calculator is divided into "pages".  Have you ever wondered how the calculator can have hundreds of kilobytes of flash, but can only read values from 0-65535?  This is becasue you have to swap in pages which will temporarily replaces part of the rom with a page of flash in 16kb chunks (like for instance replacing over the location $4000 to $7FFF which is how applications run).  This is why its a little trickier to read from archive since you also have to keep track of page number and often you're replacing over parts of the ram or rom that are needed for other things.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: Routines
« Reply #303 on: June 08, 2010, 02:19:45 am »
Ah ok. I kind of understand, I think.
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

SirCmpwn

  • Guest
Re: Routines
« Reply #304 on: June 08, 2010, 08:33:06 am »
There are RAM pages, too.  It's all about managing your resources across several pages.  However, the only thing that ever really needs several pages of storage is an OS.  Massive RPGs don't usually even need that much on a calculator.

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Routines
« Reply #305 on: June 08, 2010, 11:44:08 am »
Unfortunately, not all calcs are equal when it comes to RAM. The 83+ has only 32KB, while the 83+SE and older 84+(SE) have 128KB. Regrettably, TI cut this down so that a newer 84+(SE) has only 48KB of RAM. But anyway, yes, paging makes things more difficult. Your running code is in the area $8000-$BFFF (more specifically from $9D95 to where the program ends), and the calculator's hardware is such that attempting to run code on page $80 ($40 for 83+), which is normally in the $C000-$FFFF area, causes a reset.
Btw, as for RPG's, I think I've seen ones over 16KB in size. I can't remember which ones, but, given that they require their components to be archived, yeah. What I don't know that I've seen are RPG's over one sector (64KB) in size.
"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 DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Routines
« Reply #306 on: June 08, 2010, 11:51:41 am »
There are a lot of RPGs over 16 KB, especially in BASIC. In ASM we got Joltima, Desolate (well, not that much of an RPG but still seen as one by some people) and Dying Eyes. On the 83 we had Narkemen too. They're all around 18 KB in one file. In BASIC, we got FFTOM, ROL, Illusiat series, a lot of which are so large they won't fit in RAM (Illusiat 13 is 135 KB and uses most of the calc archive)

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Routines
« Reply #307 on: June 08, 2010, 08:56:59 pm »
has anyone managed to create a substring routine? this has been bothering me

EDIT: made a crude one. only will work for same length substrings for now, because that's all i need for now.

L is the length of your substring. in this example, it would be 4.
Code: [Select]
"YOURTEXTHERE->Str1
" ->Str2          // one space
For(Z,0,2
conj(L*Z+Str1,Str2,L
det(16-L)
Disp Str2,i
End
« Last Edit: June 08, 2010, 09:18:53 pm by nemo »


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 #308 on: June 08, 2010, 11:44:22 pm »
det is not a command that contributes anything to executable code.  It only tells the parser to allocate extra space to the end of the program.  You want to use the Fill command to fill memory with zeros.

If you want a sub string of Str1 starting at A that is B bytes long, you can do this:
Code: [Select]
:"Hello World"->Str1
:
:conj(Str1+A,L1,B)           ;Copy the part of the string you want to L1
:0->{L1+B}                   ;Add a null character to signify the end of the substring
:Disp L1                     ;Display the substring
« Last Edit: June 08, 2010, 11:49:31 pm by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Routines
« Reply #309 on: June 09, 2010, 12:20:27 am »
For people who wants to get the current RAM:

Code: [Select]
{e9828}r-{e9824}r
Source of information: BrandonW, Calc84maniac and Iambian in the following IRC logs:

Quote
[00:09:04] <@OmnomIRC> <calc84maniac> you could manually do the Free Ram check in Axe by subtracting two values in memory
[00:09:29] <+Iambian> calc84maniac: The calc has those two values specified?
[00:09:36] <+BrandonW> Free RAM is actually quite easy to calculate, the subtraction of the values at two RAM pointers.
[00:09:44] <+BrandonW> ...and calc84maniac beat me to it.
[00:09:48] <@DJ_Omni> really?
[00:09:52] <@DJ_Omni> that would be nice to know
[00:09:55] <+Iambian> I knew it involved two pointers.
[00:09:57] <@OmnomIRC> <calc84maniac> what was it, (OPS) and (FPS)?
[00:10:10] <+BrandonW> Can't remember exactly.
[00:10:14] <+BrandonW> One moment.
[00:10:16] <+Iambian> Oh. I was thinking about the long way around it.
[00:10:16] <+SpyBot45> New post by Magic Banana in Hey Guys! http://ourl.ca/6026/94063
[00:10:41] <+Iambian> But I know it's the end of the floating point stack and the end of the operator stack.
[00:10:47] <@DJ_Omni> so we had magic mushrooms
[00:10:48] <+BrandonW> Yes, (OPS)-(FPS).
[00:10:52] <@DJ_Omni> now we have magic bananas!
[00:10:58] <@DJ_Omni> mhmm
[00:11:00] <@rcfreak0> oO
[00:11:03] <@CoolioJaz> @Iambian i think so, yeah....
[00:11:10] <@DJ_Omni> are those located at specific memory addresses?
[00:11:20] <+Iambian> They are, since they're labeled.
[00:11:21] <@DJ_Omni> If they are, then Axe should be able to easily access them
[00:11:21] <+BrandonW> Yes, (9828h)-(9824h).
[00:11:27] <@DJ_Omni> aah ok thanks
[00:11:31] <@OmnomIRC> <calc84maniac> so in Axe, that would be
[00:11:57] <@OmnomIRC> <calc84maniac> {e9828}r-{e9824}r
[00:12:15] <@OmnomIRC> <calc84maniac> where "e" is the exponential one
[00:12:34] <@OmnomIRC> <calc84maniac> I guess I should call it "ee"?
[00:12:49] <+Iambian> So that's how you're gonna check for free RAM without resorting to hex codes
[00:13:19] <+Iambian> Nifty workaround.
« Last Edit: June 09, 2010, 12:20:49 am by DJ Omnimaga »

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: Routines
« Reply #310 on: June 09, 2010, 09:17:26 am »
Oh wow, that's actually very useful! Thanks to Brandon W, Calcmaniac and to DJ Omnimaga for posting this.

Offline Raylin

  • Godslayer
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1392
  • Rating: +83/-25
  • I am a certifiable squirrel ninja.
    • View Profile
    • Ray M. Perry
Re: Routines
« Reply #311 on: June 09, 2010, 11:00:09 am »
^++

Agreed and seconded.
Bug me about my book.

Sarah: TI-83 Plus Silver Edition [OS 1.19]
Cassie: TI-86 [OS 1.XX]
Elizabeth: TI-81 [OS 1.XX]
Jehuty: TI-83 Plus Silver Edition [OS 1.19]
Tesla: CASIO Prizm







Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Routines
« Reply #312 on: June 09, 2010, 11:42:26 am »
Nice to know. The less hex we have to use, the better.
"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 ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Routines
« Reply #313 on: June 09, 2010, 06:03:14 pm »
That's really nice to know!  Thanks DJ, Calc84, Iambian, and BrandonW! ;D

SirCmpwn

  • Guest
Re: Routines
« Reply #314 on: June 09, 2010, 07:46:04 pm »
Very nice!  I will actually be using this, not for my contest entry, but for a different project.