larsbrinkhoff / terminal-simulator

Simulation of VT52 and VT100 terminal hardware.
GNU General Public License v3.0
113 stars 17 forks source link

Displaytext gets distorted while/after scrolling #25

Open guidol70 opened 3 years ago

guidol70 commented 3 years ago

I did a short test with RunCPM and the VT100-Terminal Emulation. On the first DIR command the text is shown OK, but gets distorted while the terminal is scrolling :(

PS: Is there any chance to get the terminal working with less CPU-power? On a single-Core 1.2Ghz IBM Thinpad X40 its so slow/unuseable. On a dual-Core 1.4Ghz Chromebox with Ubuntu Focal its using around 75% of the CPU

Before_scrolling

After_while_scrolling

larsbrinkhoff commented 3 years ago

The "checkerboard character" is due to the VT100 not being able to process input fast enough. This is consistent with a real terminal. The best solution is to turn off smooth scrolling, and to turn on XON/XOFF flow control.

As for CPU usage, my goal is to have the simulator be usable on a Raspberry Pi 3. Maybe that's faster than your single-core Thinkpad.

There are some things that can be tuned to make run faster. First, avoid the code using OpenGL and GPU shading. Try building commit 94f8bbd4400cbfaca4fee92053247b82bb105546. It the future, this should be a configurable option.

Second, locate this code in video.c:

#if 0
  if ((fields & 3) != 0)
    return;
#endif

Edit the #if 0 to #if 1. Now the simulation will use a reduced frame rate: 15 Hz instead of the full 60 Hz.

guidol70 commented 3 years ago

I did compile commit 94f8bbd, but thats slower than before :( How can I avoid OpenGL and the GPU Shading?

With the older version (16.06.2021) and the change in video.c its a bit better. I also did try it on a NanoPi A64 quadcore with armbian, but only at 15Hz its useable :( and I also do get dropout (lost chars)

I also disabled the curvature commit (5a7e801) - because I like a "plain" screen

How can I disable smooth scolling? I can get to the setup, but dont know the key to disable smooth scrolling :(

Maybe you can create some start-options for 15Hz, curvature screen and smooth scrolling, background green? ;) In the setup-screen max baudrate is 19.200, but when the emulation did start I can read something about 38.400

larsbrinkhoff commented 3 years ago

For now, the only way to avoid OpenGL is to use 94f8bbd or earlier.

Your suggestion to toggle features on/off is good, so maybe it's about time to do that now.

Smooth scrolling is turned off in SET-UP B. Type F9 for SET-UP A, then 5 for SET-UP B. Then turn the first bit in "switchpack 1" to 0 using cursor keys and 6.

jumpscroll

larsbrinkhoff commented 3 years ago

I'm surprised your NanoPi A64 doesn't do better, but I don't have any theory why.

guidol70 commented 3 years ago

I'm surprised your NanoPi A64 doesn't do better, but I don't have any theory why.

the NanoPi A64 shows 25% CPU usage while showing the IDLE 15Hz VT100. And 75% for the IDLE 60Hz VT100 :(

Maybe bad GPU support against the RPi3 under RPi-OS?

Have to check with my RPi3 these days...

larsbrinkhoff commented 3 years ago

My PRi 3 seems to do fine at 60 Hz without the OpenGL shader. With, it does not keep up. The RPi 4 does though.

For now, the simulator does the same processing whether the VT100 is idle or not. A future update could do better when idling.

guidol70 commented 3 years ago

Had to learn how to get the " 94f8bbd"-version from github - never used this option before :) With this version my RPi3 can use the 15Hz version fine and the RunCPM directory is shown correctly when scrolling is set to "jump". With the 60Hz config I have a VERY BIG input delay (seems to be more than 4times (difference between 15Hz and 60Hz)) With the 15Hz config I do get the input immediately :)

larsbrinkhoff commented 3 years ago

Thanks for the feedback. I'll look into making those things configurable.

A hint to make jump scroll permanent. In SET-UP mode, you can type Shift+S to save your settings to persistent NVRAM. The simulator writes a file called nvram in the current directory which is used for future runs.

larsbrinkhoff commented 3 years ago

I now have a real VT100 to compare against. I can confirm it does have trouble keeping up during jump scroll on, even at 9600 baud.

larsbrinkhoff commented 3 years ago

I added -Q to disable OpenGL and GPU shading. It's a more modest display, but much lighter on the host computer.

larsbrinkhoff commented 3 years ago

This is from a real VT100 at 9600 baud, smooth scrolling, and flow control disabled. As you can see it has the same kind of problems as the simulator. 20210710_130437