Recently I've been working on a VT100 emulator for the CE. I've connected it to my computer using my serial library and two serial adapters to record the above demo. Currently, it can take user input of letters, numbers, symbols, arrow keys, "ctrl" keys (e.g. ^C), and the delete key, send said data to a serial device, receive data from a serial device, print ASCII characters, and parse ESC and CSI escape sequences and handle the most commonly used ones.
I still need to implement the remaining CSI sequences, handle the G0 and G1 character sets properly, support graphics attributes / colors, add proper cursors, and add a way to input the Tab and Backspace keys, as well as some other stuff I'm probably forgetting.

The code is available on my GitHub, though it won't work properly without a fix that I made for usbdrvce which I will add to the toolchain soon.
I am DrDnar and I approve of this use of FontLibC.
Nice work! Keep it up
Telnet83 rides again!

This seems useful to the point that I might actually consider using it if I needed a portable terminal emulator (if I owned a CE Razz).
I've been putting off posting in this thread, but I have to say that it is looking pretty polished so far. I wonder what the speed would be like if you tried something like this: https://opensource.com/article/18/12/linux-toy-youtube-dl

Keep up the nice work! Glad to see that the usbdrvce libraries are working well (kudos to jacobly!)
I've implemented 256-color mode.

A few other SGR attributes such as bold and underline are tracked, but only foreground and background color, bold text, and inverse graphics currently work.
I also have some code to convert 24-bit true color to the nearest 24-value greyscale or 216-value RGB color as appropriate, though it's not working at the moment.

After finishing that, I plan on improving the documentation, cleaning up the code, implementing a few more common CSI sequences, then fixing srldrvce to automatically detect device type (currently it assumes everything is a FTDI232).

I also should probably include a menu to allow you to change settings rather than having them baked in at compile-time or loaded from an appvar that has no editor of any kind. I really don't feel like doing this at the moment, so if anyone would be interested in helping with that please let me know.

I've also added an echo mode that takes all input and loops it back to the terminal. You can enter escape sequences in this mode if you really want to by pressing F1 and [ at the same time, when 2nd mode but not alpha mode is on.

I've also included a font called TomThumb that's 4px wide, though because of the aforementioned lack of a functional menu it is hard to switch to. You can switch to it by changing the default font pack name and then deleting the settings appvar, or editing the settings appvar using an ICE program or an editor on a computer. The main benefit of a 4px-wide font is that you can fit all of the VT100's 80 columns on-screen at the same time, which improves compatibility. The downside is that the font is a bit hard to read, as it is monochrome and only 6 pixels tall.
Whoa!! so your telling me that you connected you calc to your pc. and you can use linux based terminal on it!!

does it actual get the computer username and type of computer? hopeful it can run gui application later on.
I've still been working on this occasionally, I just haven't really added any features individually significant enough to warrant a post since then.

I've fixed several of the issues with srldrvce that made the terminal not particularly useful, and it now should properly support Windows and a few device types without crashing.

Back in January of last year, I switched everything to redraw every frame. This made things like partial scrolling significantly easier to implement but made the terminal significantly less responsive. A few days ago I ditched that and switched to a system where I move the LCD base around VRAM to scroll the display. This means that scrolling is almost instant, except when I run out of VRAM and have to move everything on screen back to the top. I tried using hardware scrolling to avoid this copy, but because the LCD is sideways, the vertical scrolling is actually horizontal.

Moving the LCD base around is extremely fast compared to the old methods - it was able to display /usr/share/dict/words, which contains 102401 lines and 972398 bytes, in 344 seconds, for about 298 lines or 2826 characters per second.

I was able to use the hardware cursor to invert the character the cursor is over, which is pretty neat but unfortunately doesn't show up properly in the CEmu version I'm using. This makes it easy for me to efficiently blink the cursor without having to worry about drawing and undrawing it.

I added a keyboard shortcut (F1 + F2) to send a stty command with the correct number of rows and columns.

I also did the usual refactoring, and it now builds with convimg instead of convpng. At least, it would, if there weren't a bug in the current version of convimg that prevents the palette from being read.



Since I guess I missed this when it was originally posted, I might as well necro-reply:
Alvajoy123 wrote:
Whoa!! so your telling me that you connected you calc to your pc. and you can use linux based terminal on it!!

does it actual get the computer username and type of computer? hopeful it can run gui application later on.

This project is a terminal emulator, which basically means that it reads data from serial and displays it to a user, and reads user input to send to serial. The "linux based terminal" you're referring to is actually the bash shell, which is running on the computer, not the calculator. Normally, when you open a terminal on a Linux computer, you're starting a terminal emulator, which is connected via a virtual serial device to a bash process. In this case, though, it's using an actual serial device instead, which is connected to Terminal CE.

So, it really doesn't do anything but display data a computer sends to it. If you connect it to a Windows computer, you'll get a cmd shell; if you connect it to Linux computer, you get a bash shell. If you connect it to an Arduino, you'll get whatever the Arduino sends to the serial port; if you connect it to the serial monitor in the Arduino IDE, it will display whatever you send. It doesn't get the username and type of computer - it's just displaying the text that bash sent to it, which (as I have it configured) happens to include the username and hostname.

While it would be neat to run GUI applications, that's not really what a terminal emulator is. I'm sure you could set up an X server or a client for some sort of remote desktop protocol using usbdrvce, but that would be an entirely separate project.
This project has come up multiple times over the past few days for some reason, so I decided to work on it a bit more (despite really not having the time to do so at the moment, 0x5). It now supports the WIP srldrvce rewrite, and I also refactored the previously very messy main.c and input.c files. I also changed it so that it only recalculates the cursor position in pixels after it's finished receiving bytes from serial, rather than doing so for every single character that it draws to the screen, which should further increase the speed.

Since the last update in the thread, I also removed the convimg dependency, since it was really just turning an image into a palette, and GitHub user bicknrown submitted a PR which migrated from convhex to convbin. Contributions are welcome, if anyone reading this ends up using it and wants to add or fix something.
We were discussing backspaces in SAX today and I discovered that they were broken in Terminal CE, and not actually bound to the inputs I thought they were. So, I cleaned up the keymap representation using macros to make it a bit more readable.

I also changed the keymap slightly to better match the one used by the Python app. If anyone has any feedback on the new keymap, I'd love to hear it - I'm particularly curious about how backspace and delete should be handled; right now I have backspace bound to mode and delete bound to del.
Got kinda annoyed that I couldn't just hold the arrow keys or delete, so I added key repeat. Both the initial delay and the repeat rate are configurable, though you'll need convbin and a hex editor to configure them at the moment, as the menu still doesn't work.

I also ended up completely rewriting how the keypad input system works again, oops.

In other news (that really isn't that unrelated), I've fixed every bug I'm aware of in srldrvce-rewrite, so it's probably close to release-ready.

EDIT: almost forgot that y'all don't comment on anything without eye candy, 0x5:
commandblockguy wrote:

Oh God, the font looks so small on the CE...
That's TomThumb, the smaller of the two fonts I'm using for testing. It's tiny so that it can fit a full 80 characters per line. Gohufont, which is shown in the previous screenshots, is much easier to read, but Neofetch doesn't like having that few columns.
I love the small font, then again I'm known for liking small fonts Smile.

Awesome work as always and great to see SRLDRVCE in use!
commandblockguy wrote:
Got kinda annoyed that I couldn't just hold the arrow keys or delete, so I added key repeat. Both the initial delay and the repeat rate are configurable, though you'll need convbin and a hex editor to configure them at the moment, as the menu still doesn't work.

I also ended up completely rewriting how the keypad input system works again, oops.

In other news (that really isn't that unrelated), I've fixed every bug I'm aware of in srldrvce-rewrite, so it's probably close to release-ready.

EDIT: almost forgot that y'all don't comment on anything without eye candy, 0x5:


Hi, I just recently bought TI84+CE second hand (less than a half offered by marketplace). So I try to compile some application for it. And I really interested in this and trying to compile with CE toolchain. But it seems doesn't work, asking for usbdrvce, do you have any suggestion which branch can I use to compile this terminal-ce?
Would it be easy to make a branch where the CE receives graphical input from a USB device (e.g. RPi) and displays it? I figure it would be possible to get upwards of 20fps. As above, it probably defeats the purpose of a terminal emulator, but it would be a cool and related project.
sJRw wrote:
Would it be easy to make a branch where the CE receives graphical input from a USB device (e.g. RPi) and displays it? I figure it would be possible to get upwards of 20fps. As above, it probably defeats the purpose of a terminal emulator, but it would be a cool and related project.

That's already been done with Calc2KeyCE by Dmalenke (probably as well as a few others that I'm forgetting, I know a couple people have done screen-mirroring things over USB), although I don't think the framerate is quite that high.
Neat project! Though, How do I actually use this? It just displays a blank screen with a cursor in the corner.
(P.S. I use Ubuntu 22.04 if that helps)
MammouzaV2 wrote:
Neat project! Though, How do I actually use this? It just displays a blank screen with a cursor in the corner.
(P.S. I use Ubuntu 22.04 if that helps)


The calculator should show up as a tty device like /dev/ttyACM0. You can either manually read from and write to it like a regular file, or start a login shell on it with sudo systemctl start getty@ttyACM0
commandblockguy wrote:
MammouzaV2 wrote:
Neat project! Though, How do I actually use this? It just displays a blank screen with a cursor in the corner.
(P.S. I use Ubuntu 22.04 if that helps)


The calculator should show up as a tty device like /dev/ttyACM0. You can either manually read from and write to it like a regular file, or start a login shell on it with sudo systemctl start getty@ttyACM0


Thanks! Very Happy
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement