1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-12-24 04:31:02 +00:00

Add support for upper/lower case expansion of filename in linker script. Closes #345

This commit is contained in:
jespergravgaard 2019-12-26 09:28:53 +01:00
parent 08d268f130
commit 34ca539dd5
2 changed files with 6 additions and 4 deletions

View File

@ -42,6 +42,8 @@ public class SourceLoader {
String outputFileName = new File(program.getFileName()).getName(); String outputFileName = new File(program.getFileName()).getName();
String linkScript = new String(Files.readAllBytes(filePath)); String linkScript = new String(Files.readAllBytes(filePath));
linkScript = linkScript.replace("%O", outputFileName); linkScript = linkScript.replace("%O", outputFileName);
linkScript = linkScript.replace("%_O", outputFileName.toLowerCase());
linkScript = linkScript.replace("%^O", outputFileName.toUpperCase());
program.setLinkScript(filePath, linkScript); program.setLinkScript(filePath, linkScript);
program.setTargetPlatform(TargetPlatform.CUSTOM); program.setTargetPlatform(TargetPlatform.CUSTOM);
} catch(IOException e) { } catch(IOException e) {

View File

@ -1,7 +1,7 @@
// Load a file to memory using the C64 KERNAL LOAD functions // Create a D64 disk containing the program and a sprite file
.file [name="kernalload.prg", type="prg", segments="Program"] .file [name="%O.prg", type="prg", segments="Program"]
.disk [filename="kernalload.d64", name="DISK", id=1] { .disk [filename="%O.d64", name="DISK", id=1] {
[name="KERNALLOAD", type="prg", segments="Program"], [name="%^O", type="prg", segments="Program"],
[name="SPRITE", type="prg", segments="Sprite"] [name="SPRITE", type="prg", segments="Sprite"]
} }
.segmentdef Program [segments="Basic, Code, Data"] .segmentdef Program [segments="Basic, Code, Data"]