Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: AngelFish on January 05, 2011, 11:07:51 pm

Title: Command line
Post by: AngelFish on January 05, 2011, 11:07:51 pm
This is an evolution of an old project of mine called TI-explorer. It's exactly what the name suggests: a calculator command line.

(http://img.removedfromgame.com/imgs/CMD line.gif)
Title: Re: Command line
Post by: Juju on January 05, 2011, 11:08:47 pm
Nice graphical command line :P

OMG I lost.
Title: Re: Command line
Post by: AngelFish on January 05, 2011, 11:19:26 pm
My calc lost too  :P
Title: Re: Command line
Post by: SirCmpwn on January 05, 2011, 11:29:56 pm
Nice!  You should take a look at my Terminal (http://ourl.ca/7064), it's a similar project.
Title: Re: Command line
Post by: AngelFish on January 05, 2011, 11:38:15 pm
How did you parse input? I'm trying to read the bytes typed, but that's kind of a pain.
Title: Re: Command line
Post by: SirCmpwn on January 05, 2011, 11:41:10 pm
The keyboard has a pattern: from Enter (9), as you move vertically, the numbers increase, and wrap around each row (almost).  Every eight vertical moves, you wrap around.  So, use getkey-11→K, and then {Str1+K} is the letter pressed, assuming Str1 is the following:
"WRMH**?[theta]VQLG**:ZUPKFC* YTOJEB**XSNIDA"
* is an invalid key, or one without a letter.
Title: Re: Command line
Post by: AngelFish on January 05, 2011, 11:43:27 pm
I meant how did you parse the text?  I use a lookup table to display characters, so it's not a problem for me to extract the codes.
Title: Re: Command line
Post by: SirCmpwn on January 05, 2011, 11:58:07 pm
Oh, I have two subroutines, CS (Compare Strings) and SW (Starts With), used like this:
sub(CS,[String1],[String2]
Which returns a 1 if they are equal, and a 2 if not.  I use this for no-arg commands.
sub(SW,[String1],[String2]
Returns a 1 if [String2] starts with [String1].  I use this for arg commands, like (I know this won't compile) sub(SW,"echo ",UserInput
Here's the code:
Code: [Select]
Lbl SW
If {r1}=0 or ({r2}=0
0
Return
End
While {r1}
If {r1}=/={r2}
0
Return
End
r1+1→r1
r2+1→r2
End
1
Return
Lbl CS
If {r1}=0
0
Return
End
While {r1} and {r2}
If {r1}=/={r2}
0
Return
End
r1+1→r1
r2+1→r2
End
If ({r1}=0 and ({r2}=/=0)) or ({r1}=/=0 and ({r2}=0
0
Else
1
End
Return
Title: Re: Command line
Post by: AngelFish on January 06, 2011, 12:49:24 am
Added a desktop background :P

(http://img.removedfromgame.com/imgs/CMD1.gif)
Title: Re: Command line
Post by: Eeems on January 06, 2011, 12:53:42 am
what's the mouse going to be for?
Are you going to include a flashing text cursor so you know where you are in the string?
Title: Re: Command line
Post by: AngelFish on January 06, 2011, 12:54:39 am
The mouse will be so that you can move the command window around [and hopefully select text]. I am planning on a cursor as well.
Title: Re: Command line
Post by: Eeems on January 06, 2011, 01:07:37 am
ah ok cool :)
Title: Re: Command line
Post by: DJ Omnimaga on January 06, 2011, 02:20:42 am
So basically this would not only be a command line, but also some sort of shell?
Title: Re: Command line
Post by: AngelFish on January 06, 2011, 02:29:00 am
If I ever decide to implement shell features, they'll be through Doors. It's just a command line for now.
Title: Re: Command line
Post by: DJ Omnimaga on January 06, 2011, 02:55:46 am
Ah ok. I was wondering because you mentionned being able to move the window around and stuff.
Title: Re: Command line
Post by: AngelFish on January 06, 2011, 02:57:58 am
I'm trying to replicate many of the features of a GUI with the command line interface. I even have Microsoft's Bliss in the background, courtesy of Runer:P

Of course, my command line is infinitely more awesome because it can lose The Game.
Title: Re: Command line
Post by: Munchor on January 06, 2011, 09:57:33 am
SirCmpwn, thanks for sharing the subroutine SW :D

Nice job Qwerty, I just don't think the space between letters is that necessary, can you later have a command to choose whether we want it or not? I'd be glad :)
Title: Re: Command line
Post by: AngelFish on January 06, 2011, 01:44:48 pm
The space between the letters is there because there's a bug in the text routine where the space character will erase part of the preceding character unless the spacing is that wide. I'm currently tracking it down.

Oh, I forgot to mention that this is running in 6MHz mode right now.


EDIT: The bug has mysteriously vanished after changing the character set.
Title: Re: Command line
Post by: SirCmpwn on January 06, 2011, 05:22:00 pm
SirCmpwn, thanks for sharing the subroutine SW :D

Certainly.
Title: Re: Command line
Post by: AngelFish on January 08, 2011, 10:44:54 pm
It's not as impressive as Terminal, but I'm working on it.

(http://img.removedfromgame.com/imgs/0-Powder.gif)
Title: Re: Command line
Post by: SirCmpwn on January 08, 2011, 10:46:07 pm
I like it!  It provides an almost GUI-esque interface, very nice!
Title: Re: Command line
Post by: Eeems on January 08, 2011, 10:49:08 pm
It's a lot more graphical then Terminal :p make it allow other programs to use it's graphics routines, like the mouse and you will start being able to compete with Terminal more :p
Title: Re: Command line
Post by: SirCmpwn on January 08, 2011, 10:50:36 pm
Terminal is functional, not pretty.  Yours is both.  I'm excited to see where this goes :)
Title: Re: Command line
Post by: AngelFish on January 08, 2011, 10:59:19 pm
It's a lot more graphical then Terminal :p make it allow other programs to use it's graphics routines, like the mouse and you will start being able to compete with Terminal more :p

The problem with that is that I'm absolutely destroying SafeRAM to handle all of the graphics stuff. I'm already using all six lists to handle everything. Programs would only have access to the upper half of each area and even then only with certain routines.
Title: Re: Command line
Post by: SirCmpwn on January 08, 2011, 11:00:43 pm
That could present an issue, but how I handle similar problems in Terminal is by starting a fresh Terminal unless the program specifies that it didn't do anything mean.
Title: Re: Command line
Post by: ztrumpet on January 08, 2011, 11:30:39 pm
This looks neat.  Good luck on it. :)
Title: Re: Command line
Post by: DJ Omnimaga on January 09, 2011, 08:55:43 pm
Looks nice Qwerty! :D
Title: Re: Command line
Post by: AngelFish on January 12, 2011, 12:18:29 pm
After several dozen RAM clears, discovering how to draw The Matrix on-calc (followed by a RAM clear), destroying a few hooks on my calculator, and generally messing things up, the parser is finally understanding the control character, determining the correct number of arguments, and computing the hash of the input commands, which means that I just have to get it to read the command lookup table properly. I've also fixed a few bugs in the input routine which would cause the calculator to crash if you used backspace more than four times. ;D
Title: Re: Command line
Post by: Munchor on January 12, 2011, 12:23:34 pm
After several dozen RAM clears, discovering how to draw The Matrix on-calc (followed by a RAM clear), destroying a few hooks on my calculator, and generally messing things up, the parser is finally understanding the control character, determining the correct number of arguments, and computing the hash of the input commands, which means that I just have to get it to read the command lookup table properly. I've also fixed a few bugs in the input routine which would cause the calculator to crash if you used backspace more than four times. ;D

Nice work, the reason why I would never attempt such a project is getting the input string, so nice job!
Title: Re: Command line
Post by: AngelFish on January 12, 2011, 12:25:15 pm
It's kind of a pain to get the input string, because the Axe Input command won't work for this program. That's half my code right there.
Title: Re: Command line
Post by: Munchor on January 12, 2011, 12:26:16 pm
It's kind of a pain to get the input string, because the Axe Input command won't work for this program. That's half my code right there.

So you created your own engine for getting text, that's great!
Title: Re: Command line
Post by: DJ Omnimaga on January 17, 2011, 02:28:26 pm
how to draw The Matrix on-calc (followed by a RAM clear)
Hehe I had that happen often back in the days, especially with the equ>string bug. XD

Anyway nice to see this coming along pretty well :)
Title: Re: Command line
Post by: yunhua98 on January 17, 2011, 02:42:59 pm
Very nice!  But whys the program called powder?
Title: Re: Command line
Post by: Munchor on January 17, 2011, 02:44:28 pm
Very nice!  But whys the program called powder?

Isn't the orignal one called Power too?
Title: Re: Command line
Post by: AngelFish on January 17, 2011, 03:13:28 pm
Very nice!  But whys the program called powder?

Because I'm using it to develop the routines for my port of Powder. That's what the greyscale mouse is about  ;)
Title: Re: Command line
Post by: AngelFish on April 04, 2011, 11:20:35 pm
Dead.
Title: Re: Command line
Post by: Eeems on April 05, 2011, 12:29:47 am
Awww :(
That's too bad :(