PCem build guide

Discussion of development and patch submission.
jznomoney
Posts: 97
Joined: Sat 06 Dec, 2014 9:11 pm

Re: PCem build guide

Post by jznomoney »

is there a way to build the wxwidgets port for windows?
ChronicEel93
Posts: 22
Joined: Thu 29 Sep, 2016 7:17 pm

Re: PCem build guide

Post by ChronicEel93 »

jznomoney wrote:is there a way to build the wxwidgets port for windows?
get the headers and lib files from this site: https://github.com/wxWidgets/wxWidgets/ ... tag/v3.1.0
they will be in separate archives. Get wxWidgets-3.1.0-headers and wxMSW-3.1.0_gcc510TDM_Dev. Copy the headers to the include folder from the first one, and the libs from the second one. It should get wx working. Network fails for me though, even with pcap libs installed, so keep an eye out for that :P! As a side note when building WX, you don't need directx libs to build.
ChronicEel93
Posts: 22
Joined: Thu 29 Sep, 2016 7:17 pm

Re: PCem build guide

Post by ChronicEel93 »

I can build succesfully, but whenever I try to run it it asks for dlls. I can find most of them laying about the mingw directory, and I can get the rest from the pcem download, but the Openal32.dll throws an error. No idea where to get a working version.
User avatar
dreamer
Posts: 40
Joined: Wed 28 Dec, 2016 11:56 am

Re: PCem build guide

Post by dreamer »

I think you can get one in the official PCem download.
User avatar
omarsis81
Posts: 945
Joined: Thu 17 Dec, 2015 6:20 pm

Re: PCem build guide

Post by omarsis81 »

Hey dreamer! As you know, I was able to to compile PCem with your magnificent guide with MingW =)
Now, I wish to make patches tu submit to Sarah. I understand I need to use "hg diff"
I read this https://globulation2.org/index.php?titl ... oldid=5834 but I wasn't successful
Any help?
User avatar
dreamer
Posts: 40
Joined: Wed 28 Dec, 2016 11:56 am

Re: PCem build guide

Post by dreamer »

If you are using MinGW I suppose you are on Windows. Get TortoiseHG (https://tortoisehg.bitbucket.io/), it's easier than command line tools.
User avatar
omarsis81
Posts: 945
Joined: Thu 17 Dec, 2015 6:20 pm

Re: PCem build guide

Post by omarsis81 »

Thank you once again dreamer!
A. Naim
Posts: 139
Joined: Thu 09 Jul, 2015 5:06 pm

Re: PCem build guide

Post by A. Naim »

Edit: Figured it out while following the guide. The first set is parent packages; the second set is sub-packages. You may want to clarify it, as it may be confusing to people new to mingw see what looks like the same thing twice.

This was asked before, but I don't know if it was explained, and I'm confused about it myself.

Why do the instructions say to install "mingw32-gcc-g++" and then remove the same item?
Open up the installer and mark these for installation from the "Basic Setup":
> mingw-developer-tools
> mingw32-base
> mingw32-gcc-g++
> msys-base

!! IMPORTANT !! Actually install marked packages by selecting "Apply changes".

Mark these for removal in "All packages" (bin, lic, src variants):
> mingw32-gcc
> mingw32-gcc-g++

Apply changes.
Zilog
Posts: 51
Joined: Wed 13 May, 2015 8:01 pm

Re: PCem build guide

Post by Zilog »

Hi Dreamer
thanks a lot for this guide.

I's possbile upgrade guide with the wxwidgets and sdl libray?

Thanks a lot.
By Zilog.
ChronicEel93
Posts: 22
Joined: Thu 29 Sep, 2016 7:17 pm

Re: PCem build guide

Post by ChronicEel93 »

Any help for building with network support AND WX? Every time I try to build Makefile.mingw-wx-sdl2-network mingw errors out on wx-hostconfig.c . Any help with that would be nice. I do have both WX and PCap libs, and I can build a wx version without networking, but i cant do both.

here is log:
In file included from c:\mingw\include\pcap\pcap.h:54:0,
from c:\mingw\include\pcap.h:45,
from wx-hostconfig.c:7:
c:\mingw\include\stdio.h:345:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__mingw__snprintf'
extern int __mingw_stdio_redirect__(snprintf)(char*, size_t, const char*, ...);
^
c:\mingw\include\stdio.h:349:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__mingw__vsnprintf'
extern int __mingw_stdio_redirect__(vsnprintf)(char*, size_t, const char*, __VALIST);
^
make: *** [wx-hostconfig.o] Error 1
A. Naim
Posts: 139
Joined: Thu 09 Jul, 2015 5:06 pm

Re: PCem build guide

Post by A. Naim »

ChronicEel93 wrote:Any help for building with network support AND WX? Every time I try to build Makefile.mingw-wx-sdl2-network mingw errors out on wx-hostconfig.c . Any help with that would be nice. I do have both WX and PCap libs, and I can build a wx version without networking, but i cant do both.

here is log:
In file included from c:\mingw\include\pcap\pcap.h:54:0,
from c:\mingw\include\pcap.h:45,
from wx-hostconfig.c:7:
c:\mingw\include\stdio.h:345:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__mingw__snprintf'
extern int __mingw_stdio_redirect__(snprintf)(char*, size_t, const char*, ...);
^
c:\mingw\include\stdio.h:349:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '__mingw__vsnprintf'
extern int __mingw_stdio_redirect__(vsnprintf)(char*, size_t, const char*, __VALIST);
^
make: *** [wx-hostconfig.o] Error 1
That looks like a code error, not a makefile error. So it should probably go in its own thread; but I'm not a mod or anyone official. :) And I don't know the codebase, either; I just have some familiarity with C++.
jznomoney
Posts: 97
Joined: Sat 06 Dec, 2014 9:11 pm

Re: PCem build guide

Post by jznomoney »

Can someone post an updated guide to build pcem under windows with wxwidgets?
User avatar
BoisterousSleet75
Posts: 39
Joined: Fri 11 Aug, 2017 3:06 am

Re: PCem build guide

Post by BoisterousSleet75 »

jznomoney wrote:Can someone post an updated guide to build pcem under windows with wxwidgets?
Yeah, I would like to see someone posts an updated guide to build PCem under Windows with wxWidgets.
Long Live Marxism-Leninism-Maoism! ☭
dondiego
Posts: 17
Joined: Thu 27 Dec, 2018 12:05 am

Re: PCem build guide

Post by dondiego »

Somehow i've managed to compile v13.1 using this guide. The classic win32 port still worked then and broke a few commits later.
There are a few serious problems with the guide though.
It doesn't make sense to install components and then uninstall them afterwards, besides if you need gcc 4.7.2 for some reason you can deselect 6.3.0 and select than one in the installer seeing all packages, no need to install any component manually.
BTW why 4.7.2? With 6.3.0 you can target XP SP1 and probably lower. It compiles and runs but it crashes silently on exit, i should debug that. I don't think it's due to the specific gcc version but a typical problem with MinGW itself.
You need to install the external libraries sure but there were already D3D9 files included in MinGW, i extracted the allegro version without overwriting. I also used OpenAL-soft 1.18.2.
Then the MinGW installer doesn't create shourtcuts, so i had to launch msys.bat in some subfolder. But i had to modify it too to add "set HOME=\." for convenience else it's nearly imposible to make changes to the source with Git or any version control system having to copy the files in a msys subfolder all the time.
One more thing, you didn't need CMake the makefiles were already there and there wasn't any CMakelists.txt. You invoked make instead, did you mistake make with CMake?

Now i've noticed that CPU usage is much higher with the SDL2 version on my laptop and on an old pentium 4 the speed is pretty much the same for a 486 and a XT. Without D3D9 i must say i tried SDL2 software.
With v12 i got serious "implicit declaration of function" warnings, i don't know if it even ran. The official v12 didn't work with DirectDraw BTW.
dondiego
Posts: 17
Joined: Thu 27 Dec, 2018 12:05 am

Re: PCem build guide

Post by dondiego »

Code: Select all

Program received signal SIGSEGV, Segmentation fault.
0x004fe284 in readmemb (a=4096) at 808x.c:54
54              else return *(uint8_t *)(readlookup2[(a) >> 12] + (a));
(gdb) bt
#0  0x004fe284 in readmemb (a=4096) at 808x.c:54
#1  0x004ff0d3 in dumpregs () at 808x.c:525
#2  0x00564358 in closepc () at pc.c:607
#3  0x0062dcad in WinMain@16 (hThisInstance=0x400000, hPrevInstance=0x0, lpszArgument=0x35444ba "", nFunsterStil=10)
    at win.c:789
#4  0x00662ec4 in main ()
Now what's this?
Edit: i see it only crashes when i don't run a VM, it's a debug function. It was a bug in the emulator.
dondiego
Posts: 17
Joined: Thu 27 Dec, 2018 12:05 am

Re: PCem build guide

Post by dondiego »

Okay i've just added -DRELEASE_BUILD to CFLAGS in the makefile. I don't know how that autotools mess works.
dondiego
Posts: 17
Joined: Thu 27 Dec, 2018 12:05 am

Re: PCem build guide

Post by dondiego »

Actually it was broken.
The "Hard disc controllers can now be selected on all machines." commit is very old and the old config code was not adjusted then.
I was using a config file copied from another folder, when i changed the graphics card the controller changed to none. It showed internal ide grayed out.
Creating a new machine the same happens. So i'd need to adjust the old config code to allow the selection i guess.
Post Reply