FC18: Added pepper tests and deleted E10 support for FC6
This commit is contained in:
parent
2efd06a713
commit
c0d16aa4ab
9 changed files with 70 additions and 245 deletions
|
|
@ -227,6 +227,12 @@ public enum FCDotCDC1604DashP6 implements FourCornerDotColleZero33 {
|
|||
}
|
||||
|
||||
static public List<FCDotCDC1604DashP6> pepper3SequenceWrite(int mode) {
|
||||
if (mode < 0) {
|
||||
throw new IllegalArgumentException("Negative pepper is illegal");
|
||||
}
|
||||
if (mode > 7) {
|
||||
throw new IllegalArgumentException("Pepper spray is only 3 bit");
|
||||
}
|
||||
return List.of(
|
||||
((mode >> 2) & 0b1)==0?_PEPPER_EXCLAMATION:_PEPPER_QUESTION,
|
||||
((mode >> 1) & 0b1)==0?_PEPPER_EXCLAMATION:_PEPPER_QUESTION,
|
||||
|
|
|
|||
|
|
@ -1,124 +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.cake2.zero33.dec1;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.x4o.fc18.cake2.FourCornerDotCake;
|
||||
import org.x4o.fc18.cake2.FourCornerX06BaklavaPointSequence;
|
||||
import org.x4o.fc18.cake2.FourCornerX08MuffinPointSequence;
|
||||
import org.x4o.fc18.cake2.FourCornerX18CakePointDotName;
|
||||
import org.x4o.fc18.cake2.FourCornerX18CakePointSequence;
|
||||
import org.x4o.fc18.cake2.zero33.FCDotCDC1604DashP6;
|
||||
|
||||
/**
|
||||
* "FC.DEC0801-E10" Four Corner dot Directly Escaped Control of 8 embedded control codes.
|
||||
*
|
||||
* Select data gram local text symbols for 6 and 8 bit systems.
|
||||
*
|
||||
* And these can be used within an user escape sequence and/or in the vt06 sequences as serial switching.
|
||||
*
|
||||
* @author Willem Cazander
|
||||
* @version 1.0 Jan 21, 2025
|
||||
*/
|
||||
public enum FCDotDEC0801DashE10 implements FourCornerX06BaklavaPointSequence, FourCornerX08MuffinPointSequence, FourCornerX18CakePointSequence, FourCornerX18CakePointDotName {
|
||||
|
||||
/// ¡¡¡
|
||||
/// Back to normal dough
|
||||
E10_CDC1604_P6(FourCornerDotCake.FC_CDC1604_P6),
|
||||
|
||||
/// ¡¡¿
|
||||
/// 2 gram of BMW (booleans)
|
||||
E10_BMW0102_S2(FourCornerDotCake.FC_BMW0102_S2),
|
||||
|
||||
/// ¡¿¡
|
||||
/// 10 gram of AMD (decimals)
|
||||
E10_AMD0110_SA(FourCornerDotCake.FC_AMD0110_SA),
|
||||
|
||||
/// ¡¿¿
|
||||
/// 27 gram of NES (unvocalized-hebrew)
|
||||
E10_NES0127_9C(FourCornerDotCake.FC_NES0127_9C),
|
||||
|
||||
/// ¿¡¿
|
||||
/// 3 gram of NXP (3-phase)
|
||||
E10_NXP0103_S3(FourCornerDotCake.FC_NXP0103_S3),
|
||||
|
||||
/// ¿¡¿
|
||||
/// 1 gram of UWU (white space)
|
||||
/// Typewriter gram escape the the UWU word space word index register lookup the right white and left width for user.
|
||||
E10_UWU0101_S1(FourCornerDotCake.FC_UWU0101_S1),
|
||||
|
||||
/// ¿¡¡
|
||||
/// 26 gram of ICL (lowercase)
|
||||
E10_ICL0126_9B(FourCornerDotCake.FC_ICL0126_9B),
|
||||
|
||||
/// ¿¿¿
|
||||
/// 8 gram of OCE (octals)
|
||||
E10_OCE0801_H3(FourCornerDotCake.FC_OCE0801_H3),
|
||||
;
|
||||
private static final FCDotDEC0801DashE10[] VALUES = values();
|
||||
|
||||
private final FourCornerDotCake displayCake;
|
||||
|
||||
private FCDotDEC0801DashE10(FourCornerDotCake displayCake) {
|
||||
this.displayCake = Objects.requireNonNull(displayCake);
|
||||
}
|
||||
|
||||
public FourCornerDotCake displayCake() {
|
||||
return displayCake;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Integer> baklavaPointSequence() {
|
||||
return FCDotCDC1604DashP6.pepper3SequenceWritePoints(ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Integer> muffinPointSequence() {
|
||||
return baklavaPointSequence();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Integer> cakePointSequence() {
|
||||
return baklavaPointSequence();
|
||||
}
|
||||
|
||||
public List<Integer> baklavaPointsE10(int offset) {
|
||||
List<Integer> result = new ArrayList<>();
|
||||
result.addAll(FCDotDEC2701DashPX0.ESC_DEC0801_E10.baklavaPointSequence());
|
||||
result.addAll(baklavaPointSequence());
|
||||
result.add(FCDotCDC1604DashP6.NX01_A.ordinal() + offset);
|
||||
//result.add(FCDotCDC1604DashP6.SEQ_SALAH__EXCLAMATION.cakePointDotIndex()); // TODO: add api layer snake for head
|
||||
return result;
|
||||
}
|
||||
|
||||
static public int valuesLength() {
|
||||
return VALUES.length;
|
||||
}
|
||||
|
||||
static public FCDotDEC0801DashE10 valueOf(int idx) {
|
||||
return VALUES[idx];
|
||||
}
|
||||
}
|
||||
|
|
@ -82,9 +82,7 @@ public enum FCDotDEC2701DashPX0 implements FourCornerX06BaklavaPointSequence, Fo
|
|||
// =========== Internal escape sequence, to embed symbols,fractions and adult texts.
|
||||
|
||||
/// _ESC6_X2 _ESC6_X1 _ESC6_X1 = 10
|
||||
/// Embed data gram codes with pepper and salt in text and end with ‽
|
||||
/// In the above 9 "user" escapes and in ESC_VT06 this can be used without this prefix to switch.
|
||||
ESC_DEC0801_E10,
|
||||
__ESC_RESERVED_B1,
|
||||
|
||||
/// _ESC6_X2 _ESC6_X1 _ESC6_X2 = 11
|
||||
__ESC_RESERVED_B2,
|
||||
|
|
|
|||
|
|
@ -41,38 +41,38 @@ import org.x4o.fc18.cake2.zero33.FCDotCDC1604DashP6;
|
|||
*/
|
||||
public enum FCDotINC0801DashP8 implements FourCornerX06BaklavaPointSequence, FourCornerX08MuffinPointSequence, FourCornerX18CakePointSequence, FourCornerX18CakePointDotName {
|
||||
|
||||
/// ¡¡¡
|
||||
/// !!!
|
||||
/// Select LUA page 7A mode.
|
||||
INC_LUA0127_P7A(FourCornerDotCake.FC_LUA0127_P7A),
|
||||
|
||||
/// ¡¡¿
|
||||
/// !!?
|
||||
/// Select LUA page 7B mode.
|
||||
INC_LUA0127_P7B(FourCornerDotCake.FC_LUA0127_P7B),
|
||||
|
||||
/// ¡¿¡
|
||||
/// !?!
|
||||
/// Select LUA page 7C mode.
|
||||
INC_LUA0127_P7C(FourCornerDotCake.FC_LUA0127_P7C),
|
||||
|
||||
/// ¡¿¿
|
||||
/// !??
|
||||
/// Select LUA page 7D mode.
|
||||
INC_LUA0127_P7D(FourCornerDotCake.FC_LUA0127_P7D),
|
||||
|
||||
/// ¿¡¿
|
||||
/// ?!!
|
||||
/// Select BYD page 7E mode.
|
||||
INC_BYD0127_P7E(FourCornerDotCake.FC_BYD0127_P7E),
|
||||
|
||||
/// ¿¡¿
|
||||
/// ?!?
|
||||
/// Select BYD page 7F mode.
|
||||
INC_BYD0127_P7F(FourCornerDotCake.FC_BYD0127_P7F),
|
||||
|
||||
/// ¿¡¡
|
||||
/// ??!
|
||||
/// Select BYD page 7G mode.
|
||||
INC_BYD0127_P7G(FourCornerDotCake.FC_BYD0127_P7G),
|
||||
// Select italic mode.
|
||||
//INC_PIE9D_27(FourCornerDotCake.FC_PIE9D_27),
|
||||
|
||||
/// ¿¿¿
|
||||
// Select lower case mode.
|
||||
/// ???
|
||||
// Select lower case mode. TODO: remove
|
||||
INC_PIE9C_26(FourCornerDotCake.FC_PIE9C_26),
|
||||
;
|
||||
private static final FCDotINC0801DashP8[] VALUES = values();
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ import org.x4o.fc18.cake2.flag4.FCDotF4TTY0001DashNL;
|
|||
import org.x4o.fc18.cake2.flag4.FCDotF4TXT0001DashSP;
|
||||
import org.x4o.fc18.cake2.zero33.FCDotCDC1604DashP6;
|
||||
import org.x4o.fc18.cake2.zero33.dec1.FCDotCMD5401Dash2D;
|
||||
import org.x4o.fc18.cake2.zero33.dec1.FCDotDEC0801DashE10;
|
||||
import org.x4o.fc18.cake2.zero33.dec1.FCDotDEC2701DashPX0;
|
||||
import org.x4o.fc18.cake2.zero33.dec1.FCDotINC0801DashP8;
|
||||
import org.x4o.fc18.octal8.PrimordialOctal;
|
||||
|
|
@ -69,7 +68,6 @@ public class FourCornerZionStenoLexer implements FourCornerZionStenoPetroglyphs
|
|||
private int cdcDECScanIndexEnd = 0;
|
||||
private FCDotDEC2701DashPX0 cdcDECMode = null;
|
||||
private FCDotINC0801DashP8 cdcDECModeInc = null;
|
||||
private FCDotDEC0801DashE10 cdcDECModeE10 = null;
|
||||
private int cdcDECModePie = 0;
|
||||
private Boolean cdcDECModePieAlt = null;
|
||||
private FourCornerZionStenoLexerSmoke smokeSignals = CLEAN_SMOKE;
|
||||
|
|
@ -260,7 +258,6 @@ public class FourCornerZionStenoLexer implements FourCornerZionStenoPetroglyphs
|
|||
private void decModeReset() {
|
||||
cdcDECMode = null;
|
||||
cdcDECModeInc = null;
|
||||
cdcDECModeE10 = null;
|
||||
cdcDECModePie = 0;
|
||||
cdcDECModePieAlt = null;
|
||||
}
|
||||
|
|
@ -728,9 +725,6 @@ public class FourCornerZionStenoLexer implements FourCornerZionStenoPetroglyphs
|
|||
if (FCDotDEC2701DashPX0.ESC68_CMD5401_2D.equals(cdcDECMode)) {
|
||||
return handleCMD(lexer);
|
||||
}
|
||||
if (FCDotDEC2701DashPX0.ESC_DEC0801_E10.equals(cdcDECMode)) {
|
||||
return handleE10(lexer);
|
||||
}
|
||||
if (FCDotDEC2701DashPX0.ESC68_INC0801_P8.equals(cdcDECMode)) {
|
||||
return handleINC(lexer);
|
||||
}
|
||||
|
|
@ -763,43 +757,6 @@ public class FourCornerZionStenoLexer implements FourCornerZionStenoPetroglyphs
|
|||
return true;
|
||||
}
|
||||
|
||||
private boolean handleE10(FourCornerZionStenoLexer lexer) {
|
||||
int cdcPoint = lexer.input.get(lexer.cdcDECScanIndex);
|
||||
if (FCDotCDC1604DashP6.isEscapePepper(cdcPoint)) {
|
||||
lexer.cdcDECModeE10 = FCDotDEC0801DashE10.valueOf(readEscapePepper3(lexer));
|
||||
return true;
|
||||
}
|
||||
if (FCDotCDC1604DashP6._SALAH_INTERROBANG.baklavaPointDotIndex() == cdcPoint) {
|
||||
lexer.decModeReset();
|
||||
return true; // end E10 mode, so no print
|
||||
}
|
||||
// if (FCDotCDC1604DashP6._RAKA_QUESTION.baklavaPointDotIndex() == cdcPoint) {
|
||||
// decModeE10DeckLevel = 0;
|
||||
// }
|
||||
// if (FCDotCDC1604DashP6._SALT_COMPARE_LEFT.baklavaPointDotIndex() == cdcPoint) {
|
||||
// decModeE10DeckLevel = 1;
|
||||
// return true;
|
||||
// }
|
||||
// if (FCDotCDC1604DashP6._SALT_COMPARE_RIGHT.baklavaPointDotIndex() == cdcPoint) {
|
||||
// decModeE10DeckLevel = 2;
|
||||
// return true;
|
||||
// }
|
||||
|
||||
if (FCDotDEC0801DashE10.E10_CDC1604_P6.equals(lexer.cdcDECModeE10)) {
|
||||
lexer.handler.strobeTheWord(cdcPoint); // not A based offset here
|
||||
//lexer.handler.strobeWord(FourCornerDotCake.FC_CDC1604_P6, cdcPoint); // not A based offset here
|
||||
return true;
|
||||
}
|
||||
FourCornerDotCake displayCake = lexer.cdcDECModeE10.displayCake();
|
||||
if (cdcPoint < FCDotCDC1604DashP6.NX01_A.ordinal() || cdcPoint > displayCake.getLength() - 1 + FCDotCDC1604DashP6.NX01_A.ordinal()) {
|
||||
lexer.decModeReset();
|
||||
return false;
|
||||
}
|
||||
//lexer.handler.strobeWord(displayCake, cdcPoint - FCDotCDC1604DashP6.NX01_A.ordinal());
|
||||
lexer.handler.strobeTheWord(displayCake.getStart() + cdcPoint - FCDotCDC1604DashP6.NX01_A.ordinal());
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean handleCMD(FourCornerZionStenoLexer lexer) {
|
||||
int cdcPoint = lexer.input.get(lexer.cdcDECScanIndex);
|
||||
FCDotCMD5401Dash2D cmdMode = FCDotCMD5401Dash2D.valueOfCDC(cdcPoint);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue