Omnimaga

Calculator Community => Casio Calculators => Casio PRIZM => Topic started by: MPoupe on June 24, 2011, 03:39:22 am

Title: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: MPoupe on June 24, 2011, 03:39:22 am
Hello,
I would like to show you my first program for Casio fx cg. It is VT100-like terminal emulator, it has to be connected to the linux (or unix, bsd,...) machine supporting serial console. It is in very early stage, not all is functioning.

What works (somehow:-) ):
- shell prompt
- Midnight commander (mc -a -c), see image
- special attributes (try man ls), see image

What doesn't work:
- editors (I tried joe and internal editor from mc), there are some escape sequences to be implemented
- many other things, you will find them :-)

After you connect (and login), please tell the server the terminal resolution (terminal is 64x27, default settings (80x24) would wrap lines).
On linux execute :
# stty rows 27 columns 64

Martin
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: Juju on June 24, 2011, 03:47:23 am
Awesome :D
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: Munchor on June 24, 2011, 04:00:22 am
Oh, a shell for the PRIZM, very nice :D
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: AngelFish on June 24, 2011, 04:05:08 am
I don't think this is a shell.
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: Jim Bauwens on June 24, 2011, 04:08:45 am
Ok, I really want one now! Imagine hooking this up to embedded devices and the like....
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: SimonLothar on June 24, 2011, 04:25:47 am
I would like to show you my first program for Casio fx cg. It is VT100-like terminal emulator...
Very well done. Congrats!
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: MPoupe on June 24, 2011, 05:14:00 am
Very well done. Congrats!
Thank you. Your docs and mini-SDK allows me to do it.
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: MPoupe on June 24, 2011, 05:21:14 am
If you try fxterm with Casio serial cable, you may find, that stream PC->fxterm goes OK, but fxterm->PC doesn't. The problem is in DTR signal on COM port, which must be set ON. The cable (probably) uses it to get power.
I used following (and very dirty workaround):
Linux is running in vmware (which run on windows), it has serial port, which is configured as named pipe (\\.\pipe\seriak), vmware end is server,other end is an application.
On windows run proxy - attached application, which forwards data between pipe and real COM1 port. The proxy ensures, that DTR signal is ON, so it works.

This is very dirty solution, proxy is very dirty software, but at least it works for testing:-)
I hope there is a way to configure Linux to set DTR signal ON, I did a very quick research, but found nothing:-(
Martin
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: Munchor on June 24, 2011, 07:28:12 am
I don't think this is a shell.

Oh sorry I meant terminal*. Is it a terminal?
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: Jim Bauwens on June 24, 2011, 07:31:09 am
It a console. It connect to a computer through serial.

So its a BIT like a screen connected to your computer.
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: MPoupe on June 24, 2011, 07:31:25 am
Oh sorry I meant terminal*. Is it a terminal?
Yes, it is emulator of VT 100 terminal, so it is a terminal.
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: Munchor on June 24, 2011, 07:32:43 am
It a console. It connect to a computer through serial.

So its a BIT like a screen connected to your computer.

Oh sorry I meant terminal*. Is it a terminal?
Yes, it is emulator of VT 100 terminal, so it is a terminal.

Thank you I get it, because I don't really know the VT 100 Terminal.
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: fxdev on June 24, 2011, 08:13:10 am
Amazing. I wanna see a Linux or BSD system running on the Prizm! :D
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: Eiyeron on October 06, 2011, 11:34:58 am
Maybe on Fx*9860, too, no? PLease
Juste for terminal! :p
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: MPoupe on October 07, 2011, 05:32:32 am
Maybe on Fx*9860, too, no? PLease
Juste for terminal! :p
I was thinking about such program when I bought my fx9860G, but I found a problem with font / screen resolution. Simply the screen is too small to display moderate count of character in a row. Standard font has 5+1 pixel width => 21 characters, which is too few (the +1 is for space between letters).
Smaller font (4+1) would be hard to read and you get 25 characters.
More smaller font (3+1) would get moderate count of characters, but there are hardly distinguishable characters (such like M/N/W/H ).
I want not to use proportional font as it sucks :-)

The FXTerm is not finished (some escape sequences are ignored, so e.g. editors don't work). I can finish this after I find some spare time and then I can port it to fx9860G, but I need to solve somehow the font problem.

Do you have any idea ?
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: DJ Omnimaga on October 07, 2011, 09:32:57 pm
That seems interesting. I unfortunately do not know much about that stuff, so I can,t help, though.
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: Juju on October 07, 2011, 10:21:44 pm
I think the font is pretty nice as it is. And I'll try this next time I'll get on a Linux machine.
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: MPoupe on October 11, 2011, 08:57:31 am
I think the font is pretty nice as it is. And I'll try this next time I'll get on a Linux machine.
Hello,
you probably misread my post. I have problem to choose correct font for 9860G. It's screen is too small to use normal font.

Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: Juju on October 11, 2011, 12:48:21 pm
I think the font is pretty nice as it is. And I'll try this next time I'll get on a Linux machine.
Hello,
you probably misread my post. I have problem to choose correct font for 9860G. It's screen is too small to use normal font.


Oh, ok, sorry. In that case, maybe something akin to Telnet 83, with a 3x4 font and a horizontally and vertically scrollable screen (much like when your screen is zoomed in).
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: JonimusPrime on October 17, 2011, 04:11:38 pm
If you try fxterm with Casio serial cable, you may find, that stream PC->fxterm goes OK, but fxterm->PC doesn't. The problem is in DTR signal on COM port, which must be set ON. The cable (probably) uses it to get power.
I used following (and very dirty workaround):
Linux is running in vmware (which run on windows), it has serial port, which is configured as named pipe (\\.\pipe\seriak), vmware end is server,other end is an application.
On windows run proxy - attached application, which forwards data between pipe and real COM1 port. The proxy ensures, that DTR signal is ON, so it works.

This is very dirty solution, proxy is very dirty software, but at least it works for testing:-)
I hope there is a way to configure Linux to set DTR signal ON, I did a very quick research, but found nothing:-(
Martin

Very nice work! You may be able to use something like setserial on your nix machine to disable/enable flow control which should fix that issue. Or you may even be able to force power to that port to be on with it.
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: DJ Omnimaga on October 24, 2011, 03:46:22 pm
I think the font is pretty nice as it is. And I'll try this next time I'll get on a Linux machine.
Hello,
you probably misread my post. I have problem to choose correct font for 9860G. It's screen is too small to use normal font.


Oh, ok, sorry. In that case, maybe something akin to Telnet 83, with a 3x4 font and a horizontally and vertically scrollable screen (much like when your screen is zoomed in).
Yeah that would be an idea, or maybe KermMartian's 3x3 fonts, although I don't think they had numbers, commas and dots.

EDIT: Actually Telnet used 3x5 fonts. This is the Telnet 83 program he's talking about by the way: http://www.ticalc.org/archives/files/fileinfo/71/7116.html . I bet they could be modified to be 3x4 though.
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: Juju on October 24, 2011, 03:56:53 pm
Also any way to make it work with USB?
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: JonimusPrime on October 27, 2011, 08:05:09 pm
Juju, for this to work with USB one would have to emulate an well supported USB TTL chip, I know there was some talk on doing this on the TI-89T a while back but I doubt we know enough Prizm's USB controller to do this, but I'd love to be proven wrong.
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: Eiyeron on October 30, 2011, 10:03:23 am
How do you connect to Linux?
(I've got Ubu)
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: MPoupe on November 01, 2011, 09:58:13 am
How do you connect to Linux?
See (for example) this:http://linuxtechres.blogspot.com/2009/09/how-to-login-from-serial-port-under.html
But please use speed 9600, it is hardcoded in this verion of the fxterm.
So you will need to add line to your inittab:
s0:2345:respawn:/sbin/agetty 9600 ttyS0 vt100
to enable serial console on COM1
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: helder7 on February 26, 2012, 12:31:19 pm
cool, i have connected my prizm with my otheros++ in my ps3

awesome martin poupe

=============
ps: the app icon is quite confusing, in the menu

can you recompile the app with this icon?

(http://img811.imageshack.us/img811/294/fxterm.jpg)

you can download icon package at mediafire -> http://www.mediafire.com/?4nc5e27ke847pac

I made an icon compatible with simon sdk (bmp 8 bits, low quality), and other compatible with cemetechSDK (bmp 24 bits, high quality)...
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: MPoupe on February 27, 2012, 11:38:37 am
can you recompile the app with this icon?
Hi, thank you for icons, I will use them.
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: christop on March 07, 2012, 07:13:19 pm
As a self-proclaimed VT100 expert, I have to say this is impressive! Yours is nicer than my VT100 emulator too: mine is only monochrome (though I recently added grayscale glyphs) and only 60 columns by 20 rows. Each character is 4x6 pixels (the screen 240x128). Mine doesn't even support setting top and bottom margins for the scrolling region, or double-width and double-height lines! I found it to be sufficient for some full-screen applications like "links", though.

How did you implement your emulator? Did you write a state machine? I used the pages at http://vt100.net/emu/dec_ansi_parser (which contains a very useful state diagram) and http://vt100.net/docs/vt100-ug/ to write my emulator. I haven't tried connecting mine to a Linux system yet, but I plan to do that before too long (if I can figure out how to make TiEmu act like a virtual serial port).
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: MPoupe on March 08, 2012, 09:29:02 am
As a self-proclaimed VT100 expert, I have to say this is impressive! Yours is nicer than my VT100 emulator too: mine is only monochrome (though I recently added grayscale glyphs) and only 60 columns by 20 rows. Each character is 4x6 pixels (the screen 240x128). Mine doesn't even support setting top and bottom margins for the scrolling region, or double-width and double-height lines! I found it to be sufficient for some full-screen applications like "links", though.

How did you implement your emulator? Did you write a state machine? I used the pages at http://vt100.net/emu/dec_ansi_parser (which contains a very useful state diagram) and http://vt100.net/docs/vt100-ug/ to write my emulator. I haven't tried connecting mine to a Linux system yet, but I plan to do that before too long (if I can figure out how to make TiEmu act like a virtual serial port).
Hello,
I think we did a parallel job:-). I also used dec_ansi_parser, but another doc sources (thank you for link, I just downloaded vt100-ug doc).
I also do not support all escape sequences (I don't support these you mentioned and also fxTerm has problems with partial clearing of the screen - like clear line from cursor to end, etc.). My first target was to be able to login to the linux machine, correctly display output of man pages (= test text attributes) and run Midnight commander (mc -a for colors and -mc- a -b for another test). But the MC internal editor (like any other editor) is broken :-)
My fxTerm may be nicer, but it is only because I can use color display with more pixels. The released version uses font similar to one from old Casio calculator (6x8), but I created smaller fonts to have more characters on the screen. I will use them in next version.

Where does your TV100 emulator live ? I would like to see it (at least screenshots)

Martin




Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: Jim Bauwens on March 08, 2012, 11:26:13 am
I think he is referring to his project Punix, an POSIX (IIRC) OS for the 68k calcs.
There is a topic somewhere on the forums with pics in it :)
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: christop on March 09, 2012, 10:15:25 am
Yep, I'm referring to Punix. I don't mention much about the VT100 emulator, but here's the Punix thread: http://ourl.ca/9392
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: flyingfisch on April 18, 2012, 10:20:05 am
If you try fxterm with Casio serial cable, you may find, that stream PC->fxterm goes OK, but fxterm->PC doesn't. The problem is in DTR signal on COM port, which must be set ON. The cable (probably) uses it to get power.
I used following (and very dirty workaround):
Linux is running in vmware (which run on windows), it has serial port, which is configured as named pipe (\\.\pipe\seriak), vmware end is server,other end is an application.
On windows run proxy - attached application, which forwards data between pipe and real COM1 port. The proxy ensures, that DTR signal is ON, so it works.

This is very dirty solution, proxy is very dirty software, but at least it works for testing:-)
I hope there is a way to configure Linux to set DTR signal ON, I did a very quick research, but found nothing:-(
Martin

Can you connect with the USB cable?
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: MPoupe on April 18, 2012, 10:32:49 am
Can you connect with the USB cable?
No.
1. I do not know how to communicate on USB (do we know such syscalls ?)
2. The device (calculator) must emulate usb->serial convertor so linux machine will make console for it. This would probably require low level programming of USB controller on the calculator. Do you know how ? I do not :-(
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: flyingfisch on April 18, 2012, 10:38:34 am
I do not know how, unfortunately.

So, I have to have a way to connect to my computer with the COMM cable?
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: MPoupe on April 18, 2012, 11:51:37 am
So, I have to have a way to connect to my computer with the COMM cable?
Yes.
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: DJ Omnimaga on April 18, 2012, 02:41:45 pm
I think I have this cable, because it came with my FX-9850G, but when I tried to connect my 9850G a few years ago, it was not detected.
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: flyingfisch on April 18, 2012, 05:19:02 pm
this cables work

(http://i.imgur.com/t5b7x.jpg)

Oh, wow never saw one of those before.
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: MPoupe on August 27, 2012, 05:40:04 am
I released new version at my page http://martin.poupe.org/casio/
News: 4 embedded fonts, menu for communication parameters.
Source code included.
The simulator variant uses windows pipe instead of COM port - I used it to communicate with Linux running in VMWare
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: christop on August 27, 2012, 05:29:47 pm
Nice state machine! I've been thinking about adding character tables as you did for a few different states (ground, ESC, CSI, etc), but I worried about how much space those will take. Mine currently tests each character (eg, ch == 0x18 || ch == 0x1a || ...). But now I'm thinking the size of character tables shouldn't matter that much; it'll add probably a couple kilobytes or so in ROM but should execute a little faster (which I think matters more than ROM usage).

I'm amused at the way you defined your fonts in source code with defines like _X_X_X (I defined my fonts in the binary PBM image format and automatically convert them to C source code when the software is built).

I'm still jealous of the hardware UART and the higher resolution color screen on the Casio. All I've got is a proprietary serial protocol (TI D-BUS) and a crappy low-resolution monochrome screen. :/
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: helder7 on August 28, 2012, 07:06:26 am
Nice see a update :)

Unfortunately, I will not be able to test this new update, I have no cable. I tested the initial version with a cable borrowed.

is possibel to make a homemade cable? Official cables are expensive and rare, they cost 37€ + taxes.
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: MPoupe on August 28, 2012, 08:57:04 am
Unfortunately, I will not be able to test this new update, I have no cable. I tested the initial version with a cable borrowed.
is possibel to make a homemade cable? Official cables are expensive and rare, they cost 37€ + taxes.
You can test it partially without nay cable. Run fxTerm on any COMM settings and select local echo. You will be able to write letters on the screen.
BTW: I never tried it ;-)
Cable: do you have USB->RS232 convertor? I think it contains USB->uart (TTL) converter and TTL->RS232 (max232) converter. If you remove the second convertor and replace connector by 2.5 mm jack, it should work.
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: DJ Omnimaga on August 28, 2012, 10:14:04 am
Glad to see this software updated. Also I wish TI cables worked with Casio calcs, because there are some tutorials on Google (or ticalc.org) on how to build $5 link cables.
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: helder7 on August 28, 2012, 10:33:04 am
this ti cables 2,5 mm to usb works?

(http://i.imgur.com/qBwKU.jpg)
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: MPoupe on August 28, 2012, 10:54:20 am
this ti cables 2,5 mm to usb works?
I do not know the schematics, but I think no. I mean this: http://pinouts.ru/Converters/usb_serial_adapter_pinout.shtml
Imagine you remove MAX213 and wire signals (TXD and RXD) from FT232AM to the calculator.
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: Juju on August 28, 2012, 10:59:45 am
I think an Arduino would work, it have a build-in USB-to-TTL converter, so you would plug the 2.5mm jack to pins 0 and 1 and it would work. I didn't tested it though, as I don't have any cable to cut in half.

EDIT: It's doable, you don't even have to load a program in the Arduino, I would need to know whether the tip or the ring is TX or RX. The sleeve is most likely the ground.
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: JosJuice on September 04, 2012, 10:19:39 am
this ti cables 2,5 mm to usb works?

(http://i.imgur.com/qBwKU.jpg)
No. That cable is only capable of translating TI's linking protocol - it can't transfer arbitrary data.
Title: Re: FXTerm - VT100 terminal emulator for Casio fx9860 G
Post by: MPoupe on January 02, 2013, 05:21:37 am
Hello,
This is fast and dirty port of fxTerm to fx9860G. Try it if you want :-)
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: DJ Omnimaga on January 02, 2013, 06:24:51 pm
Glad to hear it is ported to this older model :). Does it run on the SH4 version of the calc or the SH3 one?
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: MPoupe on January 03, 2013, 04:30:55 am
Glad to hear it is ported to this older model :). Does it run on the SH4 version of the calc or the SH3 one?
It works for SH3, I have it in my calc. But I used only syscalls, no direct HW access, so I think it should work on SH4 too. But unfortunately I do not have SH4 based 9860 so I cannot test it.
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: Spyro543 on January 03, 2013, 07:51:16 am
I do :) I'll test it when I get home, but that'll be in 7 hours...
Title: Re: FXTerm - VT100 terminal emulator for Casio fx cg
Post by: MPoupe on January 04, 2013, 08:21:28 am
I do :) I'll test it when I get home, but that'll be in 7 hours...
Do you have SH4 or SH3 based fx 9860G  ?
Does it work for you ?