@Test public void shouldStartLoadingGameIntoTheMemoryRomBanks() throws IOException { GameLoader gameLoader = givenAGameLoader(fakeGameReader); gameLoader.load(ANY_GAME_URI, mmu); assertEquals(0xC3, mmu.readByte(FIRST_ROM_BYTE_ADDRESS) & 0xFF); }
public void load(String uri, MMU mmu) throws IOException { byte[] gameInBytes = gameReader.readGame(uri); int address = ROM_START_MEMORY_ADDRESS; for (int i = 0; i < gameInBytes.length; i++) { byte gameInByte = gameInBytes[i]; mmu.writeByte(address, gameInByte); address++; } }
GameLoader { public void load(String uri, MMU mmu) throws IOException { byte[] gameInBytes = gameReader.readGame(uri); int address = ROM_START_MEMORY_ADDRESS; for (int i = 0; i < gameInBytes.length; i++) { byte gameInByte = gameInBytes[i]; mmu.writeByte(address, gameInByte); address++; } } }
GameLoader { public void load(String uri, MMU mmu) throws IOException { byte[] gameInBytes = gameReader.readGame(uri); int address = ROM_START_MEMORY_ADDRESS; for (int i = 0; i < gameInBytes.length; i++) { byte gameInByte = gameInBytes[i]; mmu.writeByte(address, gameInByte); address++; } } GameLoader(GameReader gameReader); }
GameLoader { public void load(String uri, MMU mmu) throws IOException { byte[] gameInBytes = gameReader.readGame(uri); int address = ROM_START_MEMORY_ADDRESS; for (int i = 0; i < gameInBytes.length; i++) { byte gameInByte = gameInBytes[i]; mmu.writeByte(address, gameInByte); address++; } } GameLoader(GameReader gameReader); void load(String uri, MMU mmu); }
GameLoader { public void load(String uri, MMU mmu) throws IOException { byte[] gameInBytes = gameReader.readGame(uri); int address = ROM_START_MEMORY_ADDRESS; for (int i = 0; i < gameInBytes.length; i++) { byte gameInByte = gameInBytes[i]; mmu.writeByte(address, gameInByte); address++; } } GameLoader(GameReader gameReader); void load(String uri, MMU mmu);  }