Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch pi5-ils2-bworm-cyclerealistic Excluding Merge-Ins
This is equivalent to a diff from ccedb853c9 to ee19934afd
2024-08-08
| ||
21:13 | Fix mis-calling "False" as "false" and fix error return in check_exists (even though nobody uses it as of yet.) Merge in from trunk. Leaf check-in: ee19934afd user: poetnerd tags: pi5-ils2-bworm-cyclerealistic | |
2024-08-03
| ||
17:42 | Fix mis-calling "False" as "false" and fix error return in check_exists (even though nobody uses it as of yet.) check-in: acf91edb78 user: poetnerd tags: trunk | |
17:17 | Move declaration of op_code outside #ifdef PIDP8I so it works both with and without gpio. check-in: 9de1597bf4 user: poetnerd tags: pi5-ils2-bworm-cyclerealistic | |
2024-06-15
| ||
21:58 | merge Steve Tockey's branch cycle-realistic into the pi5-ils2-bookworm branch check-in: d413ed639f user: HBEggenstein tags: pi5-ils2-bworm-cyclerealistic | |
16:29 | Unconditionally install pidp8i.rc check-in: 1d0f9ffd4d user: poetnerd tags: pi5-ils2-bookworm | |
2024-06-14
| ||
23:42 | revert pinctrl chaching optim., not worth it. Moved ILS/NLS switching logic from compile time to runtime / configuration file check-in: ccedb853c9 user: HBEggenstein tags: pi5-ils2-bookworm | |
2024-06-09
| ||
20:59 | Fix for scanswitch as per email on 5/19. Otherwise pidp8i won't start from systemd. check-in: 3a1f169d7d user: poetnerd tags: pi5-ils2-bookworm | |
Changes to lib/os8script.py.in.
︙ | |||
1504 1505 1506 1507 1508 1509 1510 | 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 | - + - + | mon = self.simh.os8_test_result (reply, "Monitor Prompt", "") if mon: return "success" cd = self.simh.os8_test_result (reply, "Command Decoder Prompt", "") retval = "fail" if cd: # OS/8 command returned to command decoder. We escape. mon = self.simh.os8_escape ("") |
︙ | |||
1972 1973 1974 1975 1976 1977 1978 | 1972 1973 1974 1975 1976 1977 1978 1979 1980 | - + | def check_exists (s, image_copyins): for copyin in image_copyins: image = copyin[1] image_path = dirs.os8mi + image if (not os.path.isfile(image_path)): print("Required file: " + image_path + " not found.") |
Changes to src/SIMH/PDP8/pdp8_cpu.c.
︙ | |||
21 22 23 24 25 26 27 | 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | - + + + + | Except as contained in this notice, the name of Robert M Supnik shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from Robert M Supnik. ---------------------------------------------------------------------------- |
︙ | |||
89 90 91 92 93 94 95 96 97 98 99 100 101 102 | 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | + + + | The register state for the PDP-8 is: AC<0:11> accumulator MQ<0:11> multiplier-quotient L link flag PC<0:11> program counter MA<0:11> memory address MB<0:11> memory buffer Major_State<0:1> major state register IF<0:2> instruction field IB<0:2> instruction buffer DF<0:2> data field UF user flag UB user buffer SF<0:6> interrupt save field |
︙ | |||
254 255 256 257 258 259 260 261 | 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | + + + - + | int16 mq; } InstHistory; uint16 M[MAXMEMSIZE] = { 0 }; /* main memory */ int32 saved_LAC = 0; /* saved L'AC */ int32 saved_MQ = 0; /* saved MQ */ int32 saved_PC = 0; /* saved IF'PC */ int32 saved_MA = 0; /* saved MA */ int32 saved_IR = 0; /* saved IR */ int16 saved_Major_State = 1; /* saved Major State */ int32 saved_DF = 0; /* saved Data Field */ |
︙ | |||
300 301 302 303 304 305 306 307 308 309 310 311 312 313 | 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 | + + | cpu_mod CPU modifier list */ UNIT cpu_unit = { UDATA (NULL, UNIT_FIX + UNIT_BINK, MAXMEMSIZE) }; REG cpu_reg[] = { { ORDATAD (PC, saved_PC, 15, "program counter") }, { ORDATAD (MA, saved_MA, 12, "memory address") }, { ORDATAD (next_Major_State, saved_Major_State, 2, "major state") }, { ORDATAD (AC, saved_LAC, 12, "accumulator") }, { FLDATAD (L, saved_LAC, 12, "link") }, { ORDATAD (MQ, saved_MQ, 12, "multiplier-quotient") }, { ORDATAD (SR, SR, 12, "front panel switches") }, { GRDATAD (IF, saved_PC, 8, 3, 12, "instruction field") }, { GRDATAD (DF, saved_DF, 8, 3, 12, "data field") }, { GRDATAD (IB, IB, 8, 3, 12, "instruction field buffter") }, |
︙ | |||
353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 | 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + - - + + + + + + - - + + - - - - - + + + + - - + + - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - + + + + + + + + + + + + + + + - - - - - - - - - + + + + + + + + + + + + - - - - + - - - - - - - + + + + + + + + + - - + + - - - - + + + + + - - - - - + + + - - - + + - + - - - + + + + + + + - - - - - + + + + + + + + + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - + - - - - - - - - + - - + - - - - - - - - - - - + + + + - - - - - - - - - - - - + - - - + + - - - - - - - + + - - - - - - - - - + - - - - - - - - - - - - + - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - + + + + + - - - + + - - - - - + + + - - + + - - - - - - - + - - - - - - + - - - - - - + + + + + + + + + + + + + - + - - - - - - - - + + + + + - - + - - + + - - - - + + + - - - - + + - - - - - - - + + - - - - - + + + + + + - - - - + + - - + - + + + - - - - + + - - - - - - - + + + - - - - - - - + + + + + + + + + - - - + - - - + - - - - - + + + + + - - - - - - + + + + + - - - - - - - - - + + + + + + + + + + - - - - - - + + + + + - - + + - - - - + + - - - - - - + + + + + + - - - - - - + + + + + + + + - - - - - - + + + + + + + - - + - - - + - - + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - + + + + + + + + - - - + + + - - - + - - - - - - - - + + + + + + + - - - - + - - - - + + + - - - + - - - - + - - - - - - + + + - - - - - - + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - - - - - - - - - + + + + + + + + + - - + + + + + + + + + + - + - - - - + + + + + + - + - - - - + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + | DEVICE cpu_dev = { "CPU", &cpu_unit, cpu_reg, cpu_mod, 1, 8, 15, 1, 8, 12, &cpu_ex, &cpu_dep, &cpu_reset, NULL, NULL, NULL, NULL, 0 }; // These definitions support simulation of Fetch, Defer, and Execute cpu major states // so that the Sing Step switch can behave as on a real pdp-8. The major states are // detailed in, for example, the 1973 small computer handbook on pages 3-18 to 3-22. // http://bitsavers.informatik.uni-stuttgart.de/pdf/dec/pdp8/handbooks/Small_Computer_Handbook_1973.pdf #define FETCH_state 1 #define DEFER_state 2 #define EXECUTE_state 3 t_stat sim_instr (void) { int32 IR, MB, IF, DF, LAC, MQ; uint32 PC, MA; uint16 this_Major_State, next_Major_State; int32 device, pulse, temp, iot_data; t_stat reason; /* Restore register state */ if (build_dev_tab ()) /* build dev_tab */ return SCPE_STOP; PC = saved_PC & 007777; /* load local copies */ MA = saved_MA & 007777; IR = saved_IR & 007777; this_Major_State = next_Major_State = saved_Major_State; IF = saved_PC & 070000; DF = saved_DF & 070000; LAC = saved_LAC & 017777; MQ = saved_MQ & 07777; int_req = INT_UPDATE; reason = 0; //////////////////////////////////////////////////////////////////////////////////// // For some strange reason, there are times when IB can be essentially uninitialized. // It seems harmless most of the time, but it's deadly on TSS-8 startup which is at // address 24200. Then, at 24204 is a JMS 0060. The JMS code for the EXECUTE major // state, below, necessarily uses IB to give correct behavior following a CIF. The // killer problem is that when--without this if () test--that TSS-8 JMS executes, // IB is 0 not 2 so it is interpreted as a JMS to 00060 instead of the necessary // JMS to 20060. Having this test forces IB to be set to IF the first time through // so it's no longer "uninitialized" with respect to the simulated execution. See // the TBD FIX in the code for the Start switch in main.c.in. When that is fixed, // this can be removed. if (IB = -1) IB = IF; //////////////////////////////////////////////////////////////////////////////////// /* ---PiDP add--------------------------------------------------------------------------------------------- */ |
︙ | |||
1353 1354 1355 1356 1357 1358 1359 | 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 | - - + + - + - + - - - - - - - - - - - + + - - - - - + - - - + - - - - - - + + - - - - - - - + - - - - + - - - - - - + - - + + - - - - - - - + + + + - - - - - + + + + + - - - - - - - - - - - + + + + - - - - + - - + + + + - - + + - - - - + + - - - - - - - - + + + + - - - + + - - - - + - - - - - - - + + + + - - + - - - + - - + - - - - - + + + + + - - - + + - - - + - - - - - + + - - + - - - - - + + + - - - - + + - - - + - - - - - + - - + - - + - - - - - - - - - - + + + + - - - - - - - - + + + + + - - + - + - - - + + + + - + - - - + + + | temp = 0; else temp = temp >> SC; /* <=24? shift AC:MQ */ LAC = (temp >> 12) & 07777; MQ = temp & 07777; PC = (PC + 1) & 07777; SC = emode? 037: 0; /* SC = 0 if mode A */ break; |
︙ | |||
1586 1587 1588 1589 1590 1591 1592 | 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 | - - + + - + - - - - - + + + - + - - + + + + + + + + + + + + + + + - + - + + + + + | // You might think to move this code to the top of set_pidp8i_leds, // but the function call itself is a nontrivial hit. In fact, you // don't even want to move all of this to a function here in this // module and try to get GCC to inline it: that's good for a 1 MIPS // speed hit in my testing! (GCC 4.9.2, Raspbian Jessie on Pi 3B.) if (pidp8i_gpio && (++skip_count + dither >= max_skips )) { |
︙ | |||
1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 | 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 | + - + - + - - + + + + + + + | NULL}; /* Reset routine */ t_stat cpu_reset (DEVICE *dptr) { saved_LAC = 0; saved_Major_State = FETCH_state; int_req = (int_req & ~INT_ION) | INT_NO_CIF_PENDING; saved_DF = IB = saved_PC & 070000; UF = UB = gtf = emode = 0; pcq_r = find_reg ("PCQ", NULL, dptr); if (pcq_r) pcq_r->qptr = 0; |
︙ | |||
1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 | 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 | + | return SCPE_IERR; newdev = get_uint (cptr, 8, DEV_MAX - 1, &r); /* get new */ if ((r != SCPE_OK) || (newdev == dibp->dev)) return r; dibp->dev = newdev; /* store */ return SCPE_OK; } /* Show device number for a device */ t_stat show_dev (FILE *st, UNIT *uptr, int32 val, CONST void *desc) { DEVICE *dptr; DIB *dibp; |
︙ | |||
1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 | 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 | + | if (dibp == NULL) return SCPE_IERR; fprintf (st, "devno=%02o", dibp->dev); if (dibp->num > 1) fprintf (st, "-%2o", dibp->dev + dibp->num - 1); return SCPE_OK; } /* CPU device handler - should never get here! */ int32 bad_dev (int32 IR, int32 AC) { return (SCPE_IERR << IOT_V_REASON) | AC; /* broken! */ } |
︙ | |||
1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 | 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 | + | } /* end if dsp */ } /* end for j */ } /* end else */ } /* end if enb */ } /* end for i */ return FALSE; } /* Set history */ t_stat cpu_set_hist (UNIT *uptr, int32 val, CONST char *cptr, void *desc) { int32 i, lnt; t_stat r; |
︙ | |||
1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 | 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 | + | hst = (InstHistory *) calloc (lnt, sizeof (InstHistory)); if (hst == NULL) return SCPE_MEM; hst_lnt = lnt; } return SCPE_OK; } /* Show history */ t_stat cpu_show_hist (FILE *st, UNIT *uptr, int32 val, CONST void *desc) { int32 l, k, di, lnt; const char *cptr = (const char *) desc; |
︙ | |||
1892 1893 1894 1895 1896 1897 1898 | 1741 1742 1743 1744 1745 1746 1747 1748 1749 | - + + | fprintf (st, "(undefined) %04o", h->ir); if (h->ir < 04000) fprintf (st, " [%04o]", h->opnd); fputc ('\n', st); /* end line */ } /* end else instruction */ } /* end for */ return SCPE_OK; |
Changes to src/pidp8i/gpio-common.c.in.
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 12 | - + + | /* * gpio-common.c: functions common to both gpio.c and gpio-nls.c * |
︙ | |||
34 35 36 37 38 39 40 | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | - - - - | * by the other gpio-* modules, from the GPIO thread. */ #include "pidp8i.h" #include <config.h> |
︙ | |||
103 104 105 106 107 108 109 | 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | - + - + | // Double-buffered LED display brightness values. The update-to copy is // modified by the SIMH CPU thread as it executes instructions, and the // paint-from copy is read by the gpio-*.c module in its "set LEDs" // loop. When the GPIO thread is finished with the paint-from copy, it // zeroes it and swaps it for the current "update-to" copy, giving the // CPU thread a blank slate, and giving the GPIO thread a stable set of // LED "on" time values to work with. |
︙ | |||
135 136 137 138 139 140 141 | 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | - - + + | static const ms_time_t debounce_ms = 50; // time switch state must remain stable // Flow-control switch states which are owned by -- that is, primarily // modified by -- the PDP8/pidp8i module, but we can't define these // there because we refer to them below, and not all programs that link // to us link to that module as well. For such programs, it's fine if |
︙ | |||
245 246 247 248 249 250 251 | 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 | - - + - + + + - - - + + + + + + + + + + + - | // thread consumes the values provided by the CPU thread. #define SWAP(dir) \ __atomic_exchange_n (&pdis_update, display_bufs + dir, __ATOMIC_SEQ_CST) void swap_displays () { |
︙ | |||
454 455 456 457 458 459 460 461 462 | 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 | + + - + + | if (time(&now) != last) { printf("\r\nLED: [PC:%04o] [MA:%04o] [MB:%04o] [AC:%04o] [MQ:%04o]", pcurr[0], pcurr[1], pcurr[2], pcurr[3], pcurr[4]); last = now; } #endif #if 0 // This appears to be no longer necessary in the cycle-realistic version // Override Execute and Run LEDs if the CPU is currently stopped, // since we only get set_pidp8i_leds calls while the CPU's running. |
︙ |
Changes to src/pidp8i/gpio-common.h.
︙ | |||
109 110 111 112 113 114 115 | 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | - - + + | // in instructions since the last display paint. size_t on[NLEDROWS][NCOLS]; // Most recent state for each LED, for use by NLS full-time and by // ILS in STOP mode. (One bitfield per row.) uint16_t curr[NLEDROWS]; |
︙ |
Changes to src/pidp8i/gpio-ils.c.
1 2 3 4 5 6 7 8 9 10 11 12 | 1 2 3 4 5 6 7 8 9 10 11 12 13 | + | /* * gpio-ils.c: implements gpio_core () for Ian Schofield's incandescent * lamp simulator * * Copyright © 2015-2017 Oscar Vermeulen, Ian Schofield, and Warren Young * © 2021 Steve Tockey * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: |
︙ | |||
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | + + | // The GPIO module's main loop core, called from thread entry point in // gpio-common.c. static int is_init = 0; static float RISING_FACTOR = RISING_FACTOR_DEFAULT; static float RISING_FACTOR_INIT = RISING_FACTOR_DEFAULT; static float FALLING_FACTOR = FALLING_FACTOR_DEFAULT; static float FALLING_FACTOR_INIT = FALLING_FACTOR_DEFAULT; void gpio_core (int* terminate) { // The ILS version uses an iteration rate that is somewhat faster than the NLS // version, depending on execution speed of the Raspberry Pi. // The overall refresh rate sould be between 80 and ~ 200 Hz. const us_time_t intervl = 20; |
︙ | |||
108 109 110 111 112 113 114 115 116 117 118 119 120 121 | 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | + + + | int n = sscanf(tweaking, "%f,%f",&RISING_FACTOR,&FALLING_FACTOR); if ( n != 2 || RISING_FACTOR > 1.0 || RISING_FACTOR <= 0.0 || FALLING_FACTOR > 1.0 || FALLING_FACTOR <= 0.0 ) { RISING_FACTOR = RISING_FACTOR_DEFAULT; FALLING_FACTOR = FALLING_FACTOR_DEFAULT; } // new values will later be fine tuned by auto-calibration RISING_FACTOR_INIT = RISING_FACTOR; FALLING_FACTOR_INIT = FALLING_FACTOR; } if ( tweaking_ramp ) { us_time_t iv[MAX_BRIGHTNESS+1]; int n = sscanf(tweaking_ramp, "%d,%d,%d,%d,%d,%d,%d,%d," "%d,%d,%d,%d,%d,%d,%d,%d," "%d,%d,%d,%d,%d,%d,%d,%d," "%d,%d,%d,%d,%d,%d,%d,%d,%d", |
︙ | |||
154 155 156 157 158 159 160 | 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | - + + + + + + + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | // in control of the swap timing, we don't need to copy the // pdis_paint pointer: it points to the same thing between // these swap_displays() calls. swap_displays(); // Recalculate the brightness target values based on the // "on" counts in *pdis_paint and the quantized brightness |
︙ | |||
201 202 203 204 205 206 207 | 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 | - - + + | // fill one panel row of 12 lights with test pattern for (int col=0; col < 12 ; col++) { brightness[2][col]=test_pattern[col]; } } // Light up LEDs |
︙ | |||
315 316 317 318 319 320 321 | 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 | - - + + | printf("\n\rTime per iteration %f ms\n\r", cycle_ms); #endif // is this value plausible? if(cycle_ms > 2.0 && cycle_ms < 30.0) { // adjust the RISING_FACTOR and FALLING_FACCTOR // the defaults are calibrated for a ca 7ms refresh time filtered_cycle_ms=(filtered_cycle_ms==0) ? cycle_ms : filtered_cycle_ms * 0.7 + cycle_ms * 0.3; |
︙ |
Changes to src/pidp8i/main.c.in.
1 2 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | - - + + + + + | /* pidp8i.c: PiDP-8/I additions to the PDP-8 simulator |
︙ | |||
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | + + + + + - - - - - + + + + + - - - - + + + + - + - | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the names of the authors above shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from those authors. */ #include "pidp8i.h" #include <PDP8/pdp8_defs.h> #include <assert.h> #include <dirent.h> // for USB stick searching #include <errno.h> #include <string.h> //// MODULE GLOBALS //////////////////////////////////////////////////// extern int cpuRun, swSingInst, swSingStep; static int sing_step_single_shot = 0; //########################################################################################################## |
︙ | |||
273 274 275 276 277 278 279 | 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 | - + - + + + - + + - + + + + - + - + + + + - + - + - + - - + | // slowly rise or they can overshoot and then take a while to recover // with the IPS. size_t get_pidp8i_initial_max_skips (size_t updates_per_sec) { DEVICE *pthrot = find_dev ("INT-THROTTLE"); if (pthrot) { |
︙ | |||
356 357 358 359 360 361 362 | 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 | - - + + - - + - - - - - - - - - - - - - - - - - + + - + - - + + - - + - - | case 03000: set_pidp8i_led (pd, 5, 8); break; // 011 ISZ case 04000: set_pidp8i_led (pd, 5, 7); break; // 100 JMS case 05000: set_pidp8i_led (pd, 5, 6); break; // 101 JMP case 06000: set_pidp8i_led (pd, 5, 5); break; // 110 IOT case 07000: set_pidp8i_led (pd, 5, 4); break; // 111 OPR 1 & 2 } |
︙ | |||
523 524 525 526 527 528 529 | 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 | - + - - - - - - - - - + + + - + - - - - - - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - + + + + + + + + + + - - - - - - - + + + + + + + + - - + + - - - - - - + + + + + + + + + + + - + - + - - + + - - - - + - - + - - - - - - - - - - - - - + - - - - - - + - - - - + - - + + + + + + - - + + - + + - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - + - + - + + + + - + + + - - - + + + - + + + + - - + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + | } else { printf ("\r\nNo unmounted %s file found\r\n", devCode); } } |
︙ |
Changes to src/pidp8i/pidp8i.h.
1 2 3 4 5 6 7 8 9 10 11 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | + + + | /* pidp8i.h: Interface between PiDP-8/I additions and the stock SIMH PDP-8 simulator Copyright © 2015-2017 by Oscar Vermeulen and Warren Young Portions copyright © 2021 by HB Eggenstein © 2021 by Steve Tockey Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |
︙ | |||
32 33 34 35 36 37 38 | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | - - - + + + + - + - - - + + + - + | #include "gpio-common.h" #include <stdint.h> #include <stdlib.h> typedef enum { |