Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement MODE Command #3670

Open
2 tasks done
MasterO2 opened this issue May 12, 2024 · 3 comments
Open
2 tasks done

Implement MODE Command #3670

MasterO2 opened this issue May 12, 2024 · 3 comments
Assignees
Labels
DOS Issues related to DOS integration or DOS commands enhancement New feature or enhancement of existing features

Comments

@MasterO2
Copy link
Contributor

MasterO2 commented May 12, 2024

Are you using the latest Dosbox-Staging Version?

  • I have checked releases and am using the latest release.

Different version than latest?

No response

What Operating System are you using?

Windows 10

If Other OS, please describe

No response

Is your feature request related to a problem? Please describe.

Dosbox-Staging cannot natively adjust the number of rows and columns at the command prompt:

https://www.reddit.com/r/dosbox/comments/1cl1rlo/can_the_dos_terminal_size_be_adjusted_in_terms_of/

Describe the solution you'd like

Dosbox-Staging should implement its own MODE command to address the issue.

Describe alternatives you've considered

Alternative 1:

On Dosbox-Staging's Discord channel, user interloper proposed the following:

Looking at my default install, mode.com isn't part of the builtin or the addon Y:\DOS programs. I tested the vidmode.zip here: https://ftp.sunet.se/mirror/archive/ftp.sunet.se/pub/simtelnet/msdos/screen/
I just dropped the 25.COM, 43.COM, and 50.COM files into the resource\drives\y\dos in my install area, and now these tools are in my PATH and i can switch between the modes. Description of all those utilities in index.html - https://ftp.sunet.se/mirror/archive/ftp.sunet.se/pub/simtelnet/msdos/screen/00_index.txt

Those .COM files are a passable workaround, but MODE would address this issue more cleanly.

Alternative II:

Dosbox-X has ttf support which allows adjusting of font sizes as well as the settings below in the [ttf] section of dosbox-x.conf:

lins = 0
cols = 0

Alternative III:

Dosbox-X has its own MODE command.

Add any other context or screenshots about the feature request here.

MODE command from Dosbox-X:

command_000

No response

Code of Conduct & Contributing Guidelines

  • Yes, I agree.
@MasterO2 MasterO2 added the enhancement New feature or enhancement of existing features label May 12, 2024
@johnnovak
Copy link
Member

johnnovak commented May 14, 2024

@MasterO2 I've been planning this since last year, so you've kinda beaten me to it with this ticket 😄 No problem, though, and thanks for outlining your solution ideas. Here comes mine! 😎

@FeralChild64 I'm asking your opinion on this because the original MS-DOS MODE command was a bit of Swiss Army Knife of everything and it had support for changing codepages and COM & LPT port stuff as well. Because you've added lots of COM port and localisation related functionality and config settings, my understanding is using the MODE command for these things might be redundant or perhaps even undesired?

From here:
https://home.csulb.edu/~murdock/mode.html

MODE n
MODE LPT#[:][n][,][m][,][P]
MODE [n],m[,T]
MODE (displaytype,linetotal)
MODE COMn[:]baud[,][parity][,][databits][,][stopbits][,][retry]
MODE LPTn[:]=COMn
MODE CON[RATE=(number)][DELAY=(number)]
MODE (device) CODEPAGE PREPARE=(codepage) [d:][path]filename
MODE (device) CODEPAGE PREPARE=(codepage list) [d:][path]filename
MODE (device) CODEPAGE SELECT=(codepage)
MODE (device) CODEPAGE [/STATUS]
MODE (device) CODEPAGE REFRESH

I'm interested in adding support to Staging to change the CLI screen mode and the key repeat rate, but I don't like the idea of forcing people to learn these archaic incantations.

E.g. to set the key repeat & delay to "fast" and the 80x50 mode:

MODE CON: RATE=32 DELAY=1
MODE CON: COLS=80 LINES=50

I'd rather give people VIDMODE and KEYRATE Staging-only built-ins with better syntax:

KEYRATE FAST
KEYRATE 32 1
VIDMODE 80x50

For video modes, the MODE command is rather limited; I want to add support for 80x30, 80x43, 80x50, and 132x43, 132x50 and 132x60 VESA modes at least.

What could throw a spanner in the works is if you're convinced we must have the MODE command anyway for some COM/LPT or codepage related stuff. I have little experience with those areas, so I'm asking your opinion on this.

@Grounded0 Grounded0 added the DOS Issues related to DOS integration or DOS commands label May 15, 2024
@FeralChild64
Copy link
Collaborator

@johnnovak I think we should implement a stripped-down MODE command and possibly add KEYRATE (but definitely not the VIDMODE!) as a syntactic sugar.

Rationale: At least in the latest MS-DOS/PC-DOS/DR-DOS, there is a much easier syntax available for changing the screen mode:

  • MODE 80,50 - switches to 80x50 screen mode
  • MODE 40 - switches to 40-column screen mode, keeps current number of rows unchanged
  • MODE ,50 - switches to 50-row screen mode, keeps the current number of columns unchanged

We could add support for 'MODE 80x50' syntax in addition to the standard 'MODE 80,50' (it shouldn't conflict with anything), but I see no good reason for having a separate VIDMODE command.

See also the DR-DOS help, it's often much more descriptive than MS-DOS one:

1
2

@johnnovak
Copy link
Member

johnnovak commented May 15, 2024

@FeralChild64 I like that approach, and the MODE W,H and MODE WxW syntax is sane. I'll add a separate KEYRATE command too, then if we really need some "compatible" MODE command features, we can add them in the future as needed.

The VIDMODE stuff was inspired by the existing VMODE program, but yeah, just implementing a barebones MODE command with enhancements is better 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DOS Issues related to DOS integration or DOS commands enhancement New feature or enhancement of existing features
Projects
None yet
Development

No branches or pull requests

4 participants