简体   繁体   中英

Is it feasible to create an emulator front-end using Kivy?

I've created a gameboy color emulator using C++ and am ready to start developing the frontend that will display the emulator's viewport, emit audio, and also display some debug information.

I'm looking into using Kivy to create the UI frontend and boost.python (which looks pretty promising) to interop between the C++ core and the python UI.

What I would like to have in my front end are:

  • A window to show the emulator graphics. More specifically something that let's me update a raw bitmap (ie raw pixel data) on each frame.
  • A window to display some debug information. More specifically I want a large scrollable text box to show the disassembled code and another one to show the memory.
  • A way to emit audio that's generated by the emulator. The core doesn't support audio yet so I'm not sure what it'll look like on the C++ side.
  • Accept keyboard input to control the game.

Will Kivy allow me to do all of this? I see that it has dependencies on glew and sdl2 which should take care of the graphics and audio requirements, right? Are there widgets that will let me create the disassembly and memory viewer?

A window to show the emulator graphics, update a raw bitmap on each frame

Not sure how exactly, but you have access to textures and to a huge part of OpenGL through Kivy and Python, so this could be doable.

A window to display some debug information, large scrollable text box

Use RecycleView and Label's core. There's an example for ListView, but since the new changes it's kind of broken. However, in a similar way it could be done for RecycleView

A way to emit audio that's generated by the emulator

Should work without problems if you can pass it to the provider. The only issue I see with built-in audio support in Kivy is pause and seek, because those afaik either aren't implemented (most probably) or are broken. However with Gstreamer it should work.

Accept keyboard input to control the game.

Keyboard and multitouch work out of the box with Kivy, you only need to (for keyboard) extend one method and (for touch) check for collisions with Widgets

Are there widgets that will let me create the disassembly and memory viewer?

No. At least none that I know will do that out of the box. If by disassembly you mean text, dump it into a widget that can handle text. Memory viewer however isn't there and you'll need to create your own widget. That's not hard if you work with Kivy at least for a while.

Kivy by default doesn't do 3D. There are "plugins" that can allow you such thing, but I don't see any that's still maintained so there's this thing. Also I see the code isn't C, but C++ so I'm not sure how to bind those together. Cython should be the rescue here ^^

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM