xlar54 / ultimateii-dos-lib

cc65 library for accessing the DOS and network functions of the Ultimate II+ cartridge and Ultimate 64 motherboard
GNU General Public License v3.0
60 stars 13 forks source link

VT100/ANSI #45

Open MaxPlap opened 4 years ago

MaxPlap commented 4 years ago

Would be very useful support for VT100/ANSI terminal. I think it's the big missing of ultimateII. Why should I give up my UltimateII+ to free Cartridge slot for a RRNET or use the userport with wimodem?

xlar54 commented 4 years ago

I think this is a valid issue. Lets keep it open.

MaxPlap commented 4 years ago

My original issue was wrong: I cannot connect to some telnet server using the Term, and I erroneously thought it was a codec issue. I find out it was the absence of support for telnet negotiation (RFC854). I suppose it is not in the feature list

LeifBloomquist commented 3 years ago

@MaxPlap I have added very simple Telnet RFC854 handling and a start on ANSI support. Check out my branch here for the code.

https://github.com/LeifBloomquist/ultimateii-dos-lib/blob/master/src/samples/ultimateterm.c

MaxPlap commented 3 years ago

@LeifBloomquist , I pulled the project but I got some sort of compilation error:

ultimateterm.c(1405): Error: Conflicting types for 'handle_telnet_iac'

I used the build.sh script and I'm using cl65 2.18

LeifBloomquist commented 3 years ago

@LeifBloomquist , I pulled the project but I got some sort of compilation error:

ultimateterm.c(1405): Error: Conflicting types for 'handle_telnet_iac' I used the build.sh script and I'm using cl65 2.18

OK I'll have a look into it.

@MaxPlap I can't reproduce this unfortunately on a clean machine. I'm using cl65 2.19 Git fcda94f under Windows, (which uses build.bat, but build.sh should work just the same).

I tried both my fork (which only builds u-term64.prg) and also started with xlar54's latest build, just copying in the modified ultimateterm.c, both worked fine (though there are many unrelated warnings about Pointer conversions).

Try the latest cl65? Though you can see the function definition and the prototype (line 170) match so...not sure where this error is coming from?

LeifBloomquist commented 3 years ago

Also I think it would be cleaner to move the Telnet and ANSI handling code to their own files, will address that "soon".

sblendorio commented 3 years ago

interesting... gonna have to merge it, I just have to test it!

MaxPlap commented 3 years ago

You were right, my version of cc65 was slightly too old. I tried and it works! I connected to some linux telnet server and I was able to use it for a while. I think it may be interesting to continue its development with a dedicated branch, I'd love to use my C128 as a good terminal for my raspberry Pi home server.

sblendorio commented 3 years ago

@MaxPlap I'm testing the whole thing, one question: how to switch to "ANSI" mode coming from ASCII or PETSCII?

MaxPlap commented 3 years ago

It checks the first byte received when the connection has been estabilished: https://github.com/LeifBloomquist/ultimateii-dos-lib/blob/dd36312e176bcb082bed1d5075c7b96d2762c1e3/src/samples/ultimateterm.c#L740 if it's 0xff, it assumes it's a telnet connection and set the flag for it

sblendorio commented 3 years ago

so when it's TELNET connection, no way to change mode, is it right? It sounds good.

MaxPlap commented 3 years ago

It's quite a good assumption. When the terminal will become a feature creep, charset selection may be implemented

sblendorio commented 3 years ago

Fixing it in the original repo. Is it a problem if I do so without pull-request?

sblendorio commented 3 years ago

Gonna do pull-request.

sblendorio commented 3 years ago

@LeifBloomquist merged your branch and did some fix about cast warnings. Do you have some good idea for improvements in this feature?

LeifBloomquist commented 3 years ago

It would be good to handle some more ANSI control messages, though my current implementation has some limitations for more complex messages. At very least, would want to be able to use vi, nano/pico and pine :-)

Ideally we would eventually have as many features as CaTer: https://www.opppf.de/Cater/ (can also study their source). But it also needs a special termcap file on the server side.

sblendorio commented 3 years ago

Released 2.5! https://github.com/xlar54/ultimateii-dos-lib/releases/tag/v2.5

@LeifBloomquist what about helping us to implement Punter download protocol?

LeifBloomquist commented 3 years ago

Can do, though my hobby time is severely limited these days. Open a new issue for it?

sblendorio commented 3 years ago

@LeifBloomquist sure! Here it is :) https://github.com/xlar54/ultimateii-dos-lib/issues/54