Building Your Own Shell

Submitted By: ClrDraw Date: December 13, 2013, 11:22:39 am Views: 248
Summary: This is a brief description of how to code a program like AlphaCS (http://www.omnimaga.org/index.php?action=downloads;sa=view;down=871) in Axe Parser.

Woohoo, my first tutorial!  ;D This is a collection of information I found useful when coding AlphaCS. I hope you find it useful and hope to see more people making Axe shells in the future because of this  :thumbsup:

Every shell needs a nice GUI, so the first step should be planning how you want the program to look. Do you want a list of programs? An array of icons? Do you want the user to type the name and have the program be selected automatically? These are all possible interfaces. Be sure to choose something that you can program easily enough that will also be user-friendly and quick to navigate. You also don't want to go overboard with animations and stuff that can take up space in your code and be frustrating to the user. Keep it simple and easy ;)

Next you need to actually code the GUI. To find the programs on the calculator by scratch, take a look at Squidgetx's VAT Tutorial. If you want to save time and still accomplish the same thing, look into jacobly's AMEMKIT or my own (now updated) SRCSORT. I recommend using SRCSORT if you are making a shell because it will find all programs on the calculator even if they are hidden and will return important information about the programs.

For this tutorial, n will be the pointer to the VAT location of the program.

Once you have a menu displaying your programs you must now decide what your shell will do. Every shell should be able to run programs. There are hex codes to run ASM and BASIC but there are no hex codes I know of to help you with DoorsCS or MirageOS programs. I recommend using zStaxe to help you with this. The only problem is it won't work unless zStart is installed.

To lock programs, take another look at the VAT Tutorial. Changing {n} to 6 will lock the program and changing {n} to five will unlock it. To archive programs, simply use the Archive L1 and Unarchive L1 commands with the name of the program in L1.
Code: [Select]
6->{n}

To hide programs, subtract 64 from the first letter of the program name. This is {n-7} in the VAT. To unhide, add 64.
Code: [Select]
{n-7}-64->{n-7}

To archive or unarchive simple use the commands from the catalog. If the program name is in L1, use:
Code: [Select]
Archive L1
Unarchive L1

If the program is in archive, you should unarchive it before editing the VAT (hiding and locking) and archive it again when your done. This will save your changes. If hide or lock a program but do not do this, it will be unhidden/unlocked when the RAM is cleared.

That's about all you need for a simple shell. But many shells have other features like battery status, free ram, free rom, sleep mode, etc. I found Zeda's Hex Codes very helpful for this. Just be sure to remove "C9" from the end of the codes because it will exit your program if you don't. Also use Asm(hex code here) instead of AsmPrgm since this is in Axe.

Rating: This article has not been rated yet.

Comments



Powered By SMF Articles by CreateAForum.com