Genesis Plus GX

[h]Genesis Plus GX - libretro[/h]

How to compile the library (for libretro)


git clone https://github.com/libretro/Genesis-Plus-GX.git
make -f Makefile.libretro

Screenshots

Just a little issue. The geometry.aspect_ratio field is never initialized in retro_set_viewport_dimensions.

Alright, thanks for making me aware of that. I’ll look at it and fix it.

EDIT: OK, pushed a fix to the repo. Let me know if that takes care of it.

You might want to add -DALIGN_LONG and -DALIGN_DWORD in Android.mk. Without them ARM (and probably MIPS) will give a SIGBUS (BUS_ADRALN) signal as soon as a Genesis game scrolls horizontally. Other than that, SMS Genesis and Sega-CD all run perfectly on my Nexus 7.

Updated Genesis Plus GX with your suggested changes. It no longer crashes when setting LOCAL_ARM_MODE := arm. So thanks for that.

BTW - let me know what the framerate is with Virtua Racing on your Nexus 7 - on my humble Cortex A8 1.2GHz CPU (single-core), I get 34fs. Virtua Racing runs fullspeed on a Wii at least so it would be interesting if the Nexus 7 can achieve 60fps there or whether or not that would take a Nexus 10 (ie. an A15 processor).

It just barely gets past 60 on my personal, mostly java based, fronted. I can’t get retroarch to run on android though. I sorta got it by copy the jni from native into phoenix, but I can’t make it find libretro.so. It looks like the libretro path is expected in a fixed location(?), but I don’t have root to put it there (I should really get around to rooting sometime).

[quote=“meancoot”]

It just barely gets past 60 on my personal, mostly java based, fronted. I can’t get retroarch to run on android though. I sorta got it by copy the jni from native into phoenix, but I can’t make it find libretro.so. It looks like the libretro path is expected in a fixed location(?), but I don’t have root to put it there (I should really get around to rooting sometime).[/quote]

You don’t need a rooted device, your libretro.so just needs to be pushed to the right location -


   /* ugly hack for now - hardcode libretro path to 'allowed' dir */
   snprintf(libretro_path, sizeof(libretro_path), "/data/data/com.retroarch/lib/libretro.so");

The reason this was done for now is because we can’t ‘execute’ files from the extsd device since it’s mounted read-only and it would require root permissions.

BTW - I would encourage you to start using the official RetroArch/Phoenix Android code and give me feedback. I’m planning a Christmas release so I can use all the help I can get meeting that deadline.

On Android (4.2 at least) the /data dir owned by system:system. Presumably each folder inside is owned by the user the app will run as. I guess they did it so users couldn’t just go poking into an apps data. As such using ‘adb push’ to try and write there just nets a permission denied message.

The way I do it is include all of the libraries in my apps ‘lib’ folder (I use a hack in my android.mk that includes every .so in a specific directory). The top level browser activity lists the found modules, then after one is selected the file browser starts in a folder created based on the loaded module along with an ‘SD Card Root’ button that takes you to the external storage root. I’m no UI designer but I think it works pretty well. (I’m not interested in supporting it but if you wan’t to pick it for ideas I’ll upload it).

Anyway, I got RetroArch working by including the libreto.so as a prebuilt library, and Virtua Racing does not run full-speed. I get around 36 fps. It goes to ~57 if the width != pitch path in gl_copy_frame packs the buffer manually instead of calling glTexSubImage2D for every line.

Change it to something like:


uint8_t* fbuf = malloc(width * height * 2); // Allocate the buffer once and reuse it
const uint8_t *src = (const uint8_t*)frame;
for (unsigned h = 0; h < height; h++, src += pitch)
{
   memcpy(&fbuf[h * (width * 2)], src, width * 2);
}
         
glTexSubImage2D(GL_TEXTURE_2D,
 0, 0, 0, width, height, gl->texture_type,
 gl->texture_fmt, fuf);

free(fbuf);

I don’t have much spare time until the weekend so I’ll try and hunt some bugs then.

To be honest with you, I don’t really notice any speedups after doing what you said - framerate in Virtua Racing is the same as before.

http://pastebin.com/wZxKLsgG

Can you submit a pull request to make sure it’s not just my specific implementation?

Sure, go ahead and upload it - I appreciate that.

Also - sad to hear we can no longer load libs from the ‘data’ directory - I was banking on that being possible as I have had no problems doing it on Android 4.0.

A little feature request for this core: it’d be cool if it could save per game brm files for Sega CD. It also annoys me a bit how it puts a cart.brm in the same folder as the iso loaded instead of the save folder I specify in my cfg file.

is it possible to switch input peripherals? GenplusGX supports 6-buttons Control Pads, the XE-1AP analog controller, lightguns, etc.