I have started working on an application that will hopefully evolve to provide on-calc tutorials. Currently it has an example to show the user how to create a simple Hello World program. Here is a screenshot:
The "tutorials" are basically a sequence of keypresses that get simulated. As well, I have added in some commands to interact with the user so you can actually step the user through the process and give them notifications about what is going on. Once I add in a menu, I will release the app and source so that others can create tutorials and submit them for the official release.
My goal is to cover all of the commands and I will probably need a separate version to work with mathprint. As well as all of the commands, there will be tutorials for different aspects of programming and it will be possible to have tutorials outside the app (probably as appvars). The current command available for making a tutorial are:
| Key(val) | 1 byte
This is the main command. This tells the engine which key to
simulate. For example, to simulate [ENTER], use Key(skEnter).
| Delay(val) | 2 bytes
This sets the delay between simulated key presses. I find 30
to work well.
| Text(y,x,string) | 4 bytes + length of string
This is how you communicate to the user. This is like the
BASIC command, except it draws over whatever is on the LCD, not
just the graph screen. For the worried, this does not affect the
contents of the graph screen. So for example:
| WaitForKey(key) | 2 bytes
This waits for the user to press the appropriate key. When the
user presses the key, it will be registered. No other keys
respond while waiting.
| Repeat(key,num) | 3 bytes
This will simulate a key press a number of times in a row.
This is useful for navigating menus to get to an item.
| ExitTutor() | 1 byte
This ends the tutorial and normal OS stuff resumes.
These commands should be enough for most tasks. However, if
there are more commands for the adventurous:
| SetAns(num) |
This will set the "Ans" variable to the specified value. Note
that this whole program works with 1-byte values, 0 to 255.
| TestAnsEqu(num) |
If 'Ans' is equal to 'num', then 'Ans' is set to 1, else it
is set to 0.
| GetKey(num) |
Stores the user's keypress to Ans. This isn't as responsive
as it could be, yet, but it works.
| JumpIfAnsEqu(num,label) | 4 bytes
This will jump to a label if Ans=num. Note that the label must
be on the same flash page.
| PushAns() |
This pushes Ans onto a stack for later retrieval with
PopAns(). The stack is currently 240 bytes, but it may be
smaller in the future.
| PopAns() |
This removes the last value on the stack and stores it to
Hopefully I will make a lot of progress on this project, but I also have several other big projects that I am working on. I think that once menus are finished, the rest will be easy.