EmulatorArchive / genplus-gx

Automatically exported from code.google.com/p/genplus-gx
Other
1 stars 0 forks source link

Genplus makes wrong assumptions about integer sizes #189

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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.

Original issue reported on code.google.com by airmake...@gmail.com on 24 Sep 2011 at 11:35

GoogleCodeExporter commented 9 years ago
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.

Original comment by ekeeke31@gmail.com on 25 Sep 2011 at 9:56

GoogleCodeExporter commented 9 years ago
Fixed in r637

Original comment by ekeeke31@gmail.com on 25 Sep 2011 at 10:07

GoogleCodeExporter commented 9 years ago
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

Original comment by airmake...@gmail.com on 25 Sep 2011 at 1:33

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
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.

Original comment by ekeeke31@gmail.com on 25 Sep 2011 at 3:06

GoogleCodeExporter commented 9 years ago
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.

Original comment by airmake...@gmail.com on 25 Sep 2011 at 4:18