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 ... 124 125 [126] 127 128 ... 135
1876
« on: March 05, 2010, 02:32:15 pm »
You can do that with interrupts, but I haven't implemented that yet. And even with interrupts, a few routines like "DispGraph" disable interrupts for the duration of the command during execution.
In the mean time, you can run the codes you want to test in big for loops so they take a measurable amount of time; maybe enough looping to last 5-10 seconds. That way if there is any difference, you can actually measure it with a stopwatch or clock.
1877
« on: March 05, 2010, 11:32:49 am »
lol, Axe Parser is still only about 9kb, half of the page! Probably because there's no graphics, level data, music, etc. which took up over half of Pyoro's 12kb. I am planning to add some graphics for menus and stuff, but I'm not expecting to use any more than 2 pages total by the end.
1878
« on: March 05, 2010, 11:25:31 am »
Yeah that's essentially what I'm doing. I have saftey mode, sandbox mode, and normal mode.
"Sandbox" is actually what I called safety before.
"Saftey" now means that all ram is archived, but ram is not cleared. Programs remain archived after execution and it returns to the homescreen (so you will notice glitches but everything is still archived). You'll have to manually unarchive everything you want to put back in RAM yourself (not recommended until a ram clear is performed).
"Normal" is obviously what has been done to date.
1879
« on: March 05, 2010, 11:14:54 am »
@trevmeister66 Eeems was correct about the string sizes. When you define data, like the data in your strings, that data is added to the end of the program, not to the RAM. Your compiled code will look like this:
<Hex code for all of program>06646464640664646464
While you CAN use this area to modify data, it is limited by the room it has in the program. A 1000 byte program can not use 2000 bytes of its own ram! If you want to use the free ram, then at the start of your program, you have to copy your data to the RAM using a for loop or something.
@omnimaga If you want to speed up the pixilation, you can draw 8x8 and 4x4 sprites instead of blocks of pixels using Pt-Off(). Its probobly even faster for the 2x2 case but I'm not quite sure about that. Also, in the next version, you will be able to use 15MHz mode so yeah, that can be 3 times faster.
1880
« on: March 04, 2010, 04:39:01 pm »
Well, I'll wait on that then.
Anyway, I need to propose some safety features and I'd like some feedback. Here is the idea. If you select a "safety mode" in the options, the following will occur: All data in ram is archived and an application variable is created to keep track of what it archived (The appvar is also archived). A dummy variable is also created and is kept in RAM. Next, after the program is compiled, it is executed within axe parser itself rather than coming back to the home screen. Once the program finishes, the ram is automatically cleared on the calculator so any corrupted data gets restored to the default. Next, the appvar gets unarchived and unarchives the variables on its list. So when the program quits, everything is back to normal.
Now, if the program crashed, and you need to pull the batteries, then the dummy variable gets deleted. That means that the next time you run axe, it will notify you that you have recovered from a crash and automatically unarchive the programs from the save list to return the calculator back to normal.
This seems like the perfect system to prevent crashes, but its a little too perfect. What I mean, is that if you start getting used to this, then if it corrupts the memory when safe mode is off, it will be very hard to find where the error is since the error would never be detectable in safety mode.
You might ask "Isn't it possible for axe to automatically detect when memory is corrupted?" but the problem is that I would need a copy of the entire original RAM to compare it before and after the program is run and that really isn't going to be possible. And even if it were possible, many assembly programmers often intentionally change non-safe areas of RAM to set flags, alter external variables, run self modifying code, etc.
I'm still going to add this mode anyway, but does anyone else have any other ideas about how to improve safety?
1881
« on: March 04, 2010, 04:14:23 pm »
A "NAME" is basically a static pointer to data, meaning that once you store some data, like a string or sprite, you can refer to that data again using it's name. Please remember, the variables and names have NOTHING to do with the variables that Basic programs use. Pic1 is just a NAME , it doesn't mean the picture that's in the calculator.
Have you ever programed in other languages? In practically all other languages, they don't come with predefined variables like "A" or "Str1" you have to declare them on your own. Like in C, if you want to create a variable to keep track of the time, you might have to do this:
int time = 20
The word "time" isn't referring to the system clock or some other actual quantity of time. Instead, you are defining it yourself to mean whatever you want! You could have called it "pizzas" if you want, since the meaning is simply the meaning you give to it.
Now in Axe Parser, since the calculator has to compile the code, but doesn't have a lot of memory to store long names, only short names are allowed. In fact, they have to be so short that you only get 1 type, 1 number and 1 letter/number. So if you had a string you want to name, you would do this:
"Hello World"->Str1
Just like "time" in the previous example, Str1 isn't the system Str1, its just a name and it could have been anything. If you want, you can do this:
"Hello World"->Pic1 Disp Pic1
And it will be exactly the same as if you called it Str1. There is no difference, its just a name. That's why I call it a NAME instead of separate PICS, STRINGS, and GDB variables, because they're all identical. Tacking on extra letters just makes a longer name, that's it.
1882
« on: March 03, 2010, 10:26:48 pm »
I think this has been mentioned before, but I wasn't sure how much it has been talked about, but what about reading/writing to/from AppVar's?
That will be done using GetCalc(). You can also get Variables, Lists, Strings, Ans, and other RAM variables and locations with this command and it will return a pointer to said object or zero if it doesn't exist. Therefore, you can also store to these objects. I'm nowhere near ready to support that command however so don't expect it soon.
1883
« on: March 03, 2010, 10:20:29 pm »
Supported Vars are A-Z Supported Names are Pic00-Pic9Z, Str00-Str9Z, and GDB00-GDB9Z (These can also be single numbers) Supported Labels are 00-ZZ (These can also be single letters/numbers)
By the way, there is a really annoying bug I am trying to fix right now where sometimes when you try to compile the first time, it throws a random error, but if you try again, it will compile correctly. Perhaps this is what happened?
1884
« on: March 03, 2010, 01:55:38 pm »
That's actually a really good idea to use some variables as variable pointers that are looked up by some routines. Maybe I will use the "u" "v" "w" variables for this since I'll probably need more than 1 of them. The only problem with this is that the variables have to be initialized before the program starts. Otherwise, it will just be something random. The parser could do it automatically, but then its just adding extra bytes in case you decide to change it again to anything but the default. It would be really annoying to start every program with L6->u to do any drawing and it might not make sense for beginners.
I could always make the variable location part of the self modifying code so it already starts initialized without using extra memory, but then that means it can never compile as an app. Although I'm still not sure how feasible it is to compile apps on-calc. Have other programmers been able to do it?
All those precompile headers use variables that have to be set somewhere. That means I would also need preprossesor variables which would be very difficult to add and I'm already running out of memory. There is no reason that the same program should compile differently on different calculators since only the executable would be distributed ideally.
1885
« on: March 02, 2010, 05:26:33 pm »
I think the above way you just wrote is better. Having a different program for each type of calculator is more annoying in my opinion than a single, insignificantly larger program that works for every calculator. I might add a command that returns the exact type of calculator and operating system version, not just 15MHz support.
1886
« on: March 02, 2010, 04:52:31 pm »
I've already added it, this is how it works. You will use the command "Full" found in the modes page and it stands for full speed mode. However, the command also returns a value. It will be false (zero) if the calculator does not support 15MHz and true (non-zero) if it does. So if you had a game you only wanted to be able to run on 15MHz calcs, you can do this:
:!If Full :Return :End
That would quit the game if the Full command failed. If you don't care about the type of calc, then you just use it normally like this:
:Full
The command "Normal" returns to regular speed and doesn't return a value since it can never fail.
1887
« on: March 02, 2010, 01:04:13 pm »
By the way, I added a 15MHz mode in the next version and its incredible! Why didn't I know about this when making pyoro? I could've had 8 level grayscale or something! But the downside is that if you use this mode, your games will run 3 times slower with an 83+ than with the other calculators so compatibility becomes an issue.
Maybe I should just make all math signed... it would only cut the maximum number limit in half from 65535 to 32767 which is still probably big enough for most applications. I think it will get confusing to have 2 sets of operators, especially for those not familiar with signed/unsigned math. It would only affect multiplication, division, modulus, and inequalities I think.
1888
« on: March 01, 2010, 10:58:53 pm »
Actually, I was thinking of changing the single quote to be an ascii character constant like 'A'. Not sure what will replace it yet, maybe the decimal point since I haven't used it yet and its a single key press instead of [2nd][angle][down][enter] I like that idea, but does it rule out floating point numbers?
Floats would be prefixed with "Float" so it wouldn't matter, but I don't plan on adding floats until near the end. Its really an advanced feature. And Eeems, anything like that I would implement would probably be with the regular if statement. I Don't think there is any reason to have preprocessor statements since that stuff is taken care of by options in the compiler. You don't need a preprocessor to handle different headers for instance since they are added automatically by the parser.
1889
« on: March 01, 2010, 09:05:53 pm »
Actually, I was thinking of changing the single quote to be an ascii character constant like 'A'. Not sure what will replace it yet, maybe the decimal point since I haven't used it yet and its a single key press instead of [2nd][angle][down][enter]
How about .NAMEHERE which is tells the compiler what to name the compiled program by default. The output name can be changed, but that will be what is already typed into the box when you first try to compile. It seems like a nuisance to have to add 4 characters .AXE that aren't going to be used at all, at least they should do something.
1890
« on: March 01, 2010, 06:08:10 pm »
While we're on the topic of headers, would you prefer large advanced headers or a simple one. What I mean by that, is that you can store other information in the header like what shell it should compile to, the name of the output file, some setting to optimize more for speed or size, and other stuff.
But that information doesn't have to be in the source file, you can enter all that data into Axe Parser itself and it will save your settings so you don't have to re-enter that information every time you compile.
I kind of prefer the later since the big headers will just be more to learn and increase source file sizes, but what do you all think about it?
Another thing I was thinking about is maybe instead of a header, you just have to end the program name with a "theta" or something. This doubles as both a header AND it prevents you from trying to output to a file with the same name. So if you're making a pacman game, then the source file would be "PACMANθ" and it would compile to "PACMAN" as the output. You would probably also have the option of naming it something else in case you need 8 letters or something.
Pages: 1 ... 124 125 [126] 127 128 ... 135
|