all repos — mgba @ 73d32e7cc700ced48b747cbbf3c57eaefd7b4643

mGBA Game Boy Advance Emulator

Initialize some SIO variables properly
Jeffrey Pfau jeffrey@endrift.com
Wed, 02 Apr 2014 23:16:37 -0700
commit

73d32e7cc700ced48b747cbbf3c57eaefd7b4643

parent

4c1014685fd4551f75d56e16bdc9af85bf00cc16

1 files changed, 6 insertions(+), 9 deletions(-)

jump to
M src/gba/gba-sio.csrc/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) {