Bug fixes related to floppy drive

This commit is contained in:
simon
2017-11-14 20:58:07 -05:00
parent cfb8050cee
commit 8701007ad9
4 changed files with 44 additions and 33 deletions

View File

@@ -108,8 +108,14 @@ public class GameServer implements Runnable {
for (User user : users_) {
if(user.getCpu() != null){
user.getCpu().reset();
user.getCpu().execute();
try {
user.getCpu().reset();
user.getCpu().execute();
} catch (Exception e) {
LogManager.LOGGER.severe("Error executing " + user.getUsername() + "'s code");
e.printStackTrace();
}
}
}

View File

@@ -60,7 +60,7 @@ public class Memory implements Target, JSONSerialisable {
offset = (char)offset * 2;
if (offset + count > this.bytes.length || count < 0 || offset < 0) {
if (offset + count > this.bytes.length || count < 0 || offset < 0 || srcOffset >= bytes.length) {
return false;
}