The guys at Sipeed have released a new beta of their MicroPython port for their range of boards based on the Kendryte K210 processor and this one features an emulator for the NES.
You need a NES rom (you can test with this open-source game binary – Nova The Squirrel) and at least version beta_0.2.1 of MaixPy.
- Insert a MicroSD card with your NES ROMs (you could upload to Flash as well)
- Connect your device to USB
- In Windows, download K-Flash from https://kendryte.com/downloads/ , unzip and run K-Flash.exe
- In K-Flash select the device’s port
- Navigate to the MaixPy binary ( beta_0.2.1 available here or Github releases here)
- Click Flash to upload
I use Putty for the serial monitor. Connect using the settings below (change the port number if needed). If the connection fails, try pressing reset on the board.
Copy and then paste all the code below into Putty at the >>> prompt and press enter twice and the emulator will start up.
import nes nes.init(0) nes.run("/sd/name-of-your-game.nes")
When Putty is the active window (ie you’ve not clicked outside the window) you can control the game using your keyboard. Keys W, A, S and D are the D-pad direction keys. N is select, M start with J and K being the action buttons. This works to a point but there are problems when pressing more than one key.
It’s also possible to wire up a PS2 Controller but I don’t have one to test this. The following code is for use with the PS2 controller
import nes from Maix import GPIO fm.register(8, fm.fpioa.GPIO0) wifi_en=GPIO(GPIO.GPIO0,GPIO.OUT) wifi_en.value(0) nes.init(1) nes.run("/sd/name-of-your-game.nes")
Installing MaixPy from source in Windows 10: https://robotzero.one/sipeed-maix-micropython/
MaixPy on Github: https://github.com/sipeed/MaixPy
Sipeed homepage: https://sipeed.com/#/
Releases including binary: https://github.com/sipeed/MaixPy/releases
Nova The Squirrel NES game: https://github.com/NovaSquirrel/NovaTheSquirrel
If I've saved you some time and you want to say 'Thanks!' you can buy me a coffee here...