Initialize some SIO variables properly
Jeffrey Pfau jeffrey@endrift.com
Wed, 02 Apr 2014 23:16:37 -0700
1 files changed,
6 insertions(+),
9 deletions(-)
jump to
M
src/gba/gba-sio.c
→
src/gba/gba-sio.c
@@ -42,6 +42,9 @@ sio->rcnt = RCNT_INITIAL;
sio->siocnt = 0; sio->mode = -1; sio->activeDriver = 0; + sio->drivers.normal = 0; + sio->drivers.multiplayer = 0; + sio->drivers.joybus = 0; _switchMode(sio); }@@ -55,15 +58,9 @@ }
} void GBASIOSetDriverSet(struct GBASIO* sio, struct GBASIODriverSet* drivers) { - if (drivers->normal) { - GBASIOSetDriver(sio, drivers->normal, SIO_NORMAL_8); - } - if (drivers->multiplayer) { - GBASIOSetDriver(sio, drivers->multiplayer, SIO_MULTI); - } - if (drivers->joybus) { - GBASIOSetDriver(sio, drivers->multiplayer, SIO_JOYBUS); - } + GBASIOSetDriver(sio, drivers->normal, SIO_NORMAL_8); + GBASIOSetDriver(sio, drivers->multiplayer, SIO_MULTI); + GBASIOSetDriver(sio, drivers->joybus, SIO_JOYBUS); } void GBASIOSetDriver(struct GBASIO* sio, struct GBASIODriver* driver, enum GBASIOMode mode) {