Building PCem

Support and general discussion.
Post Reply
Lekendri
Posts: 17
Joined: Wed 27 Apr, 2016 11:06 pm

Building PCem

Post by Lekendri »

Hi all,

Sorry to be a total noob.

I've been using the binaries from the download section and I am amazed by the functionality compared to other PC emulators. However, in certain cases I'm getting 42% in the BIOS settings running on an i5 laptop with 8GB RAM, IntelHD. I have had better results on my PC where at worst it gets to the 80% mark installing things in windows98 on an FX-8150 with 16GB RAM, AMD R9-270.

I've read a few of the posts here and it seems the general view is that building oneself is better. so to that end I embarked on the gargantuan task of downloading the bits from bitbucket and attempting to build. I found a set of instructions on the forums here for building PCem viewtopic.php?f=2&t=174&p=776&hilit=dos ... tions#p776 but this pulls from http://www.retrosoftware.co.uk/hg/pcem which no longer exists. I've tried messing with the BuildPCem.txt and have changed to download from bitbucket, and have modified bits, and I have gotten further, but ultimately it still fails. I've also found PCem auto get+update+compile on github, which looked promising, but that also required some modification to get the batch file to finish, but again yields no usable results.

In short, I've never had to compile/build anything like this in my life, and am looking for some up-to-date instructions on how to do this.

If you wish to :roll: and n00b me, I totally understand. But any help would be appreciated.

I won't thank you in advance as that's just presumptuous. :D
User avatar
leilei
Posts: 1039
Joined: Fri 25 Apr, 2014 4:47 pm

Re: Building PCem

Post by leilei »

To build PCem I have a Mingw32 setup installed and I double-click a batch file with these contents:

Code: Select all

set path=c:\mingw\bin;
rem del *.o
mingw32-make.exe -j 4 -f Makefile.mingw
pause
Lekendri
Posts: 17
Joined: Wed 27 Apr, 2016 11:06 pm

Re: Building PCem

Post by Lekendri »

Thanks leilei.
And I guess then that the zip from bitbucket is just extracted to the MinGW/msys/1.0/home/me folder?

This just sounds too simple to be real after the other instructions.

So I extracted the whole lot, and placed the batch file in the src folder, got a few strange messages regarding pointers, but it carried on anyway until the end when I received this:

Code: Select all

soundopenal.c:6:19: fatal error: AL/al.h: No such file or directory
 #include <AL/al.h>
                   ^
compilation terminated.
Makefile.mingw:41: recipe for target 'soundopenal.o' failed
mingw32-make.exe: *** [soundopenal.o] Error 1
mingw32-make.exe: *** Waiting for unfinished jobs....
So I'm gonna take a guess at AL/al.h is missing.
From the instructions mentioned previously there were the following lines in the text file:

Code: Select all

wget -c http://kcat.strangesoft.net/openal-releases/openal-soft-1.16.0.tar.bz2
tar xvf openal-soft-1.16.0.tar.bz2
cd openal-soft-1.16.0
cd build
cmake .. -G "MSYS Makefiles" -DDSOUND_INCLUDE_DIR=C:\MinGW -DCMAKE_BUILD_TYPE=Release -DCMAKE_SHARED_LINKER_FLAGS_RELEASE=-static-libgcc -DCMAKE_INSTALL_PREFIX=/mingw
make install
Checking through the extraction folder there was another folder include which contained a folder AL and the file al.h
Is this the correct file or is there an updated version?
And finally how would I get Mingw to see/include it?

Damned noobs. Always so full of questions...... :roll:
Lekendri
Posts: 17
Joined: Wed 27 Apr, 2016 11:06 pm

Re: Building PCem

Post by Lekendri »

Well, your tough love is sincerely appreciated.
leilei got me in the right direction, but obviously dependencies weren't met on a fresh MinGW install. I decided to wipe the previous as most of the instructions failes to run/build.
Had a few setbacks with cmake and dx8, but overcame those with some digging. Then got most of the original instructions mentioned in my first post to work, but the final Make -f Makefile.mingw always failed in MSYS.
Then I finally went back to the batch file method once all dependencies were installed and lo and behold, my very own pcem.exe 8-)

Having seen no real improvement, I wondered about the makefile.mingw64 file, and have attempted to build that, but I get it failing at

Code: Select all

Makefile.mingw64:41: recipe for target 'vid_voodoo.o' failed
mingw32-make.exe: *** [vid_voodoo.o] Error 1
I'm going to go try figure this out now, but if anyone has any ideas, feel free to chip in ;)
Battler
Posts: 793
Joined: Sun 06 Jul, 2014 7:05 pm

Re: Building PCem

Post by Battler »

Why are you attempting to build 64-bit PCem with a 32-bit compiler? That won't work.
Zup
Posts: 83
Joined: Mon 30 Nov, 2015 10:47 am

Re: Building PCem

Post by Zup »

Maybe if he set up a cross-compiling environment.

The problem is that a makefile lacks the instructions needed to build some files. Maybe is he missing some libraries or there is a bug on that makefile?
Lekendri
Posts: 17
Joined: Wed 27 Apr, 2016 11:06 pm

Re: Building PCem

Post by Lekendri »

Why are you attempting to build 64-bit PCem with a 32-bit compiler? That won't work.
Yeah, that occurred to me shortly after posting. :oops: I proceeded to get and install MinGW64, and MSYS2 to go with it, but had various other issues then when attempting to build.
Maybe if he set up a cross-compiling environment.
I did try a couple of other solutions, but each one turned out more convoluted than the previous. Had varying success, but there did seem to be some issues on the makefiles on a couple.
The problem is that a makefile lacks the instructions needed to build some files. Maybe is he missing some libraries or there is a bug on that makefile?
I would have thought the mingw64 makefile would have all the relevant instructions to build a 64bit version just as the mingw makefile builds the 32bit. As for the libraries, I have tried copying over all the same bits from the lib and include folders, also tried building openal and alut files again with the MinGW64 install to try to get some compatibility, just keeps failing.

I also have Visual Studio 2015 Community installed and tried to get it to build in there. Tried various things like pulling in all the files into oe project, tried a makefile project, but didn't seem to want to get anywhere, and greyed out the build options to boot.

So have gone back to MinGW for now as that seems simple enough and pretty safe, and will shelf building a 64bit version myself for now, until I understand more of what is going on and how it all works.

Thanks for replies.
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: Building PCem

Post by SarahWalker »

For the record, there are currently no real benefits to running a 64-bit build. In my testing it's been reliably 5-10% slower than the 32-bit version, probably due to increased cache pressure (pointers are double the size, and PCem has a lot of them).
Lekendri
Posts: 17
Joined: Wed 27 Apr, 2016 11:06 pm

Re: Building PCem

Post by Lekendri »

Thanks for the info Sarah.
I suppose my experience over the years with applications in general mostly supports that, where there are no benefits to 64bit versions of most applications. Like some functions of the 64bit version of MS Office are not compatible with the 32bit version.
I think I'll dismatle that 64bit shelf, and just rely on your excellent work and tweaking.

Out of interest, are there machine specific benefits to building oneself? or are the benefits to do with the more recently updated files within the source on bitbucker?

:P Either way, it's been a laugh building this, and it is great fun to use. :P
User avatar
leilei
Posts: 1039
Joined: Fri 25 Apr, 2014 4:47 pm

Re: Building PCem

Post by leilei »

If you plan on playing 3dfx Voodoo games in their emulated natural habitat, it's quite faster for that now (compared to 10.1)....though an i5 laptop won't cut it with 2 hyperthreaded cores probably.
Lekendri
Posts: 17
Joined: Wed 27 Apr, 2016 11:06 pm

Re: Building PCem

Post by Lekendri »

I have been looking at games. I've installed my favourite of yesteryear - Daggerfall.
It never seems to get it right under DOSBox despite now being packaged with it direct from Bethesda. But as I'm antediluvian (well, almost), I still have it on CD, and like to make use of it.
Installed under Award 430VX - POD 200MMX - 256MB RAM - Mach 64 - Win98SE
On the AMD FX8150 4.0Ghz - 16GB RAM - AMD R9-270 - Windows 10x64, Daggerfall has been running at 26%, hence this adventure into building myself to see if it makes a difference. Beside that, the controls and graphics are perfect. Which is where I have a problem with DOSBox. Although I've noticed that whilst in the BIOS setup, the machine shows 47%, and does tend to lose time if I stay there too long, whereas Windows 98 itself seems fine until it starts heavy lifting. But that's how I remember Windows 98 anyway.

However, I think it may be my pure bloody mindedness in trying to get the most out of PCem, whereas in reality, the PC I had when I played this many hundreds of years ago was a lowly P75 - 16MB RAM - some VGA graphics card and DOS 6.22.

I think I'll try that kinda spec, see if it likes that better.
Lekendri
Posts: 17
Joined: Wed 27 Apr, 2016 11:06 pm

Re: Building PCem

Post by Lekendri »

Out of interest, does the % indicator in the titlebar represent the current %age of the emulated speed? e.g. 100% of a P120.
User avatar
SarahWalker
Site Admin
Posts: 2054
Joined: Thu 24 Apr, 2014 4:18 pm

Re: Building PCem

Post by SarahWalker »

Yes.
Lekendri
Posts: 17
Joined: Wed 27 Apr, 2016 11:06 pm

Re: Building PCem

Post by Lekendri »

Thanks Sarah.
That has made things easier.
So I've gotten a stable >97% constant on the SIS mobo with 486dx2/66 running Dos6.22. Running fine with good sound and control. Loving it! 8-)
So I think I was trying to run before I could walk with a vague mockup of the last PC I had that ran some of the apps and games correctly, rather than the first PC I rand them on successfully.

Whilst running on the Award 430 with a Pentium, the speeds during DOS itself were decent, except when things like Soundblaster setup screens (those awesome ANSI affairs), when it dropped to about 48%, and copying files from a CD to the local drive, when it hit nearer 30% for some files. I remember from eons ago a program I used called DOSIdle, and found a copy and installed that in DOS which gave me an extra 8% in the title bar. I'm not sure if that information is helpful, although I did think the claims of DOSIdle quite wild when I first encountered it, but it worked then, and does seem to have some effect on the emulation too.
Post Reply