Omnimaga
Omnimaga => News => Topic started by: SirCmpwn on January 08, 2011, 10:20:58 pm
-
Terminal v0.1b
(http://www.omnimaga.org/index.php?action=dlattach;topic=6079.0;attach=5461)
I've just put the finishing touches on the beta of this. I've gotten the shell support working - you can now create your own programs that use the Terminal routines, and have them execute within the shell. You can perform I/O from the command line to provide a similar user experience to those using Windows or Linux within your own programs. I've also added a few other methods - Index Programs, Compare Strings, Starts With, and a few more. You can read all about it in the readme (which you should definately read if you are going to develop for Terminal). I've also included a demo program that you can run from within Terminal that uses the command line capabilities of Terminal.
This is also the first shell that supports both assembly and Axe, meaning that not only can assembly programmers access the routines, it also has support for developers to use it with Axe without any additional code modifications. I will eventually create an include file for assembly programmers, but all the details that are needed to use asm with Terminal are provided in the readme. As for Axe, prgmTERMINC provides all the functionality you need to use Terminal, and easily.
I've included a demo program for Axe developers. I welcome any and all feedback, feature requests, or questions. Enjoy, and let's see some cool programs!
(Download) (http://www.omnimaga.org/index.php?action=dlattach;topic=6079.0;attach=5459)
-
Amazing :D
Here is an idea, how about adding the ability to pass arguments to a program, and allow programs to call other programs? maybe just call them at the end or something, and pass arguments to that called program?
-
Well, for loading arguments, I'll put them in L1 on startup. For calling other programs, that shouldn't be too hard, but it could get crowded in RAM.
-
thought you'd do something like that :)
Are you going to do it the same way that C/C++ does it (argc argv)? Or store it in a different way?
Yeah it could get crowded, that's why I said possibly just running them right after instead
-
I think that it should be okay, so long as I change the way that archived programs are run. As for C/C++, probably not. I'll just put a zero delimited list of strings in L1 (SaveSScreen for assembly), ended with double zeros.
-
Ah ok, sounds good. Maybe you could add a number at the start designating how many arguements are being passed kind of like argc? Then again, that might make it harder to figure out things.
Can't wait to see this implemented :)
-
I could do that. So for arguments, I'll set it up at SaveSScreen (L1) like so (":" used for readability, not actually present in the program):
2:-A:0:-B:0:0
-
Hmm, that could work :)
-
Will do :) for now, L1/SaveSScreen contains the command last used before starting your program "EXEC PRGMNAME". I will also eventually add a Parse routine, which programs can use to parse a string as if it was entered into the command line.
-
Sounds good :)
http://eeems.pastebin.com/EfZGqnpc
^ z80 include file for developers
-
Thanks Eeems, I'll add that to the next beta, along with a ZDS version.
-
Sweet :)
(http://img.removedfromgame.com/imgs/0-wabbitemu7.gif)
.NOLIST
#INCLUDE "Terminal.inc"
.LIST
.org $9d93
.db $BB,$6D
call RestorePage
COUT(Hello)
SafeExit
Hello:
.db "Hello World!",0
EDIT: New Include file http://eeems.pastebin.com/htk4WmS8
-
Very nice! Glad to see asm support works out well.
Also, I've moved this to News.
-
:) Me too!
I think this is news worthy :P
Ok, a few command/function requests:- Command Alias's
- Commands
- CP (copy a file to the new name)
- UGrp (ungroup a backup)
- LG (list groups)
- Functions
- Call (calls a program from within another)
- Write (write a string of data into a program/appvar)
- Read (gets the pointer to a program/appvar's data in hl and puts the size in bc
- IMG (pretty much iputsprite)
- Update (iSafeCopy)
-
list]- Command Alias's
- Commands
- CP (copy a file to the new name)
- UGrp (ungroup a backup)
- LG (list groups)
- Functions
- Call (calls a program from within another)
- Write (write a string of data into a program/appvar)
- Read (gets the pointer to a program/appvar's data in hl and puts the size in bc
Alias's will be done.
CP and LG will be done, and LG-esque commands will be available for every data type (and have Index routines to go with). UGrp will be saved for later, but will be possible.
As for functions, I'll add Call through the Parse routine, through which you can use "EXEC PRGMNAME" from within your program. The rest of the functions are trivial in both Axe and Asm, so I'll leave them out. Also, for IMG and Update, I'll have Ion compatability eventually.
-
This is pretty cool!
Question:
So, if I make an Axe program using the subprograms provided, would that mean I could compile and run programs and display correctly even without the app?
Feature requests:
In addition to the ability to list all programs, what about the ability to list and run/display/archive/unarchive/delete/make (pick appropriate verbs) all BASIC apps, appvars, picvars, strings, lists, variables, and groups?
And also, would it be possible to add subprograms that would allow you to do any of the above when coded into Axe?
It might help with things like saving and opening level data - let the user input in a name for the appvar and save to it, or use your search function to return a list of all appvars with the correct beginning sequence then display all the available appvars all with just 3 or 4 subprograms...
-
You need to run programs using these routines from the Terminal, although I will add a routine later to launch the Terminal.
I can look into all of those features as well.
-
Question:
So, if I make an Axe program using the subprograms provided, would that mean I could compile and run programs and display correctly even without the app?
Not if you use any of the given routines, this is like running programs made for DCS or ION etc.Feature requests:
In addition to the ability to list all programs, what about the ability to list and run/display/archive/unarchive/delete/make (pick appropriate verbs) all BASIC apps, appvars, picvars, strings, lists, variables, and groups?
I'm liking that idea too :)
EDIT: Wow, ninja'd!
EDIT2: Btw, same program I showed I also made with mimas, here is the source and the include I made
EDIT3: Oh, btw, calling ConsoleInput doesn't seem to be doing anything at least not when called with assembly... :(
EDIT4: Also attached is the fruit of my coding tonight :) A little poem for all you The Blue Platform fans have fun :D
-
I've added the CP command to copy one program to another, and the MV command to rename a program (both unfinished - the latter will be difficult). I will be adding MORE as well, and eventually removing the need to preface a program with EXEC. I've added the ClearConsole routine for Axe/Assembly developers. I'll look into why ConsoleInput isn't working from Asm, it certainly is working from Axe.
Eeems, very nice! Impressive, and more optimized once I release the update with ClearConsole. I'll also be changing the text routine, it will support \n, so you can use that for new lines as well.
As for ConsoleInput, it works fine. It uses the ">" to get input. It looks the same as the Terminal does. I'll eventually add a routine to provide a custom message at the input prompt.
-
Sounds great! :D
Yeah that would be helpful, my code is a mass of labels and COUT() right now x.x
When I tried a COUT() followed by a CIN() and then a COUT() nothing happened other then both the COUT()'s displayed and there was no input prompt at all.
I was also wondering if you could make a command to allow us to change the cursor location so we can output anywhere on the terminal :)
-
I could add the cursor change pretty easily. Axe users just have to set X and Y (I'll force that to be aligned later). For now, you can change the value at $89E4 (X) and $89E6 (Y).
I just tried your COUT/CIN/COUT and it worked fine for me.
-
I have an idea, not show Terminal in the list of programs, since well you're running it.
-
That is the source code. Terminal is an App. The source code displays in the listing on my emulator when I grabbed the screen shot.
-
http://eeems.pastebin.com/JtMTxFPU
^ new include file containing TCurX/Y and Argv (the location where CIN() stores its stuff ($86EC+56) )
You are right, it works now for some reason, but it wasn't before strangely...not sure why...
EDIT: New include file for mimas too :)
-
Will it support loading apps? :P
-
No. I also have created my own include file for ZDS, Tasm, and Mimas, and I'll be taking over the include maintentance. Thanks, Eeems!
-
No. I also have created my own include file for ZDS, Tasm, and Mimas, and I'll be taking over the include maintentance. Thanks, Eeems!
Ok, sounds good :) Can't wait to use the official one :P
-
Thanks, although I removed most of the macros :P I hate using macros for one-line operations.
-
Like safeexit cout and quit? they are really helpful
-
SafeExit, COUT, and Quit were left in.
-
Ah ok, then did you change the other ones back into equates? I was doing it that way to make code size smaller.
-
Yeah, I changed to equates.
-
oh :(
-
I think most people can afford an extra 5 letters, no? It leaves more room for optimization IMHO. And a custom include would not be difficult.
-
how could you optimize call $4094 more?
Yeah it wont. Maybe you could make some macros though for those beginners who want to use them?
EDIT: new version of my poem program btw
(http://img.removedfromgame.com/imgs/0-wabbitemu9.gif)
-
I can look into optimizing it, but it is pure Axe, so there's only so fast it can go...
I reccomend using "\n" in the next version for multiline couts.
-
Ok.
Yeah I will, just using the current code I am until you get the next version out so I can do multiline code :P
-
Yep. Any other requests? I've already added a few of your requests, still working on more. I'll post a new version before finishing them all, though.
Also, I'll be adding an Axe Bridge routine set, where Axe users can decrease program size by using Terminal's Axe routines instead of using them in-code, and where assembly users can call Axe routines. This will make grayscale on Terminal via assembly as trivial as it is on Axe.
-
Also, I'll be adding an Axe Bridge routine set, where Axe users can decrease program size by using Terminal's Axe routines instead of using them in-code, and where assembly users can call Axe routines. This will make grayscale on Terminal via assembly as trivial as it is on Axe.
Ooh, cool! How will this work? Will there be an AxeBridge compiler as well?
-
No, it will basically allow you to change your code from this:
Pt-Change(0,0,Pic1)
To this:
sub(PC,0,0,Pic1)
Which would remove the Pt-Change code from your executable and decrease the size dramatically.
Or assembly programmers could use:
call DispGraphGS
Which would call DispGraphrr
-
Ah, I see. Very cool. ;D Good luck. :)
-
Read my mind on that stuff SirCmpwn :P
-
nice! if i get my link cable back im going to put this on my calc!
-
I shall repeat a question: In the list of programs can it there be no 'Terminal', since well you're running it? It's just a simple feature request that I'd like. Do you agree?
-
No. Like I've said before, Terminal is only in the list because it is the source code. The source code was on the emulator when I screenie'd it. You shouldn't be seeing it when you run this on-calc.
-
No. Like I've said before, Terminal is only in the list because it is the source code. The source code was on the emulator when I screenie'd it. You shouldn't be seeing it when you run this on-calc.
:O Sorry, that's great :D
-
So this can do something similar to Windows batch files?
-
Eventually, yes. I'll add scripting.
-
Cool i like new languages :D
-
The scripting language will basically consist of a series of instructions that Terminal interprets, in order, like most console scripting languages.
-
I especially like languages like that. Super easy to learn.
-
Right, plus arguments and such.
-
New program for the beta :)
Converts the hex you input to the ascii equivalent on the calculator. Currently it can only do 1 character, I might add more later if people want.
(http://img.removedfromgame.com/imgs/1-wabbitemu10.gif)
Source is also attached
-
This is nice SirCmpwn, nice job. I also like the batch script idea, it would be pretty great :D
-
This is nice SirCmpwn, nice job. I also like the batch script idea, it would be pretty great :D
*Eeems
It's his program :P
-
Oh I was talking about Terminal, which you created. I just didn't see this topic until last night :P
Eeems program is nice too, though :P
-
Thanks :)
-
As you can probably imagine, I have dropped this project. I'll post the source code if I can find it, but the reason I made this was to demonstrate that it was possible to create shells using Axe, and to merge assembly and Axe. Terminal was a proof-of-concept that leads up to something I've been working on for several months. You'll get more details later, but I think you'll like it.
-
Sorry to hear, but I'm glad this lead to another interesting project. I can't wait to see it. :D