MiguelVis / te

Text editor for the CP/M operating system and related computers: Amstrad PCW, CPC, Kaypro, Spectrum...
GNU General Public License v2.0
84 stars 10 forks source link

Initial support for the Osborne Executive and Osborne 1 #14

Open indrekis opened 1 year ago

indrekis commented 1 year ago

Hello!

I have ported the TE to the two Osborne portables. Changes in comparison with the Kaypro II version are trivial. Osborne Executive version is tested on the real hardware, Osborne 1 -- only in the emulator (MAME). There is some strange bug for Osborne 1 -- with the correct number of columns (52) the editor scrolls one column after the last column, so, as a workaround, 51 columns are used now.

Possibly I've misunderstood something or missed some documentation notes, but because of empty cf_cr_name and cf_esc_name in te_conf.c I always need to use xecf on the newly created .COM-file.

If this update is basically useful, feel free to ask me about necessary changes to make it better.

MiguelVis commented 1 year ago

Hi @indrekis.

First of all sorry b y the delay in my reply.

Regarding Osborne 1 I don't know what's the source of the issue.

I couldn't reproduce it by configuring a TE adaptation to that terminal size.

The last line is cleared by using the CrtClearLine() function.

Maybe the Osborne 1 (or MAME) is writing something at the end of the line? The screen cursor?

Regarding CR and ESC names being empty after a build: if you see make.bat for DOS / Windows environments it includes the following:

cpm tecf PATCH %1.com %1.cf

So, yes you must configure a new build.

And regarding the PR: if your ports (adaptations) are just using te_kp.c plus some comments and customized .cf files, there is no need for te_osb1.c and te_osbe.c files, just the .cf files will do the job.

I mean, just copy te_kp.com into te_osb1.com and te_osbe.com and patch them by using tecf an the right .cf files.

I will be more than happy including the .cf files and including the .com files in make_all.bat.

Anyway we should take a deeper look at the Osborne 1 issue because I don't think is TE related.

What do you think?

indrekis commented 1 year ago

Hi, @MiguelVis!

Thank you for your reply.

Regarding Osborne 1 -- currently, I cannot efficiently debug the issue. In the hope it could help I created a small video -- the same executable just with 51 cols (TEOSB1.COM) and 52 cols (TEOSB1A.COM) -- at the end of the line, I press "f" many times in a row. The problem also does not manifest itself when using teosb1/teosb1a on Osborne Executive -- the TE just shows a narrower UI.

Note: Looks like CP/M 2.2 used on Osborne 1 cannot run files with underscores.

I read documentation searching for differences between models but found no clues yet. Additionally, my attempts to access real hardware failed but I still have some hope for such a test. I hope to try to debug it lately. Would be OK if I post an issue about this problem?

Regarding the adaptation, please correct me if I miss something, but looks like TECF cannot make the necessary changes (at last, starting from the te_kp.com):

  1. CrtClearEol() in te_osb[1|e].c needs to output two chars instead of one (27, 84, or "[T").
    • Could this be a reason for excessive scrolling for Osborne 1? But the same two char printed for the Executive do not lead to the same problem.
  2. CrtReverse(on) should write 2, not 3 chars, and maybe I missing something, but looking through tecf.c and "tecf dump" output did not find ways to change printed chars for this routine.
    • This also disables merging te_osb1.c and te_osbe.c.

Additionally, I have some hope to implement more efficient routines using video memory maps directly.

https://github.com/MiguelVis/te/assets/26859944/1d24bcca-6e64-441b-a0b3-44fa08e969ef

indrekis commented 1 year ago

Looks like GitHub has a problem with the video, so posted on youtube: https://youtu.be/2TkAN1zhkd