[fpc-pascal] FPC on gaming consoles: XBox One, PlayStation 4, Nintendo Switch

Michalis Kamburelis michalis.kambi at gmail.com
Thu May 10 00:41:28 CEST 2018


Hi,

I am wondering about the possibility to port Castle Game Engine to
modern gaming consoles.

Summary (TL;DR):

- Is it possible to use FPC to compile programs/libraries for one of
the gaming consoles mentioned in the subject?

- If it is not possible *yet*, how easy it would be to add such
support to FPC? (Note: We *could* sponsor such work.)

Details: (And apologies for writing such long email.)

>From what I read, the modern consoles feature more "normal" hardware
and APIs, contrary to the past consoles that had incredibly
specialized stuff (like PlayStation 3 with Cell).

Note that I'm thinking here about working with the standard OS
available on the console, and distributing the game through the
standard shop available on each console. So I'm not interested in
solutions like installing Linux on a PlayStation 4.

Bear in mind that I do not have any personal experience developing on
these consoles. I'm mostly a desktop gamer/developer :) So I'm just
gathering knowledge now. Any information is appreciated.

Finally, if the answer to one of these platforms is like "it is
possible, but it requires ~2 months of serious work", please tell me
so (in public or private). We are in the business of making games
using Castle Game Engine and FPC, and as such we may be able to pay
the developer willing to port FPC to one of the console platforms. We
are talking now with a 3rd party that could provide the funds --
things are not settled yet, but we keep our fingers crossed :)

The gaming console platforms I'm interested in:

1. XBox One. It uses an operating system based on Windows 10. As such,
maybe compiling FPC programs for it is already possible (or is easy to
add)? Maybe I can even just run a normal Windows exe on XBox One?

    From what I read, all XBox versions use Direct X for rendering, so
porting CGE to XBox would require adding a Direct 3D renderer. But
that is very doable on my side, so I don't worry about it :) And in
the meantime, we could use ANGLE (a library that provides OpenGLES
API, using Direct X internally), thus we can render using OpenGLES on
XBox One even today.

    See wikipedia: https://en.wikipedia.org/wiki/Xbox_One ,
https://en.wikipedia.org/wiki/Xbox_One_system_software

2. PlayStation 4 has it's special OS (Orbis OS, based on FreeBSD 9). I
don't know how close it is to normal FreeBSD supported by FPC.

    It's main graphics API is GNMX, which is "mostly like Direct X
11". So, again, I don't worry.

    See wikipedia: https://en.wikipedia.org/wiki/PlayStation_4 ,
https://en.wikipedia.org/wiki/PlayStation_4_system_software

    As for CPU: From what I read, both XBox One and PlayStation 4 use
https://en.wikipedia.org/wiki/Jaguar_(microarchitecture) , which has
instruction set like AMD64 (x86-64). Am I right assuming that, as far
as FPC is concerned, this is just a normal x86_64 CPU?

3. Nintendo Switch.

    CPU: Octa-core (4×ARM Cortex-A57 & 4×ARM Cortex-A53),
microarchitecture ARMv8-A. Does it mean it is the same instruction set
as existing 64-bit ARM CPU, uses e.g. by 64-bit iOS? It is called
"aarch64" by FPC.

    OS is custom. I have not found much information about it. The
"syscalls look similar to Nintendo 3DS", it seems,

    The graphics API: Nintendo Switch seems to include support for
OpenGL, OpenGL ES and even Vulkan (
https://wccftech.com/nintendo-switch-supports-vulkan/ ), which is very
cool. In addition to their custom API NVN. So Castle Game Engine could
just use modern OpenGL renderer on it.

    See wikipedia: https://en.wikipedia.org/wiki/Nintendo_Switch ,
https://en.wikipedia.org/wiki/Nintendo_Switch_system_software .

Thanks for all the answers.
Regards,
Michalis



More information about the fpc-pascal mailing list