Improved NCR banking signals with magic smoke
This commit is contained in:
parent
3c4adb03df
commit
87659bdf83
|
@ -204,14 +204,16 @@ public class FourCornerZionStenoLexer {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ncrBankReset() {
|
private void ncrBankReset(boolean magic) {
|
||||||
|
fireSignals.fireStateNCR1632BankReset(magic);
|
||||||
for (int i = 0; i < denominatorBank.length; i++) {
|
for (int i = 0; i < denominatorBank.length; i++) {
|
||||||
denominatorBank[i] = 0;
|
denominatorBank[i] = 0;
|
||||||
numeratorBank[i] = 0;
|
numeratorBank[i] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ncrBankFire() {
|
private void ncrBankFire(boolean magic) {
|
||||||
|
fireSignals.fireStateNCR1632BankSparkler(magic);
|
||||||
BigInteger denominator = BigInteger.ONE;
|
BigInteger denominator = BigInteger.ONE;
|
||||||
for (int i = 0; i < denominatorBank.length; i++) {
|
for (int i = 0; i < denominatorBank.length; i++) {
|
||||||
denominator = denominator.add(BigInteger.valueOf(denominatorBank[i]).shiftLeft(i * 9));
|
denominator = denominator.add(BigInteger.valueOf(denominatorBank[i]).shiftLeft(i * 9));
|
||||||
|
@ -310,7 +312,7 @@ public class FourCornerZionStenoLexer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void process(FourCornerZionStenoLexer lexer, int idxFirst, int idxLast) {
|
public void process(FourCornerZionStenoLexer lexer, int idxFirst, int idxLast) {
|
||||||
lexer.ncrBankReset();
|
lexer.ncrBankReset(false);
|
||||||
boolean magicSparkler = true;
|
boolean magicSparkler = true;
|
||||||
boolean requestBankReset = false;
|
boolean requestBankReset = false;
|
||||||
for (int i = idxFirst; i <= idxLast; i++) {
|
for (int i = idxFirst; i <= idxLast; i++) {
|
||||||
|
@ -323,13 +325,11 @@ public class FourCornerZionStenoLexer {
|
||||||
}
|
}
|
||||||
int numeratorX = cakePoint - FourCornerDotCake.FC_NCR1632_XN.getStart();
|
int numeratorX = cakePoint - FourCornerDotCake.FC_NCR1632_XN.getStart();
|
||||||
lexer.numeratorBank[numeratorX / 512] = numeratorX % 512;
|
lexer.numeratorBank[numeratorX / 512] = numeratorX % 512;
|
||||||
|
// 1st select + enable request, if second than reset bank
|
||||||
// highest number, 1st select + enable request, if second than reset bank
|
|
||||||
if (cakePoint == FourCornerDotCake.FC_NCR1632_XN.getStop()) {
|
if (cakePoint == FourCornerDotCake.FC_NCR1632_XN.getStop()) {
|
||||||
if (requestBankReset) {
|
if (requestBankReset) {
|
||||||
requestBankReset = false;
|
requestBankReset = false;
|
||||||
lexer.fireSignals.fireStateNCR1632BankReset();
|
lexer.ncrBankReset(true);
|
||||||
lexer.ncrBankReset();
|
|
||||||
magicSparkler = false; // if block ends with bank reset, don't leak a sparkler
|
magicSparkler = false; // if block ends with bank reset, don't leak a sparkler
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -337,17 +337,15 @@ public class FourCornerZionStenoLexer {
|
||||||
} else {
|
} else {
|
||||||
requestBankReset = false;
|
requestBankReset = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cakePoint > FourCornerDotCake.FC_NCR1632_XN.getStart() + 512) {
|
if (cakePoint > FourCornerDotCake.FC_NCR1632_XN.getStart() + 512) {
|
||||||
magicSparkler = true;
|
magicSparkler = true;
|
||||||
continue; // Only fire fraction on lowest value select
|
continue; // Only fire fraction on lowest value select
|
||||||
} else
|
} else
|
||||||
lexer.ncrBankFire();
|
lexer.ncrBankFire(false);
|
||||||
magicSparkler = false;
|
magicSparkler = false;
|
||||||
}
|
}
|
||||||
if (magicSparkler) {
|
if (magicSparkler) {
|
||||||
lexer.fireSignals.fireStateNCR1632BankSparkler();
|
lexer.ncrBankFire(true);
|
||||||
lexer.ncrBankFire();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,9 +34,9 @@ public interface FourCornerZionStenoLexerFire {
|
||||||
|
|
||||||
void fireStateScanner(int blockStart, int blockStop, int cakePoint);
|
void fireStateScanner(int blockStart, int blockStop, int cakePoint);
|
||||||
|
|
||||||
void fireStateNCR1632BankSparkler();
|
void fireStateNCR1632BankSparkler(boolean magic);
|
||||||
|
|
||||||
void fireStateNCR1632BankReset();
|
void fireStateNCR1632BankReset(boolean magic);
|
||||||
|
|
||||||
interface Adapter extends FourCornerZionStenoLexerFire {
|
interface Adapter extends FourCornerZionStenoLexerFire {
|
||||||
|
|
||||||
|
@ -53,11 +53,11 @@ public interface FourCornerZionStenoLexerFire {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
default void fireStateNCR1632BankSparkler() {
|
default void fireStateNCR1632BankSparkler(boolean magic) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
default void fireStateNCR1632BankReset() {
|
default void fireStateNCR1632BankReset(boolean magic) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -68,12 +68,16 @@ public class TestFireWalker implements FourCornerZionStenoLexerFire.Adapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void fireStateNCR1632BankSparkler() {
|
public void fireStateNCR1632BankSparkler(boolean magic) {
|
||||||
|
if (magic) {
|
||||||
ncr1632BankSparkler++;
|
ncr1632BankSparkler++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void fireStateNCR1632BankReset() {
|
public void fireStateNCR1632BankReset(boolean magic) {
|
||||||
|
if (magic) {
|
||||||
ncr1632BankReset++;
|
ncr1632BankReset++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue