From 7f3cfd50af20ac8eb59830c48665ec182d87cc01 Mon Sep 17 00:00:00 2001 From: jespergravgaard Date: Sat, 3 Aug 2019 13:32:34 +0200 Subject: [PATCH] Working on fixing problem with encoding of literal chars. 1/3 done. #245 --- src/main/java/dk/camelot64/kickc/KickC.java | 3 ++- .../java/dk/camelot64/kickc/passes/Pass5FixLongBranches.java | 2 +- src/test/java/dk/camelot64/kickc/test/TestKickAssRun.java | 3 ++- src/test/java/dk/camelot64/kickc/test/TestPrograms.java | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/dk/camelot64/kickc/KickC.java b/src/main/java/dk/camelot64/kickc/KickC.java index f029b18bb..d4b4cfa6d 100644 --- a/src/main/java/dk/camelot64/kickc/KickC.java +++ b/src/main/java/dk/camelot64/kickc/KickC.java @@ -8,6 +8,7 @@ import dk.camelot64.kickc.model.CompileError; import dk.camelot64.kickc.model.Program; import dk.camelot64.kickc.model.TargetPlatform; import kickass.KickAssembler; +import kickass.nonasm.c64.CharToPetsciiConverter; import picocli.CommandLine; import java.io.*; @@ -262,7 +263,7 @@ public class KickC implements Callable { System.setOut(new PrintStream(kasmLogOutputStream)); int kasmResult = -1; try { - //CharToPetsciiConverter.setCurrentEncoding("screencode_mixed"); + CharToPetsciiConverter.setCurrentEncoding("screencode_mixed"); kasmResult = KickAssembler.main2(assembleCommand); } catch(Throwable e) { throw new CompileError("KickAssembling file failed! ", e); diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass5FixLongBranches.java b/src/main/java/dk/camelot64/kickc/passes/Pass5FixLongBranches.java index 4cbb6a9cf..89c53de19 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass5FixLongBranches.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass5FixLongBranches.java @@ -83,7 +83,7 @@ public class Pass5FixLongBranches extends Pass5AsmOptimization { System.setOut(new PrintStream(kickAssOut)); int asmRes = -1; try { - //CharToPetsciiConverter.setCurrentEncoding("screencode_mixed"); + CharToPetsciiConverter.setCurrentEncoding("screencode_mixed"); asmRes = KickAssembler.main2(new String[]{asmFile.getAbsolutePath(), "-o", asmPrgFile.getAbsolutePath()}); } catch(Throwable e) { if(e instanceof AssertionError && e.getMessage().contains("Invalid number of bytes in memblock!")) { diff --git a/src/test/java/dk/camelot64/kickc/test/TestKickAssRun.java b/src/test/java/dk/camelot64/kickc/test/TestKickAssRun.java index 3599f0aa6..c4a6a2a99 100644 --- a/src/test/java/dk/camelot64/kickc/test/TestKickAssRun.java +++ b/src/test/java/dk/camelot64/kickc/test/TestKickAssRun.java @@ -1,6 +1,7 @@ package dk.camelot64.kickc.test; import kickass.KickAssembler; +import kickass.nonasm.c64.CharToPetsciiConverter; import org.junit.Test; import java.io.*; @@ -22,7 +23,7 @@ public class TestKickAssRun { ByteArrayOutputStream kickAssOut = new ByteArrayOutputStream(); System.setOut(new PrintStream(kickAssOut)); try { - //CharToPetsciiConverter.setCurrentEncoding("screencode_mixed"); + CharToPetsciiConverter.setCurrentEncoding("screencode_mixed"); KickAssembler.main2(new String[]{asmPath.toAbsolutePath().toString(), "-o", asmPrgFile.getAbsolutePath()}); } catch (AssertionError e) { System.setOut(new PrintStream(new FileOutputStream(FileDescriptor.out))); diff --git a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java index b77609bd8..85d6df879 100644 --- a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java +++ b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java @@ -2810,7 +2810,7 @@ public class TestPrograms { System.setOut(new PrintStream(kickAssOut)); int asmRes = -1; try { - //CharToPetsciiConverter.setCurrentEncoding("screencode_mixed"); + CharToPetsciiConverter.setCurrentEncoding("screencode_mixed"); asmRes = KickAssembler.main2(new String[]{asmFile.getAbsolutePath(), "-log", asmLogFile.getAbsolutePath(), "-o", asmPrgFile.getAbsolutePath(), "-vicesymbols", "-showmem", "-bytedump"}); } catch(Throwable e) { fail("KickAssembling file failed! " + e.getMessage());