Development:Porting

From Zaparoo Wiki

Revision as of 09:32, 5 May 2024 by Wizzo (talk | contribs)

Requirements and notes for porting TapTo to other platforms.

  • Each platform supported by TapTo has a new submodule in the platforms and cmd modules.
  • The platforms submodule contains all platform-specific code and defines a generic "platform" interface.
  • The cmd submodule is the final binary distributed to the platform, which imports the specific platform submodule and sets it up for use with the shared library.

Work to do be done:

  • The "platform" interface is not defined yet. We need to come up with a list of generic methods for this interface of stuff that will differ between platform. E.g. launching a game from a path, sending a keyboard input, starting/stopping/restarting the TapTo service, etc.
  • Although it's marked now, the shared code is still littered with references to MiSTer-specific (mrext) library calls.
  • The path definitions (config modules) are hardcoded to MiSTer paths.
  • The mrext systems module is probably no longer possible to use, there needs to be a new list of system definitions in TapTo itself that can be shared between platforms.
  • I don't know if libnfc even works on Windows. It looks like it will, but it's also not officially supported. If it doesn't, two major bits of work need to be done:
    • A custom driver needs to be created for the PN532 UART support.
    • The poll loops need to be abstracted from libnfc so other drivers can be swapped in (this really needs to be done in any case).
    • Support for the PC/SC standard needs to be added (another good one to do anyway, this is the preferred way to interact with NFC readers on everything besides MiSTer).

PC/SC

PC/SC is a smart card standard that is supported by many NFC readers and all major operating systems. It's a common protocol for the NFC reader to connect and communicate with a host device. In order for TapTo to have the best support for different readers and operating systems, it should support PS/SC eventually.

A PC/SC service in enabled by default on Windows, Mac[1], and most major Linux distributions.

There are several PC/SC libraries for Go, but they are not popular. Investigation will need to be done for the best fit:

None of these are exactly the same.

The PN532 is not supported by PC/SC

libnfc claims to have some amount of support for PC/SC, but upon testing it doesn't really work. The acr122u_pcsc driver is deprecated and not working, the pcsc driver is undocumented and would not work. I don't think it's wise to rely on support via libnfc.

  1. Not sure yet, but seems OS X is transitioning to a new smart card API, so Mac may have questionable support right now. But it's OK, this is the least necessary platform and should support PN532 alright.