PCem doesn't have TAS tools, but it works well in libTAS, so it's otherwise quite TASable at this point. In addition to running DOS, it can run Linux and early Windows, along with various environments like Flash or Java.
Source code: https://github.com/TASEmulators/pcem
This guide will show you how to set up PCem for libTAS in general. If you want to use PCem for DOS, we have pre-made configurations available and you can skip most of this guide. Look here for information on setting up for DOS and here for our submission rules.
Table of contents
- What you'll need
- Configuring PCem
- Setting up the BIOS
- Setting up the hard drive
- Using libTAS with PCem
- Swapping disks
- Movie submissions
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
- 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.
- A bootable floppy disk image or bootable CD. If you're setting up for DOS or Windows, you can use this modified boot floppy from JPC-rr, it has CD support added and is fully redistributable. Get the disk here
- Have a game in mind when you start this guide. You can either have the game pre-installed in a folder and/or have the installation media for a game and/or OS (floppy images or ISOs are fine).
When you first boot up PCem, you will see a configuration manager. Click on New to set up your system. Each of these sections is in relation to the tabs on the Configure PCem window. Config files are saved into
Important: Configurations can be made in Windows, but in order for them to work on Linux, the .cfg file has to have its line endings converted by using
dos2unix file.cfgin the terminal.
This tab sets up basic system specs such as the chipset, the CPU, and the RAM.
Machine + CPU
The machine will decide which BIOS you'll be using, and each machine is only compatible with a certain range of CPUs. When selecting the CPU, keep in mind our rules on the PC game environment. If the CPU affects the speed of the gameplay, such as in One Must Fall 2097, you must pick a processor that the game was intended to be played on. Refer to the game's official documentation for guidance on which system specs are recommended. If the CPU speed only shortens loading times and improves the framerate, feel free to use the fastest one you can.
Refer to the game's documentation for how much RAM you'll need. Each machine has a certain cap on how much RAM you can use. Keep in mind that the more RAM you use, the longer it will take to count it on the POST screen.
This is where you choose which GPU you're going to use. Only some of these are single-threaded, you should avoid the following choices: ATI Graphics Pro Turbo, Diamond Stealth 32, Number Nine 9FX, Paradise Bahamas 64, Phoenix S3, Tseng ET4000AX, and Trident TGUI9440.
If you're unsure, pick S3 ViRGE/DX, as it's the best one and will be compatible with almost everything.
Voodoo has been modified to be single-threaded on the TASVideos PCem branch, so feel free to use it if your game supports it. Note that savestates won't work in libTAS versions 1.3.4 or older if you have this checked.
You should look at your game's documentation to see what sound cards it's compatible with. If the game is compatible with Sound Blaster, then pick Sound Blaster AWE32. If it only uses Adlib, then pick Adlib Gold. If it only uses PC Speaker, then pick None.
You can see the Sound Blaster configuration by clicking on the button next to the device dropdown menu. They are not displayed, but by default the IRQ is 7 and the DMA channel is 1. You should only change things in this window if you really know what you're doing.
This is where you set up which drives are connected. You will probably only need one floppy disk, so set FDD1 to 3.5" 2.88M. If you want to install your game from 5.25" disk images, set FDD2 accordingly, otherwise leave it at None. If you're using the CD drive, pick the fastest speed.
Make drive C: a hard drive and click on New. This is where you decide how big you want the hard drive to be. Refer to the game's documentation for how much space it needs. Don't just pick the bare minimum that the game files will fit into; most games create temporary files while they're running, and the game will crash if there isn't enough room for them. Also be careful not to create a drive massively larger than what you need. The time it takes to load and save states in libTAS is proportional to the size of the hard drive image. Don't worry about sectors, heads, and cylinders; type in the size you want and it will figure out the rest for you. Pick a filename and path and click OK. This will create the hard drive image, but it's not ready to use just yet. Preparing the hard drive will be covered in a later section.
Set one of the other drives to a CD-ROM. Even if your game doesn't use a CD, it could be used to move files later. Leave the rest blank.
Anything is fine here. You will need mouse drivers to make this functional, most boot disks come with ctmouse.
Feel free to set up a joystick if your game supports it. No additional drivers or setup is required. You can bind the joystick buttons to any USB game controller.
Network connections could cause determinism issues, so leave this at None.
Setting up the BIOS
When you have the configuration done, you're ready to boot up PCem. If this is your first time running a chipset, you might get a CMOS error, this is normal. Either way, you will want to enter BIOS setup, usually this is done by pressing the Del key during the POST screen. All of the BIOS screens will look different, but all the functions referenced here will be there, although you might have to look for them. The most common chipset will be Socket 7 Shuttle HOT-557, so the screenshots and instructions will be for that.
You will see this screen:
The only menu options we really care about are the first two, Standard CMOS Setup and BIOS Features Setup.
Standard CMOS Setup
Remember what you put into the Drives tab during configuration? You'll have to make sure this matches that. Generally with this chipset, you can set the type to Auto for any drive you installed and it will auto-detect the specs of the drive. If you set one of the drives to be a CD, make sure that's Auto as well. In some BIOS setups, you will either have to use a function to detect each drive or you'll have to manually enter the cylinders, heads, and sectors of the drive. Set unused drives to None so it doesn't try to look for them during POST.
Make sure Drive A and Drive B match what you set for FDD1 and FDD2, respectively. Don't worry about the clock, the time set by libTAS will override it.
Back out of this menu and go to BIOS Features Setup.
BIOS Features Setup
The only thing you want to touch on this screen is the Boot Sequence. If you're booting from a floppy disk, make the it boot from "A" first, and if you want to boot from a CD, make it boot from "CDROM" first.
Back out of this menu and do Save & Exit Setup. You should now be able to set up the hard drive.
Setting up the hard drive
Reset PCem and it should get past the POST screen this time. You should see something similar to this:
Right-click on the PCem window (while the mouse is released) and load up your boot floppy or CD. If you're using a floppy go to Disc -> Change drive A:, and if you're using a CD go to CD-ROM -> Load image. Hit Enter to continue.
Partitioning and formatting
You will need to partition and format the hard drive using tools on the boot disk. How you do this will depend on the boot disk you're using, refer to the subsections for instructions on specific platforms.
Moving files onto the hard drive
It's time to put your game/OS on the hard drive. If you have floppy images you'd like to install from, it's ok to unmount a boot floppy and insert a new one. If you have an ISO, the boot disk should have already loaded CD drivers and you can load the CD image from the right-click menu. When you are installing, document your installation steps so we can properly replicate your hard drive!
If you have some files already prepared in a folder, it's surprisingly easy to move files into your drive with the built-in Disk Image Mounter. Use the following command in the terminal:
gnome-disk-image-mounter --writable /path/to/harddrive.img
harddrive.imgis the hard drive image you have for your configuration. This will mount it as a drive on your system. You can then copy + paste the game files using whatever file manager you prefer. Be sure to unmount it when you're done.
If you want to transfer the files within PCem, you can use the following terminal command in Linux to make a quick ISO file out of a folder:
mkisofs -o name.iso /path/to/folder
Substitute the filename and the folder path accordingly. Mount the ISO in PCem and copy the files from the CD drive to the hard drive.
Some older chipsets won't support a CD drive; in this case, your files may be small enough to fit on a floppy. To create a floppy image with your files on it, use the following series of commands:
mkfs.msdos -C /path/to/floppy.img 1440 sudo mkdir /media/floppy1/ sudo mount -o loop /path/to/floppy.img /media/floppy1/ sudo cp -R /path/to/files/ /media/floppy1/ sudo umount /media/floppy1/
Do not use this method for TASes: this can create different file structures on different PCs and cause desyncs!
Substitute the paths and floppy image name as needed here. The
mkdircommand may not be necessary if you have already done this before. With this, you should have a floppy image that you can mount to PCem and copy the files to your hard drive.
Using libTAS with PCem
libTAS needs some very specific settings to work with PCem, so read this section carefully.
Set the game executable to the PCem path you've been using. libTAS doesn't like the configuration selection screen, so you need to bypass it by setting the command-line options to
--config /path/to/config.cfg, where config.cfg is the PCem configuration file you just set up, which will likely be located in
Set the frames per second to 100/1. Uncheck Runtime -> Recycle threads. Everything else can be left at the default settings; PCem needs no time tracking, and Prevent writing to disk can remain checked so your hard drive image will be unchanged after you're done.
Make a test encode of your game to make sure the sound is working! There are a ton of resolution changes while booting, which will produce a lot of separate media files, so remember to open the correct movie segment when you're testing.
Here are a few tips for using PCem in libTAS:
- Avoid loading a savestate made before a resolution change; this can cause desyncs, crashes, or just mess up the display.
- Make sure Runtime -> Savestates -> Incremental savestates is unchecked, this does not work with PCem. Your loaded states will fail and give you a stack smashing error.
- 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.
- The system time specified by libTAS will be properly transferred to PCem; it might look wrong in the BIOS, but Windows will correctly display the time and date.
The right-click menu in normal PCem bugs out in libTAS, presenting a problem when swapping disks is needed mid-TAS. Keylie has kindly coded in hotkeys to the TASVideos build of PCem to solve this.
To specify the list of disks you want to use, you need to manually put them into the .cfg file where the disk path would normally be. The list should be the paths of the disks delimited by semicolons. For CDs, for example, you should specify:
cdrom_path = path1;path2;path3;etc...
cdrom_drive = 200, otherwise this may not work.
For floppy drives A: and B: respectively, specify:
disc_a = path1;path2;path3;etc...
disc_b = path1;path2;path3;etc...
The following hotkeys control disk swapping.
Ctrl + , + Arrow
Floppy drive A:
Ctrl + . + Arrow
Floppy drive B:
Ctrl + / + Arrow
Left: Select previous disk in list
Right: Select next disk in list
Down: Load selected disk
Up: Eject current disk
The messages for disk selections and loading will be displayed in the console window.
When you submit a libTAS movie to TASVideos, the following rules apply.
We allow libTAS to run PCem as a DOS machine emulator. Only TASVideos releases of PCem are allowed. Such releases are marked
stto indicate single-threading - modification required for determinism, not available in the original PCem.
Platform: DOSat the very start of the .ltm movie annotations, that way the site will recognize your platform properly.
Closely follow the guides linked in this section to prevent desyncs!
- Synchronization of your movie depends on the following file types:
- If Runtime -> Prevent writing to disk is unchecked in libTAS, PCem will change your files, which will cause desyncs.
- If you change those files yourself outside of libTAS and PCem, it will also cause desyncs.
- Use .ltm annotations to document which machine ROM files your movie requires, along with their hashsums. PCem logs to the terminal which ROMs it's loading.
Emulate compatible machine
PCem can emulate variety of machines, but the only system currently allowed for libTAS+PCem submissions is DOS. It is further limited to 3 machine configurations, each representing an era of DOS games based on release date and system requirements.
- 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.
If the game you're TASing doesn't work properly on either of these 3 setups, you can modify the one that's closest to intended specs, to make your game work well. Keep in mind though that PC game environment must be legitimate. If your modifications are beyond tweaking the
.cfgfiles, you will need to record a libTAS movie of you setting up your config, similar to how our setups were recorded, including meticulous documentation of the process. Explain what and why you're changing too.
Game installation should be a part of your main movie. This part of the movie shouldn't waste time for no reason, but still configure your game to look and sound best.
The only exception is games that take several minutes to install, in which case you may record game installation in a separate movie and provide it as a verification. Optimizing this movie is not required.