These changes fix a couple of issues with connections to a SNES Classic.
SNESClassicFactory::findMemoryLocations would sometimes fail to find the ROM location, because it was looking for an 8196 KB "anon" block in the output of pmap, but that block sometimes ends up contiguous with a 2044 KB "stack" block, so pmap shows it as a 10240 KB "stack" block. So now, if we see a line of output from pmap of size 10240, we check a few bytes to confirm it is actually the ROM location and then use it.
The other problem is that SNESClassicFactory::aliveCheck would leave the socket open when closing the device, which meant that the next time a client tried to list devices, there might be some unread data already in the socket, which would result in some garbage being stored as the canoe PID. Now, we close the socket when the device is closed, so it will reconnect to the SNES Classic the next time SNESClassicFactory::listDevices is called and it will be in a clean state.
These changes fix a couple of issues with connections to a SNES Classic.
SNESClassicFactory::findMemoryLocations
would sometimes fail to find the ROM location, because it was looking for an 8196 KB "anon" block in the output ofpmap
, but that block sometimes ends up contiguous with a 2044 KB "stack" block, sopmap
shows it as a 10240 KB "stack" block. So now, if we see a line of output frompmap
of size 10240, we check a few bytes to confirm it is actually the ROM location and then use it.SNESClassicFactory::aliveCheck
would leave the socket open when closing the device, which meant that the next time a client tried to list devices, there might be some unread data already in the socket, which would result in some garbage being stored as the canoe PID. Now, we close the socket when the device is closed, so it will reconnect to the SNES Classic the next timeSNESClassicFactory::listDevices
is called and it will be in a clean state.