Page 1 of 1

Editing Nes emu controls for built in game pads

Posted: Thu Dec 07, 2017 7:57 am
by Duhjoker
I've been studying the NES emu for the esp32 and I have a few questions. I found the nes inputs files here...

https://github.com/espressif/esp32-nese ... nesinput.h

and the playstation controller stuff here....

https://github.com/espressif/esp32-nese ... ntroller.c

I want to build a console so I can play old nes games but I want to use two featherwing joys (with analog and button cross) as the controls. one on either side of a screen.

So how can I make the inputs draw from the featerwing joys instead of looking for ps controller.

https://www.adafruit.com/product/3632

Re: Editing Nes emu controls for built in game pads

Posted: Sat Dec 09, 2017 4:05 am
by ESP_Sprite
The playstation stuff is used here. Suggest you take out the call to psxReadInput and replace that to a call to your own driver, wich should return an 16-bit mask of the buttons/Dpad-directions pressed. You can then change the ev[] structure to map these to events. (Alternatively, entirely rewrite the function; the important thing is that it does the evh=get_event()/evh() thing every time a button is pressed or released).