Just in case you havent made the d-pad of your NES usb gamepad work with your game here are a few suggestions.
Unfortunately I dont have the same usb game controller as you, so these are just suggestions which have workes with my troublesome game controllers.
1. I also have a retro type gamepad with usb, although its a sega style one, it have the feature to switch between xinput and directinput if I press the start button and "B" at the same time for a few seconds. In one of the modes the d-pad do not work correctly. In the other mode the d-pad works correctly (well either as d-pad buttons, or as a left stick).
2. I also have a game controller with a d-pad that seems to transmit wrong data when pressing left and right. It was because the d-pad was transmitting left stick analog data instead of d-pad button data. Therefore I check both for d-pad movement and for left stick (axis) movement in order to make the d-pad of this type of game controller work too. I found out that I should edit the stick sensibility with the function : gamepad_set_axis_deadzone(device, deadzone); // device is the game-controller-port and a good deadzone variable is 0.5. Because if the stick sensibility/deadzone is extreme like 0 or 1, then it can cause some of the directions to not be detected at all ! Therefore I use the deadzone value 0.5.
3. An old gamepad of mine have a d-pad that behaves like a joystick "hat" (thumbstick I think it is called). Those behave different too, but can be detected and used, and when used I had to adjust the sensibility using this function : gamepad_set_button_threshold(device, threshold);
4. Actually I also have a gamepad with a d-pad that sends down when pressing right, left when pressing down and so forth. That d-pad also transmit left stick (or hat) data at the same time, so I just first check the d-pad button data and IF there are other data send from the d-pad then the new data overrides the d-pad button data (which were wrong anyway).
Best regards and good luck
Max