Coder Social home page Coder Social logo

Comments (8)

M-J-Murray avatar M-J-Murray commented on July 4, 2024

Hello

This library works by interacting with a modified version of mame. It uses the lua engine to send frame data to the library via linux fifo pipes. These pipes also allow for the application to be efficiently stepped along. I also experimented with emu.wait() calls, but fifo pipes were the most reliable and efficient.
You will be able to stop emulations dynamically and reopen them with different games. Meaning you can automate this in your python script.
This library was developed on Ubuntu, but it should work for all Linux systems. The reason the library doesn't work on other platforms is because I am using the Linux fifo pipes to communicate with the emulator. At this time I am not aware of similar mechanisms on other operating systems.

Michael

from mametoolkit.

RielFox avatar RielFox commented on July 4, 2024

Hey
I installed Ubuntu. I am new to Linux so I was trying 'make' on the mame emulator folder and I was adding dependencies. I was getting dependency error messages such as

Package fontconfig was not found in the pkg-config search path.
Perhaps you should add the directory containing `fontconfig.pc'
to the PKG_CONFIG_PATH environment variable
No package 'fontconfig' found

I googled each package and either used 'apt-get install' to get them or added .pc files to my /usr/lib/pkgconfig folder that I found while searching.

I am not sure if there is a more intuitive way to solve dependencies such as these.

I eventually reached to this monstrous crash while trying 'make':

'GCC 8 detected
Compiling src/mame/drivers/z88.cpp...
../../../../../src/mame/drivers/z88.cpp: In member function ‘void z88_state::bankswitch_update(int, uint16_t, int)’:
../../../../../src/mame/drivers/z88.cpp:67:20: error: ‘%d’ directive writing between 1 and 11 bytes into a region of size 2 [-Werror=format-overflow=]
sprintf(bank_tag, "bank%d", bank + 2);
^~~~~~~~
../../../../../src/mame/drivers/z88.cpp:67:20: note: directive argument in the range [-2147483646, 2147483647]
In file included from /usr/include/stdio.h:873,
from /usr/include/c++/8/cstdio:42,
from /usr/include/c++/8/ext/string_conversions.h:43,
from /usr/include/c++/8/bits/basic_string.h:6391,
from /usr/include/c++/8/string:52,
from /usr/include/c++/8/stdexcept:39,
from /usr/include/c++/8/array:39,
from /usr/include/c++/8/tuple:39,
from /usr/include/c++/8/bits/unique_ptr.h:37,
from /usr/include/c++/8/memory:80,
from ../../../../../src/emu/emu.h:23:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:36:34: note: ‘__builtin___sprintf_chk’ output between 6 and 16 bytes into a destination of size 6
return __builtin___sprintf_chk (__s, __USE_FORTIFY_LEVEL - 1,
~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
__bos (__s), __fmt, __va_arg_pack ());
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [acorn.make:468: ../../../../linux_gcc/obj/x64/Release/src/mame/drivers/z88.o] Error 1
make[1]: *** [Makefile:100: acorn] Error 2
make: *** [makefile:1263: linux_x64] Error 2'

Not sure where did it go wrong. I'm assuming some dependencies are still missing?

Thanks!

from mametoolkit.

M-J-Murray avatar M-J-Murray commented on July 4, 2024

You do not need to do anything special with mame to use this library. All you need to do is get a python environment, I recommend you use virtual environment or anoconda. Then go to your pip file inside your python environment. And just run './pip install MAMEToolkit' and you should be ready to go.

from mametoolkit.

RielFox avatar RielFox commented on July 4, 2024

I've already done all the steps you advised. I was under the impression that you had to compile the modified version of mame and put the binaries somewhere inside the /MAMEToolkit directory.
I'll give it a go!

from mametoolkit.

M-J-Murray avatar M-J-Murray commented on July 4, 2024

The pip repo comes with the compiled modified version of mame. The reason it doesn't exist in the github repo is because github has a 50mb file limit on free repos. Let me know if you have any more trouble.

from mametoolkit.

RielFox avatar RielFox commented on July 4, 2024

Hey,
I tried some code to see that everything works in my conda environment.
'
import numpy as np
import tensorflow as tf
from MAMEToolkit.emulator import see_games

see_games()
'
I get "./mame: error while loading shared libraries: libQt5Widgets.so.5: cannot open shared object file: No such file or directory". It ends up I have all the Qt files needed in my installation, and I even re downloaded Qt and installed for Ubuntu.

I am trying to follow these steps now: http://doc.qt.io/qt-5/linux-deployment.html
Will update if I get it going.

Update: I tried many things such installing with 'apt-get' and 'pip install' and 'brew' and 'conda install' from inside my environment, getting both Qt and PyQt. I also installed Qt manually. I tried setting the path of the files in $LD_LIBRARY_PATH to '/usr/lib/x86_64-linux-gnu' which included all the files needed. I also tried adding this dir to the $PATH. I got the files manually (https://rpmfind.net/linux/rpm2html/search.php?query=libQt5Widgets.so.5()(64bit) and https://rpmfind.net/linux/rpm2html/search.php?query=libQt5Gui.so.5()(64bit) ) and added all of the necessary files to many dirs such as '/home//anaconda3/lib', '/home//anaconda3/envs//lib', '...//lib/python3.6/python3.6/lib-dynload', '..//x86_64-conda_cos6-linux-gnu/sysroot/lib' and '..//lib/python3.6/site-packages'.

While I managed to bypass the 'libQt5Widgets.so.5', I now get the similar './mame: error while loading shared libraries: libQt5Gui.so.5: cannot open shared object file: No such file or directory' and I am making sure 'libQt5Gui.so.5' is located in all the dirs mentioned above (along with the rest of Qt shared libraries). Still, the interpreter wont see it.

Thanks!

from mametoolkit.

PigUnderRoof avatar PigUnderRoof commented on July 4, 2024

I solved depency problems like libqt5widgets5 by sudo apt-get install and sucessfully ran kof97.

from mametoolkit.

RielFox avatar RielFox commented on July 4, 2024

My previous Ubuntu installation proved to be unstable and ended up in Kernel Panics and frequent crashes after a while. In a new Ubuntu and lubuntu installation, inside my conda environment, I did:

sudo apt-get install libsdl2-dev
sudo apt-get install libsdl2-ttf-dev
sudo apt-get install libqt5widgets5

and it worked, I was able to start MAME from Python with 'see_games()'.

I'm not sure why it wasn't working before, as I tried everything listed, but I assume my failing system/ssd might have caused problems.

from mametoolkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.