Yes, the lightpen does pass the diagnostics!

16 views
Skip to first unread message

Bill E

unread,
Feb 9, 2026, 11:50:09 AM (2 days ago) Feb 9
to [PiDP-1]
I've verified that the pseudo-lightpen does pass the diagnostics from:
digital-1-27-m-mb.bin
which is the original PDP-1 test program.
Again, it is supported by p7sim, p7simES, and Ian's snazzy Type 30 in:

Ian Schofield

unread,
1:31 PM (10 hours ago) 1:31 PM
to [PiDP-1]
Hi Bill,

 Just a small patch to consider where I have simulated a circular Light Pen aperture.
 I have just tacked on the code to this message as I found a lot of diffs I hadn't synced in repo even from today!.
 /opt/pidp1-mods/src/blincolnlights/pdp1/pdp1.c

bool
checkLightPen(PDP1 *pdp1P)
{
int i, sawOne, dpyx, dpyy;
DispCon *dpyP;
int delx,dely;

    if( !updatePenLocation(pdp1P) )
    {
        return(false);                // no hit possible
    }

    dpyP = &(pdp1P->dpy[0]);
    dpyx = cvtDpyToSigned(pdp1P->dbx);
    dpyy = cvtDpyToSigned(pdp1P->dby);

    // Both coordinate pairs have been converted from 10 bit 1's complement to
    // full signed 2's complement.
    delx = (lastX - dpyx)*(lastX - dpyx);                         // Find squared magnitudes of hit offset
    dely = (lastY - dpyy)*(lastY - dpyy);
    if (delx + dely < penAperture * penAperture * 4)   // Compare with (penAperture*2)^2
/*
    if((lastX >= (dpyx - penAperture)) &&
        (lastX <= (dpyx + penAperture)) &&
        (lastY >= (dpyy - penAperture)) &&
        (lastY <= (dpyy + penAperture)))
*/
    {
        logger(LOG_LP, "LP x %d, y %d hit at x %d, y %d aperture %d\n", lastX, lastY, dpyx, dpyy,penAperture);
        return(true);
    }

    return(false);
}

Try with LightPen MAINDEC. Hope this is of interest, BW, Ian.
Reply all
Reply to author
Forward
0 new messages