use of com.rox.emu.rom.InesRom in project emuRox by rossdrew.
the class DebuggerWindow method getProgramFromFile.
private int[] getProgramFromFile() {
final File file = new File("src" + File.separator + "main" + File.separator + "resources" + File.separator + "rom" + File.separator + "SMB1.NES");
System.out.println("Loading '" + file.getAbsolutePath() + "'...");
final FileInputStream fis;
byte[] fileContent = {};
try {
fis = new FileInputStream(file);
fileContent = new byte[(int) file.length()];
fis.read(fileContent);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
final InesRom rom = InesRom.from(fileContent);
Memory prgRom = rom.getProgramRom();
return prgRom.getBlock(0, prgRom.getSize() - 1);
}
Aggregations