wwarthen / RomWBW

System Software for Z80/Z180/Z280 Computers
GNU Affero General Public License v3.0
323 stars 93 forks source link

CLS returns capital H char on pigfx terminal #384

Closed Alex-Kw closed 6 months ago

Alex-Kw commented 6 months ago

I just upgraded from RomWBW 3.0.1 to 3.4. I have a macro on my keyboard which types CLS and a carriage return, which cleared the screen. Now, that macro as well as just typing CLS and return just returns a capital "H" instead of clearing the screen.

Thanks for all the awesome updates and work. Cheers.

wwarthen commented 6 months ago

Hi @Alex-Kw,

This sounds like the pigfx is sending data faster than the serial port interrupt handler can handle. There have been small changes to the interrupt handling code between these versions.

Please tell me which serial port hardware you are using. ACIA? SIO? or something else?

Thanks,

Wayne

Alex-Kw commented 6 months ago

Wayne,

I haven't ever had any speed related terminal issues, i.e. qterm access to bbs systems and other applications like wordstar work. I use the SIO/2 with a dual clock. CLS worked OK on 3.0.1 and 3.1 iirc.

PiGfx only does display, input is from a Commodore keyboard by way of its own serial adapter.

My build is actually documented here if it helps:

https://forum.vcfed.org/index.php?threads/z80-rc2014-pro-romwbw-build-w-digital-io-ym2149-floppy-controller-and-more.1243132/

I doubt it's needed, but I could always sniff the bus with a logic analyser on 3.0.1 vs 3.4, I kept both eeproms and cf cards intact.

Thanks!

wwarthen commented 6 months ago

Sorry, I got stuck on the idea that it was related to the keyboard macro, but I now understand that it is happening even if you just type it manually.

The CLS command is only available on some of the OSes. Which OS are you using? I confirmed that entering CLS on Z-System (ZSDOS + ZCPR 1), NZCOM, and ZPM3 worked (cleared the screen correctly). I would not expect it to work on CP/M 2.2 or CP/M 3.

Thanks,

Wayne

Alex-Kw commented 6 months ago

Thanks Wayne. I'm only expecting it to work in ZPM3, so I'll ensure I'm absolutely booting the right slice or even try some of the others. I'll circle back and let you know for sure.

Alex-Kw commented 6 months ago

Definitely was using ZPM3, ZSDOS also exhibits the same behavior after the upgrade to 3.4.0.

Let me know if there's anything of use I can check. My MBASIC clear screen command still works fine, "PRINT CHR$(12);" and a CR clears the screen well.

wwarthen commented 6 months ago

Hi Alex,

I think I may have found an explanation for what is happening. I went back and reviewed the escape sequence emitted to clear the screen under ZPM3 in v3.0.1 vs. v3.4. They changed between these versions:

Old: <esc>[2J<esc>[H New: <esc>[;H<esc>[J

Under ZPM3, the clear-screen escape sequence is determined by the TCAP.Z3T file. This file was changed in commit 63a3159 and the comments were:

Updated tcap.z3t for ZPM3 slice. Previous definition was VT-525. New definition is specifically VT-100. Credit to Marco Maccaferri for all of this.

In theory, the new TCAP definitions were supposed to be an improvement.

The old and the new escape sequences both work in my terminal emulator and should be OK according to the DEC terminal standards. However, I suspect that pigfx does not like the ";" in the new escape sequence, aborts processing the escape sequence, and prints the trailing 'H'.

I don't know of a tool to edit the TCAP.Z3T files. You would probably need to do it with a hex editor. The ZAP application included with RomWBW would work. Note that the TCVIEW application included with RomWBW can be used to view a TCAP.Z3T file.

NZCOM (slice 2) will behave the same as ZPM3. However, ZSDOS (slice 1) should be sending <esc>[2J. I would expect that to work.

Thanks,

Wayne

Alex-Kw commented 6 months ago

Wayne,

Thank you! You are correct in your expectation of ZSDOS, I must have been on NZCOM last night.

I can be happy with this! I'll either edit the TCAP.Z3T file(s) as appropriate, or see if I can just fix and recompile PiGFX to accept both escape sequences.

Cheers, Alex

wwarthen commented 6 months ago

Glad we have an explanation for this. It is good to know about this because others may encounter a similar problem.

Thanks,

Wayne