mirror of
https://github.com/dborth/snes9xgx.git
synced 2024-12-24 18:21:50 +01:00
xenon: support for multiple controllers
This commit is contained in:
parent
feee83d784
commit
0e3155eeda
@ -60,13 +60,16 @@ emulate ()
|
||||
{
|
||||
while(1) // emulation loop
|
||||
{
|
||||
struct controller_data_s c;
|
||||
if (get_controller_data(&c, 0))
|
||||
int ctrl;
|
||||
for (ctrl = 0; ctrl < 4; ++ctrl)
|
||||
{
|
||||
// printf("got controller data!\n");
|
||||
int offset = 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);
|
||||
struct controller_data_s c;
|
||||
if (get_controller_data(&c, ctrl))
|
||||
{
|
||||
// printf("got controller data!\n");
|
||||
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);
|
||||
|
||||
S9xReportButton (offset + 0, c.b);
|
||||
S9xReportButton (offset + 1, c.a);
|
||||
@ -84,6 +87,7 @@ emulate ()
|
||||
S9xReportButton (offset + 10, c.left);
|
||||
S9xReportButton (offset + 11, c.right);
|
||||
}
|
||||
}
|
||||
S9xMainLoop ();
|
||||
|
||||
usb_do_poll();
|
||||
|
Loading…
Reference in New Issue
Block a user