Show Posts
|
|
Pages: 1 [2] 3 4 ... 114
|
|
16
|
Calculator Community / Axe Language / Re: Axe Q&A
|
on: 01 May, 2013, 23:21:44
|
|
I would advise fully reading through the Documentation.pdf file included in Axe releases, for starters. It's far from a total guidebook, but it covers a lot of the basics and walks through code examples for common tasks.
|
|
|
|
|
17
|
Calculator Community / Axe Language / Re: Axe Q&A
|
on: 01 May, 2013, 09:36:08
|
|
Axe includes data in programs in the same order you enter it. What this means is that if you enter the data for 19 sprites contiguously, they will end up in the compiled program in that same order with no gaps between their data. Knowing that each monochrome 8x8 sprite is 8 bytes large, each consecutive sprite must then be exactly 8 bytes in memory after the one before it. So you can access the Ith sprite (0-indexed) with I*8+Pic00.
|
|
|
|
|
18
|
Calculator Community / Axe Language / Re: question for searching
|
on: 01 May, 2013, 00:32:28
|
|
Axe is not assembly, just like C is not assembly. And Axe doesn't natively support things like hooks for a couple of reasons. Hooks don't really interface with languages other than assembly well, because it's common for inputs/outputs to be in specific CPU registers, or even flags. And different hooks have different inputs/outputs, so it's not really easy to handle them all. Also, because most hooks deal with core OS functionalities, it's common that the hook needs to use OS constant definitions, which are readily available to assembly programmers, but not Axe programmers. And this one isn't a deal-breaker, but generally hooks should be fast; a slow hook can really bog down a calculator. Assembly code can be made to be far faster than Axe, and I don't want to encourage the production of bulky and slow hooks.
tl;dr Hooks are best left to assembly, in my opinion.
|
|
|
|
|
20
|
Calculator Community / TI Z80 Calculator Projects / Re: zStart - an app that runs on ram clears
|
on: 30 April, 2013, 03:21:14
|
Stuff I intend on fixing later: I found another bug with Axe compilation. Unlike Axe, zStart doesn't check whether a program is compilable or not, so you can accidentally compile another source file (e. g. a file with subroutines etc.) which is not meant to be compiled as the main program by Axe. It causes Axe to crash or compile another program (like the one directly above or below (?) in the program list). Of course you can avoid this by not doing the On + Sto-> in the wrong place but it happened multiple times when I didn't watch out.
I believe I've fixed this problem from the Axe end for Axe 1.2.2.
|
|
|
|
|
22
|
Calculator Community / Axe Language / Re: question for searching
|
on: 29 April, 2013, 20:00:25
|
The first issue I see is the omitted closing parenthesis after GetCalc( on the first line. Unlike in TI-BASIC, a store operation in Axe does not automatically close all unmatched parentheses before it, so that code would really be storing the pointer to the raw string data "Str1" rather than the result of calling GetCalc("Str1"). Close your parenthesis in Axe! The other issue is that the length() command is for finding the length of null-terminated strings of data. But OS variables that can have a variable size, including OS strings, don't use null termination to mark their size, but instead have the size stored as a 2-byte header immediately before the data. So if you have a pointer to an OS program, appvar, picture, equation, or string in the variable A, then the size of the data (not including the 2-byte size header) can be accessed with {A-2}r.' With those two changes applied to your code, hopefully this should work: 1 2 3 4 5 6 7 8
| :GetCalc("Str1")→A :{A-2}ʳ→L :If GetCalc("prgmASDF",L)→B :Copy(A,B,L) :Else :Disp "Creation error" :End
|
|
|
|
|
|
24
|
Calculator Community / Axe Language / Re: question for searching
|
on: 25 April, 2013, 07:03:56
|
|
In the code I gave, you'd replace that comment with your code to check for the pattern you want. How you check for the pattern is up to you, and depends on the pattern you want to match. For whatever pattern you're checking, you'll probably end up using multiple instances {n+Y₀} to read the nth byte (0-indexed) of the program and compare the value to the expected byte/range.
|
|
|
|
|
25
|
Calculator Community / Axe Language / Re: question for searching
|
on: 25 April, 2013, 04:47:33
|
|
Are you asking what those tokens are? The ʳ and ° are both found in the ANGLE menu, accessible from 2nd + APPS. And you probably knew these already, but just to be complete, dim( is accessible from 2nd + STAT + right, and Y₀ is accessible from VARS + right + 1/enter. Everything else on that line can be found directly on the keypad.
But what does the comment from the line below it have to do with it? That comment is a placeholder saying that you want to replace it with the actual logic of testing if programs match your pattern and processing them accordingly.
|
|
|
|
|
26
|
Calculator Community / Other Calculator Discussion and News / Re: Essential Calculator Programs
|
on: 22 April, 2013, 04:52:07
|
|
Why do people keep saying that 2.55 is buggy? In my experience, 2.55 is no buggier than 2.43, bugs are just caused by a few old programs that made bad assumptions. With MathPrint turned off, I have found extremely few things that don't work fine in OS 2.55. The only thing I can think of off the top of my head is that Omnicalc's entries menu doesn't work, but you don't need that anyways because of the built-in command history scrollability on the home screen.
If you know of any bad OS 2.53/2.55 bugs, feel free to share, though. They may be there, I just haven't found them in my experience, so I'm quite happy with the new MP OSes.
|
|
|
|
|
27
|
Calculator Community / Other Calculator Discussion and News / Re: TI-83+/84+ OS glitches compilation thread (all OSes)
|
on: 21 April, 2013, 16:26:59
|
|
Do Basic Builder applications call B_CALL(_ReloadAppEntryVecs) before exiting? If not, I don't think it's an OS bug as much of a Basic Builder bug for not following TI's application exit protocol. I think it was recently noticed in a thread on Cemetech that one of the effects of not calling this (at least on MP OSes) is that the appRunning flag is left set when the application exits and small issues arise, so whether or not you mess around with context vectors and you think you actually need the call, it seems that this call may be important.
|
|
|
|
|
28
|
Calculator Community / Axe Language / Re: question for searching
|
on: 20 April, 2013, 20:07:22
|
I believe you want to search for all programs on the calculator that start with some certain pattern? Once you've located a program, checking for a certain pattern should be fairly straightforward: just compare the first few bytes read from the program to values/ranges you want them to be in. But the key to being able to do what you want is being able to search through the VAT, a list of all variables on the calculator, to find programs. Probably the easiest way to do this is with MemKit, an Axiom included in the Tools folder in the Axe release. How to include the Axiom and use the individual commands is explained fairly well in the readme, so I'll get right to generally how you want to use MemKit. You generally want to loop through all items in the VAT in a style like this: 1 2 3 4 5 6 7 8 9 10
| Load() .Start at beginning of VAT While 1 .Start loop If dim()=5 .If this VAT entry is a program .The next line is a little hacky and will not work in versions lower than 1.2.1 .This manually sets up Y₀ to be used to access this variable (dim()ʳʳ→{°Y₀+2}??dim()ʳ,dim()ʳ-16384)→{°Y₀}ʳ .Here you perform whatever checks to see if the variable fits your pattern and act accordingly End End!If Next() .Continue loop if there are more VAT entries to process
|
|
|
|
|
|
30
|
Calculator Community / Axe Language / Re: Axe Q&A
|
on: 11 April, 2013, 20:29:56
|
There's a pretty ingenious (at least I thought so when I learned it years ago) way to handle this. Keep track of the total number of bullets with some variable. When you add a bullet, increase the bullet total and put the new bullet at the end of the list of bullets, which should be at the memory location old_total*6+list_start. This all probably seems pretty standard. But the trick is in bullet removal: decrease the bullet total and move the data for the last bullet in the list into the position of the bullet that was just removed. In Axe, the code for that might look something like this: 1 2 3 4 5 6
| .Deletes the bullet at index r₁ (0-indexed) .Updates bullet total N Lbl Del Copy(N--*6+<list_start>,r₁*6+<list_start>,6) Return
|
|
|
|
|
|
|