Genplus makes wrong assumptions about integer sizes

Issue #189 resolved
Former user created an issue

Original [issue 189](https://code.google.com/p/genplus-gx/issues/detail?id=189) created by airmaker90 on 2011-09-24T23:35:17.000Z:

Noticed while trying to run Genplus on Linux x64 that stuff was breaking horribly. Waded through the source to find something seriously glaring:

\#define int32 signed long int

in types.h

Long is not 32-bit. It's defined to be larger or equal in size with int. On Linux, BSD and OSX 64-bit, long is 64-bit. This created big issues in the audio core where long int\* are used for samples. Replaced them with the actual int32\_t, and it worked out.

Comments (5)

  1. Former user Account Deleted
    • changed status to open

    Comment # 1 originally posted by ekeeke31 on 2011-09-25T09:56:37.000Z:

    You are right, this comes from the original genesis plus, when 64-bit platform was non-existant. Using C-99 standard is indeed better for portability.

    On that subject, do you have an ETA for the linux port ? If there is an homepage for it, I could add it to this project links.

  2. Former user Account Deleted

    Comment # 3 originally posted by airmaker90 on 2011-09-25T13:33:33.000Z:

    There are still additional issues, which I should have mentioned.

    In sound/fir\_resampler.h, you'll see: typedef signed long int sample\_t; Using 64-bit samples is probably a bit overkill :D

    There is also YM2413Update() and YM2612Update(), they take long int\*. You also have the YM\_Update function pointer in sound/sound.c which needs to be fixed. After changing those, it worked out.

    It's not a Linux port per se. I made a libsnes interface for it, so I could run it in SSNES :) http://board.byuu.org/viewtopic.php?f=17&t=2037

  3. Former user Account Deleted

    Comment # 5 originally posted by ekeeke31 on 2011-09-25T15:06:38.000Z:

    Yes, I fixed that in the last revision (r638).

    I know a little about SSNES, it runs under Windows as well, right ? That's good news indeed and probably the best way to get Genesis Plus GX running on computers with all the fancy features of your frontend.

  4. Former user Account Deleted

    Comment # 6 originally posted by airmaker90 on 2011-09-25T16:18:52.000Z:

    I see :) Good stuff. Yes, SSNES runs on Linux, Windows, OSX and BSD, so it should work fine on all those platforms. It's obviously a bit tacky to run other emulators in what is essentially a SNES frontend, but hey. :D It works.

  5. Log in to comment