Skip to content

A fixed windowresolution is not handled correctly #2175

@ant-222

Description

@ant-222

I think the windowresolution setting in DOSBox-X is illogical and buggy. If one specifies a fixed window size, e.g.:

windowresolution = 800x600

launches DOSBox-X, and maximises its window, the game display stays the same size, although the window is properly maximized. This is a contradiction.
Furthermore, with a fixed setting the user is no longer able to stretch the window by dragging its edges. This makes no sense because the default value:

windowresolution = original

which allows resizing on-the-fly, requires (according to its name) that the window have the size of the graphical mode being emulated (with optional aspect-ratio correction).

In the original DOSBox, this setting is the only way control the size of the window. But since DOSBox-X supports dynamic resizing, I propose the following changes:

  1. The setting shall be interpreted as the initial window size of the newly-started DOSBox-X (preferably in terms of the client area).

  2. In case of a fixed size, stretching and maximization should work exactly as they currently do with the value original. There is no reason to disable them.

Observe also that the original DOSBox very rarely allows black borders around the window. I think DOSBox-X can prevent them too, and easily enough: by ensuring that the window have exactly the size required to accomodate the emulated display or that the emulated display fill the window's client area. The exact behavior should depend on the scaler and aspect-correction settings.

To prevent absurd window dimensions, the approach implemented in the pixel-perfect mode can be adopted:

  1. With aspect=true, DOSBox-X shall calculate its window proportions according to the aspect ratio of the emulated display (which I believe is always 4:3).

  2. With aspect=false DOSBox-X shall strive to preserve square pixels. It is not so simple as it may seem, because the meaning of square pixel depends upon many factors, such as:

    1. the doublescan setting,
    2. the double-width and double-height flags in the renderer,
    3. the source resolution, which may be as exotic as 256x256, 360x480, or 320x400.

My current implementation of pixel-perfect mode for DOSBox-X handles all those cases and may be used as reference.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions