BizHawk icon indicating copy to clipboard operation
BizHawk copied to clipboard

[Core Port Req.] BlastEm (Sega MD/Genesis)

Open ghost opened this issue 4 years ago • 37 comments
trafficstars

a feature request, and not replace but offer as well

blastem_libretro waterbox? blastem_libretro.dll feature request? ALT core?

ghost avatar Jun 03 '21 13:06 ghost

The upstream core appears to be broken. Loading any savestate is the core's weak point and might crash BizHawk, so BlastEm core needs to be updated and fixed if developers want to add it here. Even if it doesn't crash, it would cause timing issues, effectively desyncing a TAS. Even most hacked ROMs crash it too... Waterboxing is the only way to avoid this.

getCursorsExe avatar Jun 03 '21 13:06 getCursorsExe

Didnt realize it was broken, was just reading "its super accurate"

ghost avatar Jun 03 '21 13:06 ghost

You don't need to close it, we need to wait for developers' comment.

getCursorsExe avatar Jun 03 '21 13:06 getCursorsExe

It crashes most likely because it is a very new core. This issue only exists in the Libretro release of BlastEm.

getCursorsExe avatar Jun 03 '21 13:06 getCursorsExe

Right, but my only reason for requesting it is hearing how much more accurate than the current core it is however if its prone to crashing I made a mistake requesting it

ghost avatar Jun 03 '21 13:06 ghost

For those out of the loop:

BlastEm is an open source, higly accurate emulator for the Genesis/Megadrive that runs on modest hardware. It is the first emulator to properly run Titan's impressive Overdrive 2 demo and it is the only other emulator besides Genesis Plus GX that can properly run the original Overdrive.

It's written in C with the usual SDL2. The source is on a self-hosted Mercurial repo and is licensed under the GPL v3+.

YoshiRulz avatar Jun 03 '21 14:06 YoshiRulz

So then It would be a good idea to add as a second option core?

ghost avatar Jun 03 '21 14:06 ghost

While it has many issues that crashes often (including savestates), it might be good idea but BizHawk devs need to fix these or the core will be completely unusable.

getCursorsExe avatar Jun 03 '21 17:06 getCursorsExe

I was just thinking a stable core option would be a nice addition. Dont know how stable this is though if its truly prone to crashing

ghost avatar Jun 03 '21 18:06 ghost

It is pretty stable if we don't use savestates. Both native and gst savestate formats doesn't function correctly at all. Waterbox requried.

getCursorsExe avatar Jun 03 '21 18:06 getCursorsExe

This core appears to be broken. Loading any savestate is the core's weak point and might crash BizHawk

Ok so waterbox it.

CasualPokePlayer avatar Jun 04 '21 00:06 CasualPokePlayer

I thought it might give bizhawk a more accurate genesis core. If blastem is really that buggy i dont think its worth adding

ghost avatar Jun 04 '21 00:06 ghost

Aside from elaborate technical demos, which games does blastem emulate better than upstream gpgx?

vadosnaprimer avatar Jun 04 '21 06:06 vadosnaprimer

Ah, when I copy-pasted that description from the website, I didn't notice the word "demo". BlastEm is actually missing a lot of mappers and peripherals so there would be little benefit in adding it as an alternate core, unless it offered a substantial speed increase over GPGX in those games it does emulate.

YoshiRulz avatar Jun 04 '21 07:06 YoshiRulz

gpgx is also really fast.

vadosnaprimer avatar Jun 04 '21 07:06 vadosnaprimer

I belive the newest blastem 0.63 can run the full library. Its slower than genplgx but more accurate. That being said i dont think its stable enough. Too many ppl say it crashed. Using myself the win64 nightly no issues but when i tried the liberto version crash crash crash. So i cancel my request.

ghost avatar Jun 04 '21 16:06 ghost

more accurate

Any game examples?

vadosnaprimer avatar Jun 04 '21 17:06 vadosnaprimer

It is still a good idea, since it perfectly runs TiTAN Overdrive 2 Demo.

getCursorsExe avatar Jun 06 '21 19:06 getCursorsExe

You plan to TAS a demo?

vadosnaprimer avatar Jun 06 '21 20:06 vadosnaprimer

It is still a good idea, since it perfectly runs TiTAN Overdrive 2 Demo.

Runs the complete commercial library without hacks….

ghost avatar Jun 06 '21 22:06 ghost

You plan to TAS a demo?

No, but since it perfectly runs it, it means that this core is very accurate, pretty similar to hardware

getCursorsExe avatar Jun 07 '21 11:06 getCursorsExe

You plan to TAS a demo?

No, but since it perfectly runs it, it means that this core is very accurate, pretty similar to hardware

Do what I did, switch to retroarch. Now I have both cores and sharers.

ghost avatar Jun 07 '21 18:06 ghost

Doesn't look like a perfect core, but it'd be nice to have another Genesis in our pocket.

nattthebear avatar Jun 08 '21 00:06 nattthebear

It has to be waterboxed, because the upstream one is unusable for TASing. Even if it would, it would cause thousands of desyncs (even worse than Octoshock). We need to check the savestate script of the upstream core why loading a savestate interferes with the game and can crash the emulator. https://github.com/libretro/blastem/blob/libretro/saves.c

getCursorsExe avatar Jul 28 '21 12:07 getCursorsExe

Compare with Genplus-gx: https://github.com/libretro/Genesis-Plus-GX/blob/master/core/state.c

getCursorsExe avatar Jul 28 '21 12:07 getCursorsExe

Took a peek at doing this: going off it's front page:

BlastEm depends on SDL2, GLEW and OpenGL.

~~OpenGL is an immediate no for waterboxing, that would need to be stripped out of the core, how easy that is I don't know.~~ (There's a DISABLE_OPENGL define flag in there, that flag would probably need to be set).

There is another interesting aspect to this core: it seems to support dynarec. This wouldn't work in waterbox as it is (although it could in theory be made to work), but regardless seems like a NEW_CORE define disables this dynarec? Could potentially be interesting to look into, as I imagine that dynarec might be significantly faster compared gpgx (does libretro disable dynarec / the "it's slower" due to that?).

Regardless, it still doesn't look pretty to port over, SDL2 should probably be stripped out (does wbx even support that?). But if that's not so hard then it's probably painless?

EDIT: Looks like a lot of the problems can just be disabled with specific flags anyways. Doesn't seem so bad looking even further.

CasualPokePlayer avatar Nov 29 '21 06:11 CasualPokePlayer

https://github.com/CasualPokePlayer/BizHawk/tree/blastem/waterbox/blastem

Well, I took a stab at this. It builds. That's it. I have no idea if this even works. Probably does. Needs an actual interface and stuff c# side actually hooked up, but it doesn't seem so bad.

EDIT: Got some interface in, it boots and plays games. A lot of shit needs to be hooked up. Not too bad ig

CasualPokePlayer avatar Nov 30 '21 05:11 CasualPokePlayer

OpenGL is an immediate no for waterboxing, that would need to be stripped out of the core, how easy that is I don't know. (There's a DISABLE_OPENGL define flag in there, that flag would probably need to be set).

Should we use LLVMpipe for this?

Also, no audio currently. Inputs do not work.

getCursorsExe avatar Apr 03 '22 18:04 getCursorsExe

Yes because those were not hooked up. Stop complaining work in progresses are incomplete.

CasualPokePlayer avatar Apr 03 '22 18:04 CasualPokePlayer

I somehow managed to build it perfectly.

getCursorsExe avatar Apr 03 '22 18:04 getCursorsExe