'lightpen' in action

36 views
Skip to first unread message

Bill E

unread,
Feb 3, 2026, 2:16:33 PM (2 days ago) Feb 3
to [PiDP-1]
Yes, I said it couldn't be done. Well, it sort-of can. I implemented a time-based sliding window correlation hack that does a fair job of matching mouse events with dpy instructions. It depends on all the dots having to be refreshed, a dpy actually sees a past event. It's really more of a proof of concept; it can miss events or improperly assign them, but it does surprisingly well. As long as you don't move the 'pen' too fast.
I'll check the stuff into my repo just to keep track of it. Oh, the text and cross are done using the Type 33 symbol generator. The light pen has both pidp1 and p7sim  mods to make it work.

Bill

PS - for any hardware impl via the backplane add-on, the speed could be an issue. The indication of a hit has to arrive in the pidp processing loop less than 30 usecs from when the dpy was done. I don't think the i2c connection would be fast enough. Socket or usb maybe, not sure. Probably need to use one of very few gpio pins for an interrupt.
lightpen.mp4

Kevin McGrath

unread,
Feb 4, 2026, 5:46:13 PM (yesterday) Feb 4
to [PiDP-1]
Very cool Bill!  I'd love to check it out on my machine, is there a process y'all are going through to make these changes available through the main repo?

Might be nice to have a way to turn off the mouse pointer when it's within the Type 30/33's window/radius.

I'm not sure why anyone would want to really emulate this with actual light sensing hardware, you could just use a nice little touchscreen stylus and pretend it's a light pen for the same effect.

I wonder if there was ever a PDP-1 version of SketchPad?  Or does a T-Square papertape exist?  I don't know if it used the lightpen though.

https://en.wikipedia.org/wiki/T-Square_(software)

I can imagine an actual working version of Chess using your Type 33 character display with lightpen input when the player wants to make a move.  I found source code for a Solitaire that uses the modified MIT PDP-1, I'm working on porting it to our simulated PDP-1, just have 3 assembly errors to work through and then I can see if it actually does something.  I get the feeling I'm going to be debugging on the PDP-1 very soon, which actually sounds exciting.  Solitaire with lightpen input seems like a distinct possibility:


MIT modified PDP-1 instruction replacement macros:

/Changes to the PDP-1 that MIT made, and macros that replace the new instructions:
/Source: http://www.bitsavers.org/pdf/mit/rle_pdp1/memos/mb_1-1_may65.pdf

/ Add to Memory: The new C(AC) and the new C(Y) are the sum of
/ the original C(Y) and the original C(AC). The addition is performed
/ with 1's complement arithmetic. If the sum of two like-signed
/ numbers yields a result of the opposite sign, the overflow
/ flip-flop will be set. A result of minus zero is changed to plus zero.

define adm Y
add Y
dac Y
term

/ Swap accumulator with in-out. This is the combination of the above two
/ instructions. It happens after all normal operate options. If the computer
/ is stopped of the end of this instruction, the MBR will contain zero, and the
/ swap will not yet have occurred.

define swp
rcl 9s
rcl 9s
term

/ Jump and Deposit Program Counter: The contents of the Program Counter
/ (holding the address of the instruction following the jdp) are deposited
/ in the memory register Y. The original contents of the AC remain
/ in the AC unchanged. The state of the overflow flip-flop is saved
/ as described under jsp. The next instruction executed is taken from
/ Memory Register Y+1.

define jdp Y
dac ~ta
jsp .+1 /load the Accumulator with the PC
add (4 /adjust return address
dac Y
lac ta
jmp Y+1
term

/ Load In-Out from Accumulator: This operate class instruction copies the
/ contents of the AC into the IO register. It happens after all
/ normal operate class options, and the old contents of the IO will be
/ shown. (see timing diagram below)

define lia
dac ~ta
lio ta
term

-Kevin.

Bill E

unread,
Feb 4, 2026, 6:38:05 PM (yesterday) Feb 4
to [PiDP-1]
Trying not to be too negative, but my stuff was in a linked fork of the main repo. The changes were supposedly going to be folded back into that. 5 months ago. Nothing. I have to assume at this point the original devs have lost interest, the main repo hasn't had any changes for 4 months now. Been there before. So, you'd have to check out my branch, which today I made independent, the number of changes are getting too many for me to keep synced across my full mod repo and the one that's just the emulator bits. But, it has all the main branch stuff,  you can just check it out and build like the original, although I haven't done that in a while. If anyone is actually interested, I'll make sure it still builds.

My pidp has been running 24/7 with all my mods, no problem. In fact, some of my latest ones reduce the massive cpu drain from the hardware panel driver from 180% of the cpu to 70%, so from using 1.8 cores to using 0.7 of a core. And, music on the modded version is far better. :)

I'll post a full list of changes soon, just so you know what there is. The repo is: https://github.com/wjenh/pidp1-mods.git
I' actively maintaining it and there is plenty of documentation for my added IOTs and tools.

As for the lightpen, it does work and again if it's going to be used, I'll put some effort into optimizing it. However, it is an approximation, as I said in an earlier post.

Biill

Bill E

unread,
12:29 PM (9 hours ago) 12:29 PM
to [PiDP-1]
On Wednesday, February 4, 2026 at 5:46:13 PM UTC-5 ke...@mcgrath.name wrote:
I can imagine an actual working version of Chess using your Type 33 character display with lightpen input when the player wants to make a move.  I found source code for a Solitaire that uses the modified MIT PDP-1, I'm working on porting it to our simulated PDP-1, just have 3 assembly errors to work through and then I can see if it actually does something.  I get the feeling I'm going to be debugging on the PDP-1 very soon, which actually sounds exciting.  Solitaire with lightpen input seems like a distinct possibility:

The current lightpen code would work well for this. If the display is relatively static and you're not trying to track quickly moving points, the correlation is very good.

Bill 
Reply all
Reply to author
Forward
0 new messages