From 0cba2dec04b537b7e7afec7d120a1440800e51c8 Mon Sep 17 00:00:00 2001 From: Karol Stasiak Date: Mon, 6 Apr 2020 17:54:59 +0200 Subject: [PATCH] Generate .INF file for every output file --- src/main/scala/millfork/Main.scala | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/scala/millfork/Main.scala b/src/main/scala/millfork/Main.scala index 70ccdc59..0a26289f 100644 --- a/src/main/scala/millfork/Main.scala +++ b/src/main/scala/millfork/Main.scala @@ -157,6 +157,12 @@ object Main { errorReporting.debug("Writing output to " + path.toAbsolutePath) errorReporting.debug(s"Total output size: ${code.length} bytes") Files.write(path, code) + if (platform.generateBbcMicroInfFile) { + val start = platform.codeAllocators(bankName).startAt + val codeLength = code.length + Files.write(Paths.get(prgOutput +".inf"), + s"${path.getFileName} ${start.toHexString} ${start.toHexString} ${codeLength.toHexString}".getBytes(StandardCharsets.UTF_8)) + } } errorReporting.debug(s"Total time: ${Math.round((System.nanoTime() - startTime)/1e6)} ms") c.runFileName.foreach{ program => @@ -165,12 +171,6 @@ object Main { errorReporting.debug(s"Running: ${cmdline.mkString(" ")}") new ProcessBuilder(cmdline.toArray: _*).directory(new File(program).getParentFile).start() } - if (platform.generateBbcMicroInfFile) { - val start = platform.codeAllocators("default").startAt - val codeLength = result.code("default").length - Files.write(Paths.get(defaultPrgOutput+".inf"), - s"$defaultPrgOutput ${start.toHexString} ${start.toHexString} ${codeLength.toHexString}".getBytes(StandardCharsets.UTF_8)) - } } private def getDefaultIncludePath: Either[String, String] = {