Editing Nes emu controls for built in game pads

Posts: 85
Joined: Mon Mar 20, 2017 8:09 am

Editing Nes emu controls for built in game pads

Postby Duhjoker » Thu Dec 07, 2017 7:57 am

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.

Fear is the mind killer.......

GameR the DIY iot gaming device that does more......

Posts: 2000
Joined: Thu Nov 26, 2015 4:08 am

Re: Editing Nes emu controls for built in game pads

Postby ESP_Sprite » Sat Dec 09, 2017 4:05 am

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).

Who is online

Users browsing this forum: No registered users and 16 guests