This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Messages - Quigibo
Pages: 1 ... 129 130 [131] 132 133 ... 135
1951
« on: February 15, 2010, 02:37:33 am »
I had to do that in Pyoro for the scores. The main reason was because regular font will not display correctly in the grayscale engine I made, and to make drawing as fast as possible in the least amount of memory, aligned 8x8 sprites are the way to go so I had to make my own number font to fit this size. It was 7x8 instead of the standard 5x7.
1952
« on: February 15, 2010, 01:09:30 am »
That's right, drawing 8x8 sprites is actually FASTER than drawing text. Not only because the routine is faster, but also because it is drawn to the buffer instead of directly to the screen. This is a paradigm you'll just have to get used to.
1953
« on: February 15, 2010, 12:22:29 am »
Data is data. String = Picture = List = Hex. It also equals executable code, but that part is my job You can use strings however you like. You would probably use decimal numbers or hex code for a tile map, but if its more convenient, then yes you can use a string as well.
1954
« on: February 14, 2010, 03:34:10 pm »
I make a bunch of fractal art. These are some of the wallpapers I've cycled through:
1955
« on: February 14, 2010, 03:22:01 pm »
Hmm, I was wondering, could Celtic III style program control be added? So like, calling another program, getting a list of programs, creating a program, deleting a program, etc. Also are you planning in adding string operators? Like sub() inString() and such?
Its too soon to tell. I'm not sure if I will have commands for program manipulation, but there will definitely be a way to create, save, and load application variables. String handling is going to be very different since all strings are constant length. It is very easy to get a substring if it ends at the normal ending, you can just do Disp Str1+A. For anything else, you can write your own subroutine to copy part of the string to a buffer and then display the buffer instead of the string. I can probably automate this but I would use a different command instead of sub(). Its still faster than the TI-BASIC sub() command.
1956
« on: February 14, 2010, 03:04:38 pm »
You are correct, the variables start uninitialized. Assume random garbage, not 0 or something predictable. They will be preserved between consecutive runs of the program, but running pretty much any other assembly program or app will scramble most or all of the values. So if you embed 2 different Axe programs into a Basic program, they can pass arguments to each other via preserved variables. But you cannot use the variables as any sort of long term storage.
In you example, the first time it runs, K was probably something random but upon exiting the program, it became 9. So when you run the program a second time, K is already 9 so the while loop is skipped.
1957
« on: February 13, 2010, 07:31:51 pm »
Good news! After a very gruesome debugging session (but not as brutal as I've had before), I've finally finished rewriting the entire symbol table handling. I think it works now, at least, it hasn't failed me yet and it runs past example programs fine. Definitely expect the next release on time, but I've got far too much to do before I can start adding sprite support, that will have to wait just a bit longer.
1958
« on: February 12, 2010, 09:21:00 pm »
Awesome! This is fascinating. I like the new method, and I don't mind the speed decrease. It sounds really cool. Does DelVar-ing a variable mean that there can be more than the 150, or not? This is cool!
Yes, if you delete a label, it is deleted from the symbol table and you can add more labels, including one with the same name as the one you deleted. You will probably be able to do the same thing with sprites in the future. So once you use the sprite/label and you don't need to reference it again, deleting it (you're really just deleting the name not the actual data) will allow you to free up more room for more sprites/labels.
1959
« on: February 12, 2010, 06:49:39 pm »
Unfortunately, do to the limitation of the calculator's available RAM, I am pretty much going to have to re-write the entire core of the program. No one has notice the problem yet because all the example programs are small and don't require a lot of user specified data. Once you start getting into medium and large sized programs, it will become a very big issue. I will share the method I am using, the method I am planning on using, and other methods I've thought of to to see if maybe someone has a better idea before I start rewriting it. THE OLD METHODThe old method was to do a single pass. Every time a label or name is encountered, it is added to the symbol table so that at the end of the programs, all the symbols are replaced. All declared data like strings, pictures, sprites, and lists are added to the end of the program as it is being written and also to the symbol table. The symbol table can only hold 150 entries and it really can't be expanded beyond that by much so that means you can only have 150 combined: - Labels
- Name declarations
- Name references
ALTERNATIVE METHOD #1Store all the data at the beginning of the program, that way once a variable is defined, you know exactly where the data is (since the expansion of the program doesn't push the data down further) so that way you don't need to add name references to the symbol table. The down side is that now the labels are going to be pushed down as data is added to the top so I need to add all the label references as well. Also, a 3 byte increase in program size. So 150 combined: - Labels
- Gotos
- Name declarations
ALTERNATIVE METHOD #2Same as alternative #1 except that the programmer is forced to define all variables at the beginning of the program instead of allowing variables to be defined within the program. That way, the labels don't get pushed down as the program is being created. Its kind of a slight inconvenience to the programmer though, and you would almost surely want to define the variables in a separate subprogram so that you don't have to keep scrolling all the way down to edit your code. 150 of: THE NEW METHOD2 passes are made. In the first pass, all name declarations are skipped and name references are left blank so that no data is being added to the end of the program. That way, only labels are kept track of the first pass. Then on the second pass, the opposite happens. All regular code is skipped, since it already was written in the first pass, but all data is written to the end where it won't ever be pushed further down, so I don't need to keep track of references. Disadvantage is that compiling will take about 1.5x longer and also I have to rewrite most of the core, but I think these leave a far more reasonable amount of variables: 150: AND 150: Don't forget, arrays of sprites count as 1 variable. So if you have 20 8x8 sprites each representing a number on a grid, you can just store all of them consecutively to Pic1 and then reference them as Pic1, Pic1+8, Pic1+16, etc. or even Pic1+A. Theoretically you can do this with strings too, but its a little harder since each string is probably a different size and you also have to take the terminating character into account.
1960
« on: February 12, 2010, 06:18:15 am »
Single line expressions can be executed by using the ternary. In your example, you could either do it with blocks like this:
If A=1 D->B End
or, because its a single expression, do this:
A=1?(D->B)
which is more compact than the regular TI basic. I don't think I will use the "Then" token at all, maybe I'll re-code it do something else in the future.
1961
« on: February 11, 2010, 12:42:33 am »
By the way, I am considering adding the ternary operator to take the burden off of quick if statements. The syntax will like this: statement ?( expression1 , expression2 ) If the statement is true, the expression becomes expression1, if it is false, it becomes expression2. So for instance: A<B?(A,B) Returns the minimum of A and B. It is equivalent in BASIC like this: :If A<B :A :Else :B :End So quick things like :If K=15 :A+1->A :End can be written like this: K=15?(A+1->A,)
1962
« on: February 11, 2010, 12:28:58 am »
So I've redone a lot of the code. You won't notice it, but it is much more organized on the inside now making it easier for me to add future features, and there's still a lot more that could be organized further. Anyway, I've got a to-do list a mile high right now. I still haven't actually made many of the mentioned corrections yet. Most of these things are very minor, but very important like parsing order of operations, rewriting some code so that I will be able to handle pointers, the for loop, etc.
Although I could get to doing sprites right away, they're very easy to do, I feel I should finish these corrections first so that everything will just work better. So either I will release the next version with sprites a little later than I anticipated, or I will release an intermediate version with some of the corrections and then the version after that will finish most of the corrections and include sprite handling.
btw, haven't made use of "not(" yet. Its on my list.
Oh and I'd like some feedback on this: Should I continue to exclusively use multiblock "If" statements? Or should I do what BASIC does and allow single or multiblock? The disadvantage is that then you would have to add the token "Then" after every multiblock statement. The compiled program will be the same either way, but what is more convenient, never needing the "Then", or sometimes not needing the "End"?
1963
« on: February 10, 2010, 12:14:53 am »
If you want 5 | 2, then you can do "5 or 2". If you want 5 || 2, then you can do "5≠0 or 2≠0" since this is basically what a Boolean "or" would do for you anyway. While I agree it could be made more efficient by a c style Boolean operator where the second argument may be skipped if it does not need to be checked, I don't think its worth it. You're almost always going to use "or" and "and" when comparing two expressions that already have some type of equality operator. I think the introduction of 2 different types of "or" will just confuse many programmers and make the coding more complicated since there would have to be some weird way to differentiate the two.
But now that I think about it, maybe I should make the regular "or" "and" "xor" the Boolean versions (like basic) and then add new commands for the bitwise operations. I'm thinking to use the plot symbols for this. The little dot will be "and", the little plus sign will be "or" and the little square will be "xor".
1964
« on: February 09, 2010, 08:16:10 pm »
The next version has already taken care of getting 'illegal' characters into strings using standard tokens.
Let me just explain signed vs unsigned so it doesn't confuse anyone. All the numbers are unsigned meaning they represent a number between 0 and 65535. Negative numbers act just like the regular numbers counted backwards instead of forwards, that is -1 is really 65535, -2 is really 65534, etc. This allows normal subtraction and addition with negative numbers that everyone is used to.
That's all well and good until you have a statement like -1<1. That would actually be false since 65535 is not less than 1. You can get around this by doing a 'signed comparison' which is what calc84maniac is talking about. The limitations with signed comparison is that your numbers can only be half the size, that is -32768 to 32767. So you would not be able to use the signed comparison (and get the correct answer) if the number is too large or too small.
This is an good idea to implement, but I think I would want it more intuitive than a question mark. Maybe something like -1<<1 would be better? Repeating any operation twice will do the signed version of the operation. So -4<<2 equals 1 and -2**8 would equal -16.
Oh and by the way, bitwise and Boolean or are identical, there is no reason to separate the 2.
1965
« on: February 08, 2010, 03:55:21 pm »
Submitting a work in progress should be approved similar to the way files are approved to the archives. That way, the ticalc.org staff can filter out the files that need filtering before they actually appear on the website. Ratings and reviews are probably a bad idea, I think that should be the purpose of providing a link to the project.
Pages: 1 ... 129 130 [131] 132 133 ... 135
|