Initialize some SIO variables properly

This commit is contained in:
Jeffrey Pfau 2014-04-02 23:16:37 -07:00
parent 4c1014685f
commit 73d32e7cc7
1 changed files with 6 additions and 9 deletions

View File

@ -42,6 +42,9 @@ void GBASIOInit(struct GBASIO* sio) {
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 GBASIODeinit(struct GBASIO* sio) {
}
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->joybus, SIO_JOYBUS);
}
void GBASIOSetDriver(struct GBASIO* sio, struct GBASIODriver* driver, enum GBASIOMode mode) {