Fceux lua socket server and Jupyter Python client
This is proof-of-concept of remote controlling of Fceux NES emulator with Python via sockets. I use Jupyter Notebook as interactive python environment for controlling emulator. This is also good environment for running examples.
For checking example:
- You must have working Python 3 and Jupyter Notebook. Run jupyter with command:
jupyter notebook
-
Open FceuxPythonServer.py.ipynb notebook and run first cell:
-
Now you must run fceux emulator with ROM (I used Castlevania (U) (PRG0) [!].nes for my examples) Next, start lua script fceux_listener.lua. It must connect to running jupyter python server. I run emulator, load ROM to it and start lua script with command:
fceux.exe -lua fceux_listener.lua "Castlevania (U) (PRG0) [!].nes"
You are able to send commands from Jupyter to Fceux (you can execute Notebook cells one by one and see results). Additionally, I recommend to install some software to pin fceux window on top, so you can see command results in emulator window immediatly. For example, it can be done with Dexpot.
Video with results: https://www.youtube.com/watch?v=c3D5gljbkO0