diff --git a/src/main/java/dk/camelot64/kickc/SourceLoader.java b/src/main/java/dk/camelot64/kickc/SourceLoader.java index fced28ba5..6a224863f 100644 --- a/src/main/java/dk/camelot64/kickc/SourceLoader.java +++ b/src/main/java/dk/camelot64/kickc/SourceLoader.java @@ -42,6 +42,8 @@ public class SourceLoader { String outputFileName = new File(program.getFileName()).getName(); String linkScript = new String(Files.readAllBytes(filePath)); linkScript = linkScript.replace("%O", outputFileName); + linkScript = linkScript.replace("%_O", outputFileName.toLowerCase()); + linkScript = linkScript.replace("%^O", outputFileName.toUpperCase()); program.setLinkScript(filePath, linkScript); program.setTargetPlatform(TargetPlatform.CUSTOM); } catch(IOException e) { diff --git a/src/test/kc/examples/kernalload/kernalload.ld b/src/test/kc/examples/kernalload/kernalload.ld index 4d5d0c08b..8d7057efc 100644 --- a/src/test/kc/examples/kernalload/kernalload.ld +++ b/src/test/kc/examples/kernalload/kernalload.ld @@ -1,7 +1,7 @@ -// Load a file to memory using the C64 KERNAL LOAD functions -.file [name="kernalload.prg", type="prg", segments="Program"] -.disk [filename="kernalload.d64", name="DISK", id=1] { - [name="KERNALLOAD", type="prg", segments="Program"], +// Create a D64 disk containing the program and a sprite file +.file [name="%O.prg", type="prg", segments="Program"] +.disk [filename="%O.d64", name="DISK", id=1] { + [name="%^O", type="prg", segments="Program"], [name="SPRITE", type="prg", segments="Sprite"] } .segmentdef Program [segments="Basic, Code, Data"]