(Libxenon) D-pad works now in ROM browser menu

This commit is contained in:
TwinAphex51224 2011-12-14 08:36:04 +01:00
parent ee43531a99
commit 325a9fb48e
2 changed files with 9 additions and 7 deletions

View File

@ -139,9 +139,9 @@ int main(void)
usb_do_poll();
get_controller_data(&pad, 0);
if (pad.s1_y > STICK_THRESHOLD)
if (pad.s1_y > STICK_THRESHOLD || pad.up)
pos--;
if (pad.s1_y < -STICK_THRESHOLD)
if (pad.s1_y < -STICK_THRESHOLD || pad.down)
pos++;
if (entrycount && (pos < 0 || pos >= entrycount))

View File

@ -17,23 +17,25 @@
*/
#include "../driver.h"
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include "../driver.h"
#include "../libsnes.hpp"
#include <input/input.h>
#include <usb/usbmain.h>
#include <stdlib.h>
struct controller_data_s pad[5];
static struct controller_data_s pad[4];
static void xenon360_input_poll(void *data)
{
(void)data;
for (unsigned i = 0; i < 5; i++)
for (unsigned i = 0; i < 4; i++)
{
usb_poll();
usb_do_poll();
get_controller_data(&pad[i], i);
}
}