[UNAPI] - Telnet Client

ページ 4/9
1 | 2 | 3 | | 5 | 6 | 7 | 8 | 9

By Sd-Snatcher

Hero (582)

Sd-Snatcher さんの画像

19-08-2019, 00:07

This is the code of the library of ansi driver used in Pascal


type

OpenStringb     = String[255]; 

Procedure LOAD_ansi;
var

  driver: file of byte;
  by,by2 : byte; 
   
  BytePtr  : ^Byte;  
  inta:integer; 
  doll: char;    
Begin 

		Inta:=$b000;

        Assign (driver,'ANSI-DRV.BIN')          ;   { Assign file name    }
        Reset  (driver)                   ;   { Open for read       }

 		repeat
 			read(driver,by); 
 			mem[inta]:=by;
 			inta:=inta+1;
        until eof(driver);
        close(driver);  
End;


Procedure Ansi_INIT;
Begin
    Inline (    
				$CD/$00/$b0		
             ); 
End; 

Procedure Ansi_STOP;
Begin
    Inline (    
				$CD/$03/$b0		
             ); 
End;                                  

Procedure Ansi_PRINT(STR:OpenStringb );
Begin
    Inline (    
        		$21/STR/		
    		    $CD/$09/$b0		
             ); 
End; 



Procedure Ansi_PRINTchar(STR:char);
begin 

  
	Inline (    
   				$3A/STR/
	    		$CD/$06/$b0		
          	); 

end;

By Sd-Snatcher

Hero (582)

Sd-Snatcher さんの画像

19-08-2019, 00:18

Inline is directly z80 machine code.

The driver is loaded at b000

-Init driver:
CALL b000
-stop driver:
CALL b003
-print character :
LD A, Character
CALL b006
-print String:
LD HL, STRING$
CALL b009

As far i know, driver cant be loaded elsewhere, for speed reasons address are fixed.

No i didnt code it.

By ducasp

Paladin (712)

ducasp さんの画像

19-08-2019, 12:47

Hey, thanks Carlos, I'll look into it, I've tried to reach the driver author, Sonic_Aka_T, but his yahoo account seems to be closed, so you think it is OK to use it as long as I mention him?

By ducasp

Paladin (712)

ducasp さんの画像

20-08-2019, 01:46

Hi Sd-Snatcher, did you observe any of those behaviours?

  • Using v9958 (MSX2+/TR) black is grey...
  • Using print String, it seems driver loses the ESC state if the string finish before a ESC code completes...

I could only make it work ok printing byte per byte (and it is really pretty, pretty fast, even doing byte per byte it is faster than jANSI called directly using DMPSTR), and it seems that this makes performance suffer, i.e.: the hispa logo was draw in 7s on a v9990 vs 8.5s using 9958. If you have the contact of Sonic_Aka_T, I would like to check if he is interested in working on it or providing the source files so I can work on those.

Thanks!

By Sd-Snatcher

Hero (582)

Sd-Snatcher さんの画像

20-08-2019, 02:47

No, as far i remember black is black ♪♫♬

You can see the videos from Karloch.

https://www.youtube.com/watch?v=Ly8unl-O6ks

Watching code, these string are Pascal strings (first byte is size), but i think driver can work with C str (zero terminated). I dont remember to have any problem with hispamsx.org and some ascII files i used to test.

I dont remember had hay contact with him since this (~2005).

https://www.youtube.com/watch?v=BXvzcfwN3LI

I think that Eugeny Brychkov have used it sucesfully too in gr8net

https://www.youtube.com/watch?v=XcRJSJ9n5fQ

By ducasp

Paladin (712)

ducasp さんの画像

20-08-2019, 14:48

Thanks Carlos,

Using pascal like strings, where the first byte is the string size and not expecting null termination to indicate the end of string made the ansi file dumper concept work fine with both drivers, it seems that either c strings aren't supported or there is an issue with that.

By the way, Toby was kind enough to answer my email to him and he told me that he will check if source code still is available. Smile

By Sd-Snatcher

Hero (582)

Sd-Snatcher さんの画像

20-08-2019, 16:51

Great!

By ducasp

Paladin (712)

ducasp さんの画像

21-08-2019, 00:01

Just in case, in fact the way it is it will work only with Pascal Strings, (I've been viewing the code on BlueMSX debugger), as soon as you call the function to dump string, it will first call a function to transform the pascal string in a C string (read first byte, increment pointer, save pointer, add value read to the pointer, save 0 in it, then restore pointer and loop printing.

If anyone bothers, you can turn it back into a C string function by just changing to 00 the bytes offset 0x107, 0x108 and 0x109 (so it no longer calls the function to transform pascal string). Of course, by doing so it won't work with pascal strings anymore (and perhaps it is a good idea to use the pascal string with one less byte than its capacity otherwise some other data or code will be turned into 0 in the normalization of the string). Smile

By Sd-Snatcher

Hero (582)

Sd-Snatcher さんの画像

21-08-2019, 16:38

I think, he first programmed it with zero terminated, and i asked him to change it for Pascal.

By ducasp

Paladin (712)

ducasp さんの画像

24-08-2019, 17:59

I'm really happy to announce v1.0 of the Telnet terminal.

First, thanks Sd-Snatcher (Carlos de Santa Ana) and Sonic_Aka_T (Tobias Keizer)! Your help made this version possible. Smile

So, what is new?

  • jANSI is no longer used. Long history short: I've talked to Carlos de Santa Ana about INLCLIES (work only for internestor light) and its ANSI rendering was awesome, asking if I could use it. He did send me the details of how it works, cool. Then I've reached the driver author, Tobias Keizer (Sonic_AKA_T), and he is an awesome guy, that sent me the source code of his driver and allowed me to change it and publish source code as well. End result: 6 seconds rendering HISPAMSX boot logo ANSI animation on OCM Turbo / Hardware accelerated UNAPI adapter, and 13 seconds at regular z80 speeds, pretty damn blazing amazing fast! So Sonic_AKA_T just brought us BLAST PROCESSING from SEGA Genesis directly to our MSX's 2 or greater. Smile (And it is way, waaay, waaaaay faster on OBSONET as well really usable even at regular z80 speeds, how does 30s to see HISPAMSX ANSI boot animation looks like? Remember that using jANSI it was 61s? Big smile )
  • As such, command line options have reduced a lot, no need to deal with external ANSI drivers.
  • And the cool thing is, this still works with MSX1, but it will be not ANSI compatible as it is not possible.

As usual, binary available at:

https://github.com/ducasp/MSX-Development/tree/master/UNAPI/...

Source code available at:

https://github.com/ducasp/MSX-Development/tree/master/UNAPI/...

fr3nd, can you publish v1.0 on MSX HUB? Changes are radical, now only three files, TELNET.COM, ANSI-DRV.BIN and README.TXT, all other memman, .bat and jansi files no longer needed

P.s.: Many, many thanks Toby! I've published the changes on ANSI-DRV.BIN on my github:

https://github.com/ducasp/MSX-Development/tree/master/ANSI-DRV

  • I've made a few commentaries on the source code where I researched to understand what was going on...
  • I've changed the way it proccess strings to work with C-Strings instead of Pascal Strings.
  • I've tweaked the code a bit to allow the screen border color to be the same as the background color.
  • I've tweaked the code a bit to allow the screen to have 25 lines of text like IBM-PC.
  • I've fixed the behavior of when ANSI Cursor Down and ANSI Cursor Forward is used with a parameter too big (it would overlap and result in the line/column to not be the limit as it should).
  • I've added the possibility to retrieve the current cursor position (important for telnet terminals that want to look good on Synchronet BBSs).
  • I've fixed an issue where, after a few lines of text scrolled, some lines that were deleted would appear on the bottom.
  • I've added the possibility to have a callback function to handle returning cursor position when 6n escape command is received (for examples on how to use that, check the TELNET terminal source code).
ページ 4/9
1 | 2 | 3 | | 5 | 6 | 7 | 8 | 9