17 #define SIG( name ) static inline uint8_t name (struct ge *ge)
26 SIG(RESIA) {
return !RESI1(
ge); }
31 SIG(RIUCA) {
return !(RIA01(
ge) && RESIA(
ge) && RIA2A(
ge) && RIA3A(
ge)); }
34 SIG(RES01) {
return !(RESIA(
ge) ); }
65 SIG(RES31) {
return RES3(
ge); };
75 SIG(verified_condition) {
78 uint8_t M7 =
BIT(M, 7);
79 uint8_t M6 =
BIT(M, 6);
80 uint8_t M5 =
BIT(M, 5);
81 uint8_t M4 =
BIT(M, 4);
87 ((M7 && !FA4 && !FA5) ||
88 (M6 && !FA4 && FA5) ||
89 (M5 && FA4 && !FA5) ||
90 (M4 && FA4 && FA5))) ||
170 case KNOT_PO_IN_NO: no =
ge->
rPO;
break;
171 case KNOT_V1_IN_NO: no =
ge->
rV1;
break;
172 case KNOT_V2_IN_NO: no =
ge->
rV2;
break;
173 case KNOT_V3_IN_NO: no =
ge->
rV3;
break;
174 case KNOT_V4_IN_NO: no =
ge->
rV4;
break;
175 case KNOT_L1_IN_NO: no =
ge->
rL1;
break;
176 case KNOT_L2_IN_NO: no =
ge->
rL2;
break;
177 case KNOT_L3_IN_NO: no =
ge->
rL3;
break;
179 case KNOT_RI_IN_NO_43: no =
ge->
rRI << 8;
break;
183 case KNOT_FORCING_NONE:
break;
184 case KNOT_FORCING_NO_21: no = (no & 0x00ff) | (
ge->
kNO.
forcings << 0);
break;
185 case KNOT_FORCING_NO_43: no = (no & 0xff00) | (
ge->
kNO.
forcings << 8);
break;
212 if (RES0(
ge) || (RIUC(
ge) && AF32(
ge)))
218 if (RES0(
ge) || RES3(
ge))
221 if (RIUC(
ge) && !AF32(
ge))
231 case NS_CN1:
return (cn & 0x000f) >> 0;
232 case NS_CN2:
return (cn & 0x00f0) >> 4;
233 case NS_CN3:
return (cn & 0x0f00) >> 8;
234 case NS_CN4:
return (cn & 0xf000) >> 12;
269 return ((ni4 << 12) |
330 SIG(DI79A) {
return !(DI151(
ge) && DI021(
ge)); }
333 SIG(DI84A) {
return !(DI011(
ge) && DI291(
ge)); }
334 SIG(DI85A) {
return !(DI291(
ge) && DI031(
ge)); }
337 SIG(DI91A) {
return !(DI031(
ge) && DI211(
ge)); }
338 SIG(DI931) {
return !(DI21A(
ge) && DI29A(
ge) && DI21A(
ge) && DI15A(
ge)); }
341 SIG(DI95A) {
return !(DI931(
ge) && DI031(
ge)); }
342 SIG(DI971) {
return !(DI29A(
ge) && DI25A(
ge) && DI24A(
ge) && DI29A(
ge)); }
348 SIG(DO021) {
return !(DO02A(
ge) && DO02A(
ge)); }
355 SIG(DE00A) {
return 0; !(DO011(
ge) && DI062(
ge)); }
357 SIG(DE07A) {
return !(DO071(
ge) && DI062(
ge)); }
359 SIG(DE231) {
return !(DE23A(
ge) && DE23A(
ge)); }
361 SIG(DA25A) {
return !(DI111(
ge) && DO021(
ge)); }
367 SIG(DU201) {
return !(DU18A(
ge) && DU19A(
ge)); }
369 SIG(EC69A) {
return !(AF41(
ge) && DI572(
ge));}
370 SIG(EC70A) {
return !(AF51(
ge) && DI572(
ge)); }
374 SIG(ED91A) {
return !(DE231(
ge) && DU201(
ge)); }
457 SIG(PB11A) {
return !(FINA1(
ge) && PC111(
ge)); }
458 SIG(PB13A) {
return !(TE303(
ge) && PC131(
ge)); }
459 SIG(PB14A) {
return !(TE304(
ge) && PC141(
ge)); }
464 SIG(RB101) {
return !(AITEA(
ge) && PB11A(
ge) && PB13A(
ge) && PB14A(
ge)); }
467 SIG(RB01A) {
return !(RT121(
ge) && RB101(
ge)); }
468 SIG(RB111) {
return !(RB12A(
ge) && RB01A(
ge)); }
470 SIG(PF12A) {
return !(FINI1(
ge) && PC121(
ge)); }
471 SIG(PF13A) {
return !(FINE3(
ge) && PC131(
ge)); }
472 SIG(PF14A) {
return !(FINE4(
ge) && PC141(
ge)); }
473 SIG(RF101) {
return !(PF12A(
ge) && PF13A(
ge) && PF14A(
ge)); }
496 SIG(PELEA) {
return !(LU081(
ge) && LUPO1(
ge)); }
497 SIG(RELO1) {
return !(PELEA(
ge) && RUF1A(
ge)); }
498 SIG(PAM4A) {
return !(RELO1(
ge) && RASI1(
ge) && PC121(
ge)); }
499 SIG(PM11A) {
return !(FUSE1(
ge) && PC111(
ge)); }
500 SIG(PM13A) {
return !(MARE3(
ge) && PC131(
ge)); }
501 SIG(PM14A) {
return !(MARE4(
ge) && PC141(
ge)); }
502 SIG(RM101) {
return !(PM11A(
ge) && PM13A(
ge) && PM14A(
ge)); }
503 SIG(PAM1A) {
return !(RASI1(
ge) && RM101(
ge)); }
504 SIG(RS011) {
return !(PAM4A(
ge) && PAM1A(
ge)); }
505 SIG(PIM1A) {
return !(TO501(
ge) || RS011(
ge) || RB111(
ge) || RUF11(
ge)); }
508 SIG(PUC11) {
return !(PIC1A(
ge) && PIM1A(
ge)); }
549 SIG(PC11A) {
return !(PUC11(
ge) && PB071(
ge) && PB061(
ge)); }
550 SIG(PC12A) {
return !(PUC11(
ge) && PB071(
ge) && PB06A(
ge)); }
551 SIG(PC13A) {
return !(PUC11(
ge) && PB07A(
ge) && PB06A(
ge)); }
552 SIG(PC14A) {
return !(PUC11(
ge) && PB07A(
ge) && PB061(
ge)); }
553 SIG(PC21A) {
return !(PUC21(
ge) && PB261(
ge)); }
554 SIG(PC22A) {
return !(PUC21(
ge) && PB26A(
ge)); }
555 SIG(PC31A) {
return !(PUC31(
ge) && PB371(
ge) && PB361(
ge)); }
556 SIG(PC32A) {
return !(PUC31(
ge) && PB371(
ge) && PB36A(
ge)); }
557 SIG(PC33A) {
return !(PUC31(
ge) && PB37A(
ge) && PB36A(
ge)); }
558 SIG(PC34A) {
return !(PUC31(
ge) && PB37A(
ge) && PB361(
ge)); }
560 SIG(SEPEI) {
return !(PC11A(
ge) && PC21A(
ge) && PC31A(
ge)); }
561 SIG(PU002) {
return !(PC12A(
ge) && PC22A(
ge) && PC32A(
ge)); }
562 SIG(PU003) {
return !(PC13A(
ge) && PC33A(
ge)); }
563 SIG(PU004) {
return !(PC14A(
ge) && PC34A(
ge)); }
571 SIG(PUB01) {
return !(PUB01_d1(
ge) && PUB01_d2(
ge) && PUB01_d3(
ge) && PUB01_d4(
ge)); }
588 SIG(DU89A) {
return !(DU871(
ge) && DU881(
ge) && PC011(
ge) && DU881(
ge)); }
594 SIG(DU92) {
return !(DU90A(
ge) && DU91A(
ge)); }
614 SIG(DU98) {
return !(DU89A(
ge) && PC03A(
ge)); }
617 SIG(TU00A) {
return !(RT121(
ge) && RUF1A(
ge) && PC121(
ge));}
629 SIG(PTA3A) {
return !(TE103(
ge) && TE203(
ge)); }
632 SIG(PTA4A) {
return !(TE104(
ge) && TE204(
ge)); }
635 SIG(PA11A) {
return !(FU091(
ge) && PC111(
ge)); }
636 SIG(PA12A) {
return !(LU081(
ge) && PC121(
ge)); }
637 SIG(PA13A) {
return !(PTA31(
ge) && PC131(
ge)); }
638 SIG(PA14A) {
return !(PTA41(
ge) && PC141(
ge)); }
639 SIG(RA101) {
return !(PA11A(
ge) && PA12A(
ge) && PA13A(
ge) && PA13A(
ge) && PA14A(
ge)); }
654 SIG(PIB1A) {
return !(RET21(
ge) && PC211(
ge)); }
657 SIG(PB12A) {
return !(RESI1(
ge) && PC121(
ge)); }
658 SIG(PB22A) {
return !(RET21(
ge) && PC221(
ge)); }
659 SIG(PB32A) {
return !(RES31(
ge) && PC321(
ge)); }
660 SIG(PIB21) {
return !(PB12A(
ge) && PB22A(
ge) && PB32A(
ge)); }
662 SIG(RB13A) {
return !(RESI1(
ge) && PC131(
ge)); }
663 SIG(RB33A) {
return !(RES31(
ge) && PC331(
ge)); }
664 SIG(PIB31) {
return !(RB13A(
ge) && RB33A(
ge)); }
666 SIG(RB14A) {
return !(RESI1(
ge) && PC141(
ge)); }
667 SIG(RB34A) {
return !(RES31(
ge) && PC341(
ge)); }
668 SIG(PIB41) {
return !(RB14A(
ge) && RB34A(
ge)); }
680 const char *where =
"";
682 uint8_t count = PIB11(
ge) + PIB21(
ge) + PIB31(
ge) + PIB41(
ge);
708 ge_log(
LOG_PERI,
"READING FROM NE KNOT %s --> %03x\n", where, ret);
722 #define NAOR(a, b, c, d) !(a || b || c || d)
738 SIG(AEBEC) {
return !(RATE1(
ge) && PC131(
ge)); }
741 SIG(PV13A) {
return !(RAVI1(
ge) && PC131(
ge)); }
742 SIG(VICU3) {
return !(FINUC(
ge) && PV13A(
ge)); }
Bit manipulation helpers.
static uint16_t NI_knot(struct ge *ge)
NI Knot.
static uint8_t NI_source(struct ge *ge, enum knot_ni_source source)
static uint16_t NO_knot(struct ge *ge)
Knot driven by P0, V1, V2, V4, L1, R1, V3 and L3.
static uint8_t NA_knot(struct ge *ge)
Knot driven by SO or SI.
static uint16_t NE_knot(struct ge *ge)
NE Knot.
void ge_log(ge_log_type type, const char *format,...)
Log message.
@ LOG_PERI
Peripherals IO.
uint8_t reader_get_LUPO1(struct ge *ge)
uint8_t connector_get_TE30(struct ge_connector *conn)
uint8_t reader_get_LU08(struct ge *ge)
uint8_t connector_get_MARE(struct ge_connector *conn)
uint8_t reader_get_FINI1(struct ge *ge)
uint8_t connector_get_TE10(struct ge_connector *conn)
uint8_t connector_get_TE20(struct ge_connector *conn)
uint8_t connector_get_FINE(struct ge_connector *conn)
static uint16_t ge_counting_network_output(struct ge *ge)
uint16_t SITE
Don't wait for external unit availability.
struct ge_counting_network::cmds cmds
enum ge_knot_no::@0 force_mode
The entire state of the emulated system, including registers, memory, peripherals and timings.
uint8_t AINI
Program Loading.
struct ge_integrated_reader integrated_reader
The I/O interface for the integrated reader (RI)
uint8_t JS2
Console jump condition 2.
struct ge_connector ST4
The I/O interface for the ST4 connector.
uint8_t ffFA
Special conditions register 2.
uint16_t rPO
Program addresser.
uint8_t PIC1
Selection Channel 1.
enum ge_console_rotary register_selector
The current state of the console register rotary switch.
uint8_t RIA0
Synchronous CPU Cycle Request.
uint8_t RIA2
Synchronous Channel 2 Cycle Request.
uint16_t rV1
Addresser for the first operand.
uint8_t rSO
Main sequencer.
uint16_t rRO
Multipurpose 8+1 bit register.
struct ge_counting_network counting_network
struct ge_console_switches console_switches
The current state of the console switches.
struct ge_connector ST3
The I/O interface for the ST3 connector.
uint8_t RIA3
Synchronous Channel 3 Cycle Request.
uint8_t PUC3
Channel 3 in transfer.
uint8_t rL2
Auxiliary register.
uint8_t PUC2
Channel 2 in transfer.
uint8_t rRI
Photoprint register 8-bit register used to store the photodisc codes.
uint16_t rBO
Default operator.
uint8_t PB06
Unconditionally stores L106.
struct ge_knot_ni kNI
Knot driven by counting network, or by the UA to store the result of the operation.
uint8_t RACI
Rejected Command.
uint16_t rV4
Addresser for external instructions using channel 2.
uint8_t RASI
Channel 1 in transfer.
uint16_t rL1
Length of the operand.
uint8_t rSA
Future state configuration.
uint16_t rV2
Addresser for the second operand.
uint8_t RESI
Synchronous Channel 1 Cycle Request.
uint8_t RIG1
End from controller 1.
uint8_t rSI
Peripheral unit sequencer.
uint8_t PB26
Stores L106 if channel 2 is selected.
uint16_t rL3
Length of operands involving channel 3.
uint8_t PB07
Unconditionally stores L106.
uint16_t rV3
Addresser for external instructions using channel 3.
uint8_t rFO
Current function code.
uint8_t JS1
Console jump condition 1.