The entirety of the general guide applies here, this page will give you specific instructions and tips for using DOS in PCem.
If you need a boot disk (not necessary for the pre-made configurations), you can use this boot floppy disk or boot directly from a FreeDOS installation CD.
Table of contents
What you'll need
- PCem 17+st-1 or newer. This fork has some modifications to make parts of PCem single-threaded. The normal build of PCem will have determinism issues.
- Remember that the run must sync on an official emulator version or it will not be accepted.
- ROMs for PCem. These are for the different chipsets that PCem supports. We can't link them here, you'll have to get them yourself. You can find the ROM names for each piece of hardware in the PCem readme. Put the ROMs into
~/.pcem/roms/
(this path can be changed by editing~/.pcem/pcem.cfg
)- Note that the Linux port of PCem is case sensitive, pay attention to the exact ROM filenames in the readme.
- libTAS 1.4.2 or newer.
- Remember that the run must sync on an official emulator version or it will not be accepted.
Premade configurations
To make setup as easy as possible, you can just pick one of these premade configurations. They represent machines compatible with DOS games, based on era they were released in, and specs they were intended for.
- Early '80s config - for 1980s games that don't require a hard drive - ones that can boot or run directly from a floppy disk
- Late '80s package - for games released until 1989-12-31.
- Early '90s package - for games released from 1990-01-01 to 1994-12-31.
- Late '90s package - for games released after 1995-01-01.
Here's how we created them:
Using with libTAS
This section will be focusing on setting up a configuration to make tool-assisted speedruns. These guidelines will help you make a TAS that people will be able to sync on other machines. If nobody else can sync your run, then it will probably not get accepted!
Be aware of our Movie Rules for libTAS movies and especially for running DOS in PCem in libTAS.
Choosing a configuration
We offer three pre-made configurations: Late 80s, Early 90s, and Late 90s. You're encouraged to choose one that makes the most sense for your game, especially if the gameplay speed is dependent on the processor speed.
If you want to make slight modifications to the configs, e.g. add more RAM or add a joystick, feel free to do so. Just make sure you document the changes and note them in your movie annotations. You still need to start from the supplied .nvr and .img files.
Installing your game
You may install your game either from original install disks or a folder containing the pre-installed game.
VERY IMPORTANT NOTES:
- Do not modify the hard drive image outside of PCem! Different methods of mounting the image and copying files onto it can result in different file structures which can result in desyncs. Methods of modifying the hard drive within PCem are outlined below.
- Do not make unnecessary writes to the hard drive image! Seemingly harmless operations like making an empty folder and deleting it will cause desyncs.
- Always start with a fresh hard drive image from one of the packages. All modifications to the hard drive need to be done within a libTAS movie!!!
Installing from original media
If you have the original installation floppies/CDs, you can install your game either as a part of the TAS or within a verification movie (the verification movie does not have to be optimized). Provide MD5 hashes for your installation media in your movie annotations. If you need to use multiple disks, see this section for how to change disks within a movie.
Try to use original unaltered versions of your disk images if possible. You can verify the authenticity of floppy images by checking the hashes on Good Old Days (incomplete, but has quite a lot) or if you're using CDs you can reference redump.
If you make a verification movie, it's recommended you first record it with Runtime -> Prevent writing to disk checked, and then play it back with this setting unchecked to create the modified files you'll be using.
Using pre-installed version
In the case you only have the pre-installed game files, setup is actually quite easy. Put all the files into one folder. Do not include custom files that we will not be able to reproduce, such as personal save files and high score tables. Also do not use cracked versions unless there is no other option. Files not necessary to run the game, such as readmes and order forms, can be omitted if desired. Provide MD5 hashes for all files used in the movie annotations. Make an ISO of the game files with the terminal command:
mkisofs -o name.iso /path/to/folder
Substitute the ISO name and the game folder appropriately. In the .cfg file for your setup, set
cdrom_drive = 200
and cdrom_path = /path/to/name.iso
. When you reach the DOS prompt in your movie, you will need to copy the files to the C:
drive with the DOS command copy d:\*.* c:
or xcopy d:\ c:\ /e
if there are subdirectories (you can buffer these inputs while FreeDOS is loading). If the game comes with a setup utility, you may need to run it to set up proper sound and controls. A verification movie is not recommended for this installation and setup since it only takes a few seconds.
CD driver issues
The FreeDOS CD driver,
udvd2.sys
, is known to have some bugs, especially with CD audio playback, and some games do not even work with it at all, such as Fallout. If you're trying to run a game that requires a CD and it's not working quite right, you should try swapping out the CD driver as part of your movie. oakcdrom.sys
is known to work well with PCem. To swap out the CD driver:
- Do all of the following actions within your movie or verification movie, starting from fresh files.
- Include the CD driver with your game files or make an ISO with just the driver on it. (For info on how to use multiple CDs in a config, check here)
- Within libTAS, boot up the config and get to the
C:\>
prompt. Copy the driver to the appropriate place with the commandcopy d:\path\to\oakcdrom.sys c:\fdos\bin\
, substituting in the proper driver path. - Open the editor with the command
edit autoexec.bat
. Go down to the line that saysDEVLOAD /H /Q %dosdir%\BIN\UDVD2.SYS /D:FDCD0001
and replaceUDVD2.SYS
withOAKCDROM.SYS
. Do File -> Save to save it. - Reboot the PC by using the built-in Restart input for libTAS.
You can then install your game and continue.
Preparation
There are a couple things you need to set up inside and outside of libTAS to assure your movie will sync.
flash.bin
flash.bin
is a file that contains the flash memory of the system. Because the ROM gets written into it, we can't distribute it. This file may also contain custom system parameters from previous configs using the chipset. For these reasons, flash.bin
should be deleted before starting a TAS. Failure to do this may result in desyncs. The Late 80s setup does not use this, but flash.bin
can be found in ~/.pcem/roms/pb570/
for the Early 90s setup and in ~/.pcem/roms/ga686bx/
for the Late 90s setup. If you use a verification movie to install your game, you can use the flash.bin
that is generated from it, as long as we will be able to reproduce it.
libTAS Settings
libTAS only needs a few settings to work properly.
- Set the game executable to
/path/to/pcem
. Set the command line option to--config /path/to/config.cfg
, substituting the path of your .cfg file appropriately. Use the full path, do not shorten it with ~. - Set the frames per second to 100/1.
- Make sure Runtime -> Recycle threads is unchecked and Prevent writing to disk is checked.
- Make sure Runtime -> Savestates -> Incremental savestates is unchecked or savestates may not work.
That's it. Hit Start and begin TASing!
Tips
- Make a quick test encode to make sure your sound is working (uncheck Sound -> Mute before doing this). libTAS will make many video segments so make sure you open and listen to the correct one.
- Avoid loading a savestate made before a resolution change; this can cause desyncs, crashes, or just mess up the display.
- If you're using the mouse, don't make a right-click your first mouse input. This will make the right-click menu pop up, which will cause the display window to softlock. It's easy to avoid this by making an arbitrary left-click during boot, this will make PCem think the mouse is trapped and now you can right-click all you want.