dmsc / emu2

Simple x86 and DOS emulator for the Linux terminal.
GNU General Public License v2.0
397 stars 30 forks source link

Curses #22

Closed abelz-A closed 2 years ago

abelz-A commented 3 years ago

Hi, thank you for writing this program.

I wrote a different terminal interface to it, using curses. Tested it with for example Volkov commander, and the terminal works fine with that.

usage: ./emu2 -c vc.com

option -C uses a different curses interface, which works only for int10, not for direct writes to video memory. Mainly useful for testing dos apps.

It has been fun writing this extension, and I hope it will be useful to anyone else. greetz...

dmsc commented 2 years ago

Hi!

Thanks for your contribution. Some comments:

I wrote a different terminal interface to it, using curses. Tested it with for example Volkov commander, and the terminal works fine with that.

I sew two different works: curses support and emulated extended memory support.

Why do you need the curses interface? Are you using a terminal in which the built-in terminal support does not work?

I'm interested to know so that I could add support for your terminal, or the use case. As is, merging this is not possible, as you are duplicating a lot of the functionality of "video.c" into "term.c", this would introduce a lot of maintenance overhead.

About EMS, you added some support and then removed in a followup commit. Did it work? What program were you using to test this?

Certainly would be interesting to add EMS support if you find an interesting program that uses it.

usage: ./emu2 -c vc.com

option -C uses a different curses interface, which works only for int10, not for direct writes to video memory. Mainly useful for testing dos apps.

Yes, I see. Originally, emu2 also only emulated int10 calls, including scrolling and windowing, but as you probably realized, most DOS programs write to video memory directly instead of calling int10, so I implemented the video memory support - and then the int10 implementation simply manipulates video memory. This made the terminal support much simpler, as I only need a few terminal codes to output the DOS screen.

It has been fun writing this extension, and I hope it will be useful to anyone else. greetz...

Great!

I tested Volkov commander (never used it before), and I discovered a problem with version 4.99.08: it does not work because the program tries to execute it's overlay using "load and execute" function and expects to find a copy of the main program in RAM. But emu2 implements that function as a separate unix process, so it exits with an error.

Using version 4.05 works, but there is a problem with the "get extended error" function, producing an error at start. I could probably fix this.

Have Fun!

abelz-A commented 2 years ago

Hi, First focussing on the tui. I don't really need a curses interface, however it has refresh buffering built in and that is well tested. I do admit there is to much stuff I don't need in it. I made the function b8_to_term which does almost the same thing as check_screen but for use case "vc.com v4.05" the terminal behaves correctly, whereas with the original emu2 the display gets mangled. (I am not talking about file of fs issues, only the tui) The terminals I use are xfce_term, terminator and I also tested xterm. I have LANG=en_GB.UTF-8. (OS is Debian Linux 11) I disabled scrolling in curses, but have no idea how this is done in raw terminal escapes. For me vc is not the only prog that messes up the terminal, but it is the most messy. Did it really display well for you?

About EMS: I had included a very dirty handler (only 1 handle which is always returned by alloc and a static 1MiB block used for EMS memory.) it worked for the app I used for testing, but found it too dirty to include. I have written a version with real handles and counters, that I will be happy to include soon.

And about files and listings: One of the progs I used to test was MSDOS 3.3 command.com. And I noticed that the dir command doesn't work for subdirectories. This issue is in dos_find_firs() probably.

I hope this info is useful, and have fun too!

dmsc commented 2 years ago

Hi!

First focussing on the tui. I don't really need a curses interface, however it has refresh buffering built in and that is well tested. I do admit there is to much stuff I don't need in it. I made the function b8_to_term which does almost the same thing as check_screen but for use case "vc.com v4.05" the terminal behaves correctly, whereas with the original emu2 the display gets mangled. (I am not talking about file of fs issues, only the tui) The terminals I use are xfce_term, terminator and I also tested xterm. I have LANG=en_GB.UTF-8. (OS is Debian Linux 11) I disabled scrolling in curses, but have no idea how this is done in raw terminal escapes. For me vc is not the only prog that messes up the terminal, but it is the most messy. Did it really display well for you?

Yes, it works ok, see: image image

But, I'm using gnome-terminal with a big screen size. If using xterm with a size of 80x25 you are right that the output is distorted: image

The solution for XTERM and gnome-terminal is to set the terminal to a size greater than 80x25.

I just pushed a new version that should solve this, it disables the atutomatic margin on the terminal and restricts the vertical position to less than the terminal size.

About EMS: I had included a very dirty handler (only 1 handle which is always returned by alloc and a static 1MiB block used for EMS memory.) it worked for the app I used for testing, but found it too dirty to include. I have written a version with real handles and counters, that I will be happy to include soon.

Great, I will look at this then.

And about files and listings: One of the progs I used to test was MSDOS 3.3 command.com. And I noticed that the dir command doesn't work for subdirectories. This issue is in dos_find_firs() probably.

I see, can you submit a bug report? That will need investigating.

I hope this info is useful, and have fun too!

Thanks!

abelz-A commented 2 years ago

Great, that solves the problem!