diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/FourCornerRecipe.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/FourCornerRecipe.java index 65409e3..03fc2ac 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/FourCornerRecipe.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/FourCornerRecipe.java @@ -48,31 +48,6 @@ final public class FourCornerRecipe { private FourCornerRecipe() { } - @Deprecated // TODO: move to sand worm - static public List embedUNI2K(String value) { - List result = new ArrayList<>(value.length()); - PrimitiveIterator.OfInt i = value.codePoints().iterator(); - int bankSelect = 0; - while (i.hasNext()) { - int codePoint = i.nextInt(); - if (codePoint > 2048) { - int bankSelectNew = codePoint >> 11; - if (bankSelect != bankSelectNew) { - bankSelect = bankSelectNew; - result.add(FourCornerDotCake.FC_UNI2K_22.getStart() + bankSelect); - } - } else if (bankSelect != 0){ - bankSelect = 0; - result.add(FourCornerDotCake.FC_UNI2K_22.getStart() + bankSelect); - } - // bank selects output only on change - - int bankPoint = codePoint & 0b11111111111; - result.add(FourCornerDotCake.FC_UNI2K_11.getStart() + bankPoint); - } - return result; - } - static public List embedNCR1632Denominator(BigInteger value) { return embedNCR1632Value(new ArrayList<>(), value, FourCornerDotCake.FC_NCR1632_XD.getStart()); } diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/FourCornerUnicodeDisplay.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/FourCornerUnicodeDisplay.java index 31a473d..eebc579 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/FourCornerUnicodeDisplay.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/FourCornerUnicodeDisplay.java @@ -38,7 +38,6 @@ import org.x4o.fc18.cake2.pie9d.FCDotPIE9DDash09; import org.x4o.fc18.cake2.zero33.FCDotCDC1604DashP6; import org.x4o.fc18.octal8.PrimordialOctal; import org.x4o.fc18.zion7.FourCornerZion7Candlelier; -import org.x4o.fc18.zion7.FourCornerZion7WaterCodex; import org.x4o.fc18.zion7.FourCornerZionStenoLexer; import org.x4o.fc18.zion7.FourCornerZionStenoLexerSmoke; @@ -121,7 +120,7 @@ public class FourCornerUnicodeDisplay { lexer.withSmokeSignals(printer).read(chars); } - private final class StenoUnicodePrinter implements FourCornerZion7Candlelier, FourCornerZion7WaterCodex, FourCornerZionStenoLexerSmoke.AdapterMonoPipe { + private final class StenoUnicodePrinter implements FourCornerZion7Candlelier, FourCornerZionStenoLexerSmoke.AdapterMonoPipe { private final StringBuilder output; private boolean wasExternalWord = false; @@ -239,15 +238,6 @@ public class FourCornerUnicodeDisplay { public void strobeSandWorm(List spice) { } - @Override - public void strobeWaterUnicode(List codePoints) { - codePoints.forEach(v -> output.appendCodePoint(v)); - } - - @Override - public void strobeWaterKanji(List kuTenPoints) { - } - @Override public void burnMonoPipe(int line, int col, String pipeError) { StringBuilder errBuf = new StringBuilder(); diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/FourCornerDotCake.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/FourCornerDotCake.java index dcd58bf..3594bb7 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/FourCornerDotCake.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/FourCornerDotCake.java @@ -340,12 +340,10 @@ public enum FourCornerDotCake { /// This can encode sand worm text data like icons, bitmap images or vector images and unicode4D/etc like HolyC of TempleOS. FC_SAND_KHORKHOI(0x27000, 32768, "Sand octals of large khorkhoi"), - /// Support lower 11 bit of unicode to be encoded with one cake point. - @Deprecated // TODO: move to sand worm - FC_UNI2K_11(0x30000 - 4096, 2048, "Unicode page point"), - /// Optional select for the 11 bit half word, to get full 21 bit unicode-one point. - @Deprecated // TODO: move to sand worm - FC_UNI2K_22(0x30000 - 2048, 2048, "Unicode page select"), + /// free + __RESERVED_F4A(0x30000 - 4096, 2048, "free"), + /// free + __RESERVED_F4B(0x30000 - 2048, 2048, "free"), // =========== Allow big terminators to learn a computer math diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/zero33/dec1/FCDotDEC2701DashPX0.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/zero33/dec1/FCDotDEC2701DashPX0.java index dc47434..9c7529e 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/zero33/dec1/FCDotDEC2701DashPX0.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/cake2/zero33/dec1/FCDotDEC2701DashPX0.java @@ -79,24 +79,7 @@ public enum FCDotDEC2701DashPX0 implements FourCornerX06BaklavaPointSequence, Fo ESC_DEC0801_E10, /// _ESC6_X2 _ESC6_X1 _ESC6_X2 = 11 - /// If your machine has KANJI roms and display engine support than embed using this. - /// Single argument serial bank switching kanji KuTen escape string must end with ! - /// Token to select plane; - /// _PEPPER_DOWNUP_EXCLAMATION = JIS X 0208 plane 1 (DEFAULT and in MSX1++ ROMs) - /// _PEPPER_DOWNUP_QUESTION = JIS X 0213 plane 2 - /// _SALT_COMPARE_LEFT = JIS X reserved plane 3 - /// _SALT_COMPARE_RIGHT = JIS X reserved plane 4 - /// Token to select KuTen - /// NY10_CARET - NY18_ASTERISK = posimal(1-9) MSB of KuTen (1=DEFAULT) - /// NY01_AT - NY09_EQUALS = posimal(1-9) LSB of KuTen (1=DEFAULT) - /// NX17_Q - NX22_V = Ten row (0-16-32-48-64-80) (0=DEFAULT) - /// Token to fire a glyph dough character; - /// NX01_A - NX16_P = 0x0 - 0xF - /// Token to reset banking to first value - /// NX27_AMPERSAND = bank reset - /// Example escape for 𪚲鳦; (last used than first used glyph or G=2-94-87 and B=2-94-1) - /// [3*ESC]¿*_VGQB! - ESC_KANJI, + __ESC_RESERVED_B2, /// _ESC6_X2 _ESC6_X1 _ESC6_X3 = 12 __ESC_RESERVED_B3, diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZion7WaterCodex.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZion7WaterCodex.java deleted file mode 100644 index 96cfc7d..0000000 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZion7WaterCodex.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2004-2014, Willem Cazander - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted provided - * that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this list of conditions and the - * following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and - * the following disclaimer in the documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package org.x4o.fc18.zion7; - -import java.util.List; - -/// Handles the lexer water codex strobes. -/// -/// @author Willem Cazander -/// @version 1.0 Jan 22, 2025 -public interface FourCornerZion7WaterCodex extends FourCornerZion7Candlelier { - - /// To support current code and resources which require unicode to access. - void strobeWaterUnicode(List codePoints); - - /// To support native rendering on the MSX - void strobeWaterKanji(List kuTenPoints); - - interface Adapter extends FourCornerZion7WaterCodex, FourCornerZion7Candlelier.Adapter { - - @Override - default void strobeWaterUnicode(List codePoints) { - } - - @Override - default void strobeWaterKanji(List kuTenPoints) { - } - } -} diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoLexer.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoLexer.java index 42329aa..9f56351 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoLexer.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoLexer.java @@ -48,7 +48,6 @@ import org.x4o.fc18.octal8.PrimordialOctal; public class FourCornerZionStenoLexer { private final static FourCornerZion7AlphaOmega CLEAN_BIBLE = new FourCornerZion7AlphaOmega.Adapter() {}; - private final static FourCornerZion7WaterCodex CLEAN_WATER = new FourCornerZion7WaterCodex.Adapter() {}; private final static FourCornerZionStenoLexerFire CLEAN_FIRE = new FourCornerZionStenoLexerFire.Adapter() {}; private final static FourCornerZionStenoLexerSmoke CLEAN_SMOKE = new FourCornerZionStenoLexerSmoke.Adapter() {}; private final static FourCornerZion7SalahSequence CLEAN_PRAYER = new FourCornerZion7SalahSequence.Adapter() {}; @@ -56,7 +55,6 @@ public class FourCornerZionStenoLexer { private final boolean handlerEscape; private final FourCornerZion7Candlelier handler; private final FourCornerZion7AlphaOmega handlerDocument; - private final FourCornerZion7WaterCodex handlerCodex; private final FourCornerZion7SalahSequence handlerSalahSequence; private final FourCornerZion7TempleScrolls handlerTempleScrolls; private final int denominatorBank[] = new int[64]; // <== is the terminator select are 6 bit of banks with 9 bit of values. @@ -87,12 +85,12 @@ public class FourCornerZionStenoLexer { if (FourCornerDotCake.FC_DEC2701_PX0.equals(cakeSlice)) { continue; // handle DEC manually } - if (FourCornerDotCake.FC_UNI2K_11.equals(cakeSlice)) { - continue; // parse block manually - } - if (FourCornerDotCake.FC_UNI2K_22.equals(cakeSlice)) { - continue; // parse block manually - } +// if (FourCornerDotCake.FC_UNI2K_11.equals(cakeSlice)) { +// continue; // parse block manually +// } +// if (FourCornerDotCake.FC_UNI2K_22.equals(cakeSlice)) { +// continue; // parse block manually +// } if (FourCornerDotCake.FC_SAND_OLGOI.equals(cakeSlice)) { continue; // parse nether head manually } @@ -109,7 +107,6 @@ public class FourCornerZionStenoLexer { } CAKE_SLICE_EATERS.add(new StenoScannerCDCDEC()); CAKE_SLICE_EATERS.add(new StenoScannerNCR18()); - CAKE_SLICE_EATERS.add(new StenoScannerUNI21()); CAKE_SLICE_EATERS.add(new StenoScannerSandOlgoi()); CAKE_SLICE_EATERS.add(new StenoScannerSandKhorkhoi()); ArrayList.class.cast(CAKE_SLICE_EATERS).trimToSize(); @@ -127,11 +124,6 @@ public class FourCornerZionStenoLexer { } else { this.handlerDocument = CLEAN_BIBLE; } - if (handler instanceof FourCornerZion7WaterCodex) { - this.handlerCodex = FourCornerZion7WaterCodex.class.cast(handler); - } else { - this.handlerCodex = CLEAN_WATER; - } if (handler instanceof FourCornerZion7SalahSequence) { this.handlerSalahSequence = FourCornerZion7SalahSequence.class.cast(handler); } else { @@ -463,38 +455,6 @@ public class FourCornerZionStenoLexer { } } - static class StenoScannerUNI21 extends StenoScanner { - - public StenoScannerUNI21() { - super(FourCornerDotCake.FC_UNI2K_11.getStart(), FourCornerDotCake.FC_UNI2K_22.getStop()); - } - - @Override - public void process(FourCornerZionStenoLexer lexer, int idxFirst, int idxLast) { - boolean errorUnusedBigIndian = false; // are optional - List result = new ArrayList<>(); - int codePoint22 = 0; - for (int i = idxFirst; i <= idxLast; i++) { - int cakePoint = lexer.input.get(i); - if (cakePoint >= FourCornerDotCake.FC_UNI2K_22.getStart() && cakePoint <= FourCornerDotCake.FC_UNI2K_22.getStop()) { - codePoint22 = cakePoint - FourCornerDotCake.FC_UNI2K_22.getStart(); - errorUnusedBigIndian = true; - continue; - } - int codePoint11 = cakePoint - FourCornerDotCake.FC_UNI2K_11.getStart(); - int codePoint = (codePoint22 << 11) + codePoint11; - result.add(codePoint); - errorUnusedBigIndian = false; - } - if (errorUnusedBigIndian) { - lexer.smokeSignals.burnWaterUnicodeBadBigIndian(lexer.currLine, lexer.currCol); - } - if (!result.isEmpty()) { - lexer.handlerCodex.strobeWaterUnicode(result); - } - } - } - static class StenoScannerCDCDEC extends StenoScanner { public StenoScannerCDCDEC() { @@ -628,9 +588,6 @@ public class FourCornerZionStenoLexer { if (FCDotDEC2701DashPX0.ESC68_INC0801_P8.equals(cdcDECMode)) { return handleINC(lexer); } - if (FCDotDEC2701DashPX0.ESC_KANJI.equals(cdcDECMode)) { - // TODO: impl - } return false; } diff --git a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoLexerSmoke.java b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoLexerSmoke.java index 87b601c..2faf180 100644 --- a/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoLexerSmoke.java +++ b/nx01-x4o-fc18/src/main/java/org/x4o/fc18/zion7/FourCornerZionStenoLexerSmoke.java @@ -38,9 +38,6 @@ public interface FourCornerZionStenoLexerSmoke { void burnSalahMissingAmen(int line, int col); - void burnWaterUnicodeBadBigIndian(int line, int col); - - void burnSandWalkerOutOfRhythm(int line, int col); void burnSandWalkerStepUnaligned(int line, int col, int size); @@ -64,10 +61,6 @@ public interface FourCornerZionStenoLexerSmoke { default void burnControlCommandUnsupported(int line, int col, int cakePoint) { } - @Override - default void burnWaterUnicodeBadBigIndian(int line, int col) { - } - @Override default void burnSandWalkerOutOfRhythm(int line, int col) { } @@ -101,11 +94,6 @@ public interface FourCornerZionStenoLexerSmoke { burnMonoPipe(line, col, "burnControlCommandUnsupported:0x" + Integer.toHexString(cakePoint)); } - @Override - default void burnWaterUnicodeBadBigIndian(int line, int col) { - burnMonoPipe(line, col, "burnWaterUnicodeBadBigIndian"); - } - @Override default void burnSandWalkerOutOfRhythm(int line, int col) { burnMonoPipe(line, col, "burnSandWalkerOutOfRhythm"); diff --git a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/FourCornerUnicodeDisplayTest.java b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/FourCornerUnicodeDisplayTest.java index b6c5055..4fa2780 100644 --- a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/FourCornerUnicodeDisplayTest.java +++ b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/FourCornerUnicodeDisplayTest.java @@ -95,7 +95,7 @@ public class FourCornerUnicodeDisplayTest { Assertions.assertEquals("B3K", FourCornerUnicodeDisplay.text().renderFromX06(cdc)); } - + /* @Test public void testUnicode() throws Exception { List cdc = new ArrayList<>(); @@ -123,7 +123,7 @@ public class FourCornerUnicodeDisplayTest { System.out.println("size UTF8="+outputExpected.getBytes(StandardCharsets.UTF_8).length); //System.out.println("size FCx6="+cdc6.size()); //System.out.println("raw FCx6="+FourCornerUnicodeDisplay.raw().renderFromInt18(cdc6)); - } + }*/ @Test public void testDec2PieText() throws Exception { diff --git a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/zion7/LexerUNI21Test.java b/nx01-x4o-fc18/src/test/java/org/x4o/fc18/zion7/LexerUNI21Test.java deleted file mode 100644 index 008e33c..0000000 --- a/nx01-x4o-fc18/src/test/java/org/x4o/fc18/zion7/LexerUNI21Test.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2004-2014, Willem Cazander - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted provided - * that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this list of conditions and the - * following disclaimer. - * * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and - * the following disclaimer in the documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR - * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package org.x4o.fc18.zion7; - -import java.util.ArrayList; -import java.util.List; - -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.x4o.fc18.cake2.FourCornerDotCake; - -/** - * Tests four corner lexer parts. - * - * @author Willem Cazander - * @version 1.0 Jan 14, 2025 - */ -public class LexerUNI21Test { - - @Test - public void testUNI21Invalid() throws Exception { - TestSmokeReader smokeReader = new TestSmokeReader(); - FourCornerZionStenoLexer lexer = new FourCornerZionStenoLexer(new FourCornerZion7Candlelier.Adapter() {}, true); - lexer.withSmokeSignals(smokeReader); - List cdc = new ArrayList<>(); - cdc.add(FourCornerDotCake.FC_UNI2K_22.getStart() + 123); - - smokeReader.reset(); - Assertions.assertEquals(0, smokeReader.pipeSmokeClouds); - lexer.read(cdc); - Assertions.assertEquals(1, smokeReader.pipeSmokeClouds); - } -}