FC18: Converted NCR magic sparkler to smoke signal for missing sparkler
This commit is contained in:
parent
e7e26b569b
commit
7ea17d7628
6 changed files with 35 additions and 47 deletions
|
|
@ -196,15 +196,7 @@ public class FourCornerZionStenoLexer {
|
|||
return true;
|
||||
}
|
||||
|
||||
private void ncrBankReset() {
|
||||
for (int i = 0; i < denominatorBank.length; i++) {
|
||||
denominatorBank[i] = 0;
|
||||
numeratorBank[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void ncrBankFire(boolean magic) {
|
||||
fireSignals.fireStateNCR1632BankSparkler(magic);
|
||||
private void ncrBankFire() {
|
||||
BigInteger denominator = BigInteger.ONE;
|
||||
for (int i = 0; i < denominatorBank.length; i++) {
|
||||
denominator = denominator.add(BigInteger.valueOf(denominatorBank[i]).shiftLeft(i * 9));
|
||||
|
|
@ -214,6 +206,11 @@ public class FourCornerZionStenoLexer {
|
|||
numerator = numerator.add(BigInteger.valueOf(numeratorBank[i]).shiftLeft(i * 9));
|
||||
}
|
||||
handler.strobeNCR1632(denominator, numerator);
|
||||
// reset the bank after each fire
|
||||
for (int i = 0; i < denominatorBank.length; i++) {
|
||||
denominatorBank[i] = 0;
|
||||
numeratorBank[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private void decModeReset() {
|
||||
|
|
@ -351,30 +348,27 @@ public class FourCornerZionStenoLexer {
|
|||
|
||||
@Override
|
||||
public void process(FourCornerZionStenoLexer lexer, int idxFirst, int idxLast) {
|
||||
lexer.ncrBankReset();
|
||||
boolean magicSparkler = true;
|
||||
boolean missingSparkler = true;
|
||||
for (int i = idxFirst; i <= idxLast; i++) {
|
||||
int cakePoint = lexer.input.get(i);
|
||||
if (cakePoint >= FourCornerDotCake.FC_NCR1632_DEN.getStart() && cakePoint <= FourCornerDotCake.FC_NCR1632_DEN.getStop()) {
|
||||
int denominatorX = cakePoint - FourCornerDotCake.FC_NCR1632_DEN.getStart();
|
||||
lexer.denominatorBank[denominatorX / 512] = denominatorX % 512;
|
||||
magicSparkler = true;
|
||||
missingSparkler = true;
|
||||
continue;
|
||||
}
|
||||
int numeratorX = cakePoint - FourCornerDotCake.FC_NCR1632_NUM.getStart();
|
||||
lexer.numeratorBank[numeratorX / 512] = numeratorX % 512;
|
||||
|
||||
if (cakePoint > CAKEPOINT_BANK0_END) {
|
||||
magicSparkler = true;
|
||||
missingSparkler = true;
|
||||
continue; // Only fire fraction on lowest value select
|
||||
}
|
||||
lexer.ncrBankFire(false);
|
||||
lexer.ncrBankReset();
|
||||
magicSparkler = false;
|
||||
lexer.ncrBankFire();
|
||||
missingSparkler = false;
|
||||
}
|
||||
if (magicSparkler) {
|
||||
lexer.ncrBankFire(true);
|
||||
lexer.ncrBankReset();
|
||||
if (missingSparkler) {
|
||||
lexer.smokeSignals.burnNCR1632MissingBankSparkler(lexer.currLine, lexer.currCol);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -724,8 +718,7 @@ public class FourCornerZionStenoLexer {
|
|||
lexer.numeratorBank[lexer.cdcDECModeNCR68NumPage] = lexer.cdcDECModeNCR68NumValue;
|
||||
lexer.cdcDECModeNCR68NumPage = 0;
|
||||
lexer.cdcDECModeNCR68NumValue = 0;
|
||||
lexer.ncrBankFire(false);
|
||||
lexer.ncrBankReset();
|
||||
lexer.ncrBankFire();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,8 +32,6 @@ public interface FourCornerZionStenoLexerFire {
|
|||
|
||||
void fireStateScannerMatch(int blockStart, int blockStop, int matchPoint, int idxFirst, int idxLast);
|
||||
|
||||
void fireStateNCR1632BankSparkler(boolean magic);
|
||||
|
||||
interface Adapter extends FourCornerZionStenoLexerFire {
|
||||
|
||||
@Override
|
||||
|
|
@ -43,9 +41,5 @@ public interface FourCornerZionStenoLexerFire {
|
|||
@Override
|
||||
default void fireStateScannerMatch(int blockStart, int blockStop, int matchPoint, int idxFirst, int idxLast) {
|
||||
}
|
||||
|
||||
@Override
|
||||
default void fireStateNCR1632BankSparkler(boolean magic) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@ public interface FourCornerZionStenoLexerSmoke {
|
|||
void burnSandWalkerStepUnaligned(int line, int col, int size);
|
||||
|
||||
|
||||
void burnNCR1632MissingBankSparkler(int line, int col);
|
||||
|
||||
interface Adapter extends FourCornerZionStenoLexerSmoke {
|
||||
|
||||
@Override
|
||||
|
|
@ -68,6 +70,10 @@ public interface FourCornerZionStenoLexerSmoke {
|
|||
@Override
|
||||
default void burnSandWalkerStepUnaligned(int line, int col, int size) {
|
||||
}
|
||||
|
||||
@Override
|
||||
default void burnNCR1632MissingBankSparkler(int line, int col) {
|
||||
}
|
||||
}
|
||||
|
||||
interface AdapterMonoPipe extends FourCornerZionStenoLexerSmoke {
|
||||
|
|
@ -103,5 +109,10 @@ public interface FourCornerZionStenoLexerSmoke {
|
|||
default void burnSandWalkerStepUnaligned(int line, int col, int size) {
|
||||
burnMonoPipe(line, col, "burnSandWalkerStepUnaligned:" + size);
|
||||
}
|
||||
|
||||
@Override
|
||||
default void burnNCR1632MissingBankSparkler(int line, int col) {
|
||||
burnMonoPipe(line, col, "burnNCR1632MissingBankSparkler");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue