mirror of
https://github.com/LCTT/TranslateProject.git
synced 2024-12-26 21:30:55 +08:00
Merge pull request #11006 from way-ww/master
翻译完毕20180905 How To Run MS-DOS Games And Programs In Linux.md
This commit is contained in:
commit
8d38655569
@ -1,255 +0,0 @@
|
||||
Translating by way-ww
|
||||
|
||||
How To Run MS-DOS Games And Programs In Linux
|
||||
======
|
||||
|
||||
![](https://www.ostechnix.com/wp-content/uploads/2018/09/dosbox-720x340.png)
|
||||
|
||||
If you ever wanted to try some good-old MS-DOS games and defunct C++ compilers like Turbo C++ in Linux? Good! This tutorial will teach you how to run MS-DOS games and programs under Linux environment using **DOSBox**. It is an x86 PC DOS-emulator that can be used to run classic DOS games or programs. DOSBox emulates an Intel x86 PC with sound, graphics, mouse, joystick, and modem etc., that allows you to run many old MS-DOS games and programs that simply cannot be run on any modern PCs and operating systems, such as Microsoft Windows XP and later, Linux and FreeBSD. It is free, written using C++ programming language and distributed under GPL.
|
||||
|
||||
### Install DOSBox In Linux
|
||||
|
||||
DOSBox is available in the default repositories of most Linux distributions.
|
||||
|
||||
On Arch Linux and its variants like Antergos, Manjaro Linux:
|
||||
```
|
||||
$ sudo pacman -S dosbox
|
||||
|
||||
```
|
||||
|
||||
On Debian, Ubuntu, Linux Mint:
|
||||
```
|
||||
$ sudo apt-get install dosbox
|
||||
|
||||
```
|
||||
|
||||
On Fedora:
|
||||
```
|
||||
$ sudo dnf install dosbox
|
||||
|
||||
```
|
||||
|
||||
### Configure DOSBox
|
||||
|
||||
There is no initial configuration required to use DOSBox and it just works out of the box. The default configuration file named `dosbox-x.xx.conf` exists in your **`~/.dosbox`** folder. In this configuration file, you can edit/modify various settings, such as starting DOSBox in fullscreen mode, use double buffering in fullscreen, set preferred resolution to use for fullscreen, mouse sensitivity, enable or disable sound, speaker, joystick and a lot more. As I mentioned earlier, the default settings will work just fine. You need not to make any changes.
|
||||
|
||||
### Run MS-DOS Games And Programs In Linux
|
||||
|
||||
To launch DOSBox, run the following command from the Terminal:
|
||||
```
|
||||
$ dosbox
|
||||
|
||||
```
|
||||
|
||||
This is how DOSBox interface looks like.
|
||||
|
||||
![](https://www.ostechnix.com/wp-content/uploads/2018/09/Dosbox-prompt.png)
|
||||
|
||||
As you can see, DOSBox comes with its own DOS-like command prompt with a virtual `Z:\` Drive, so if you’re familiar with MS-DOS, you wouldn’t find any difficulties to work in DOSBox environment.
|
||||
|
||||
Here is the output of `dir`command (Equivalent of `ls` command in Linux) output:
|
||||
|
||||
![](http://www.ostechnix.com/wp-content/uploads/2018/09/dir-command-output.png)
|
||||
|
||||
If you’re a new user and it is the first time you use DOSBox, you can view the short introduction about DOSBox by entering the following command in DOSBox prompt:
|
||||
```
|
||||
intro
|
||||
|
||||
```
|
||||
|
||||
Press ENTER to go through next page of the introduction section.
|
||||
|
||||
To view the list of most often used commands in DOS, use this command:
|
||||
```
|
||||
help
|
||||
|
||||
```
|
||||
|
||||
To view list of all supported commands in DOSBox, type:
|
||||
```
|
||||
help /all
|
||||
|
||||
```
|
||||
|
||||
Remember, these commands should be used in the DOSBox prompt, not in your Linux Terminal.
|
||||
|
||||
DOSBox also supports a good set of keyboard bindings. Here is the default keyboard shortcuts to effectively use DOSBox.
|
||||
|
||||
![](http://www.ostechnix.com/wp-content/uploads/2018/09/Dosbox-keyboard-shortcuts.png)
|
||||
|
||||
To exit from DOSBox, simply type and hit ENTER:
|
||||
```
|
||||
exit
|
||||
|
||||
```
|
||||
|
||||
By default, DOSBox starts with a normal window-sized screen like above.
|
||||
|
||||
To start dosbox directly in fullscreen, edit your `dosbox-x.xx.conf` file and set the value of **fullscreen** variable as **enable**. Now, DosBox will start in fullscreen mode. To go back to normal screen, press **ALT+ENTER**.
|
||||
|
||||
Hope you get the basic usage of DOSBox.
|
||||
|
||||
Let us go ahead and install some DOS programs and games.
|
||||
|
||||
First, we need to create directories to save the programs and games in our Linux system. I am going to create two directories named **`~/dosprograms`** and **`~/dosgames`** , the first one for storing programs and latter for storing games.
|
||||
```
|
||||
$ mkdir ~/dosprograms ~/dosgames
|
||||
|
||||
```
|
||||
|
||||
For the purpose of this guide, I will show you how to install **Turbo C++** program and Mario game. First, we will see how to install Turbo.
|
||||
|
||||
Download the latest Turbo C++ compiler, extract it and save the contents file in **`~/dosprograms`** directory. I have save the contents turbo c++ in my **~/dosprograms/TC/** directory.
|
||||
```
|
||||
$ ls dosprograms/tc/
|
||||
BGI BIN CLASSLIB DOC EXAMPLES FILELIST.DOC INCLUDE LIB README README.COM
|
||||
|
||||
```
|
||||
|
||||
Start Dosbox:
|
||||
```
|
||||
$ dosbox
|
||||
|
||||
```
|
||||
|
||||
And mount the **`~/dosprograms`** directory as virtual drive **C:\** in DOSBox.
|
||||
```
|
||||
Z:\>mount c ~/dosprograms
|
||||
|
||||
```
|
||||
|
||||
You will see an output something like below.
|
||||
```
|
||||
Drive C is mounted as local directory /home/sk/dosprograms.
|
||||
|
||||
```
|
||||
|
||||
![](https://www.ostechnix.com/wp-content/uploads/2018/09/Dosbox-prompt-1.png)
|
||||
|
||||
Now, change to the C drive using command:
|
||||
```
|
||||
Z:\>c:
|
||||
|
||||
```
|
||||
|
||||
And then, switch to **tc/bin** directory:
|
||||
```
|
||||
Z:\>cd tc/bin
|
||||
|
||||
```
|
||||
|
||||
Finally, run turbo c++ executable file:
|
||||
```
|
||||
Z:\>tc.exe
|
||||
|
||||
```
|
||||
|
||||
**Note:** Just type first few letters and hit ENTER to autocomplete the file name.
|
||||
|
||||
![](https://www.ostechnix.com/wp-content/uploads/2018/09/Dosbox-prompt-4.png)
|
||||
|
||||
You will now be in Turbo C++ console.
|
||||
|
||||
![](https://www.ostechnix.com/wp-content/uploads/2018/09/Dosbox-prompt-5.png)
|
||||
|
||||
Create new file (ATL+F) and start coding:
|
||||
|
||||
![](https://www.ostechnix.com/wp-content/uploads/2018/09/Dosbox-prompt-6.png)
|
||||
|
||||
Similarly, you can install and run other classic DOS programs.
|
||||
|
||||
**Troubleshooting:**
|
||||
|
||||
You might be encountered with following error while running turbo c++ or any other dos programs:
|
||||
```
|
||||
DOSBox switched to max cycles, because of the setting: cycles=auto. If the game runs too fast try a fixed cycles amount in DOSBox's options. Exit to error: DRC64:Unhandled memory reference
|
||||
|
||||
```
|
||||
|
||||
To fix this, edit your **~/.dosbox/dosbox-x.xx.conf** file:
|
||||
```
|
||||
$ nano ~/.dosbox/dosbox-0.74.conf
|
||||
|
||||
```
|
||||
|
||||
Find the following variable and change its value from:
|
||||
```
|
||||
core=auto
|
||||
|
||||
```
|
||||
|
||||
to
|
||||
```
|
||||
core=normal
|
||||
|
||||
```
|
||||
|
||||
Save and close the file. Now you can be able to run the dos programs without any problems.
|
||||
|
||||
Now, let us see how to run a dos-based game, for example **Mario Bros VGA**.
|
||||
|
||||
Download Mario game from [**here**][1] and extract the contents in **~/dosgames** directory in your Linux machine.
|
||||
|
||||
Start DOSBox:
|
||||
```
|
||||
$ dosbox
|
||||
|
||||
```
|
||||
|
||||
We have used virtual drive **c:** for dos programs. For games, let us use **d:** as virtual drive.
|
||||
|
||||
At the DOSBox prompt, run the following command to mount **~/dosgames** directory as virtuald drive **d**.
|
||||
```
|
||||
Z:\>mount d ~/dosgames
|
||||
|
||||
```
|
||||
|
||||
Switch to D: drive:
|
||||
```
|
||||
Z:\>d:
|
||||
|
||||
```
|
||||
|
||||
And then go to mario game directory and run the **mario.exe** file to launch the game.
|
||||
```
|
||||
Z:\>cd mario
|
||||
|
||||
Z:\>mario.exe
|
||||
|
||||
```
|
||||
|
||||
![](https://www.ostechnix.com/wp-content/uploads/2018/09/Dosbox-prompt-7.png)
|
||||
|
||||
Start playing the game:
|
||||
|
||||
![](https://www.ostechnix.com/wp-content/uploads/2018/09/Mario-game-in-dosbox.png)
|
||||
|
||||
Similarly, you can run any dos-based games as described above. You can view the complete list of supported games that can be run using DOSBox [**here**][2].
|
||||
|
||||
### Conclusion
|
||||
|
||||
Even though DOSBOX is not a complete replacement for MS-DOS and it lacks many of the features found in MS-DOS, it is just enough to install and run most DOS games and programs.
|
||||
|
||||
For more details, refer the official [**DOSBox manual**][3].
|
||||
|
||||
And, that’s all for now. Hope this was useful. More good stuffs to come. Stay tuned!
|
||||
|
||||
Cheers!
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.ostechnix.com/how-to-run-ms-dos-games-and-programs-in-linux/
|
||||
|
||||
作者:[SK][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[译者ID](https://github.com/译者ID)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.ostechnix.com/author/sk/
|
||||
[1]: https://www.dosgames.com/game/mario-bros-vga
|
||||
[2]: https://www.dosbox.com/comp_list.php
|
||||
[3]: https://www.dosbox.com/DOSBoxManual.html
|
@ -0,0 +1,250 @@
|
||||
在Linux中怎么运行Ms-Dos游戏和程序
|
||||
======
|
||||
|
||||
![](https://www.ostechnix.com/wp-content/uploads/2018/09/dosbox-720x340.png)
|
||||
|
||||
你是否想过尝试一些经典的MS-DOS游戏和像Turbo C++这样的C++ 编译器?这篇教程将会介绍如何使用**DOSBox**在Linux环境下运行MS-DOS的游戏和程序。**DOSBox**是一个x86平台的DOS模拟器,可以用来运行经典的DOS游戏和程序。 DOSBox模拟带有声音,图形,鼠标,操纵杆和调制解调器等的因特尔 x86 电脑,它允许你运行许多旧的MS-DOS游戏和程序,这些游戏和程序根本无法在任何现代PC和操作系统上运行,例如Microsoft Windows XP及更高版本,Linux和FreeBSD。 DOSBox是免费的,使用C ++编程语言编写并在GPL下分发。
|
||||
|
||||
### 在Linux上安装DOSBox
|
||||
|
||||
DOSBox在大多数Linux发行版的默认仓库中都能找的到
|
||||
|
||||
在Arch Linux及其衍生版如Antergos,Manjaro Linux上:
|
||||
```
|
||||
$ sudo pacman -S dosbox
|
||||
|
||||
```
|
||||
|
||||
在 Debian, Ubuntu, Linux Mint上:
|
||||
```
|
||||
$ sudo apt-get install dosbox
|
||||
|
||||
```
|
||||
|
||||
在 Fedora上:
|
||||
```
|
||||
$ sudo dnf install dosbox
|
||||
|
||||
```
|
||||
|
||||
### 配置DOSBox
|
||||
|
||||
DOSBox是一个开箱即用的软件,它不需要进行初始化配置。 它的配置文件位于**`〜/ .dosbox` **文件夹中,名为`dosbox-x.xx.conf`。 在此配置文件中,你可以编辑/修改各种设置,例如以全屏模式启动DOSBox,全屏使用双缓冲,设置首选分辨率,鼠标灵敏度,启用或禁用声音,扬声器,操纵杆等等。 如前所述,默认设置即可正常工作。 你可以不用进行任何更改。
|
||||
|
||||
### 在Linux中运行MS-DOS上的游戏和程序
|
||||
|
||||
终端运行以下命令启动DOSBox:
|
||||
```
|
||||
$ dosbox
|
||||
|
||||
```
|
||||
|
||||
下图就是DOSBox的界面
|
||||
|
||||
![](https://www.ostechnix.com/wp-content/uploads/2018/09/Dosbox-prompt.png)
|
||||
|
||||
正如你所看到的,DOSBox带有自己的类似DOS的命令提示符和一个虚拟的`Z:\`Drive,如果你熟悉MS-DOS的话,你会发现在DOSBox环境下工作不会有任何问题。
|
||||
|
||||
这是`dir`命令(在Linux中等同于`ls`命令)的输出:
|
||||
|
||||
![](http://www.ostechnix.com/wp-content/uploads/2018/09/dir-command-output.png)
|
||||
|
||||
如果你是第一次使用DOSBox,你可以通过在DOSBox提示符中输入以下命令来查看关于DOSBox的简介:
|
||||
```
|
||||
intro
|
||||
|
||||
```
|
||||
|
||||
在介绍部分按ENTER进入下一页
|
||||
|
||||
要查看DOS中最常用命令的列表,请使用此命令:
|
||||
```
|
||||
help
|
||||
|
||||
```
|
||||
|
||||
要查看DOSBox中所有支持的命令的列表,请键入:
|
||||
```
|
||||
help /all
|
||||
|
||||
```
|
||||
|
||||
记好了这些命令应该在DOSBox提示符中使用,而不是在Linux终端中使用。
|
||||
|
||||
DOSBox还支持一些实用的键盘组合键。 下图是能有效使用DOSBox的默认键盘快捷键。
|
||||
|
||||
![](http://www.ostechnix.com/wp-content/uploads/2018/09/Dosbox-keyboard-shortcuts.png)
|
||||
|
||||
要退出DOSBox,只需键入并按Enter:
|
||||
```
|
||||
exit
|
||||
```
|
||||
|
||||
默认情况下,DOSBox开始运行时的正常屏幕窗口大小如上所示
|
||||
|
||||
要直接在全屏启动dosbox,请编辑`dosbox-x.xx.conf`文件并将**fullscreen**变量的值设置为**enable**。 之后,DosBox将以全屏模式启动。 如果要返回正常屏幕,请按 **ALT+ENTER**
|
||||
|
||||
希望你能掌握DOSBox的这些基本用法
|
||||
|
||||
让我们继续安装一些DOS程序和游戏。
|
||||
|
||||
首先,我们需要在Linux系统中创建目录来保存程序和游戏。 我将创建两个名为**`〜/ dosprograms` **和**`〜/ dosgames` **的目录,第一个用于存储程序,后者用于存储游戏。
|
||||
```
|
||||
$ mkdir ~/dosprograms ~/dosgames
|
||||
|
||||
```
|
||||
出于本指南的目的,我将向你展示如何安装**Turbo C ++**程序和Mario游戏。我们首先将看到如何安装Turbo。
|
||||
下载最新的Turbo C ++编译器并将其解压到**`〜/ dosprograms` **目录中。 我已经将turbo c ++保存在在我的**〜/ dosprograms / TC /**目录中了。
|
||||
```
|
||||
$ ls dosprograms/tc/
|
||||
|
||||
BGI BIN CLASSLIB DOC EXAMPLES FILELIST.DOC INCLUDE LIB README README.COM
|
||||
|
||||
```
|
||||
|
||||
运行 Dosbox:
|
||||
```
|
||||
$ dosbox
|
||||
|
||||
```
|
||||
|
||||
将**`〜/ dosprograms` **目录挂载为DOSBox中的虚拟驱动器 **C:\**
|
||||
```
|
||||
Z:\>mount c ~/dosprograms
|
||||
|
||||
```
|
||||
|
||||
你会看到类似下面的输出
|
||||
```
|
||||
Drive C is mounted as local directory /home/sk/dosprograms.
|
||||
|
||||
```
|
||||
|
||||
|
||||
![](https://www.ostechnix.com/wp-content/uploads/2018/09/Dosbox-prompt-1.png)
|
||||
|
||||
现在,使用命令切换到C盘:
|
||||
```
|
||||
Z:\>c:
|
||||
|
||||
```
|
||||
|
||||
然后切换到**tc / bin**目录:
|
||||
```
|
||||
Z:\>cd tc/bin
|
||||
|
||||
```
|
||||
|
||||
最后,运行turbo c ++可执行文件:
|
||||
```
|
||||
Z:\>tc.exe
|
||||
|
||||
```
|
||||
|
||||
**备注:**只需输入前几个字母,然后按ENTER键自动填充文件名。
|
||||
|
||||
![](https://www.ostechnix.com/wp-content/uploads/2018/09/Dosbox-prompt-4.png)
|
||||
|
||||
你现在将进入Turbo C ++控制台。
|
||||
|
||||
![](https://www.ostechnix.com/wp-content/uploads/2018/09/Dosbox-prompt-5.png)
|
||||
|
||||
创建新文件(ATL + F)并开始编程:
|
||||
|
||||
![](https://www.ostechnix.com/wp-content/uploads/2018/09/Dosbox-prompt-6.png)
|
||||
|
||||
你可以同样安装和运行其他经典DOS程序。
|
||||
|
||||
**故障排除:**
|
||||
|
||||
运行turbo c ++或其他任何dos程序时,你可能会遇到以下错误:
|
||||
|
||||
```
|
||||
DOSBox switched to max cycles, because of the setting: cycles=auto. If the game runs too fast try a fixed cycles amount in DOSBox's options. Exit to error: DRC64:Unhandled memory reference
|
||||
|
||||
```
|
||||
|
||||
要解决此问题,编辑**〜/ .dosbox / dosbox-x.xx.conf **文件:
|
||||
```
|
||||
$ nano ~/.dosbox/dosbox-0.74.conf
|
||||
|
||||
```
|
||||
|
||||
找到以下变量:
|
||||
```
|
||||
core=auto
|
||||
|
||||
```
|
||||
|
||||
并更改其值为:
|
||||
```
|
||||
core=normal
|
||||
```
|
||||
|
||||
现在,让我们看看如何运行基于DOS的游戏,例如 **Mario Bros VGA**
|
||||
|
||||
从 [**这里**][1]下载Mario游戏,并将其解压到Linux中的**〜/ dosgames **目录
|
||||
|
||||
运行 DOSBox:
|
||||
```
|
||||
$ dosbox
|
||||
|
||||
```
|
||||
|
||||
我们刚才使用了虚拟驱动器 **c:** 来运行dos程序。现在让我们使用 **d:** 作为虚拟驱动器来运行游戏。
|
||||
|
||||
在DOSBox提示符下,运行以下命令将 **~/dosgames** 目录挂载为虚拟驱动器 **d**
|
||||
```
|
||||
Z:\>mount d ~/dosgames
|
||||
|
||||
```
|
||||
|
||||
进入驱动器D:
|
||||
```
|
||||
Z:\>d:
|
||||
|
||||
```
|
||||
|
||||
然后进入mario游戏目录并运行 **mario.exe** 文件来启动游戏
|
||||
```
|
||||
Z:\>cd mario
|
||||
|
||||
Z:\>mario.exe
|
||||
|
||||
```
|
||||
|
||||
![](https://www.ostechnix.com/wp-content/uploads/2018/09/Dosbox-prompt-7.png)
|
||||
|
||||
开始玩游戏:
|
||||
|
||||
![](https://www.ostechnix.com/wp-content/uploads/2018/09/Mario-game-in-dosbox.png)
|
||||
|
||||
你可以同样像上面所说的那样运行任何基于DOS的游戏。 [**点击这里**] [2]查看可以使用DOSBOX运行的游戏的完整列表。
|
||||
|
||||
### 总结
|
||||
|
||||
尽管DOSBOX并不能作为MS-DOS的完全替代品,并且还缺少MS-DOS中的许多功能,但它足以安装和运行大多数的DOS游戏和程序。
|
||||
|
||||
有关更多详细信息,请参阅官方[**DOSBox手册**][3]
|
||||
|
||||
这就是全部内容。希望这对你有用。更多优秀指南即将到来。 敬请关注!
|
||||
|
||||
干杯!
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
via: https://www.ostechnix.com/how-to-run-ms-dos-games-and-programs-in-linux/
|
||||
|
||||
作者:[SK][a]
|
||||
选题:[lujun9972](https://github.com/lujun9972)
|
||||
译者:[way-ww](https://github.com/way-ww)
|
||||
校对:[校对者ID](https://github.com/校对者ID)
|
||||
|
||||
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
|
||||
|
||||
[a]: https://www.ostechnix.com/author/sk/
|
||||
[1]: https://www.dosgames.com/game/mario-bros-vga
|
||||
[2]: https://www.dosbox.com/comp_list.php
|
||||
[3]: https://www.dosbox.com/DOSBoxManual.html
|
Loading…
Reference in New Issue
Block a user