Giter Site home page Giter Site logo

bladesk / dosbox-pixel-perfect Goto Github PK

View Code? Open in Web Editor NEW
35.0 5.0 5.0 6.53 MB

DOSBox mod with integer scaling, savestates and VSYNC

License: GNU General Public License v2.0

Makefile 0.64% M4 0.54% Shell 3.28% C 67.36% C++ 21.81% Batchfile 0.02% NSIS 0.05% Perl 0.04% Objective-C 0.93% HTML 0.87% Assembly 1.29% R 0.01% Logos 0.02% CMake 0.32% DIGITAL Command Language 0.23% Roff 1.74% Awk 0.27% Module Management System 0.02% SAS 0.01% Ada 0.55%

dosbox-pixel-perfect's Introduction

ℹ️ Notice

This repository has been archived, since more modern DOSBox forks with integer scaling exist now. Most notably DOSBox-X - not only does it support pixel-perfect rednering (via output=openglpp), there are also save states, GUI, Windows 98 support, 3fdx Voodoo 1 emulation, better OPL emulation and more. I recommend using DOSBox-X as a more future-proof option, but this repository will be kept archived for anyone interested.

Original readme below.


DOSBox - Pixel-perfect mod + vsync + savestates

DOSBox original vs pixel-perfect mod

This is a modified version of DOSBox with focus on super crisp visual output. It uses integer scaling to produce homogenous pixels, supports VSYNC, plays nice with high-DPI displays and adds other enhancements like savestates.

Get the latest Windows version or check the releases tab.

In case DOSBox doesn't run (VCRUNTUME140.dll missing error), you need to install the Microsoft Visual C++ 2017 Runtime Library.

Features

Pixel perfect mode (aka. integer scaling)

This mode makes the rendered image fill as much of your screen as possible while keeping it scaled to the nearest integer. GPU scaling is used instead of relying on software scalers.

The original DOSBox also renders a stretched image to a power-of-two texture, which is then stretched to the screen. This mod creates a texture with exact dimensions. This improves the image quality at the cost of breaking compatibility with very old video cards.

When aspect=false, square pixels are produced (1x1, 2x2, 3x3, etc.), which is what works best for most (but not all) games.

When aspect=true, the aspect ratio is approximated using rectangular pixels. For instance 320x200 on a 1920x1080 resolution will use 4x5 pixels. This yields a 4:3.125 aspect ratio instead of the intended 4:3, but the difference is only 4%.

Borderless fullscreen window / VSYNC

A feature used by modern games that relies on the OS to provide VSYNC. This eliminates screen tearing.

High-DPI support

This DOSBox fork is DPI-aware. When using 150% scaling, the image is no longer blurred.

Savestates

Savestates allow you to save (Alt+F5) and load (Alt+F9) any game whenever you like. Note that this is an experimental feature and some games may crash. The credit for implementing this feature goes to ZenJu, tikalat, ykhwong, gandhig and bruenor41. I used the code found here and tweaked it to compile with Visual Studio.

Ready to use

A configuration file with sane defaults is provided. No need to fiddle around with settings, just run it and have fun. The folder games is automatically mounted.

The only thing you may want to adjust per-game is the speed of the emulator (Ctrl+F11/Ctrl+F12). Some games require very low speed (ie. Lemmings needs ~6000 cycles), some may require more speed.

DOSBox config

You can just use the provided config, but if you have your own special dosbox.conf, make sure your values match the ones below to use the new features. Savestates work automatically, but you need to rebuild your mapper file, if you use one.

[sdl]
fullscreen=true
fulldouble=true
fullresolution=desktop
output=openglnb # ⚠ important: pixel-perfect scaling only works with OpenGL!
pixelperfect=true # set to false to make the image fill as much of the screen as possible
borderless=true # prevents screen tearing; set to false to disable borderless fullscreen

[render]
aspect=false # change to true if circles in your game look like ellipses
scaler=none

Building

All the dependencies are included in the source code (under lib). You need to build them before you can build DOSBox. I used Visual Studio 2017, but older versions should be fine also. Build the projects in the following order:

  • lib\libpng-1.6.29\projects\vstudio\vstudio.sln - use the "Release Library" configuration
  • lib\SDL-1.2.15\VisualC\SDL.sln
  • lib\SDL_net-1.2.7\VisualC\SDL_net.sln - requires MFC to be installed
  • visualc_net\dosbox.sln - requires SDL.dll built in the previous step to be copied next to the .exe file

dosbox-pixel-perfect's People

Contributors

bladesk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dosbox-pixel-perfect's Issues

about CTRE extension

I couldn't find a place to post it, so I post it here temporarily, sorry.

Click to Remove Element https://chrome.google.com/webstore/detail/jcgpghgjhhahcefnfpbncdmhhddedhnk

Can I make two good and practical suggestions ? 👇

209_23035912

Don't show ❶ in the screenshot, because:

209_23040236


Can you add 5 shortcut hotkeys ❓

Space :   confirm ꘌ Equivalent to click

Use the mouse to select the element, and then press the Space button to directly remove the element.

Ctrl+Z :   Undo the last element removal

Ctrl+Shift+Z : Redo : revert the last undo

Tab :    ꘌ Equivalent to Q

Shift+Tab : ꘌ Equivalent to W

209_23041447


These hotkeys are the most basic standard universal hotkeys.
If it can be supported, it will be very convenient.

Screen tearing

There is screen tearing all the time with default settings e.g. with the “Epic Pinball” game.

Tried output=opengl instead of the default output=openglnb — same result.

output=ddraw was the only nonblurry output mode that provided no tearing, but, as expected according to the DOSBox-pp readme, it’s not a subject for pixel-perfect scaling — some pixels have different size.

Fwiw, I use a 4K monitor — Dell P2415Q.

vgaonly causes the patch not to work as needed

When you specify in the dosbox config file:

[dosbox]
machine=vgaonly

then doublescan seems to kick in, making the patch not to work correctly.

Example: The game "Lemmings" needs vgaonly to represent the correct colors. But vgaonly causes the "native resolution" of Lemmings (320 x 200) to change into 640 x 400.

As a consequence, you do NOT get the expected 1280 x 1000 output with 4x5 pixels...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.