tomicdesu
Well-known member
I'm trying to implement a terminal emulator (H19/H89) "insert line" function and failing. I'm assuming I'm doing something dumb and overlooking something obvious and maybe fresh eyes will see my blunder. I'm using the latest library, VGA_4BIT_T4-VGA_4BIT_T4_Fixes.
"Insert line" is implemented by a scroll down. I fudged the background color to yellow so that I could see what was happening.
It was maddeningly difficult to get this visual example, crappy as it is (CP/M doesn't do print screen, yet anyway, I think I will add it). I am using a text editor (PMATE) to put text on the screen and do one INSERT LINE function. I normally use 800x600, but and this problem exhibits there, but I switched to 640x480 to see if it was dependent (doesn't seem to be). The text editor has correct screen dimensions (30x80).
The debug print out for this example is:
By not giving PMATE the "insert line" escape code it repaints the screen and displays spaces to erase, and it paints screen correctly 100% of the time, it's just slower. So I'm certain that it is my insert line/scroll down that's failing.
So 0, 0 is top left, and 29,79 is the lower right corner, right? Variables H19Row and H19Col are 0,14 at the start, and h19_maxCols=80, h19_maxRows=30.
Am I calc'ing the scroll box right?
Worse, I swear it works right under some circumstances.
Before and after photos. Terrible photos!
"Insert line" is implemented by a scroll down. I fudged the background color to yellow so that I could see what was happening.
It was maddeningly difficult to get this visual example, crappy as it is (CP/M doesn't do print screen, yet anyway, I think I will add it). I am using a text editor (PMATE) to put text on the screen and do one INSERT LINE function. I normally use 800x600, but and this problem exhibits there, but I switched to 640x480 to see if it was dependent (doesn't seem to be). The text editor has correct screen dimensions (30x80).
Code:
case 'L':
h19Col= 0;
L.header ("INSERT LINE row "); L.print (h19Row);
L.print (" height "); L.print (h19_maxRows - h19Row - 1);
L.println();
vga4bit.setPrintCWindow (h19Col, h19Row, h19_maxCols, h19_maxRows - h19Row - 1);
vga4bit.setBackgroundColor (VGA_YELLOW); // DEBUG
vga4bit.scrollDownPrintWindow();
vga4bit.setBackgroundColor (VGA_BLACK); // DEBUG
vga4bit.unsetPrintWindow();
fini= true;
break;
The debug print out for this example is:
Code:
00:27:30 INSERT LINE row 14 height 15
By not giving PMATE the "insert line" escape code it repaints the screen and displays spaces to erase, and it paints screen correctly 100% of the time, it's just slower. So I'm certain that it is my insert line/scroll down that's failing.
So 0, 0 is top left, and 29,79 is the lower right corner, right? Variables H19Row and H19Col are 0,14 at the start, and h19_maxCols=80, h19_maxRows=30.
Am I calc'ing the scroll box right?
Worse, I swear it works right under some circumstances.
Before and after photos. Terrible photos!