FC18: Renamed fixed to choped and fixed the lexer for choco pig choped

This commit is contained in:
Willem Cazander 2025-09-05 19:30:20 +02:00
parent 33794a8186
commit 79cb6c02f1
13 changed files with 502 additions and 190 deletions

View file

@ -385,19 +385,22 @@ public class FourCornerUnicodeDisplay {
}
@Override
public void strobeNumberChocoPigFixed(FCFlameNumberTaste taste, BigInteger quake, BigInteger fraction) {
public void strobeNumberChocoPigChoped(FCFlameNumberTaste taste, BigInteger quake, BigInteger fraction) {
// TODO: add pure FC6 too like; auto fixedQ = 0QTPF.D2F3432F.A2B43F242E;
List<Integer> numberCandy = new ArrayList<>();
FourCornerRecipe.toDecimalsX18(numberCandy, 0);
numberCandy.add(FCDotCDC1604DashP6.NX17_Q.ordinal());
numberCandy.add(FCDotCDC1604DashP6.NX20_T.ordinal());
if (taste.statusSignPositive()) {
numberCandy.add(FCDotCDC1604DashP6.NX16_P.ordinal());
} else {
numberCandy.add(FCDotCDC1604DashP6.NX14_N.ordinal());
//FourCornerRecipe.toDecimalsX18(numberCandy, 0);
//numberCandy.add(FCDotCDC1604DashP6.NX17_Q.ordinal());
//numberCandy.add(FCDotCDC1604DashP6.NX20_T.ordinal());
//if (taste.statusSignPositive()) {
// numberCandy.add(FCDotCDC1604DashP6.NX16_P.ordinal());
//} else {
// numberCandy.add(FCDotCDC1604DashP6.NX14_N.ordinal());
//}
//numberCandy.add(FCDotCDC1604DashP6.NX01_A.ordinal()); // 10 = decicmals
//numberCandy.add(FCDotCDC1604DashP6.NY16_DOT.ordinal());
if (taste.statusSignNegative()) {
numberCandy.add(FCDotCDC1604DashP6.NY19_MINUS.ordinal()); // TODO: use name word symbols
}
numberCandy.add(FCDotCDC1604DashP6.NX01_A.ordinal()); // 10 = decicmals
numberCandy.add(FCDotCDC1604DashP6.NY16_DOT.ordinal());
FourCornerRecipe.toDecimalsX18(numberCandy, quake);
numberCandy.add(FCDotCDC1604DashP6.NY16_DOT.ordinal());
FourCornerRecipe.toDecimalsX18(numberCandy, fraction);

View file

@ -436,8 +436,8 @@ public enum FourCornerDotCake {
FC_DECIMAL2304_BANK(0x03CA38, 4096, "Number choco pig 2304 bit decimal point bank"),
FC_FLOAT2304_SEL0(0x03DA38, 192, "Number choco pig 2304 bit floating point select"),
FC_FLOAT2304_BANK(0x03DAF8, 4096, "Number choco pig 2304 bit floating point bank"),
FC_FIXED2304_SEL0(0x03EAF8, 192, "Number choco pig 2304 bit fixed point select"),
FC_FIXED2304_BANK(0x03EBB8, 4096, "Number choco pig 2304 bit fixed point bank"),
FC_CHOPED2304_SEL0(0x03EAF8, 192, "Number choco pig 2304 bit choped point select"),
FC_CHOPED2304_BANK(0x03EBB8, 4096, "Number choco pig 2304 bit choped point bank"),
// =========== Allow adult escape sequences
@ -562,7 +562,7 @@ public enum FourCornerDotCake {
if (idx <= FC_SANDWORM_15.ordinal()) {
return FourCornerDotCakeTower.TXT_EMBEDS;
}
if (idx <= FC_FIXED2304_BANK.ordinal()) {
if (idx <= FC_CHOPED2304_BANK.ordinal()) {
return FourCornerDotCakeTower.TXT_NCR;
}
return FourCornerDotCakeTower.TXT_ESC;

View file

@ -49,7 +49,7 @@ public interface FourCornerZion7Candlelier extends FourCornerZion7Bereshit {
void strobeNumberChocoPigFloat(FCFlameNumberTaste taste, boolean bias, BigInteger exponent, BigInteger mantissa);
/// Embed fixed point number. (4+1148+1152)
void strobeNumberChocoPigFixed(FCFlameNumberTaste taste, BigInteger quake, BigInteger fraction);
void strobeNumberChocoPigChoped(FCFlameNumberTaste taste, BigInteger quake, BigInteger fraction);
// XDBX18: doom.wad uses (ARM) Q16.16 which is equal to the real (Texas) Q15.16 (because doom map like E2M3 = 6 bit float)
//void strobeStructBlockRemark(boolean beginOrEnd, boolean textOrDoc);
@ -75,7 +75,7 @@ public interface FourCornerZion7Candlelier extends FourCornerZion7Bereshit {
}
@Override
default void strobeNumberChocoPigFixed(FCFlameNumberTaste taste, BigInteger quake, BigInteger fraction) {
default void strobeNumberChocoPigChoped(FCFlameNumberTaste taste, BigInteger quake, BigInteger fraction) {
}
}
}

View file

@ -427,7 +427,7 @@ public class FourCornerZionStenoGrapher {
}
@Override
public void strobeNumberChocoPigFixed(FCFlameNumberTaste taste, BigInteger quake, BigInteger fraction) {
public void strobeNumberChocoPigChoped(FCFlameNumberTaste taste, BigInteger quake, BigInteger fraction) {
Objects.requireNonNull(quake);
Objects.requireNonNull(fraction);
requireBigPositive(quake);
@ -435,7 +435,7 @@ public class FourCornerZionStenoGrapher {
requireBigPositive(fraction);
requireBigMax(fraction, BIG_BITS_1152);
BigInteger pig = quake.shiftLeft(1152).add(fraction);
outAddBankCake12(FourCornerDotCake.FC_FIXED2304_SEL0.getStart(), FourCornerDotCake.FC_FIXED2304_BANK.getStart(), NCR_BANK_IDX_TOPPAGE_2304, pig, v -> {
outAddBankCake12(FourCornerDotCake.FC_CHOPED2304_SEL0.getStart(), FourCornerDotCake.FC_CHOPED2304_BANK.getStart(), NCR_BANK_IDX_TOPPAGE_2304, pig, v -> {
return (v & 0xFF) + (taste.ordinal() << 8);
});
}

View file

@ -126,6 +126,12 @@ public class FourCornerZionStenoLexer implements FourCornerZionStenoPetroglyphs
if (FourCornerDotCake.FC_FLOAT2304_BANK.equals(cakeSlice)) {
continue; // parse block manually
}
if (FourCornerDotCake.FC_CHOPED2304_SEL0.equals(cakeSlice)) {
continue; // parse block manually
}
if (FourCornerDotCake.FC_CHOPED2304_BANK.equals(cakeSlice)) {
continue; // parse block manually
}
if (cakeSlice.name().endsWith("_SEL0") && cakeSlice.name().startsWith("FC_BA")) {
continue; // done by bank slices below
}
@ -159,7 +165,7 @@ public class FourCornerZionStenoLexer implements FourCornerZionStenoPetroglyphs
CAKE_SLICE_EATERS.add(new StenoScannerNumberChocoRational());
CAKE_SLICE_EATERS.add(new StenoScannerNumberChocoDecimal());
CAKE_SLICE_EATERS.add(new StenoScannerNumberChocoFloat());
CAKE_SLICE_EATERS.add(new StenoScannerNumberChocoFixed());
CAKE_SLICE_EATERS.add(new StenoScannerNumberChocoChoped());
ArrayList.class.cast(CAKE_SLICE_EATERS).trimToSize();
}
@ -583,10 +589,10 @@ public class FourCornerZionStenoLexer implements FourCornerZionStenoPetroglyphs
}
}
static final class StenoScannerNumberChocoFixed extends StenoScannerNumberBank {
static final class StenoScannerNumberChocoChoped extends StenoScannerNumberBank {
public StenoScannerNumberChocoFixed() {
super(FourCornerDotCake.FC_FIXED2304_SEL0, FourCornerDotCake.FC_FIXED2304_BANK, NCR_BANK12_SIZE, FCFlameNumberSparklerSmoke.CHOCO_FIXED);
public StenoScannerNumberChocoChoped() {
super(FourCornerDotCake.FC_CHOPED2304_SEL0, FourCornerDotCake.FC_CHOPED2304_BANK, NCR_BANK12_SIZE, FCFlameNumberSparklerSmoke.CHOCO_FIXED);
}
@Override
@ -595,7 +601,7 @@ public class FourCornerZionStenoLexer implements FourCornerZionStenoPetroglyphs
BigInteger pig = lexer.numberBankReadBig12(numberBankTop);
BigInteger quake = pig.shiftRight(1152);
BigInteger fraction = pig.and(BIG_BITS_1152);
lexer.handler.strobeNumberChocoPigFixed(taste, quake, fraction);
lexer.handler.strobeNumberChocoPigChoped(taste, quake, fraction);
}
}