
PCem – An emulator of old PC hardware platforms - peter_d_sherman
https://pcem-emulator.co.uk/development.html
======
mattbee
This emulator enables a masochistic nostalgia meta-game - pick a grimy EGA
port of a popular 1980s Amiga title. Pick an hateful, underpowered & obscure
hardware combo that is the box claims to support. The game is just to work out
the CONFIG.SYS, HIMEM & drivers to make it launch without graphical glitches &
sound crackles. Enjoy!

~~~
xenophonf
I think I enjoyed tinkering with EMM386 and QEMM parameters or fiddling with
device driver load order more than I did actually playing the games!

~~~
A4ET8a8uTh0
I can't honestly say I enjoyed it, but it felt like a win, when something that
did not want to work started working after you squeezed everything you could.

------
peter_d_sherman
The amount of old PC hardware that this thing emulates is nothing short of
absolutely amazing... old VGA cards, old network cards, old sound cards, the
list goes on and on. You'll find old favorites like SoundBlaster and NE2000,
but also some very esoteric things, like PC-BIOSes for PC's that you never
knew existed...

Also, apparently can run Windows NT and XP...

~~~
Narishma
It can run any OS that supports the emulated hardware, not just Windows.

~~~
jedieaston
Finally! I can relive Slackware Linux!

~~~
badsectoracula
So, there is an MS-DOS game jam going on these days (started last month,
finishes in ~25 days or so), so i was trying to make a simple 3D platformer
for it. I used Free Pascal and it turns out the only platform where i can
actually profile Free Pascal code without issues is Linux, meaning i somehow
had to make Linux run on an old PC.

86box (PCem fork) with Slackware to the rescue and here is my game running
under Slackware 14.2 (the latest version) with Window Maker under an emulated
300MHz mobile MMX (my computer isn't fast enough to run this at 100% all the
time sadly, but it was good enough to do some profiling):

[https://i.imgur.com/4X7lvZ7.png](https://i.imgur.com/4X7lvZ7.png)

In fact i wrote the Linux port under the emulated machine :-P

~~~
anthk
Qemu would run faster than PCEM per cycle and the game would run faster and
without dropping frames :D

~~~
badsectoracula
The goal was to run on an emulated system that matched the hardware of an old
PC, not to run a VM with Linux - i'd use VirtualBox for that. PCem/86box is
much more accurate than Qemu when it comes to emulating older hardware,
including performance differences between graphics cards.

~~~
anthk
I mean by using it in emulation mode, as I do under OpenBSD. On graphics
cards, Bochs supports voodoo, and 2/3 support is on its way.

~~~
badsectoracula
Yes i know, i was using Qemu at the past but Qemu does not support the
hardware that PCem/86box does nor at the same accuracy.

------
dusted
This is really neat. There's been a huge amount of work done in preserving old
software, but much much less in preserving the hardware environment it ran
under. Dosbox and qemu are great projects, but something specifically designed
to preserve the functionality of the pc hardware, much in the same spirit of
MAME, is just wonderful news, I wish them the best. I have a lot of old
hardware laying around, I will look into contributing with ROM dumps and other
things.

------
dintech
How does this compare to dosbox for running games?

~~~
badsectoracula
Note that i've mainly tried 86box, which is a PCem fork (but AFAIK it is kept
in sync with PCem and the main difference is a nicer GUI for Windows and that
it provides nightly builds optimized for various CPUs).

For DOS games, DOSBox is generally the better and -especially- faster choice
with the main exception being mid80s games that assumed a 4.77MHz CPU (you can
still play them on DOSBox but you need to fiddle around with the cycles and
even then it assumes 1 cycle = 1 instruction, whereas PCem counts cycles
correctly and also it takes into consideration the graphics card performance
whereas DOSBox draws things as fast as it can).

For Windows games, assuming you cannot run them in modern Windows, it is
basically the best choice - assuming you have a really fast PC, otherwise
you'll get sound stuttering and slowdowns (with my AMD Ryzen 7 3700X i can
emulate a Pentium 75Hz -mostly- fine but anything above that starts to cause
sound to stutter).

Though in my experience 99% of the Windows games out there will work in modern
Windows with something like dgVoodoo2, a framecapping tool like RTSS and
perhaps adjusting the compatibility options. It might take some fiddling here
and there. Notable exception being mid-2000s games with DRM.

~~~
signaru
Was reading the PCem forums to figure out how to share files with the host. It
seems disk images or getting networking up is necessary (which is not uncommon
for similar emulating programs).

One thing I really like about DOSBOX, is how ordinary folders in the host can
be mapped to drives in the guest OS. I wish pcem has something similar. This
can make creating files with ancient software more convenient (e.g. new retro
games).

~~~
badsectoracula
My approach is to transfer files to the emulated machine by creating an ISO
with WinCDEmu (which integrates with Explorer and file managers that can use
shell extensions like Total Commander) and mounting that ISO and then transfer
files out of the emulated machine by opening the disk image with 7zip (with
the machine turned off, of course).

For older machines and some other emulators i've written a tool to create
floppy disk images from a list of files:

[http://runtimeterror.com/tools/fat12img/](http://runtimeterror.com/tools/fat12img/)

(though that can only do 1.44MB floppies, meaning that it only works with an
emulated 286 and above)

~~~
anthk
You could borrow bximage from Bochs too to generate them easily :D.

Or in a Unix platform, with just dd and vnconfig under OpenBSD or kpartx under
Linux.

    
    
        >dd if=/dev/zero of=a.img bs=1440k count=1
    
        >vnconfig vnd0 a.img
    
        >newfs_msdos -F 12 /dev/rvnd0c
    
        >vnconfig -u vnd0
    
        >file a.img

a.img: x86 boot sector

That's under OpenBSD, under Linux is similar.

~~~
badsectoracula
As far as i can tell bximage can only create empty images, which isn't what i
was after (86box, the fork of PCem i am using, has a command to generate empty
images too). What i wrote about was creating floppy image files with files
inside them.

Also i'm using Windows and wanted a GUI tool.

------
non-entity
Ah nice, I was actually looking for something like this for a retrocomputing
project I had a while back, but developing directly on the hardware was just
too much of a pain. This particular project was on an IBM 5155, which I
imagine could be safely emulated with this using the PC-XT emulator.

I'll have to see though, as my project depends on the BIOS and ROM on the
machine, which I why DOSBox doesnt work for me.

~~~
unixhero
According to the page, it has bios roms.

~~~
Narishma
It requires BIOS roms but you have to supply them yourself.

------
rob74
I'm sure that PCem is a capable emulator, but when it comes to Lemmings or
Monkey Island, I'd still rather play them in an Amiga emulator ;) - or, in the
case of Monkey Island (I/II), using ScummVM or the "special editions" with
updated graphics published some years ago
([https://store.steampowered.com/app/32360/The_Secret_of_Monke...](https://store.steampowered.com/app/32360/The_Secret_of_Monkey_Island_Special_Edition/))

------
vardump
Is this cycle accurate (or at least reasonably close)? For something like a
combination of PC-XT and VGA adapter?

~~~
gattilorenz
For a PC-XT it should be on any reasonably modern computer.

~~~
throwaway2048
Cycle accurate has a specific definition that pcem definitely doesn't meet.

It means every chip is accurately emulated down to individual clock cycle
access times.

~~~
dfox
For PC with any graphics card (except possibly MDA) there isn't any sane
definition as to what cycle-accurate means at least if meant for the whole
system.

~~~
vardump
I'd just like something that's reasonably close to XT with the original IBM
8-bit VGA adapter. Or whatever card would be the most common VGA expansion
card for XT.

------
jandrese
Does anybody know if this can emulate composite output from a CGA card? Or are
all CGA graphics going to be trapped with the horrendous eye-searing
Cyan/Magenta combo everybody remembers?

~~~
Narishma
Yes, it emulates composite output for machines and cards that support it. It
even emulates CGA snow if you want an authentic experience.

------
xellisx
I want something that can run multiuser door games (share.exe support?)

------
snvzz
Oddly, it doesn't emulate the serial port. This is despite emulating 3d
accelerators.

I wish they focused on making emulation of older models (like the original PC)
as good as possible, instead of catering to people who just want to play DOS
games.

~~~
jandrese
What would the other side of an emulated serial port look like? A socket you
need to write a daemon to manage? A TCP/IP port to some other emulated device
with emulated serial port? Maybe write a daemon that emulates a Hayes AT modem
and lets you "call" other daemons through a mapping of the phone number to a
remote IP address/port?

~~~
snvzz
Any of these. Or even patched through an actual serial port.

------
andrewshadura
There’s no EC1840/41/42 or Poisk :(

