xenon: support for multiple controllers

This commit is contained in:
tmbinc 2009-09-11 14:52:03 +00:00
parent feee83d784
commit 0e3155eeda

View File

@ -59,12 +59,15 @@ void
emulate ()
{
while(1) // emulation loop
{
int ctrl;
for (ctrl = 0; ctrl < 4; ++ctrl)
{
struct controller_data_s c;
if (get_controller_data(&c, 0))
if (get_controller_data(&c, ctrl))
{
// printf("got controller data!\n");
int offset = 0x10;
int offset = 0x10 + ctrl * 0x10;
// printf("a=%d, b=%d, x=%d, y=%d, lb=%d, rb=%d, start=%d, select=%d, up=%d, down=%d, left=%d, right=%d\n",
// c.a, c.b, c.x, c.y, c.lb, c.rb, c.start, c.select, c.up, c.down, c.left, c.right);
@ -84,6 +87,7 @@ emulate ()
S9xReportButton (offset + 10, c.left);
S9xReportButton (offset + 11, c.right);
}
}
S9xMainLoop ();
usb_do_poll();