View Page Source

Back to Page
Revision 101 (current)
Edited by feos on 9/28/2024 6:06 PM
[https://github.com/TASEmulators/pcem|PCem] doesn't have TAS tools, but it works well in [EmulatorResources/LibTAS|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.

* Ensure you have completed the libTAS and PCem prerequisites in the [EmulatorResources/PCem#WhatYouLlNeed|What you'll need] section and consider skimming the usage information below before continuing on to another guide.
* General PCem usage can be found in [EmulatorResources/PCem/General|this guide] but follow the steps below for specific DOS and Windows configurations.
* If you want to use PCem for __DOS__ TASing, we have pre-made configurations available. Look [EmulatorResources/PCem/DOS|here] for information on setting up for DOS.
* If you want to use PCem for __Windows 95/XP__ TASing, you can [EmulatorResources/PCem/Windows#WhatYouLlNeed|run our Windows installation movie].
* Please read our [EmulatorResources/PCem#MovieSubmissions|submission rules] regarding PCem in libTAS.

%%TOC%%

!!! What you'll need

* [https://github.com/clementgallet/libTAS/releases|libTAS] 1.4.2 or newer.
* [https://github.com/TASEmulators/pcem/releases/tag/17%2Bst-1|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 [MovieRules#BeforeStarting|official emulator version] or it will not be accepted.
** After starting PCem once, you will need to edit {{~/.pcem/pcem.cfg}} and set {{confirm_on_stop_emulation = 0}}.
* ROMs for PCem v17. See the specific [EmulatorResources/PCem/DOS|DOS] or [EmulatorResources/PCem/Windows|Windows] configurations for a list of files you will need for the different chipsets that PCem supports. We can't provide the PCem ROMs, because they are copyrighted material. You can find ROM names for each piece of hardware in the [https://github.com/TASEmulators/pcem/tree/v17_13f53a2#systems|PCem readme]. Put the ROMs in {{~/.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.
* A bootable floppy disk image or bootable CD. If you're setting up for DOS, you can use this modified boot floppy from JPC-rr, it has CD support added and is fully redistributable. [https://files.tasvideos.org/common/Wiki/pcem/floppy.7z|Get the disk here].
* Have a game in mind when you start this guide. You can either pre-install the game in a folder and/or have the installation media for a game and/or OS (floppy images or ISOs are fine). See  [EmulatorResources/PCem#InstallingYourGame|Installing Your Game] for more information.

!!! Using libTAS with PCem

!! Very important sync notes

Closely follow the guides in this section to prevent desyncs!
* __Synchronization of your movie depends on the following file types:__ {{.img}}, {{.nvr}}, {{.cfg}}, and {{flash.bin}}.
** 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.
* __All modifications to the hard drive need to be done within a libTAS+PCem movie!!!__
** 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.
** 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 the hard drive image from one of our official packages.__
** Back up your hard disk image file after you've installed your OS so you don't have to run the installation movie every time.
* __Use full paths everywhere.__
** Since paths will be different for different users, we use a placeholder {{/full/path/to/file.ext}} path in our guides. It is always meant to be substituted with whatever your actual full path to a given file is.

!! Settings

libTAS needs some very specific settings to work with PCem, so read this section carefully.
# Set the game executable to the full path to pcem, usually {{/usr/bin/pcem}}.
# Set the command line option to {{--config /full/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 (PCem only runs at 100fps).
# Make sure ''Runtime -> Savestates -> Incremental savestates'' is __unchecked__ or savestates may not work.
# Make sure ''Runtime -> Prevent writing to disk'' is __checked__.
#* If your movie is going to contain a machine reboot using libTAS's ''Restart'' input, contents of PCem files in memory will still be written to those files on disk, even if you have ''Prevent writing to disk'' enabled.

!! Tips

* Make a quick test encode to make sure your sound is working. 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.
* CD reading can break or desync if you load a savestate made before PCem has started reading from the CD.
* 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.
** Even if the emulated machine doesn't support the middle mouse button, hitting it will make PCem release the mouse, so the right-click menu becomes a risk again.
* Always use software rendering. Using hardware rendering seems to be unstable, at a random point in time the emulator will crash with {{XXX: resource creation failed}} spammed in the terminal.

!!! Installing your game

Ensure you have a working installation of your operating system using the links to the OS specific guides above.

You may install your game either from original install disks or a folder containing the pre-installed game.

In the .cfg file for your setup, set {{cdrom_drive = 200}} and {{cdrom_path = /full/path/to/name.iso}}.

* PCem handles paths with spaces fine, but they should not be put inside quotes.

!! Installing from original media

If you need to use multiple disks, see [EmulatorResources/PCem#SwappingDisks|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 [https://www.goodolddays.net/diskimages/|Good Old Days] (incomplete, but has quite a lot) or if you're using CDs you can reference [http://redump.org/discs/system/pc/|redump].

!! Using pre-installed version

Put all the files into one folder. Files not necessary to run the game, such as readmes and order forms, can be omitted if desired.

* __Do not include custom files that we will not be able to reproduce, such as personal save files and high score tables.__

Make an ISO of the game files by executing [UserFiles/Info/638314431260324188|this bash script] in a Linux terminal.

When the operating system boots, you should copy the game files to the {{C:}} drive.
* In DOS, use this command in the DOS prompt: {{copy d:\*.* c:}} or {{xcopy d:\ c:\ /e}} if there are subdirectories (you can buffer these inputs while FreeDOS is loading).
* On Windows, just use the file explorer to copy the files to Desktop.

If the game comes with a setup utility, you may need to run it to set up proper graphics.

!!! Swapping disks

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...}} Also set {{cdrom_drive = 200}}, otherwise this will not work.

For floppy drives A: and B: respectively, specify {{disc_a = path1;path2;path3;etc...}} and {{disc_b = path1;path2;path3;etc...}}

The following hotkeys control disk swapping.
* CD: {{Ctrl}} + {{,}} + {{Arrow}}
* Floppy drive A: {{Ctrl}} + {{.}} + {{Arrow}}
* Floppy drive B: {{Ctrl}} + {{/}} + {{Arrow}}
Where {{Arrow}} is:
* {{Left}}: Select previous disk in list
* {{Right}}: Select next disk in list
* {{Down}}: Load selected disk
** Loading is __required__ after you've selected the disk you need.
* {{Up}}: Eject current disk
The messages for disk selections and loading will be displayed in the console window.

!!! Movie submissions

We [EmulatorResources/LibTAS#MovieSubmissions|allow libTAS to run PCem] as an IBM-PC emulator for [EmulatorResources/PCem/DOS#UsingWithLibtas|DOS] and [EmulatorResources/PCem/Windows#UsingWithLibtas|Windows]. Only [https://github.com/TASEmulators/pcem/releases|TASVideos releases] of PCem are allowed. Such releases are marked {{st}} to indicate single-threading - modification required for determinism, not available in the original PCem.

Put {{Platform: DOS}} or {{Platform: Windows}} (depending on which one you're running) at the very start of the .ltm movie annotations, that way the site will recognize your platform properly.

Use .ltm annotations or submission notes to document:
* Which machine ROM files your movie ''requires'', along with their hashsums (PCem logs to the terminal which ROMs it's loading).
* Hashsums for your installation media, or for all the individual game files if you're using [EmulatorResources/PCem#UsingPreInstalledVersion|the pre-installed game method]
* Scripts that can hash entire folders on Linux and Windows are provided [Forum/Topics/22813|in this thread].

!! Emulate compatible machine

PCem can emulate variety of machines, but we only accept systems representing an era of IBM-PC games based on release date and system requirements. We accept [EmulatorResources/PCem/DOS#PremadeConfigurations|4 machine configurations for DOS], and [EmulatorResources/PCem/Windows#WhatYouLlNeed|2 for Windows].

If the game you're TASing doesn't work properly on either of these setups (or you want to add more RAM, or a joystick, or do another useful tweak), you can modify the {{.cfg}} setup that's closest to your desired specs, to make your game work well. Keep in mind though that [MovieRules#GameplayMustBeAccurateToHardware|PC game environment must be legitimate].

If your modifications are beyond tweaking the {{.cfg}} files, you will need to record a libTAS movie of you setting up your config, similar to how [EmulatorResources/PCem/DOS/Configurations|our setups] [EmulatorResources/PCem/Windows/Configurations|were recorded], including meticulous documentation of the process. Explain what and why you're changing too.

!! Game installation

[EmulatorResources/PCem#InstallingYourGame|Game installation] can be a part of your main movie, unless you're installing from a CD image or the installation process takes several minutes.

If game installation is a part of your main movie, it shouldn't waste time for no reason, but still configure your game to look and sound best. If game installation is done in a separate file, optimizing it is not required, just make sure to provide it as a verification movie.
* When making 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.
* __Do not enter a CD key or serial in any of your movies!__ It is illegal to distribute these. Game activation needs to be done outside the libTAS movie! The game must be installed, activated, and only then [EmulatorResources/PCem#UsingPreInstalledVersion|put onto an ISO with all the required files].