Close

Targets

A project log for Lunar Lander for the PDP-1

My PDP-1 Replica (PiDP-1) from Obsolescence Guaranteed has arrived and I want to do something cool with it.

michael-gardiMichael Gardi 01/02/2026 at 18:300 Comments

The scoring for Lunar Lander worked as follows:

Base Point Values
Points are awarded for every landing attempt based on the "softness" of the contact: 

Landing Requirements

Score Multipliers

Landing pads are marked with flashing multipliers (e.g., 2x, 3x, 4x, 5x). The base points from the landing quality are multiplied by the pad's value. Narrower or more difficult terrain typically features higher multipliers. 

Fuel Bonuses and Penalties 
Fuel acts as the primary resource and "time limit" for the game: 

My next little goal here is to add the "flashing multipliers" to the screen. Since we are just displaying numbers and the letter x most of the code necessary to do this is already in place. Frankly the hard part was tweaking the coordinates used to display the multipliers so that they were directly under the target zone and centered. 

Here is the code:

/ Draw the target values.
dtv,    lac (565000            / First target 5x.
        dac dgy
        lac (436000            
        dac dgx
        lac (5                 / 5
        dac num
        jsp ddg
        lac dgx
        add (27000
        dac dgx                / x
        jsp c16

        lac (414000            / Second target 2x.
        dac dgy
        lac (557000            
        dac dgx
        lac (2                 / 2
        dac num
        jsp ddg
        lac dgx
        add (27000
        dac dgx                / x
        jsp c16

        lac (440000            / Third target 3x.
        dac dgy
        lac (637000            
        dac dgx
        lac (3                 / 3
        dac num
        jsp ddg
        lac dgx
        add (27000
        dac dgx                / x
        jsp c16

        lac (421000            / Fourth target 1x
        dac dgy
        lac (764000            
        dac dgx
        lac (1                 / 1
        dac num
        jsp ddg
        lac dgx
        add (27000
        dac dgx                / x
        jsp c16

        lac (514000            / Fifth target 4x.
        dac dgy
        lac (155000            
        dac dgx
        lac (4                 / 4
        dac num
        jsp ddg
        lac dgx
        add (27000
        dac dgx                / x
        jsp c16

        lac (661000            / Sixth target 5x.
        dac dgy
        lac (331000            
        dac dgx
        lac (5                 / 5
        dac num
        jsp ddg
        lac dgx
        add (27000
        dac dgx                / x
        jsp c16

The task of aligning the target values is exacerbated by the necessity of expressing the starting positions in "screen coordinates" which means:

But it got done.

But that's only half the battle. Now I had to make them blink. At first I dropped the call to display the flashing values in the "once a second" part of my main game loop but the flashing was too fast. I found it annoying and distracting. So I added an additional check for a 5 second interval and put the display flashing values code there. 

/ Main loop. 
fr0, load \ict, -1           / Loops about every 100 milliseconds.
    
     lac sec                 / Get the second count.
     sub (1                  / Reduce by one.
     sza i                   / Not Zero?
     jmp dsc                 /  No - Do the one second code.
     dac sec                 / Yes - Save the new second count.
     jmp acu                 / Continue with acceleration calculation.

dsc, lac (12                 / Reset the second counter.
     dac sec                

/ Put second code here.

     lac 5sc                  / Check the 5 second counter.
     sub (1
     dac 5sc                  / Save result.
     sza                      / Is AC Zero?
     jmp acu                  /   No - Continue with acceleration calculation.
     lac (5                   /  Yes - Reset 5 second counter.
     dac 5sc                

/ Put 5 second code here.

/ Draw the target values.
dtv, lac (565000              / First target 5x.
...

This produced a much better result IMHO.  

Even though the code says a "5 second interval" right now the interval is more like 2-3 seconds since I have not "tuned" the loop by adding an ict delay value.  The multiplier values are now blinking at about the same rate as an airport beacon, 20-30 times a minute.  It "feels" right.  This is good news because it means that the current code is running at more than 60 frames a second.  So there is headroom as I add more features.

Discussions