mirror of https://github.com/mgba-emu/mgba.git
Initialize some SIO variables properly
This commit is contained in:
parent
4c1014685f
commit
73d32e7cc7
|
@ -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->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) {
|
||||
|
|
Loading…
Reference in New Issue