blueberryMSX

By uberjack

Champion (328)

uberjack's picture

29-04-2014, 09:16

Hi everyone,

I've ported blueMSX to Raspberry Pi:
https://github.com/Melllvar/blueberryMSX

For now, it's basically the SDL version with the exception of the video renderer, which draws directly to the framebuffer - this makes it possible to run the emulator without a windowing environment. Joysticks/joypads are also supported.

I plan to add a simple file browser to make the emulator usable without a keyboard, but mostly I'd like to use the Pi's onboard pins to do some interesting things with the hardware - such as reading an actual MSX cartridge in realtime (like an open version of 1chipmsx?).

That said, I'm mostly clueless on hardware, so any suggestions/pointers are welcome.

Login or register to post comments

By vanfanel

Champion (446)

vanfanel's picture

29-04-2014, 10:45

Great! And I see you used GLES2/EGL to draw screen. Good, I can't stand tearing and Xorg choppiness. Big smile
However, how comes it can't do MSX2 stuff at fullspeed? It's a Z80+VDP+PSG. There's something wrong here.
Can I suggest you trying native Dispmanx (Rpi's native 2D video API) instead of GLES2? Maybe that would speed up things a little bit, if that's where bottleneck is.
It's just a matter of "dumping" the pixel buffer to a Dispmanx resource insted of using a GLES2 texture. Worth a try IMHO.

By uberjack

Champion (328)

uberjack's picture

30-04-2014, 07:59

vanfanel wrote:

However, how comes it can't do MSX2 stuff at fullspeed? It's a Z80+VDP+PSG. There's something wrong here.
Can I suggest you trying native Dispmanx (Rpi's native 2D video API) instead of GLES2? Maybe that would speed up things a little bit, if that's where bottleneck is.

I doubt that the hardware video rendering is the bottleneck in this case, since blueMSX is a relatively demanding emulator - even on newer hardware. I originally tried running the emulator on X, using SDL's software renderer. Sadly, I didn't gain that much with GLES2 - which is why I'm not convinced DispmanX will help.

I appreciate the suggestion, however - I will check it out.

By mrhazard

Supporter (1)

mrhazard's picture

14-01-2016, 20:45

Thanks for this! It's so much easier to use than openMSX.

By kanima

Master (194)

kanima's picture

14-01-2016, 21:26

uberjack wrote:

I doubt that the hardware video rendering is the bottleneck in this case, since blueMSX is a relatively demanding emulator - even on newer hardware.

I have very little experience with raspi and just spend some 10 minutes reading some articles on its architecture, so take this with a truck sized grain of salt: the raspi 1 doesn't seem to have an L2 cache for the CPU, only for the GPU. Since the CPU shares the memory with the GPU you really want the GPU to access the RAM as little as possible (unless everything fits inside the L2 cache and never changes, but that's nor relevant for our case here). This means to select the lowest possible, but still usable for blueberryMSX, screen mode. Fewer pixels -> less RAM access -> less blocking the RAM for the CPU.
The L1 cache also seems to be rediculously small, so the next bit probably won't make any difference at all, but still: try compiling with -Os instead of -O3. This will compile optimizing for executable size (and also for speed where it doesn't increase the code size). If a processor has little cache then -Os can result in faster execution than when compiled with -O3, since more loops stay inside the cache.

Anyway, I'm not sure I read all information right and even my reasoning might be completely off, but it should be easy and quick to try out both things (using max 640x480 or something and -Os compiling).

Cheers

By Manuel

Ascended (19470)

Manuel's picture

14-01-2016, 21:28

mrhazard wrote:

Thanks for this! It's so much easier to use than openMSX.

Is blueberryMSX easier to use than openMSX? Can you give me some details on that?
I haven't got a RPi to try it.

By uberjack

Champion (328)

uberjack's picture

10-02-2016, 06:17

Manuel wrote:
mrhazard wrote:

Thanks for this! It's so much easier to use than openMSX.

Is blueberryMSX easier to use than openMSX? Can you give me some details on that?
I haven't got a RPi to try it.

As the person who ported it, I don't see why that would be the case Smile. Most of my work was just switching the display code to use native GLES and adding joystick/mouse support (via udev).