1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-03 12:07:26 +00:00

Added missing fragments for Paul Gardner-Stephens Unit 3.5

This commit is contained in:
jespergravgaard 2019-08-17 13:51:07 +02:00
parent 891a4c21c2
commit 13f2f14b9d
4 changed files with 75 additions and 0 deletions

View File

@ -0,0 +1,9 @@
lda ({z2}),y
clc
adc #1
sta {z1}
iny
lda ({z2}),y
adc #0
sta {z1}+1

View File

@ -0,0 +1,10 @@
iny
lda ({z2}),y
cmp {z1}+1
bcc {la1}
bne !+
dey
lda ({z2}),y
cmp {z1}
bcc {la1}
!:

View File

@ -0,0 +1,10 @@
ldy #1
lda {z1}+1
cmp ({z2}),y
bcc {la1}
bne !+
dey
lda {z1}
cmp ({z2}),y
bcc {la1}
!:

View File

@ -44,5 +44,51 @@ public class TestKickAssRun {
return new File(tmpDir.toFile(), kcPath.getFileName().toString() + extension);
}
@Test
public void testPetsciiEscapeSequences() {
printPetscii("petscii_mixed", '\b', "\\b");
printPetscii("petscii_mixed", '\f', "\\f");
printPetscii("petscii_mixed", '\n', "\\n");
printPetscii("petscii_mixed", '\r', "\\r");
printPetscii("petscii_mixed", '\t', "\\t");
printPetscii("petscii_mixed", '\\', "\\\\");
printPetscii("petscii_mixed", '\'', "\\'");
printPetscii("petscii_mixed", '\"', "\\\"");
printPetscii("petscii_upper", '\b', "\\b");
printPetscii("petscii_upper", '\f', "\\f");
printPetscii("petscii_upper", '\n', "\\n");
printPetscii("petscii_upper", '\r', "\\r");
printPetscii("petscii_upper", '\t', "\\t");
printPetscii("petscii_upper", '\\', "\\\\");
printPetscii("petscii_upper", '\'', "\\'");
printPetscii("petscii_upper", '\"', "\\\"");
printPetscii("screencode_mixed", '\b', "\\b");
printPetscii("screencode_mixed", '\f', "\\f");
printPetscii("screencode_mixed", '\n', "\\n");
printPetscii("screencode_mixed", '\r', "\\r");
printPetscii("screencode_mixed", '\t', "\\t");
printPetscii("screencode_mixed", '\\', "\\\\");
printPetscii("screencode_mixed", '\'', "\\'");
printPetscii("screencode_mixed", '\"', "\\\"");
printPetscii("screencode_upper", '\b', "\\b");
printPetscii("screencode_upper", '\f', "\\f");
printPetscii("screencode_upper", '\n', "\\n");
printPetscii("screencode_upper", '\r', "\\r");
printPetscii("screencode_upper", '\t', "\\t");
printPetscii("screencode_upper", '\\', "\\\\");
printPetscii("screencode_upper", '\'', "\\'");
printPetscii("screencode_upper", '\"', "\\\"");
}
private void printPetscii(String encoding, char ch, String sCh) {
CharToPetsciiConverter.setCurrentEncoding(encoding);
Byte petscii = CharToPetsciiConverter.convert(ch);
System.out.println(encoding+": "+sCh+" > "+(petscii==null?"null":(int)petscii));
}
}