Update code for big indian of nx01

This commit is contained in:
Willem Cazander 2024-12-28 00:46:07 +01:00
parent 8c0a3447dc
commit 7d9bccf43c
8 changed files with 48 additions and 52 deletions

View file

@ -70,24 +70,24 @@ public enum CodePointᶻᴰ {
public int getArgumentUnicode(V036Teger teger) {
int unicode = 0;
unicode += teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1).smurfᐧnativeᐧint() & MASK_ARGU+MASK_SIGN;
unicode += (teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2).smurfᐧnativeᐧint() & MASK_ARGU+MASK_SIGN) << 15;
unicode += (teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1).smurfᐧnativeᐧint() & MASK_ARGU+MASK_SIGN) << 15;
unicode += (teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2).smurfᐧnativeᐧint() & MASK_ARGU+MASK_SIGN) << 0;
return unicode;
}
public void setArgumentUnicode(V036Teger teger, int unicode) {
int value1 = teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1).smurfᐧnativeᐧint();
int value2 = teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2).smurfᐧnativeᐧint();
value1 = (value1 & MASK_CMD) + (unicode & MASK_ARGU+MASK_SIGN);
value2 = (value2 & MASK_CMD) + ((unicode >> 15) & MASK_ARGU+MASK_SIGN);
value1 = (value1 & MASK_CMD) + ((unicode >> 15) & MASK_ARGU+MASK_SIGN);
value2 = (value2 & MASK_CMD) + ((unicode >> 0) & MASK_ARGU+MASK_SIGN);
teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1).smurfᐧnativeᐧint(value1);
teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2).smurfᐧnativeᐧint(value2);
}
public CodePointCommandᶻᴰ getCommand(V036Teger teger) {
int mode = 0;
mode += (teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1).smurfᐧnativeᐧint() >> 15) << 0;
mode += (teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2).smurfᐧnativeᐧint() >> 15) << 3;
mode += (teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1).smurfᐧnativeᐧint() >> 15) << 3;
mode += (teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2).smurfᐧnativeᐧint() >> 15) << 0;
return CodePointCommandᶻᴰ.values()[mode];
}
@ -95,8 +95,8 @@ public enum CodePointᶻᴰ {
int mode = command.ordinal();
int value1 = teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1).smurfᐧnativeᐧint();
int value2 = teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2).smurfᐧnativeᐧint();
teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1).smurfᐧnativeᐧint(value1 | (((mode >> 0) << 15)) & MASK_CMD);
teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2).smurfᐧnativeᐧint(value2 | (((mode >> 3) << 15)) & MASK_CMD);
teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_1).smurfᐧnativeᐧint(value1 | (((mode >> 3) << 15)) & MASK_CMD);
teger.legoᐧtuneᐧᗅᗷᗷᗅ(T002ᖟ.PART_2).smurfᐧnativeᐧint(value2 | (((mode >> 0) << 15)) & MASK_CMD);
}
/**

View file

@ -27,11 +27,7 @@
package love.distributedrebirth.unicode4d.atlas;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Base64;
import java.util.List;
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᒢᓫᑊᐣᑊ.ᔿᓫᒻᓫᓫ.V072Tong;
@ -57,23 +53,12 @@ public class FontAtlasStoreGlyph {
this.tongs.add(glyph);
}
public String getBase64() {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
V072Tong..gearsᐧbuildᐧbyteᐧstreamᐧfromᐧbricks(tongs, baos);
} catch (IOException e) {
throw new RuntimeException(e);
}
return Base64.getEncoder().encodeToString(baos.toByteArray());
// TODO: this is quick hack not the proper way in x4o
public String getGlyphX9() {
return V072Tong..gearsᐧbuildᐧhinarīᐧχ9ᐧfromᐧbricks(tongs);
}
public void setBase64(String base64) {
byte[] decodedBytes = Base64.getDecoder().decode(base64);
ByteArrayInputStream bais = new ByteArrayInputStream(decodedBytes);
try {
tongs = V072Tong..gearsᐧbuildᐧbricksᐧfromᐧbyteᐧstream(bais);
} catch (IOException e) {
throw new RuntimeException(e);
}
public void setGlyphX9(String hinary9) {
tongs = V072Tong..gearsᐧbuildᐧbricksᐧfromᐧhinarī(hinary9);
}
}

View file

@ -64,6 +64,8 @@ public class TestConvFont {
// gdxapp4d-chain-font-unicode4d/src/main/nodejs$ ./conv-font.sh ../chain/plane0/ ../../../target/chain2/plane0/
// gdxapp4d-chain-font-unicode4d/src/main/nodejs$ ./conv-font.sh ../chain/plane1/ ../../../target/chain2/plane1/
// gdxapp4d-chain-font-unicode4d/src/main/nodejs$ ./conv-font.sh ../chain/plane2/ ../../../target/chain2/plane2/
// cd ../../../..
// mvn package
public void run() {
System.out.println("Starting conversion;");