Named some DEC controls

This commit is contained in:
Willem Cazander 2025-01-08 15:15:28 +01:00
parent 2c59ad16db
commit 0b7f9147ea
5 changed files with 121 additions and 45 deletions

View file

@ -81,11 +81,11 @@ public class FourCornerUnicodeDisplay {
mapPoints(); mapPoints();
} }
static FourCornerUnicodeDisplay text() { static public FourCornerUnicodeDisplay text() {
return text(false, true); return text(false, true);
} }
static FourCornerUnicodeDisplay raw() { static public FourCornerUnicodeDisplay raw() {
return text(true, false); return text(true, false);
} }

View file

@ -53,20 +53,20 @@ public enum FCDotDEC1604DashP7 implements FourCornerX06BaklavaPoints, FourCorner
/// On 6/8 bit escape to 18 bit four corner. /// On 6/8 bit escape to 18 bit four corner.
/// Stream six octals as CDC chars in NX01_A to NX08_H, until any out of range P6. /// Stream six octals as CDC chars in NX01_A to NX08_H, until any out of range P6.
__ESC68_FC18, __ESC68_FC18,
/// Lower case escape code for only ONE next char is NX01_A to NX06_Z for all systems. /// Escape below for VT-52 lower case escape code, the one next char is NX01_A to NX06_Z for all systems.
/// NOTE: Other lower case chars in escape sequence needs to be encoded normally via __PIE68 and NX26_Z chars.
__ESC_BELOW, __ESC_BELOW,
UNDEFINED__QUESTION, UNDEFINED__QUESTION,
UNDEFINED__EXCLAMATION, UNDEFINED__EXCLAMATION,
UNDEFINED__TAG_CURLY_LEFT, UNDEFINED__TAG_CURLY_LEFT,
/// C1 char [ = CSI = Control Sequence Introducer
UNDEFINED__TAG_SQUARE_LEFT,
UNDEFINED__TAG_ROUND_LEFT,
UNDEFINED__TAG_COMPARE_LEFT,
UNDEFINED__TAG_CURLY_RIGHT, UNDEFINED__TAG_CURLY_RIGHT,
/// C1 char ] = OSC = Operating System Command /// ANSI C1 char [ = CSI = Control Sequence Introducer
RESERVED_ANSI_CSI,
UNDEFINED__TAG_SQUARE_RIGHT, UNDEFINED__TAG_SQUARE_RIGHT,
UNDEFINED__TAG_ROUND_LEFT,
UNDEFINED__TAG_ROUND_RIGHT, UNDEFINED__TAG_ROUND_RIGHT,
UNDEFINED__TAG_COMPARE_LEFT,
UNDEFINED__TAG_COMPARE_RIGHT, UNDEFINED__TAG_COMPARE_RIGHT,
UNDEFINED___TILDE, UNDEFINED___TILDE,
UNDEFINED___PLUS, UNDEFINED___PLUS,
@ -79,44 +79,44 @@ public enum FCDotDEC1604DashP7 implements FourCornerX06BaklavaPoints, FourCorner
UNDEFINED___APOSTROPHE, UNDEFINED___APOSTROPHE,
UNDEFINED___QUOTATION, UNDEFINED___QUOTATION,
UNDEFINED___BACKTICK, UNDEFINED___BACKTICK,
/// C1 char ^ = PM = Privacy Message
UNDEFINED___CARET, UNDEFINED___CARET,
UNDEFINED___EQUALS, UNDEFINED___EQUALS,
UNDEFINED___HASH, UNDEFINED___HASH,
UNDEFINED___DOLLAR, UNDEFINED___DOLLAR,
UNDEFINED___PERCENT, UNDEFINED___PERCENT,
UNDEFINED__BAR_VERTICAL, UNDEFINED__BAR_VERTICAL,
/// C1 char _ = APC = Application Program Command
UNDEFINED__BAR_UNDER, UNDEFINED__BAR_UNDER,
/// C1 char \ = ST = String Terminator
UNDEFINED__BAR_V_LEFT, UNDEFINED__BAR_V_LEFT,
UNDEFINED__BAR_V_RIGHT, UNDEFINED__BAR_V_RIGHT,
UNDEFINED___AT, UNDEFINED___AT,
/// MSX CURSOR UP = VT-52
UNDEFINED__NX01_A, /// VT-52 = ESC A = Cursor up
UNDEFINED__NX02_B, MSX_CURSOR_UP,
UNDEFINED__NX03_C, /// VT-52 = ESC B = Cursor down
UNDEFINED__NX04_D, MSX_CURSOR_DOWN,
UNDEFINED__NX05_E, /// VT-52 = ESC C = Cursor right
MSX_CURSOR_RIGHT,
/// VT-52 = ESC D = Cursor left
MSX_CURSOR_LEFT,
/// VT-52 = ESC E = Clear screen
MSX_CLEAR_SCREEN,
UNDEFINED__NX06_F, UNDEFINED__NX06_F,
/// C0 char G = BEL = Bell, 0x07
UNDEFINED__NX07_G, UNDEFINED__NX07_G,
/// C0 char H = BS = Backspace /// VT-52 = ESC H = Cursor home
UNDEFINED__NX08_H, MSX_CURSOR_HOME,
/// C0 char I = HT = Tab /// VT-52 = ESC I = Cursor up and insert
UNDEFINED__NX09_I, MSX_CURSOR_UPSERT,
/// C0 char J = LF = Line Feed /// VT-52 = ESC J = Clear to end of screen
UNDEFINED__NX10_J, MSX_CLEAR_EOS,
UNDEFINED__NX11_K, /// VT-52 = ESC K = Clear to end of line
/// C0 char L = FF = Form Feed MSX_CLEAR_EOL,
UNDEFINED__NX12_L, /// VT-52 = ESC L = Insert line
/// C0 char M = CR = Carriage Return MSX_INSERT_LINE,
UNDEFINED__NX13_M, /// VT-52 = ESC M = Delete line
/// C1 char N = SS2 = Single Shift Two MSX_DELETE_LINE,
UNDEFINED__NX14_N, UNDEFINED__NX14_N,
/// C1 char O = SS3 = Single Shift Three
UNDEFINED__NX15_O, UNDEFINED__NX15_O,
/// C1 char P = DCS = Device Control String
UNDEFINED__NX16_P, UNDEFINED__NX16_P,
UNDEFINED__NX17_Q, UNDEFINED__NX17_Q,
UNDEFINED__NX18_R, UNDEFINED__NX18_R,
@ -125,23 +125,30 @@ public enum FCDotDEC1604DashP7 implements FourCornerX06BaklavaPoints, FourCorner
UNDEFINED__NX21_U, UNDEFINED__NX21_U,
UNDEFINED__NX22_V, UNDEFINED__NX22_V,
UNDEFINED__NX23_W, UNDEFINED__NX23_W,
/// C1 char X = SOS = Start Of String
UNDEFINED__NX24_X, UNDEFINED__NX24_X,
UNDEFINED__NX25_Y, /// VT-52 = ESC Y = Set cursor position
MSX_CURSOR_GOTO,
UNDEFINED__NX26_Z, UNDEFINED__NX26_Z,
UNDEFINED__NX27_AMPERSAND, UNDEFINED__NX27_AMPERSAND,
// //
// Encode 18 full 18 bit FC word in 6 bit !!! // C0 char G = BEL = Bell, 0x07 FIXME: UNDEFINED__NX27_AMPERSAND
// XXX_FOUR_CORNER(), // C0 char H = BS = Backspace FIXME: UNDEFINED__NX26_Z
// C0 char I = HT = Tab
// C0 char J = LF = Line Feed
// C0 char L = FF = Form Feed
// C0 char M = CR = Carriage Return
// //
// By escaping to 18 bit full FC, all other FC encodings can be handled (with a bit overhead) // C1 char [ = CSI = Control Sequence Introducer
// on a real computer, a 6 bit mainframe like a CDC1604. // C1 char ] = OSC = Operating System Command
// C1 char ^ = PM = Privacy Message
// C1 char _ = APC = Application Program Command
// C1 char \ = ST = String Terminator
// C1 char N = SS2 = Single Shift Two
// C1 char O = SS3 = Single Shift Three
// C1 char P = DCS = Device Control String
// C1 char X = SOS = Start Of String
// //
// Historical glue for ansi codes ???
// TAG_ANSI_UPPER,
// TAG_ANSI_LOWER,
// TAG_ANSI_C0, // bell,backspace,tab etc,
// //
// Example VT52 see https://en.wikipedia.org/wiki/ANSI_escape_code // Example VT52 see https://en.wikipedia.org/wiki/ANSI_escape_code
// - ESC [ // - ESC [

View file

@ -34,7 +34,7 @@ import org.junit.jupiter.api.Test;
* @author Willem Cazander * @author Willem Cazander
* @version 1.0 Jan 1, 2025 * @version 1.0 Jan 1, 2025
*/ */
public class FCDotAPL1604DashS6Test { public class FCDotAPL1604DashP8LTest {
@Test @Test
public void testValues() throws Exception { public void testValues() throws Exception {

View file

@ -22,11 +22,15 @@
*/ */
package org.x4o.o2o.fc18.zero33; package org.x4o.o2o.fc18.zero33;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.x4o.o2o.fc18.FourCornerUnicodeDisplay;
import org.x4o.o2o.fc18.FourCornerX06BaklavaPoints;
/** /**
* Tests FCDotBYD1604DashC6 encoding. * Tests FCDotBYD1604DashC6 encoding.
@ -34,7 +38,7 @@ import org.junit.jupiter.api.Test;
* @author Willem Cazander * @author Willem Cazander
* @version 1.0 Dec 30, 2024 * @version 1.0 Dec 30, 2024
*/ */
public class FCDotBYD1604DashC6Test { public class FCDotBYD1604DashP8HTest {
@Test @Test
public void testValues() throws Exception { public void testValues() throws Exception {
@ -52,4 +56,20 @@ public class FCDotBYD1604DashC6Test {
Assertions.assertTrue(global.size() > 1); Assertions.assertTrue(global.size() > 1);
Assertions.assertFalse(duplicate, "Duplicate ascii core value detected"); Assertions.assertFalse(duplicate, "Duplicate ascii core value detected");
} }
@Test
public void testDisplay() throws Exception {
List<FourCornerX06BaklavaPoints> cdc = new ArrayList<>();
cdc.add(FCDotBYD1604DashP8H.BOX2_A);
cdc.add(FCDotBYD1604DashP8H.BOX2_B);
cdc.add(FCDotBYD1604DashP8H.BOX2_B);
cdc.add(FCDotBYD1604DashP8H.BOX2_A);
cdc.add(FCDotBYD1604DashP8H.BOX1_1);
cdc.add(FCDotBYD1604DashP8H.BOX1_3);
cdc.add(FCDotBYD1604DashP8H.BOX1_3);
cdc.add(FCDotBYD1604DashP8H.BOX1_7);
Assertions.assertEquals("═╩╩═╵└└├", FourCornerUnicodeDisplay.text().renderFromX06(cdc));
} }
}

View file

@ -0,0 +1,49 @@
/*
* 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.o2o.fc18.zero33;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
/**
* Tests FCDotCDC1604DashP6 encoding.
*
* @author Willem Cazander
* @version 1.0 Jan 08, 2025
*/
public class FCDotDEC1604DashP7Test {
@Test
public void testValues() throws Exception {
Assertions.assertEquals(64, FCDotDEC1604DashP7.length());
Assertions.assertEquals(FCDotCDC1604DashP6.NX12_L.ordinal(), FCDotDEC1604DashP7.MSX_INSERT_LINE.ordinal());
}
@Test
public void baklavaSequence() throws Exception {
int[] seq = FCDotDEC1604DashP7.MSX_CURSOR_GOTO.baklavaPoints();
Assertions.assertEquals(2, seq.length);
Assertions.assertEquals(FCDotCDC1604DashP6.__ESC6.ordinal(), seq[0]);
Assertions.assertEquals(FCDotCDC1604DashP6.NX25_Y.ordinal(), seq[1]);
}
}