SDLPoP; David's open-source port of PoP

Open-source port of PoP that runs natively on Windows, Linux, etc.
Falcury
Calif
Calif
Posts: 565
Joined: June 25th, 2009, 10:01 pm

Re: SDLPoP; David's open-source port of PoP

Post by Falcury »

David wrote: November 13th, 2021, 3:18 pm I will probably revert the #includes to their original forms.
Or perhaps add some more #ifs to keep everyone happy, once I find out how to detect each possible OS and build environment.
Maybe something like this? Although I am not entirely sure this is supported by every compiler (should work on most?); there might need to be an additional check for that.

Code: Select all

#if __has_include(<SDL2/SDL.h>)
#include "SDL2/SDL.h"
#include "SDL2/SDL_image.h"
#else
#include "SDL.h"
#include "SDL_image.h"
#endif
User avatar
VelCheran
Vizier
Vizier
Posts: 127
Joined: May 28th, 2020, 7:26 pm

Re: SDLPoP; David's open-source port of PoP

Post by VelCheran »

Thanks, I added the directories, and now I get this:
https://pastebin.com/ucL3jvJF

Am I missing some libraries again?
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: SDLPoP; David's open-source port of PoP

Post by David »

Falcury wrote: November 13th, 2021, 4:21 pm Maybe something like this? Although I am not entirely sure this is supported by every compiler (should work on most?); there might need to be an additional check for that.

Code: Select all

#if __has_include(<SDL2/SDL.h>)
#include "SDL2/SDL.h"
#include "SDL2/SDL_image.h"
#else
#include "SDL.h"
#include "SDL_image.h"
#endif
Wow, I didn't know about __has_include.
It works in Dev-C++ (which uses gcc), but I don't know if other compilers support it (for example Visual Studio).

I found this:
https://stackoverflow.com/questions/52379233/is-has-cxx17-macro-usable-in-custom-project-headers-to-enable-c17-language wrote: The recommendation to use __has_include is good, but isn't supported prior to VS 2017 (15.3 update).
and this:
https://en.cppreference.com/w/cpp/preprocessor/include wrote: __has_include (since C++17)
So it's at least a standard thing... in C++. I wonder if it's also a standard feature in C.

EDIT:
It's not: https://en.cppreference.com/w/c/preprocessor/include

But here is how to check if the compiler supports __has_include.
https://en.cppreference.com/w/cpp/feature_test wrote:

Code: Select all

#ifdef __has_include                           // Check if __has_include is present
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: SDLPoP; David's open-source port of PoP

Post by David »

VelCheran wrote: November 13th, 2021, 10:55 pm Thanks, I added the directories, and now I get this:
https://pastebin.com/ucL3jvJF

Am I missing some libraries again?
No, this time the compiler is complaining about conflicting declarations of almost every function in seg009.c.

Code: Select all

seg009.c:245: error: conflicting types for 'prandom'
proto.h:546: error: previous declaration of 'prandom' was here
seg009.c line 245 is this:

Code: Select all

word __pascal far prandom(word max) {
proto.h line 546 is this:

Code: Select all

word __pascal far prandom(word max);
I can't see any difference in types.

Interestingly, these errors appear only for functions with arguments.


Which version of Dev-C++ are you using?

I am using Dev-Cpp 5.11, which is the latest version here.
User avatar
VelCheran
Vizier
Vizier
Posts: 127
Joined: May 28th, 2020, 7:26 pm

Re: SDLPoP; David's open-source port of PoP

Post by VelCheran »

I installed 4.9.9.2, I'll update it and try again. Thanks :)
User avatar
atrueprincefanfrom18
Site Shah
Site Shah
Posts: 1782
Joined: January 21st, 2020, 2:53 pm
Contact:

Re: SDLPoP; David's open-source port of PoP

Post by atrueprincefanfrom18 »

A counter which tracks the deaths from the time the mod was started and also a different counter for the level.
And that can be pushed to the stream manager to show on the stream maybe :)
Love to create new MODS :)

My complete list of mods until now!

My channel. Do consider subscribing it! :)
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: SDLPoP; David's open-source port of PoP

Post by Norbert »

Recently thousands of visits to SDLPoP's page on PoPOT, all from GitHub.
SDLPoP's GitHub got lots of traffic from Reddit and Hacker News.
User avatar
VelCheran
Vizier
Vizier
Posts: 127
Joined: May 28th, 2020, 7:26 pm

Re: SDLPoP; David's open-source port of PoP

Post by VelCheran »

David wrote: November 13th, 2021, 3:18 pmBTW, why do you have your drives as A: and B:?
Because why not? :D
Since I don't have any floppy disk, those letters are never used, so I used them for my secondary and third internal drives (I still use C as main drive).

Sooo, I installed the latest DevC++, but I still have an error. I mean, why wouldn't I? :lol:

https://pastebin.com/ucJvWWeY

One day, I'll get this.
dmitry_s
Developer
Developer
Posts: 148
Joined: July 27th, 2021, 7:22 am

Re: SDLPoP; David's open-source port of PoP

Post by dmitry_s »

It looks like you are compiling it in 64-bit mode based on the "x86_64-w64-mingw32" path.

Try compiling it in 32-bit mode against "i686-w64-mingw32" libraries.
User avatar
VelCheran
Vizier
Vizier
Posts: 127
Joined: May 28th, 2020, 7:26 pm

Re: SDLPoP; David's open-source port of PoP

Post by VelCheran »

Where do I set this? In Tools->Compiler options? If so, even if I select the 32 bits compiler, its directories are all pointing to MinGW64 and not MinGW32. I tried changing them manually without any success.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: SDLPoP; David's open-source port of PoP

Post by Norbert »

VelCheran wrote: December 2nd, 2021, 12:52 am Where do I set this? In Tools->Compiler options? If so, even if I select the 32 bits compiler, its directories are all pointing to MinGW64 and not MinGW32. I tried changing them manually without any success.
Editor apoplexy uses SDL2's MinGW, and has docs/compiling.txt (at GitHub), which explains how to compile apoplexy in 32-bit mode. It has some extra steps you can skip for SDLPoP, but otherwise it should be similar. At the very least it should give you some clues as to what Project Options and such to use.
On a more general note, SDLPoP could probably use step-by-step compilation instructions for Windows, in either its README.md or a new compiling.txt file.
dmitry_s
Developer
Developer
Posts: 148
Joined: July 27th, 2021, 7:22 am

Re: SDLPoP; David's open-source port of PoP

Post by dmitry_s »

There are instructions on SDLPoP github.
https://github.com/NagyD/SDLPoP/blob/ma ... E.md#dev-c
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: SDLPoP; David's open-source port of PoP

Post by Norbert »

dmitry_s wrote: December 3rd, 2021, 1:34 am There are instructions on SDLPoP github.
https://github.com/NagyD/SDLPoP/blob/ma ... E.md#dev-c
Not step-by-step though.
Check apoplexy's instructions to see what I mean.
User avatar
VelCheran
Vizier
Vizier
Posts: 127
Joined: May 28th, 2020, 7:26 pm

Re: SDLPoP; David's open-source port of PoP

Post by VelCheran »

Thanks a lot! I managed to get it right starting from a fresh project and using step-by-step Apoplexy readme when necessary.
It's working perfectly fine now, I have dark screen transitions :)
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: SDLPoP; David's open-source port of PoP

Post by Norbert »

Not a big bug, but I think maybe quicksave doesn't remember dead guards? I've not tested this at all. Either way, at 00:46:18 here, there's a dead guard, then after a partial level finish, quickload is used, and shortly thereafter the guard is alive again.
Post Reply